diff --git a/cypress.config.ts b/cypress.config.ts index 82bc037..83ae383 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -7,9 +7,6 @@ export default defineConfig({ viewportWidth: 1536, e2e: { - setupNodeEvents(on, config) { - return require("./cypress/plugins/index.js")(on, config) - }, baseUrl: "http://localhost:5000", supportFile: "cypress/support/e2e.js", // baseUrl: "https://simple-comment.netlify.app", diff --git a/docs/plans/Priority4DependencyModernizationPlan.md b/docs/archive/Priority4DependencyModernizationPlan.md similarity index 99% rename from docs/plans/Priority4DependencyModernizationPlan.md rename to docs/archive/Priority4DependencyModernizationPlan.md index 64f07e9..409a782 100644 --- a/docs/plans/Priority4DependencyModernizationPlan.md +++ b/docs/archive/Priority4DependencyModernizationPlan.md @@ -1,6 +1,6 @@ # Priority 4 Plan — Dependency Modernization -Status: proposed +Status: archived Source backlog: `docs/RepoHealthImprovementBacklog.md` (`Priority 4: Dependency Modernization`) diff --git a/docs/archive/Priority4FrontendBuildModernizationChecklist01.md b/docs/archive/Priority4FrontendBuildModernizationChecklist01.md new file mode 100644 index 0000000..3345b18 --- /dev/null +++ b/docs/archive/Priority4FrontendBuildModernizationChecklist01.md @@ -0,0 +1,34 @@ +# Priority 4 — Frontend / Build Checklist 01 + +Status: archived + +Source plan: `docs/archive/Priority4FrontendBuildModernizationPlan.md` + +QC mode: Conformance QC + +## Scope Lock + +- Complete the deferred frontend/build modernization lane from Priority 4. +- Keep the work inside frontend/build compatibility and validation. +- Restore local embed/runtime behavior after the Svelte 5 shift. +- Do not absorb unrelated backend/runtime or MongoDB work into this slice. + +## Atomic Checklist Items + +- [x] C01 `[inventory]` Confirm the current frontend/build target stack and record the intended Svelte 5-compatible dependency surface in `package.json` / `yarn.lock`. +- [x] C02 `[config]` Align the frontend TypeScript, Vite, and Svelte preprocess path so the Svelte 5 toolchain uses the correct frontend tsconfig and no longer emits the stale `verbatimModuleSyntax` warning. +- [x] C03 `[test]` Align the frontend Jest path with the post-upgrade ESM dependency graph so frontend tests remain runnable under the updated stack. +- [x] C04 `[source]` Fix the source-level compatibility fallout surfaced by the upgrade, including `noImplicitAny` regressions, type-only imports, and invalid non-void self-closing tags. +- [x] C05 `[runtime]` Update the embed entrypoint from the legacy Svelte component-constructor API to the Svelte 5 mount API so local runtime mounting succeeds again. +- [x] C06 `[docs]` Finalize the validation notes with the final dependency/config state, command evidence, and any residual environment caveats that are outside the frontend/build lane itself. + +## Validation Items + +- [x] T01 `[validation]` Command validation: `yarn lint`, `yarn run prettier --list-different .`, `yarn typecheck`, `yarn test:frontend`, `yarn run build:frontend` +- [x] T02 `[validation]` Runtime validation: confirm the `simple-comment` embed mounts again in local development once the backend/runtime prerequisites are available. +- [x] T03 `[validation]` Process validation: record any residual issue that is environmental/generated-artifact noise rather than a frontend/build regression. + +## Outcome + +- Frontend/build modernization completed successfully. +- Priority 4 no longer has an active frontend/build lane. diff --git a/docs/archive/Priority4FrontendBuildModernizationChecklist01Validation.md b/docs/archive/Priority4FrontendBuildModernizationChecklist01Validation.md new file mode 100644 index 0000000..ad51e74 --- /dev/null +++ b/docs/archive/Priority4FrontendBuildModernizationChecklist01Validation.md @@ -0,0 +1,78 @@ +# Priority 4 — Frontend / Build Checklist 01 Validation + +Status: archived + +Checklist: `docs/archive/Priority4FrontendBuildModernizationChecklist01.md` + +## Final Frontend / Build State + +- `svelte`: `^5.55.0` +- `@sveltejs/vite-plugin-svelte`: `^4.0.0` +- `svelte-preprocess`: `^6.0.3` +- `vite`: `^5.4.14` +- `ts-jest`: `^29.4.6` +- `xstate`: `^4.38.1` +- `@xstate/svelte`: `^2.1.0` + +Relevant final config state: + +- `vite.config.ts` + - `sveltePreprocess({ typescript: { tsconfigFile: "tsconfig.frontend.json" } })` +- `jest.frontend.config.ts` + - `useESM: true` + - `transformIgnorePatterns: ["/node_modules/(?!svelte|esm-env)"]` + - `extensionsToTreatAsEsm: [".ts"]` +- `tsconfig.frontend.json` + - `verbatimModuleSyntax: true` + - `moduleResolution: "bundler"` + +## Source Compatibility Fixes Completed + +- `src/simple-comment.ts` + - migrated from `new SimpleComment(...)` to `mount(SimpleComment, ...)` +- `src/simple-comment-icebreakers.ts` + - typed previously implicit-`any` callback parameters +- `src/components/Login.svelte` + - `StateValue` import made type-only +- `src/components/CommentInput.svelte` + - `StateValue` import made type-only + - invalid self-closing ` {#if errorText && errorText.length > 0}

{errorText}

{/if} diff --git a/src/components/CommentInput.svelte b/src/components/CommentInput.svelte index 260b472..c70fb88 100644 --- a/src/components/CommentInput.svelte +++ b/src/components/CommentInput.svelte @@ -7,7 +7,7 @@ ServerResponse, User, } from "../lib/simple-comment-types" - import { StateValue } from "xstate" + import type { StateValue } from "xstate" import { commentPostMachine } from "../lib/commentPost.xstate" import { createEventDispatcher, onDestroy, onMount } from "svelte" import { dispatchableStore, loginStateStore } from "../lib/svelte-stores" @@ -210,7 +210,7 @@ {autofocus} {placeholder} dir="auto" - /> + > {#if !currentUser || (commentText && commentText.length)}
diff --git a/src/components/DiscussionDisplay.svelte b/src/components/DiscussionDisplay.svelte index 268c4c7..3dc1892 100644 --- a/src/components/DiscussionDisplay.svelte +++ b/src/components/DiscussionDisplay.svelte @@ -249,6 +249,6 @@ {/if} {#if $state.value === "loading"} -
+
{/if} diff --git a/src/components/Login.svelte b/src/components/Login.svelte index e8a0411..8147cc1 100644 --- a/src/components/Login.svelte +++ b/src/components/Login.svelte @@ -48,7 +48,7 @@ import PasswordInput from "./low-level/PasswordInput.svelte" import PasswordTwinInput from "./low-level/PasswordTwinInput.svelte" import Avatar from "./low-level/Avatar.svelte" - import { StateValue } from "xstate" + import type { StateValue } from "xstate" const DISPLAY_NAME_HELPER_TEXT = "This is the name that others will see" const USER_EMAIL_HELPER_TEXT = diff --git a/src/components/low-level/SkeletonText.svelte b/src/components/low-level/SkeletonText.svelte index 067f368..6e4b84d 100644 --- a/src/components/low-level/SkeletonText.svelte +++ b/src/components/low-level/SkeletonText.svelte @@ -29,13 +29,13 @@ {#if paragraph}
{#each rows as { width }} -

+

{/each}
{:else if avatar} -
+
{:else} -
+
{/if}