@jasonshimmy/vite-plugin-cer-app 0.23.1 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/checks/lighthouse.d.ts +26 -0
- package/dist/cli/checks/lighthouse.d.ts.map +1 -0
- package/dist/cli/checks/lighthouse.js +121 -0
- package/dist/cli/checks/lighthouse.js.map +1 -0
- package/dist/cli/checks/links.d.ts +12 -0
- package/dist/cli/checks/links.d.ts.map +1 -0
- package/dist/cli/checks/links.js +89 -0
- package/dist/cli/checks/links.js.map +1 -0
- package/dist/cli/checks/performance.d.ts +17 -0
- package/dist/cli/checks/performance.d.ts.map +1 -0
- package/dist/cli/checks/performance.js +61 -0
- package/dist/cli/checks/performance.js.map +1 -0
- package/dist/cli/commands/check.d.ts +3 -0
- package/dist/cli/commands/check.d.ts.map +1 -0
- package/dist/cli/commands/check.js +85 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/preview.d.ts.map +1 -1
- package/dist/cli/commands/preview.js +37 -4
- package/dist/cli/commands/preview.js.map +1 -1
- package/dist/cli/create/index.d.ts +11 -1
- package/dist/cli/create/index.d.ts.map +1 -1
- package/dist/cli/create/index.js +135 -65
- package/dist/cli/create/index.js.map +1 -1
- package/dist/cli/create/templates/spa/package.json.tpl +5 -3
- package/dist/cli/create/templates/ssg/cer.config.ts.tpl +2 -0
- package/dist/cli/create/templates/ssg/package.json.tpl +5 -3
- package/dist/cli/create/templates/ssr/package.json.tpl +5 -3
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/plugin/build-ssg.d.ts +22 -4
- package/dist/plugin/build-ssg.d.ts.map +1 -1
- package/dist/plugin/build-ssg.js +273 -13
- package/dist/plugin/build-ssg.js.map +1 -1
- package/dist/plugin/content/parser.d.ts.map +1 -1
- package/dist/plugin/content/parser.js +54 -10
- package/dist/plugin/content/parser.js.map +1 -1
- package/dist/plugin/dev-server.d.ts +6 -1
- package/dist/plugin/dev-server.d.ts.map +1 -1
- package/dist/plugin/dev-server.js.map +1 -1
- package/dist/plugin/dts-generator.d.ts.map +1 -1
- package/dist/plugin/dts-generator.js +50 -8
- package/dist/plugin/dts-generator.js.map +1 -1
- package/dist/plugin/generated-dir.d.ts +2 -0
- package/dist/plugin/generated-dir.d.ts.map +1 -1
- package/dist/plugin/generated-dir.js +17 -6
- package/dist/plugin/generated-dir.js.map +1 -1
- package/dist/plugin/html-post-process.d.ts +35 -0
- package/dist/plugin/html-post-process.d.ts.map +1 -0
- package/dist/plugin/html-post-process.js +112 -0
- package/dist/plugin/html-post-process.js.map +1 -0
- package/dist/plugin/index.d.ts +9 -0
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +89 -14
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/transforms/auto-import.d.ts.map +1 -1
- package/dist/plugin/transforms/auto-import.js +7 -0
- package/dist/plugin/transforms/auto-import.js.map +1 -1
- package/dist/plugin/transforms/prune-runtime-css.d.ts +8 -0
- package/dist/plugin/transforms/prune-runtime-css.d.ts.map +1 -0
- package/dist/plugin/transforms/prune-runtime-css.js +40 -0
- package/dist/plugin/transforms/prune-runtime-css.js.map +1 -0
- package/dist/runtime/app-template.d.ts +1 -4
- package/dist/runtime/app-template.d.ts.map +1 -1
- package/dist/runtime/app-template.js +211 -40
- package/dist/runtime/app-template.js.map +1 -1
- package/dist/runtime/composables/index.d.ts +4 -0
- package/dist/runtime/composables/index.d.ts.map +1 -1
- package/dist/runtime/composables/index.js +2 -0
- package/dist/runtime/composables/index.js.map +1 -1
- package/dist/runtime/composables/use-active-headings.d.ts +24 -0
- package/dist/runtime/composables/use-active-headings.d.ts.map +1 -0
- package/dist/runtime/composables/use-active-headings.js +112 -0
- package/dist/runtime/composables/use-active-headings.js.map +1 -0
- package/dist/runtime/composables/use-content-page.d.ts +45 -0
- package/dist/runtime/composables/use-content-page.d.ts.map +1 -0
- package/dist/runtime/composables/use-content-page.js +179 -0
- package/dist/runtime/composables/use-content-page.js.map +1 -0
- package/dist/runtime/composables/use-content-search.d.ts.map +1 -1
- package/dist/runtime/composables/use-content-search.js +1 -5
- package/dist/runtime/composables/use-content-search.js.map +1 -1
- package/dist/runtime/composables/use-fetch.d.ts +2 -1
- package/dist/runtime/composables/use-fetch.d.ts.map +1 -1
- package/dist/runtime/composables/use-fetch.js +112 -43
- package/dist/runtime/composables/use-fetch.js.map +1 -1
- package/dist/runtime/composables/use-head.d.ts.map +1 -1
- package/dist/runtime/composables/use-head.js +30 -6
- package/dist/runtime/composables/use-head.js.map +1 -1
- package/dist/runtime/composables/use-route.d.ts.map +1 -1
- package/dist/runtime/composables/use-route.js +39 -11
- package/dist/runtime/composables/use-route.js.map +1 -1
- package/dist/runtime/content/client.js +2 -2
- package/dist/runtime/content/client.js.map +1 -1
- package/dist/runtime/entry-server-template.d.ts +16 -1
- package/dist/runtime/entry-server-template.d.ts.map +1 -1
- package/dist/runtime/entry-server-template.js +120 -13
- package/dist/runtime/entry-server-template.js.map +1 -1
- package/dist/types/config.d.ts +53 -4
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js.map +1 -1
- package/dist/types/middleware.d.ts +2 -2
- package/dist/types/middleware.d.ts.map +1 -1
- package/package.json +22 -19
- package/.github/copilot-instructions.md +0 -169
- package/.github/workflows/publish.yml +0 -257
- package/.nvmrc +0 -1
- package/CHANGELOG.md +0 -232
- package/CLAUDE.md +0 -113
- package/commits.txt +0 -1
- package/cypress.config.ts +0 -16
- package/docs/authentication.md +0 -285
- package/docs/cli.md +0 -324
- package/docs/components.md +0 -237
- package/docs/composables.md +0 -907
- package/docs/configuration.md +0 -667
- package/docs/content.md +0 -570
- package/docs/data-loading.md +0 -336
- package/docs/getting-started.md +0 -237
- package/docs/head-management.md +0 -212
- package/docs/i18n.md +0 -159
- package/docs/layouts.md +0 -224
- package/docs/middleware.md +0 -234
- package/docs/plugins.md +0 -170
- package/docs/rendering-modes.md +0 -377
- package/docs/routing.md +0 -485
- package/docs/server-api.md +0 -253
- package/docs/testing.md +0 -455
- package/docs/use-fetch.md +0 -183
- package/e2e/cypress/e2e/api.cy.ts +0 -123
- package/e2e/cypress/e2e/async-component.cy.ts +0 -27
- package/e2e/cypress/e2e/component-splitting.cy.ts +0 -50
- package/e2e/cypress/e2e/content.cy.ts +0 -425
- package/e2e/cypress/e2e/cookie.cy.ts +0 -85
- package/e2e/cypress/e2e/data.cy.ts +0 -158
- package/e2e/cypress/e2e/error-boundary.cy.ts +0 -88
- package/e2e/cypress/e2e/fouc.cy.ts +0 -254
- package/e2e/cypress/e2e/group-meta.cy.ts +0 -36
- package/e2e/cypress/e2e/head.cy.ts +0 -89
- package/e2e/cypress/e2e/i18n.cy.ts +0 -79
- package/e2e/cypress/e2e/interactive.cy.ts +0 -137
- package/e2e/cypress/e2e/isr-nested-runtime.cy.ts +0 -102
- package/e2e/cypress/e2e/jit-css-custom-colors.cy.ts +0 -43
- package/e2e/cypress/e2e/middleware-chain.cy.ts +0 -89
- package/e2e/cypress/e2e/middleware-status.cy.ts +0 -30
- package/e2e/cypress/e2e/middleware.cy.ts +0 -45
- package/e2e/cypress/e2e/navigate.cy.ts +0 -39
- package/e2e/cypress/e2e/observability.cy.ts +0 -77
- package/e2e/cypress/e2e/per-route-error.cy.ts +0 -42
- package/e2e/cypress/e2e/per-route-render.cy.ts +0 -70
- package/e2e/cypress/e2e/preview-hardening.cy.ts +0 -88
- package/e2e/cypress/e2e/routes.cy.ts +0 -128
- package/e2e/cypress/e2e/seo-meta.cy.ts +0 -108
- package/e2e/cypress/e2e/server-middleware.cy.ts +0 -46
- package/e2e/cypress/e2e/session-rotation.cy.ts +0 -25
- package/e2e/cypress/e2e/session.cy.ts +0 -73
- package/e2e/cypress/e2e/ssr-render-error.cy.ts +0 -68
- package/e2e/cypress/e2e/synthetic-404.cy.ts +0 -45
- package/e2e/cypress/e2e/use-page-data.cy.ts +0 -122
- package/e2e/cypress/e2e/use-state.cy.ts +0 -138
- package/e2e/cypress/support/commands.ts +0 -120
- package/e2e/cypress/support/e2e.ts +0 -10
- package/e2e/cypress/tsconfig.json +0 -14
- package/e2e/kitchen-sink/app/components/ks-badge.ts +0 -8
- package/e2e/kitchen-sink/app/composables/useKsCounter.ts +0 -9
- package/e2e/kitchen-sink/app/error.ts +0 -18
- package/e2e/kitchen-sink/app/layouts/admin.ts +0 -13
- package/e2e/kitchen-sink/app/layouts/default.ts +0 -25
- package/e2e/kitchen-sink/app/layouts/group.ts +0 -9
- package/e2e/kitchen-sink/app/layouts/minimal.ts +0 -7
- package/e2e/kitchen-sink/app/loading.ts +0 -9
- package/e2e/kitchen-sink/app/middleware/auth.ts +0 -9
- package/e2e/kitchen-sink/app/middleware/custom-log.ts +0 -4
- package/e2e/kitchen-sink/app/middleware/group-auth.ts +0 -7
- package/e2e/kitchen-sink/app/middleware/logger.ts +0 -14
- package/e2e/kitchen-sink/app/pages/(auth)/login.ts +0 -13
- package/e2e/kitchen-sink/app/pages/(auth)/protected.ts +0 -16
- package/e2e/kitchen-sink/app/pages/404.ts +0 -9
- package/e2e/kitchen-sink/app/pages/about.ts +0 -17
- package/e2e/kitchen-sink/app/pages/admin/_layout.ts +0 -1
- package/e2e/kitchen-sink/app/pages/admin/dashboard.ts +0 -11
- package/e2e/kitchen-sink/app/pages/async-component-error-test.ts +0 -18
- package/e2e/kitchen-sink/app/pages/async-component-test.ts +0 -18
- package/e2e/kitchen-sink/app/pages/blog/[slug].ts +0 -59
- package/e2e/kitchen-sink/app/pages/blog/index.ts +0 -51
- package/e2e/kitchen-sink/app/pages/content-blog.ts +0 -37
- package/e2e/kitchen-sink/app/pages/content-doc.ts +0 -42
- package/e2e/kitchen-sink/app/pages/content-fallback.ts +0 -36
- package/e2e/kitchen-sink/app/pages/content-guides.ts +0 -35
- package/e2e/kitchen-sink/app/pages/content-index.ts +0 -39
- package/e2e/kitchen-sink/app/pages/content-search.ts +0 -36
- package/e2e/kitchen-sink/app/pages/cookie-test.ts +0 -22
- package/e2e/kitchen-sink/app/pages/counter.ts +0 -17
- package/e2e/kitchen-sink/app/pages/group-auth-blocked.ts +0 -9
- package/e2e/kitchen-sink/app/pages/group-meta-test/_layout.ts +0 -6
- package/e2e/kitchen-sink/app/pages/group-meta-test/custom-mw.ts +0 -14
- package/e2e/kitchen-sink/app/pages/group-meta-test/page.ts +0 -9
- package/e2e/kitchen-sink/app/pages/group-meta-test/protected.ts +0 -8
- package/e2e/kitchen-sink/app/pages/head.ts +0 -20
- package/e2e/kitchen-sink/app/pages/i18n-test.ts +0 -14
- package/e2e/kitchen-sink/app/pages/index.ts +0 -27
- package/e2e/kitchen-sink/app/pages/isr-test.ts +0 -17
- package/e2e/kitchen-sink/app/pages/items/[id].ts +0 -20
- package/e2e/kitchen-sink/app/pages/jit-css-custom-colors-test.ts +0 -14
- package/e2e/kitchen-sink/app/pages/loader-error-test.ts +0 -13
- package/e2e/kitchen-sink/app/pages/loader-props-test.ts +0 -19
- package/e2e/kitchen-sink/app/pages/loader-response-error-test.ts +0 -13
- package/e2e/kitchen-sink/app/pages/middleware-chain-test.ts +0 -12
- package/e2e/kitchen-sink/app/pages/middleware-status-test.ts +0 -9
- package/e2e/kitchen-sink/app/pages/navigate-test.ts +0 -16
- package/e2e/kitchen-sink/app/pages/observability-test.ts +0 -25
- package/e2e/kitchen-sink/app/pages/per-route-error-test.error.ts +0 -13
- package/e2e/kitchen-sink/app/pages/per-route-error-test.ts +0 -15
- package/e2e/kitchen-sink/app/pages/plugin-dsd-test.ts +0 -10
- package/e2e/kitchen-sink/app/pages/render-error-test.ts +0 -12
- package/e2e/kitchen-sink/app/pages/render-server-test.ts +0 -12
- package/e2e/kitchen-sink/app/pages/render-spa-test.ts +0 -12
- package/e2e/kitchen-sink/app/pages/route-info.ts +0 -14
- package/e2e/kitchen-sink/app/pages/seo-test.ts +0 -23
- package/e2e/kitchen-sink/app/pages/session-rotation-test.ts +0 -25
- package/e2e/kitchen-sink/app/pages/use-state-test.ts +0 -37
- package/e2e/kitchen-sink/app/plugins/01.setup.ts +0 -7
- package/e2e/kitchen-sink/app/plugins/02.ks-plugin-components.ts +0 -27
- package/e2e/kitchen-sink/cer-auto-imports.d.ts +0 -51
- package/e2e/kitchen-sink/cer-env.d.ts +0 -35
- package/e2e/kitchen-sink/cer-tsconfig.json +0 -30
- package/e2e/kitchen-sink/cer.config.ts +0 -43
- package/e2e/kitchen-sink/content/01.guides/01.index.md +0 -8
- package/e2e/kitchen-sink/content/01.guides/02.intro.md +0 -8
- package/e2e/kitchen-sink/content/01.guides/10.advanced.md +0 -8
- package/e2e/kitchen-sink/content/blog/2026-04-01-hello.md +0 -26
- package/e2e/kitchen-sink/content/blog/2026-04-02-draft.md +0 -10
- package/e2e/kitchen-sink/content/blog/index.md +0 -8
- package/e2e/kitchen-sink/content/blog/no-frontmatter.md +0 -7
- package/e2e/kitchen-sink/content/docs/getting-started.md +0 -48
- package/e2e/kitchen-sink/content/index.md +0 -16
- package/e2e/kitchen-sink/server/api/echo.ts +0 -12
- package/e2e/kitchen-sink/server/api/health.ts +0 -3
- package/e2e/kitchen-sink/server/api/posts/[slug].ts +0 -11
- package/e2e/kitchen-sink/server/api/posts/index.ts +0 -5
- package/e2e/kitchen-sink/server/api/session.ts +0 -23
- package/e2e/kitchen-sink/server/data/posts.ts +0 -21
- package/e2e/kitchen-sink/server/middleware/01-headers.ts +0 -6
- package/e2e/kitchen-sink/server/middleware/02-status-test.ts +0 -10
- package/e2e/kitchen-sink/tsconfig.json +0 -3
- package/e2e/scripts/clean.mjs +0 -14
- package/eslint.config.ts +0 -22
- package/src/__tests__/cli/adapters/cloudflare-worker.integration.test.ts +0 -132
- package/src/__tests__/cli/adapters/cloudflare.test.ts +0 -332
- package/src/__tests__/cli/adapters/netlify-bridge.integration.test.ts +0 -139
- package/src/__tests__/cli/adapters/netlify.test.ts +0 -286
- package/src/__tests__/cli/adapters/vercel-launcher.integration.test.ts +0 -129
- package/src/__tests__/cli/adapters/vercel.test.ts +0 -263
- package/src/__tests__/cli/preview-hardening.test.ts +0 -265
- package/src/__tests__/cli/preview-isr.test.ts +0 -320
- package/src/__tests__/index.test.ts +0 -21
- package/src/__tests__/plugin/app-template.test.ts +0 -112
- package/src/__tests__/plugin/build-ssg-render.test.ts +0 -155
- package/src/__tests__/plugin/build-ssg.test.ts +0 -598
- package/src/__tests__/plugin/build-ssr.test.ts +0 -192
- package/src/__tests__/plugin/cer-app-plugin.test.ts +0 -552
- package/src/__tests__/plugin/content/emitter.test.ts +0 -117
- package/src/__tests__/plugin/content/loader.test.ts +0 -154
- package/src/__tests__/plugin/content/parser.test.ts +0 -381
- package/src/__tests__/plugin/content/path-utils.test.ts +0 -69
- package/src/__tests__/plugin/content/search.test.ts +0 -119
- package/src/__tests__/plugin/dev-server.test.ts +0 -813
- package/src/__tests__/plugin/dts-generator.test.ts +0 -394
- package/src/__tests__/plugin/entry-server-template.test.ts +0 -385
- package/src/__tests__/plugin/generated-dir.test.ts +0 -144
- package/src/__tests__/plugin/path-utils.test.ts +0 -411
- package/src/__tests__/plugin/resolve-config.test.ts +0 -200
- package/src/__tests__/plugin/scanner.test.ts +0 -186
- package/src/__tests__/plugin/transforms/auto-import.test.ts +0 -510
- package/src/__tests__/plugin/transforms/head-inject.test.ts +0 -178
- package/src/__tests__/plugin/virtual/composables.test.ts +0 -57
- package/src/__tests__/plugin/virtual/content-components.test.ts +0 -66
- package/src/__tests__/plugin/virtual/error.test.ts +0 -71
- package/src/__tests__/plugin/virtual/layouts.test.ts +0 -70
- package/src/__tests__/plugin/virtual/loading.test.ts +0 -72
- package/src/__tests__/plugin/virtual/middleware.test.ts +0 -83
- package/src/__tests__/plugin/virtual/plugins.test.ts +0 -129
- package/src/__tests__/plugin/virtual/routes.test.ts +0 -884
- package/src/__tests__/plugin/virtual/server-api.test.ts +0 -164
- package/src/__tests__/plugin/virtual/server-middleware.test.ts +0 -102
- package/src/__tests__/runtime/app-template.test.ts +0 -198
- package/src/__tests__/runtime/define-middleware.test.ts +0 -64
- package/src/__tests__/runtime/define-server-middleware.test.ts +0 -54
- package/src/__tests__/runtime/entry-client-template.test.ts +0 -61
- package/src/__tests__/runtime/isr-handler.test.ts +0 -338
- package/src/__tests__/runtime/oauth/handler.test.ts +0 -358
- package/src/__tests__/runtime/oauth/providers.test.ts +0 -47
- package/src/__tests__/runtime/oauth-index.test.ts +0 -43
- package/src/__tests__/runtime/use-auth.test.ts +0 -169
- package/src/__tests__/runtime/use-content-search-composable.test.ts +0 -405
- package/src/__tests__/runtime/use-content-search.test.ts +0 -163
- package/src/__tests__/runtime/use-content.test.ts +0 -226
- package/src/__tests__/runtime/use-cookie.test.ts +0 -277
- package/src/__tests__/runtime/use-fetch-component.test.ts +0 -214
- package/src/__tests__/runtime/use-fetch.test.ts +0 -377
- package/src/__tests__/runtime/use-head.test.ts +0 -266
- package/src/__tests__/runtime/use-inject-client.test.ts +0 -67
- package/src/__tests__/runtime/use-inject.test.ts +0 -66
- package/src/__tests__/runtime/use-locale.test.ts +0 -152
- package/src/__tests__/runtime/use-navigate.test.ts +0 -121
- package/src/__tests__/runtime/use-page-data.test.ts +0 -298
- package/src/__tests__/runtime/use-route.test.ts +0 -156
- package/src/__tests__/runtime/use-runtime-config.test.ts +0 -182
- package/src/__tests__/runtime/use-seo-meta.test.ts +0 -109
- package/src/__tests__/runtime/use-session.test.ts +0 -320
- package/src/__tests__/runtime/use-state.test.ts +0 -340
- package/src/__tests__/types/config.test.ts +0 -18
- package/src/cli/adapters/cloudflare.ts +0 -335
- package/src/cli/adapters/netlify.ts +0 -326
- package/src/cli/adapters/vercel.ts +0 -311
- package/src/cli/commands/adapt.ts +0 -84
- package/src/cli/commands/build.ts +0 -165
- package/src/cli/commands/dev.ts +0 -125
- package/src/cli/commands/generate.ts +0 -91
- package/src/cli/commands/preview-isr.ts +0 -172
- package/src/cli/commands/preview.ts +0 -489
- package/src/cli/create/index.ts +0 -275
- package/src/cli/create/templates/shared/.gitignore.tpl +0 -25
- package/src/cli/create/templates/shared/app/layouts/default.ts.tpl +0 -15
- package/src/cli/create/templates/shared/app/pages/index.ts.tpl +0 -8
- package/src/cli/create/templates/shared/index.html.tpl +0 -12
- package/src/cli/create/templates/shared/tsconfig.json.tpl +0 -6
- package/src/cli/create/templates/spa/cer.config.ts.tpl +0 -6
- package/src/cli/create/templates/spa/package.json.tpl +0 -18
- package/src/cli/create/templates/ssg/cer.config.ts.tpl +0 -10
- package/src/cli/create/templates/ssg/package.json.tpl +0 -19
- package/src/cli/create/templates/ssr/cer.config.ts.tpl +0 -6
- package/src/cli/create/templates/ssr/package.json.tpl +0 -18
- package/src/cli/index.ts +0 -22
- package/src/index.ts +0 -20
- package/src/plugin/build-ssg.ts +0 -336
- package/src/plugin/build-ssr.ts +0 -134
- package/src/plugin/content/emitter.ts +0 -50
- package/src/plugin/content/index.ts +0 -233
- package/src/plugin/content/parser.ts +0 -259
- package/src/plugin/content/path-utils.ts +0 -55
- package/src/plugin/content/scanner.ts +0 -26
- package/src/plugin/content/search.ts +0 -28
- package/src/plugin/dev-server.ts +0 -377
- package/src/plugin/dts-generator.ts +0 -273
- package/src/plugin/generated-dir.ts +0 -121
- package/src/plugin/index.ts +0 -553
- package/src/plugin/path-utils.ts +0 -186
- package/src/plugin/scanner.ts +0 -65
- package/src/plugin/transforms/auto-import.ts +0 -206
- package/src/plugin/transforms/head-inject.ts +0 -161
- package/src/plugin/virtual/composables.ts +0 -28
- package/src/plugin/virtual/content-components.ts +0 -83
- package/src/plugin/virtual/error.ts +0 -34
- package/src/plugin/virtual/layouts.ts +0 -41
- package/src/plugin/virtual/loading.ts +0 -32
- package/src/plugin/virtual/middleware.ts +0 -45
- package/src/plugin/virtual/plugins.ts +0 -46
- package/src/plugin/virtual/routes.ts +0 -514
- package/src/plugin/virtual/server-api.ts +0 -85
- package/src/plugin/virtual/server-middleware.ts +0 -44
- package/src/runtime/app-template.ts +0 -380
- package/src/runtime/composables/define-middleware.ts +0 -17
- package/src/runtime/composables/define-server-middleware.ts +0 -18
- package/src/runtime/composables/index.ts +0 -27
- package/src/runtime/composables/use-auth.ts +0 -125
- package/src/runtime/composables/use-content-search.ts +0 -205
- package/src/runtime/composables/use-content.ts +0 -146
- package/src/runtime/composables/use-cookie.ts +0 -135
- package/src/runtime/composables/use-fetch.ts +0 -438
- package/src/runtime/composables/use-head.ts +0 -212
- package/src/runtime/composables/use-inject.ts +0 -49
- package/src/runtime/composables/use-locale.ts +0 -109
- package/src/runtime/composables/use-navigate.ts +0 -58
- package/src/runtime/composables/use-page-data.ts +0 -93
- package/src/runtime/composables/use-route.ts +0 -71
- package/src/runtime/composables/use-runtime-config.ts +0 -123
- package/src/runtime/composables/use-seo-meta.ts +0 -80
- package/src/runtime/composables/use-session.ts +0 -186
- package/src/runtime/composables/use-state.ts +0 -92
- package/src/runtime/content/client.ts +0 -168
- package/src/runtime/entry-client-template.ts +0 -39
- package/src/runtime/entry-server-template.ts +0 -493
- package/src/runtime/isr-handler.ts +0 -184
- package/src/runtime/oauth/handler.ts +0 -407
- package/src/runtime/oauth/index.ts +0 -49
- package/src/runtime/oauth/providers.ts +0 -38
- package/src/types/api.ts +0 -40
- package/src/types/config.ts +0 -371
- package/src/types/content.ts +0 -66
- package/src/types/index.ts +0 -7
- package/src/types/middleware.ts +0 -63
- package/src/types/page.ts +0 -117
- package/src/types/plugin.ts +0 -34
- package/tsconfig.build.json +0 -10
- package/tsconfig.json +0 -19
- package/vitest.config.ts +0 -33
package/dist/types/config.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { RouterConfig } from '@jasonshimmy/custom-elements-runtime/router';
|
|
2
2
|
import type { IncomingMessage } from 'node:http';
|
|
3
|
+
/** A package-provided bundle of component resolution, global imports, and Vite plugins. */
|
|
4
|
+
export interface CerAppIntegration {
|
|
5
|
+
/** Stable name used in diagnostics. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Resolve a rendered custom-element tag to its side-effect registration module. */
|
|
8
|
+
componentResolver?: (tag: string) => string | undefined;
|
|
9
|
+
/** Imports that must run once in the generated client entry (for example global CSS). */
|
|
10
|
+
globalImports?: readonly string[];
|
|
11
|
+
/** Build plugins required by the integration. */
|
|
12
|
+
plugins?: import('vite').Plugin[];
|
|
13
|
+
}
|
|
3
14
|
/**
|
|
4
15
|
* Context passed to the `onError` hook.
|
|
5
16
|
* `type` indicates which layer the error originated from so reporters can
|
|
@@ -120,17 +131,31 @@ export interface SsgConfig {
|
|
|
120
131
|
* - `string[]` — explicit list of paths (e.g. `['/about', '/contact']`).
|
|
121
132
|
*/
|
|
122
133
|
routes?: 'auto' | string[];
|
|
123
|
-
/** Maximum number of pages rendered in parallel. Defaults to `
|
|
134
|
+
/** Maximum number of pages rendered in parallel. Defaults to `4`. Increase for faster SSG builds at the cost of higher memory usage. */
|
|
124
135
|
concurrency?: number;
|
|
125
136
|
/** When `true`, unenumerated routes fall back to SSR at runtime instead of returning 404. */
|
|
126
137
|
fallback?: boolean;
|
|
138
|
+
/** Fail the build when any route cannot be rendered. Defaults to `true`; set to `false` only for intentionally partial output. */
|
|
139
|
+
failOnError?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Inline root-relative CSS assets into each generated HTML document.
|
|
142
|
+
*
|
|
143
|
+
* - `false` (default) keeps stylesheet links unchanged.
|
|
144
|
+
* - `true` inlines every root-relative stylesheet.
|
|
145
|
+
* - A positive number inlines only stylesheets at or below that UTF-8 byte size.
|
|
146
|
+
*
|
|
147
|
+
* This removes a render-blocking request for small critical stylesheets at the
|
|
148
|
+
* cost of repeating their bytes in each page. Inline styles also require an
|
|
149
|
+
* appropriate Content Security Policy (`style-src`) when CSP is enabled.
|
|
150
|
+
*/
|
|
151
|
+
inlineStylesheets?: boolean | number;
|
|
127
152
|
}
|
|
128
153
|
/** JIT (Just-In-Time) CSS configuration for shadow-DOM style injection. */
|
|
129
154
|
export interface JitCssConfig {
|
|
130
155
|
/** Additional glob patterns for content files scanned by the JIT CSS engine. */
|
|
131
156
|
content?: string[];
|
|
132
|
-
/** Enable
|
|
133
|
-
extendedColors?: boolean;
|
|
157
|
+
/** Enable every extended color family or list only the families to retain. Defaults to `false`. */
|
|
158
|
+
extendedColors?: boolean | string[];
|
|
134
159
|
/**
|
|
135
160
|
* Project-specific color families registered in the JIT CSS engine at both
|
|
136
161
|
* build time and runtime. Each key is a color family name (e.g. `brand`);
|
|
@@ -223,6 +248,14 @@ export interface RuntimeConfig {
|
|
|
223
248
|
export interface CerAppConfig {
|
|
224
249
|
mode?: 'spa' | 'ssr' | 'ssg';
|
|
225
250
|
srcDir?: string;
|
|
251
|
+
/**
|
|
252
|
+
* The canonical origin of the site (e.g. `'https://example.com'`).
|
|
253
|
+
* No trailing slash. When set, the SSG build automatically:
|
|
254
|
+
* - Injects `<link rel="canonical" href="${siteUrl}${path}">` into every page.
|
|
255
|
+
* - Writes a `robots.txt` to `dist/` (skipped when a `public/robots.txt` already exists).
|
|
256
|
+
* Also available at runtime via `useRuntimeConfig().public.siteUrl`.
|
|
257
|
+
*/
|
|
258
|
+
siteUrl?: string;
|
|
226
259
|
/** File-based content layer configuration. Reads from `content/` at the project root by default. */
|
|
227
260
|
content?: import('./content.js').CerContentConfig;
|
|
228
261
|
/**
|
|
@@ -243,6 +276,8 @@ export interface CerAppConfig {
|
|
|
243
276
|
router?: Pick<RouterConfig, 'base' | 'scrollToFragment'>;
|
|
244
277
|
jitCss?: JitCssConfig;
|
|
245
278
|
autoImports?: AutoImportsConfig;
|
|
279
|
+
/** UI/framework integrations composed into generated entries and component code splitting. */
|
|
280
|
+
integrations?: CerAppIntegration[];
|
|
246
281
|
port?: number;
|
|
247
282
|
/**
|
|
248
283
|
* Runtime configuration accessible via `useRuntimeConfig()`.
|
|
@@ -270,8 +305,22 @@ export interface CerAppConfig {
|
|
|
270
305
|
* ```
|
|
271
306
|
*
|
|
272
307
|
* You can also run the built-in adapters independently with `cer-app adapt --platform <name>`.
|
|
273
|
-
|
|
308
|
+
*/
|
|
274
309
|
adapter?: 'vercel' | 'netlify' | 'cloudflare' | ((root: string) => Promise<void>);
|
|
310
|
+
/**
|
|
311
|
+
* Additional standalone Vite plugins to include alongside the built-in cerApp plugins.
|
|
312
|
+
* UI libraries that also resolve components or add global entry imports should
|
|
313
|
+
* use `integrations` instead.
|
|
314
|
+
*
|
|
315
|
+
* @example
|
|
316
|
+
* ```ts
|
|
317
|
+
* import inspect from 'vite-plugin-inspect'
|
|
318
|
+
* export default defineConfig({
|
|
319
|
+
* plugins: [inspect()],
|
|
320
|
+
* })
|
|
321
|
+
* ```
|
|
322
|
+
*/
|
|
323
|
+
plugins?: import('vite').Plugin[];
|
|
275
324
|
/**
|
|
276
325
|
* Authentication configuration.
|
|
277
326
|
* Enables OAuth login flows via `useAuth()` and auto-generates
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAA;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAA;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAEhD,2FAA2F;AAC3F,MAAM,WAAW,iBAAiB;IAChC,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAA;IACvD,yFAAyF;IACzF,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,MAAM,EAAE,MAAM,EAAE,CAAA;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../src/types/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AA+YA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,YAAY,CAAC,MAAoB;IAC/C,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -6,7 +6,7 @@ import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
|
6
6
|
* - `false` — block navigation
|
|
7
7
|
* - `string` — redirect to that path
|
|
8
8
|
*/
|
|
9
|
-
export type GuardResult = boolean | string | Promise<boolean | string>;
|
|
9
|
+
export type GuardResult = boolean | string | void | Promise<boolean | string | void>;
|
|
10
10
|
/**
|
|
11
11
|
* Route middleware function.
|
|
12
12
|
*
|
|
@@ -32,7 +32,7 @@ export type GuardResult = boolean | string | Promise<boolean | string>;
|
|
|
32
32
|
* })
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
export type MiddlewareFn = (to: RouteState, from: RouteState | null, next: () => Promise<void>) => GuardResult
|
|
35
|
+
export type MiddlewareFn = (to: RouteState, from: RouteState | null, next: () => Promise<void>) => GuardResult;
|
|
36
36
|
/**
|
|
37
37
|
* Server middleware function. Receives the raw Node.js `req`/`res` pair and a `next`
|
|
38
38
|
* callback. Call `next()` to pass control to the next middleware in the chain,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/types/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAA;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEhE;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/types/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAA;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEhE;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC,CAAA;AAEpF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,UAAU,GAAG,IAAI,EACvB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,KACtB,WAAW,CAAA;AAEhB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,KAC1B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jasonshimmy/vite-plugin-cer-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "Nuxt-style meta-framework for @jasonshimmy/custom-elements-runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -19,28 +19,30 @@
|
|
|
19
19
|
"url": "git+https://github.com/jshimkoski/vite-plugin-cer-app.git"
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://github.com/jshimkoski/vite-plugin-cer-app#readme",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
22
25
|
"sideEffects": [
|
|
23
|
-
"**/*.css"
|
|
24
|
-
"e2e/cypress/support/*.ts"
|
|
26
|
+
"**/*.css"
|
|
25
27
|
],
|
|
26
|
-
"main": "dist/index.
|
|
28
|
+
"main": "dist/index.js",
|
|
27
29
|
"module": "dist/index.js",
|
|
28
30
|
"types": "dist/index.d.ts",
|
|
29
31
|
"exports": {
|
|
30
32
|
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
31
34
|
"import": "./dist/index.js",
|
|
32
|
-
"
|
|
33
|
-
"types": "./dist/index.d.ts"
|
|
35
|
+
"default": "./dist/index.js"
|
|
34
36
|
},
|
|
35
37
|
"./composables": {
|
|
38
|
+
"types": "./dist/runtime/composables/index.d.ts",
|
|
36
39
|
"import": "./dist/runtime/composables/index.js",
|
|
37
|
-
"
|
|
38
|
-
"types": "./dist/runtime/composables/index.d.ts"
|
|
40
|
+
"default": "./dist/runtime/composables/index.js"
|
|
39
41
|
},
|
|
40
42
|
"./types": {
|
|
43
|
+
"types": "./dist/types/index.d.ts",
|
|
41
44
|
"import": "./dist/types/index.js",
|
|
42
|
-
"
|
|
43
|
-
"types": "./dist/types/index.d.ts"
|
|
45
|
+
"default": "./dist/types/index.js"
|
|
44
46
|
},
|
|
45
47
|
"./isr": {
|
|
46
48
|
"import": "./dist/runtime/isr-handler.js",
|
|
@@ -57,7 +59,8 @@
|
|
|
57
59
|
},
|
|
58
60
|
"scripts": {
|
|
59
61
|
"validate": "npm run lint && npm test && npm run build && npm run e2e",
|
|
60
|
-
"
|
|
62
|
+
"prebuild": "node scripts/clean-dist.mjs",
|
|
63
|
+
"build": "tsc -p tsconfig.build.json && node scripts/copy-templates.mjs",
|
|
61
64
|
"dev": "tsc -p tsconfig.build.json --watch",
|
|
62
65
|
"lint": "eslint",
|
|
63
66
|
"test": "vitest run",
|
|
@@ -73,10 +76,10 @@
|
|
|
73
76
|
"e2e:serve:ssr": "node dist/cli/index.js preview --root e2e/kitchen-sink --port 4175 --ssr",
|
|
74
77
|
"e2e:serve:ssg": "node dist/cli/index.js preview --root e2e/kitchen-sink --port 4176",
|
|
75
78
|
"e2e:serve:dev": "node dist/cli/index.js dev --root e2e/kitchen-sink --port 4177 --mode ssr",
|
|
76
|
-
"e2e:run:spa": "cypress run --config baseUrl=http://localhost:4174 --
|
|
77
|
-
"e2e:run:ssr": "cypress run --config baseUrl=http://localhost:4175 --
|
|
78
|
-
"e2e:run:ssg": "cypress run --config baseUrl=http://localhost:4176 --
|
|
79
|
-
"e2e:run:dev": "cypress run --config baseUrl=http://localhost:4177 --
|
|
79
|
+
"e2e:run:spa": "cypress run --config baseUrl=http://localhost:4174 --expose mode=spa",
|
|
80
|
+
"e2e:run:ssr": "cypress run --config baseUrl=http://localhost:4175 --expose mode=ssr",
|
|
81
|
+
"e2e:run:ssg": "cypress run --config baseUrl=http://localhost:4176 --expose mode=ssg",
|
|
82
|
+
"e2e:run:dev": "cypress run --config baseUrl=http://localhost:4177 --expose mode=dev",
|
|
80
83
|
"e2e:spa": "npm run e2e:build:spa && start-server-and-test e2e:serve:spa http://localhost:4174 e2e:run:spa",
|
|
81
84
|
"e2e:ssr": "npm run e2e:build:ssr && start-server-and-test e2e:serve:ssr http://localhost:4175 e2e:run:ssr",
|
|
82
85
|
"e2e:ssg": "npm run e2e:build:ssg && start-server-and-test e2e:serve:ssg http://localhost:4176 e2e:run:ssg",
|
|
@@ -85,20 +88,20 @@
|
|
|
85
88
|
"cypress:open": "cypress open"
|
|
86
89
|
},
|
|
87
90
|
"peerDependencies": {
|
|
88
|
-
"@jasonshimmy/custom-elements-runtime": ">=3.
|
|
91
|
+
"@jasonshimmy/custom-elements-runtime": ">=3.9.0",
|
|
89
92
|
"vite": ">=5.0.0"
|
|
90
93
|
},
|
|
91
94
|
"dependencies": {
|
|
92
95
|
"commander": "^14.0.3",
|
|
93
96
|
"fast-glob": "^3.3.3",
|
|
94
|
-
"gray-matter": "^4.0.3",
|
|
95
97
|
"magic-string": "^0.30.21",
|
|
96
98
|
"marked": "^18.0.0",
|
|
97
99
|
"minisearch": "^7.2.0",
|
|
98
|
-
"pathe": "^2.0.3"
|
|
100
|
+
"pathe": "^2.0.3",
|
|
101
|
+
"yaml": "^2.9.0"
|
|
99
102
|
},
|
|
100
103
|
"devDependencies": {
|
|
101
|
-
"@jasonshimmy/custom-elements-runtime": "^3.
|
|
104
|
+
"@jasonshimmy/custom-elements-runtime": "^3.9.0",
|
|
102
105
|
"@types/node": "^25.6.0",
|
|
103
106
|
"@vitest/coverage-v8": "^4.1.2",
|
|
104
107
|
"cypress": "^15.13.1",
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
applyTo: '**'
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
You are an expert in TypeScript, JavaScript, HTML, CSS. Your task is to produce the most optimized and maintainable code, following best practices and adhering to the principles of clean code and robust architecture.
|
|
6
|
-
|
|
7
|
-
## Objective
|
|
8
|
-
|
|
9
|
-
- Create a Web Component Runtime solution that is not only functional but also adheres to the best practices in performance, security, and maintainability.
|
|
10
|
-
- When implementing features, prioritize simplicity and clarity in the codebase.
|
|
11
|
-
- When communicating with the user, you don't need to ask for permission before making cleanups or optimizations. Instead, focus on delivering a solution that is efficient and easy to understand.
|
|
12
|
-
|
|
13
|
-
## Commands to Know
|
|
14
|
-
|
|
15
|
-
- `npm run build`: Builds the project for production.
|
|
16
|
-
- `npm run dev`: Starts the development server with hot-reloading.
|
|
17
|
-
- `npm test`: Runs the test suite using Vitest.
|
|
18
|
-
- `npm test:watch`: Runs the test suite using Vitest in development watch mode.
|
|
19
|
-
- `npm run test:coverage`: Generates a code coverage report.
|
|
20
|
-
|
|
21
|
-
## Code Style and Structure
|
|
22
|
-
|
|
23
|
-
- ALL CODE MUST BE: lightweight, developer friendly, strongly typed, performant, and scalable.
|
|
24
|
-
- Write concise, technical TypeScript code with accurate examples.
|
|
25
|
-
- Use functional and declarative programming patterns; avoid classes.
|
|
26
|
-
- Prefer iteration and modularization over code duplication.
|
|
27
|
-
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
|
|
28
|
-
- Structure files: exported component, subcomponents, helpers, static content, types.
|
|
29
|
-
- Use lowercase with dashes for directory names (e.g., `components/auth-wizard`).
|
|
30
|
-
- Use kebab-case for file names (e.g., `auth-wizard.ts`).
|
|
31
|
-
- Avoid using "this" keyword in functional components.
|
|
32
|
-
- Prefer pure functions and avoid side effects.
|
|
33
|
-
- Use immutable data structures where possible.
|
|
34
|
-
- Use JSDoc comments for functions and components to improve IDE intellisense.
|
|
35
|
-
|
|
36
|
-
## Markdown Documentation
|
|
37
|
-
|
|
38
|
-
All documentation written in the docs directory should be:
|
|
39
|
-
|
|
40
|
-
- In Markdown format
|
|
41
|
-
- Structured with clear headings and subheadings
|
|
42
|
-
- Include code examples where applicable
|
|
43
|
-
- Use consistent terminology and phrasing
|
|
44
|
-
- Be 100% accurate with the actual code implementation
|
|
45
|
-
- Be easy to read and understand
|
|
46
|
-
- Be concise and to the point
|
|
47
|
-
- Use emojis for titles
|
|
48
|
-
|
|
49
|
-
## Naming Conventions
|
|
50
|
-
|
|
51
|
-
- Use lowercase with dashes for directories (e.g., components/auth-wizard).
|
|
52
|
-
- Favor named exports for components.
|
|
53
|
-
|
|
54
|
-
## TypeScript Usage
|
|
55
|
-
|
|
56
|
-
- Use strict TypeScript for all code; prefer interfaces over types.
|
|
57
|
-
- Avoid enums; use maps instead.
|
|
58
|
-
- Use functional components with TypeScript interfaces.
|
|
59
|
-
- Never use "any" type; always prefer strongly typed definitions.
|
|
60
|
-
|
|
61
|
-
## Syntax and Formatting
|
|
62
|
-
|
|
63
|
-
- Use the "function" keyword for pure functions.
|
|
64
|
-
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
|
|
65
|
-
|
|
66
|
-
## UI and Styling
|
|
67
|
-
|
|
68
|
-
- Generate Custom Elements using our lib/index.ts for components and styling.
|
|
69
|
-
- Implement responsive design; use a mobile-first approach.
|
|
70
|
-
|
|
71
|
-
## Performance Optimization
|
|
72
|
-
|
|
73
|
-
- Use TypeScript and JavaScript best practices to ensure high performance.
|
|
74
|
-
- Always favor tree-shaking and code splitting.
|
|
75
|
-
- Optimize images: use WebP format, include size data, implement lazy loading.
|
|
76
|
-
|
|
77
|
-
## Security and Performance
|
|
78
|
-
|
|
79
|
-
- Implement proper error handling, user input validation, and secure coding practices.
|
|
80
|
-
- Follow performance optimization techniques, such as reducing load times and improving rendering efficiency.
|
|
81
|
-
|
|
82
|
-
## Testing and Documentation
|
|
83
|
-
|
|
84
|
-
- Write unit tests for components using Vitest.
|
|
85
|
-
- Provide clear and concise comments for complex logic.
|
|
86
|
-
- Use JSDoc comments for functions and components to improve IDE intellisense.
|
|
87
|
-
|
|
88
|
-
## Error Handling and Validation
|
|
89
|
-
|
|
90
|
-
- Prioritize error handling and edge cases:
|
|
91
|
-
- Use early returns for error conditions.
|
|
92
|
-
- Implement guard clauses to handle preconditions and invalid states early.
|
|
93
|
-
- Use custom error types for consistent error handling.
|
|
94
|
-
|
|
95
|
-
## Key Conventions - NON-NEGOTIABLE
|
|
96
|
-
|
|
97
|
-
- NEVER GUESS OR ASSUME! Always make informed decisions based on available data in a project.
|
|
98
|
-
- Always use strongly typed TypeScript.
|
|
99
|
-
- Keep code lightweight and modular.
|
|
100
|
-
- Do not use external dependencies.
|
|
101
|
-
- Keep code performant.
|
|
102
|
-
- Keep code secure.
|
|
103
|
-
- Keep code developer friendly and easy to use.
|
|
104
|
-
- Keep code easy to read and understand.
|
|
105
|
-
- Keep code maintainable and scalable.
|
|
106
|
-
- Always write tests for your code.
|
|
107
|
-
- Always follow best practices in coding, security, and performance.
|
|
108
|
-
- Always validate assumptions with actual data.
|
|
109
|
-
- ALWAYS add new unit and e2e/integration tests for any new functionality.
|
|
110
|
-
- ALWAYS document new functionality in the project's documentation files.
|
|
111
|
-
- ALWAYS have the user validate all changes with `npm run validate` and report results back to you.
|
|
112
|
-
- NEVER run Cypress tests yourself. ONLY the user runs Cypress. Always ask the user to run Cypress and report the results.
|
|
113
|
-
- A change can only be considered complete when it meets all the above criteria and has been thoroughly tested and reviewed. THIS IS NON-NEGOTIABLE.
|
|
114
|
-
|
|
115
|
-
## Feature completion checklist (apply to every new feature or fix)
|
|
116
|
-
|
|
117
|
-
Before declaring any change complete, ALL of the following must be satisfied:
|
|
118
|
-
|
|
119
|
-
### Documentation
|
|
120
|
-
- [ ] All new features are documented in the relevant `docs/*.md` file with options, API reference, and examples.
|
|
121
|
-
- [ ] If a composable was added, it has a full entry in `docs/composables.md`.
|
|
122
|
-
- [ ] If the feature affects auto-imports, `docs/configuration.md` is updated.
|
|
123
|
-
- [ ] If the feature affects routing, `docs/routing.md` is updated.
|
|
124
|
-
- [ ] If the feature affects middleware, `docs/middleware.md` is updated.
|
|
125
|
-
- [ ] Documentation is 100% accurate with the actual implementation.
|
|
126
|
-
|
|
127
|
-
### Unit tests
|
|
128
|
-
- [ ] Vitest unit tests in `src/__tests__/` cover typical usage, edge cases, and error paths.
|
|
129
|
-
- [ ] Existing test coverage has not been reduced.
|
|
130
|
-
|
|
131
|
-
### E2e tests
|
|
132
|
-
- [ ] Cypress specs in `e2e/cypress/e2e/` cover the feature across all applicable build modes (SPA, SSR, SSG, dev).
|
|
133
|
-
- [ ] Required kitchen-sink fixtures are added to `e2e/kitchen-sink/`.
|
|
134
|
-
- [ ] Cypress is NOT run by the AI — the user runs `npm run e2e` and reports results.
|
|
135
|
-
|
|
136
|
-
### Auto-imports
|
|
137
|
-
- [ ] New framework composables are added to `FRAMEWORK_IMPORTS` and `FRAMEWORK_IDENTIFIERS` in `src/plugin/transforms/auto-import.ts`.
|
|
138
|
-
- [ ] Auto-import behavior is tested in `src/__tests__/plugin/transforms/auto-import.test.ts`.
|
|
139
|
-
|
|
140
|
-
### TypeScript
|
|
141
|
-
- [ ] All new code uses strict TypeScript — no `any`, no implicit `any`.
|
|
142
|
-
- [ ] New public types are exported from `src/types/`.
|
|
143
|
-
- [ ] `npm run build` completes without TypeScript errors.
|
|
144
|
-
|
|
145
|
-
### Validation
|
|
146
|
-
- [ ] `npm run lint && npm test && npm run build` passes clean before asking the user to run Cypress.
|
|
147
|
-
- [ ] User runs `npm run validate` to confirm the full pipeline passes.
|
|
148
|
-
|
|
149
|
-
## Methodology
|
|
150
|
-
|
|
151
|
-
1. **System 2 Thinking**: Approach the problem with analytical rigor. Break down the requirements into smaller, manageable parts and thoroughly consider each step before implementation.
|
|
152
|
-
2. **Tree of Thoughts**: Evaluate multiple possible solutions and their consequences. Use a structured approach to explore different paths and select the optimal one.
|
|
153
|
-
3. **Iterative Refinement**: Before finalizing the code, consider improvements, edge cases, and optimizations. Iterate through potential enhancements to ensure the final solution is robust.
|
|
154
|
-
|
|
155
|
-
## Process:
|
|
156
|
-
|
|
157
|
-
1. **Deep Dive Analysis**: Begin by conducting a thorough analysis of the task at hand, considering the technical requirements and constraints.
|
|
158
|
-
2. **Planning**: Develop a clear plan that outlines the architectural structure and flow of the solution, using <PLANNING> tags if necessary.
|
|
159
|
-
3. **Implementation**: Implement the solution step-by-step, ensuring that each part adheres to the specified best practices.
|
|
160
|
-
4. **Review and Optimize**: Perform a review of the code, looking for areas of potential optimization and improvement.
|
|
161
|
-
5. **Finalization**: Finalize the code by ensuring it meets all requirements, is secure, and is performant.
|
|
162
|
-
|
|
163
|
-
### Coding Environment
|
|
164
|
-
|
|
165
|
-
The user asks questions about the following coding languages:
|
|
166
|
-
|
|
167
|
-
- TypeScript
|
|
168
|
-
- HTML
|
|
169
|
-
- CSS
|