create-koppajs 1.2.1 → 1.2.3
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/CHANGELOG.md +55 -0
- package/README.md +116 -21
- package/bin/create-koppajs.js +10 -16
- package/package.json +10 -7
- package/template/README.md +19 -209
- package/template/_gitignore +0 -3
- package/template/index.html +1 -1
- package/template/package.json +9 -46
- package/template/public/favicon.png +0 -0
- package/template/public/koppajs-logo.png +0 -0
- package/template/src/app-view.kpa +1 -3
- package/template/tsconfig.json +2 -9
- package/template/vite.config.mjs +0 -35
- package/template-overlays/router/README.md +25 -203
- package/template-overlays/router/index.html +1 -1
- package/template-overlays/router/package.json +10 -47
- package/template-overlays/router/src/app-view.kpa +21 -78
- package/template-overlays/router/src/home-page.kpa +23 -60
- package/template-overlays/router/src/main.ts +0 -9
- package/template-overlays/router/src/not-found-page.kpa +16 -48
- package/template-overlays/router/src/router-page.kpa +34 -69
- package/template-overlays/router/src/style.css +5 -29
- package/template/AI_CONSTITUTION.md +0 -50
- package/template/ARCHITECTURE.md +0 -86
- package/template/CHANGELOG.md +0 -34
- package/template/CONTRIBUTING.md +0 -92
- package/template/DECISION_HIERARCHY.md +0 -32
- package/template/DEVELOPMENT_RULES.md +0 -57
- package/template/LICENSE +0 -201
- package/template/RELEASE.md +0 -230
- package/template/ROADMAP.md +0 -34
- package/template/TESTING_STRATEGY.md +0 -93
- package/template/_editorconfig +0 -12
- package/template/_github/instructions/ai-workflow.md +0 -33
- package/template/_github/workflows/ci.yml +0 -38
- package/template/_github/workflows/release.yml +0 -58
- package/template/_husky/commit-msg +0 -8
- package/template/_husky/pre-commit +0 -1
- package/template/_prettierignore +0 -7
- package/template/commitlint.config.mjs +0 -6
- package/template/docs/adr/0001-keep-the-starter-minimal.md +0 -32
- package/template/docs/adr/0002-adopt-a-living-meta-layer.md +0 -30
- package/template/docs/adr/0003-normalize-kpa-plugin-output.md +0 -24
- package/template/docs/adr/0004-adopt-an-automated-quality-baseline.md +0 -31
- package/template/docs/adr/0005-adopt-a-tag-driven-release-baseline.md +0 -45
- package/template/docs/adr/0006-adopt-commit-message-conventions.md +0 -39
- package/template/docs/adr/README.md +0 -37
- package/template/docs/adr/TEMPLATE.md +0 -18
- package/template/docs/architecture/module-boundaries.md +0 -48
- package/template/docs/meta/maintenance.md +0 -40
- package/template/docs/quality/quality-gates.md +0 -39
- package/template/docs/specs/README.md +0 -36
- package/template/docs/specs/TEMPLATE.md +0 -34
- package/template/docs/specs/app-bootstrap.md +0 -46
- package/template/docs/specs/counter-component.md +0 -48
- package/template/docs/specs/quality-workflow.md +0 -62
- package/template/eslint.config.mjs +0 -54
- package/template/playwright.config.ts +0 -31
- package/template/pnpm-lock.yaml +0 -3777
- package/template/prettier.config.mjs +0 -6
- package/template/public/favicon.svg +0 -15
- package/template/tests/e2e/app.spec.ts +0 -18
- package/template/tests/integration/main-bootstrap.test.ts +0 -33
- package/template/tests/unit/normalize-kpa-module-export.test.ts +0 -46
- package/template/vite.config.d.mts +0 -7
- package/template/vitest.config.mjs +0 -19
- package/template-overlays/router/ARCHITECTURE.md +0 -86
- package/template-overlays/router/CHANGELOG.md +0 -44
- package/template-overlays/router/DEVELOPMENT_RULES.md +0 -57
- package/template-overlays/router/ROADMAP.md +0 -34
- package/template-overlays/router/TESTING_STRATEGY.md +0 -67
- package/template-overlays/router/docs/adr/0001-keep-the-starter-minimal.md +0 -32
- package/template-overlays/router/docs/architecture/module-boundaries.md +0 -39
- package/template-overlays/router/docs/meta/maintenance.md +0 -38
- package/template-overlays/router/docs/specs/README.md +0 -19
- package/template-overlays/router/docs/specs/app-bootstrap.md +0 -42
- package/template-overlays/router/docs/specs/router-navigation.md +0 -41
- package/template-overlays/router/pnpm-lock.yaml +0 -3786
- package/template-overlays/router/tests/e2e/app.spec.ts +0 -38
- package/template-overlays/router/tests/integration/main-bootstrap.test.ts +0 -150
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Specifications
|
|
2
|
-
|
|
3
|
-
Specs define expected behavior before or alongside implementation. They are the highest-precedence project documents.
|
|
4
|
-
|
|
5
|
-
## When a spec is required
|
|
6
|
-
|
|
7
|
-
Create or update a spec when a change:
|
|
8
|
-
|
|
9
|
-
- introduces or changes user-visible behavior,
|
|
10
|
-
- adds a subsystem,
|
|
11
|
-
- changes public setup or bootstrap behavior,
|
|
12
|
-
- changes a feature in a way that needs explicit acceptance criteria.
|
|
13
|
-
|
|
14
|
-
## Required structure
|
|
15
|
-
|
|
16
|
-
Use [`TEMPLATE.md`](./TEMPLATE.md). Each spec should define:
|
|
17
|
-
|
|
18
|
-
- purpose
|
|
19
|
-
- behavior
|
|
20
|
-
- inputs
|
|
21
|
-
- outputs
|
|
22
|
-
- constraints
|
|
23
|
-
- edge cases
|
|
24
|
-
- acceptance criteria
|
|
25
|
-
|
|
26
|
-
## Lifecycle
|
|
27
|
-
|
|
28
|
-
- Draft or update the relevant spec before implementing a non-trivial change.
|
|
29
|
-
- Keep the spec narrow and testable.
|
|
30
|
-
- If implementation diverges from the spec, reconcile them immediately.
|
|
31
|
-
|
|
32
|
-
## Current specs
|
|
33
|
-
|
|
34
|
-
- [`app-bootstrap.md`](./app-bootstrap.md)
|
|
35
|
-
- [`counter-component.md`](./counter-component.md)
|
|
36
|
-
- [`quality-workflow.md`](./quality-workflow.md)
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Spec: Title
|
|
2
|
-
|
|
3
|
-
## Status
|
|
4
|
-
|
|
5
|
-
Draft | Approved | Superseded
|
|
6
|
-
|
|
7
|
-
## Purpose
|
|
8
|
-
|
|
9
|
-
Describe why this behavior exists.
|
|
10
|
-
|
|
11
|
-
## Behavior
|
|
12
|
-
|
|
13
|
-
Describe the observable behavior.
|
|
14
|
-
|
|
15
|
-
## Inputs
|
|
16
|
-
|
|
17
|
-
Describe user, system, or configuration inputs.
|
|
18
|
-
|
|
19
|
-
## Outputs
|
|
20
|
-
|
|
21
|
-
Describe rendered output, state changes, or side effects.
|
|
22
|
-
|
|
23
|
-
## Constraints
|
|
24
|
-
|
|
25
|
-
List constraints that implementation must respect.
|
|
26
|
-
|
|
27
|
-
## Edge cases
|
|
28
|
-
|
|
29
|
-
List the important boundary conditions.
|
|
30
|
-
|
|
31
|
-
## Acceptance criteria
|
|
32
|
-
|
|
33
|
-
- Criterion 1
|
|
34
|
-
- Criterion 2
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# Spec: App bootstrap
|
|
2
|
-
|
|
3
|
-
## Status
|
|
4
|
-
|
|
5
|
-
Approved
|
|
6
|
-
|
|
7
|
-
## Purpose
|
|
8
|
-
|
|
9
|
-
Provide a predictable, minimal startup path for a standalone KoppaJS application.
|
|
10
|
-
|
|
11
|
-
## Behavior
|
|
12
|
-
|
|
13
|
-
- The application starts from `index.html`.
|
|
14
|
-
- The HTML shell loads one global stylesheet and one module entrypoint.
|
|
15
|
-
- The document declares exactly one root custom element: `<app-view>`.
|
|
16
|
-
- `src/main.ts` registers `app-view` and `counter-component` with KoppaJS Core.
|
|
17
|
-
- `src/main.ts` invokes `Core()` once to bootstrap the application.
|
|
18
|
-
|
|
19
|
-
## Inputs
|
|
20
|
-
|
|
21
|
-
- Browser loading `index.html`
|
|
22
|
-
- Static asset and source file paths resolved by Vite
|
|
23
|
-
|
|
24
|
-
## Outputs
|
|
25
|
-
|
|
26
|
-
- A rendered `<app-view>` application shell
|
|
27
|
-
- A registered `<counter-component>` available to the root view
|
|
28
|
-
|
|
29
|
-
## Constraints
|
|
30
|
-
|
|
31
|
-
- There must be a single bootstrap entrypoint.
|
|
32
|
-
- The root tag in `index.html` must stay aligned with the component registered in `src/main.ts`.
|
|
33
|
-
- No hidden self-registration inside component modules.
|
|
34
|
-
- Bootstrap must rely on the public KoppaJS root API via `Core()` rather than non-public setup helpers.
|
|
35
|
-
- No extra runtime dependencies are required beyond the declared npm packages.
|
|
36
|
-
|
|
37
|
-
## Edge cases
|
|
38
|
-
|
|
39
|
-
- If a component tag changes, both `index.html` and `src/main.ts` must be updated together.
|
|
40
|
-
- If more bootstrap behavior is added, it must not introduce a second source of truth for initialization.
|
|
41
|
-
|
|
42
|
-
## Acceptance criteria
|
|
43
|
-
|
|
44
|
-
- Opening the app through Vite renders the root view without manual DOM scripting.
|
|
45
|
-
- `src/main.ts` remains the only location that calls `Core()`.
|
|
46
|
-
- The root view can render the counter component immediately after bootstrap.
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# Spec: Counter component
|
|
2
|
-
|
|
3
|
-
## Status
|
|
4
|
-
|
|
5
|
-
Approved
|
|
6
|
-
|
|
7
|
-
## Purpose
|
|
8
|
-
|
|
9
|
-
Demonstrate local interactive state in a minimal KoppaJS component.
|
|
10
|
-
|
|
11
|
-
## Behavior
|
|
12
|
-
|
|
13
|
-
- The component renders a "Counter" label, a numeric count, and increment/decrement buttons.
|
|
14
|
-
- The initial count is `0`.
|
|
15
|
-
- Clicking the increment button increases the count by `1`.
|
|
16
|
-
- Clicking the decrement button decreases the count by `1`.
|
|
17
|
-
- The displayed count updates immediately after each click.
|
|
18
|
-
- The increment and decrement buttons expose stable accessible names.
|
|
19
|
-
- The rendered count is announced politely to assistive technology when it changes.
|
|
20
|
-
|
|
21
|
-
## Inputs
|
|
22
|
-
|
|
23
|
-
- User clicks on the increment button
|
|
24
|
-
- User clicks on the decrement button
|
|
25
|
-
|
|
26
|
-
## Outputs
|
|
27
|
-
|
|
28
|
-
- Updated numeric text rendered in the component
|
|
29
|
-
- No external side effects
|
|
30
|
-
|
|
31
|
-
## Constraints
|
|
32
|
-
|
|
33
|
-
- State is local to the component.
|
|
34
|
-
- The component performs no persistence, networking, or cross-component coordination.
|
|
35
|
-
- The component remains embeddable inside the root app shell.
|
|
36
|
-
|
|
37
|
-
## Edge cases
|
|
38
|
-
|
|
39
|
-
- Negative values are allowed.
|
|
40
|
-
- Repeated clicks continue to update the count linearly within normal JavaScript number behavior.
|
|
41
|
-
|
|
42
|
-
## Acceptance criteria
|
|
43
|
-
|
|
44
|
-
- The counter is visible inside the app shell when the starter loads.
|
|
45
|
-
- The first rendered value is `0`.
|
|
46
|
-
- A single click on `+` changes the value from `0` to `1`.
|
|
47
|
-
- A single click on `-` changes the value from `0` to `-1`.
|
|
48
|
-
- Assistive technology can distinguish the increment and decrement actions without relying on symbol glyphs alone.
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# Spec: Quality workflow
|
|
2
|
-
|
|
3
|
-
## Status
|
|
4
|
-
|
|
5
|
-
Approved
|
|
6
|
-
|
|
7
|
-
## Purpose
|
|
8
|
-
|
|
9
|
-
Keep the starter's tooling, tests, and contributor workflow consistent enough that regressions are caught early without turning a minimal example into a heavyweight platform.
|
|
10
|
-
|
|
11
|
-
## Behavior
|
|
12
|
-
|
|
13
|
-
- The repository exposes a fast local validation path through `pnpm check`.
|
|
14
|
-
- The repository exposes a fuller validation path through `pnpm validate`, which adds a real-browser smoke test.
|
|
15
|
-
- Staged files run through a fast `lint-staged` pre-commit hook.
|
|
16
|
-
- Commit messages are validated by `commitlint` in a `commit-msg` hook.
|
|
17
|
-
- Source, config, and test changes are checked by ESLint, Prettier, TypeScript, and Vitest.
|
|
18
|
-
- The real UI smoke path is checked by Playwright against `vite preview`.
|
|
19
|
-
- CI runs the same full validation flow as local contributors.
|
|
20
|
-
- Tagged releases rerun the full validation flow and verify tag/version alignment before a GitHub Release is created.
|
|
21
|
-
- Stylelint is intentionally absent until the repository has a credible way to lint embedded `.kpa` CSS without covering only the least relevant styling surface.
|
|
22
|
-
|
|
23
|
-
## Inputs
|
|
24
|
-
|
|
25
|
-
- Source, config, test, and documentation changes
|
|
26
|
-
- Staged files at commit time
|
|
27
|
-
- Commit messages at commit time
|
|
28
|
-
- Pull requests and pushes that trigger CI
|
|
29
|
-
- Version, changelog, and tag pushes that trigger the release workflow
|
|
30
|
-
|
|
31
|
-
## Outputs
|
|
32
|
-
|
|
33
|
-
- Consistent formatting on supported file types
|
|
34
|
-
- Conventional commit history for maintainable review and release preparation
|
|
35
|
-
- Type-safe source and TypeScript tooling files
|
|
36
|
-
- Automated confidence for the `.kpa` export workaround, bootstrap wiring, and the starter UI smoke path
|
|
37
|
-
- A guarded GitHub release path that fails when the pushed tag does not match `package.json`
|
|
38
|
-
- Fast feedback before commit and in CI
|
|
39
|
-
|
|
40
|
-
## Constraints
|
|
41
|
-
|
|
42
|
-
- Hooks must stay fast enough for normal local use.
|
|
43
|
-
- Playwright coverage must remain focused on smoke-level user journeys until the UI surface grows.
|
|
44
|
-
- Tooling should stay aligned with the starter's actual risk profile rather than generic best-practice checklists.
|
|
45
|
-
- Release automation must stay consistent with the repository remaining `private`; it may create GitHub Releases but must not imply npm publishing.
|
|
46
|
-
- Commit rules should stay simple enough that contributors can apply them without release tooling knowledge.
|
|
47
|
-
|
|
48
|
-
## Edge cases
|
|
49
|
-
|
|
50
|
-
- If browser binaries are not installed locally, contributors must install Chromium before running `pnpm test:e2e` or `pnpm validate`.
|
|
51
|
-
- If Stylelint is introduced later, it must cover the meaningful styling surface rather than only `src/style.css`.
|
|
52
|
-
- If the UI grows beyond a simple smoke surface, expand Playwright coverage deliberately and update this spec.
|
|
53
|
-
- If a pushed tag does not match `package.json`, the release workflow must fail before creating a release artifact.
|
|
54
|
-
- Auto-generated merge, revert, `fixup!`, and `squash!` commits may be exempted by the hook logic.
|
|
55
|
-
|
|
56
|
-
## Acceptance criteria
|
|
57
|
-
|
|
58
|
-
- `pnpm check` runs lint, format verification, type checking, Vitest, and build successfully on a clean checkout.
|
|
59
|
-
- `pnpm validate` reuses the built output to run the Playwright smoke test successfully.
|
|
60
|
-
- A commit with a staged lint or formatting error is blocked by the pre-commit hook.
|
|
61
|
-
- A non-conventional commit message is blocked by the `commit-msg` hook.
|
|
62
|
-
- A pushed `vX.Y.Z` tag is rejected by release automation when `package.json` contains a different version.
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import js from "@eslint/js";
|
|
2
|
-
import globals from "globals";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import tseslint from "typescript-eslint";
|
|
5
|
-
|
|
6
|
-
const tsconfigRootDir = fileURLToPath(new URL(".", import.meta.url));
|
|
7
|
-
|
|
8
|
-
export default tseslint.config(
|
|
9
|
-
{
|
|
10
|
-
ignores: [
|
|
11
|
-
".ai/**",
|
|
12
|
-
"coverage/**",
|
|
13
|
-
"dist/**",
|
|
14
|
-
"node_modules/**",
|
|
15
|
-
"playwright-report/**",
|
|
16
|
-
"test-results/**",
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
files: ["**/*.{js,mjs,cjs}"],
|
|
21
|
-
extends: [js.configs.recommended],
|
|
22
|
-
languageOptions: {
|
|
23
|
-
globals: {
|
|
24
|
-
...globals.node,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
files: ["**/*.{ts,mts,cts}"],
|
|
30
|
-
extends: [...tseslint.configs.recommendedTypeChecked],
|
|
31
|
-
languageOptions: {
|
|
32
|
-
parserOptions: {
|
|
33
|
-
projectService: true,
|
|
34
|
-
tsconfigRootDir,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
files: ["src/**/*.ts"],
|
|
40
|
-
languageOptions: {
|
|
41
|
-
globals: {
|
|
42
|
-
...globals.browser,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
files: ["tests/**/*.ts", "*.config.ts"],
|
|
48
|
-
languageOptions: {
|
|
49
|
-
globals: {
|
|
50
|
-
...globals.node,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { defineConfig, devices } from "@playwright/test";
|
|
2
|
-
|
|
3
|
-
const port = 4173;
|
|
4
|
-
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
testDir: "./tests/e2e",
|
|
7
|
-
fullyParallel: true,
|
|
8
|
-
forbidOnly: Boolean(process.env.CI),
|
|
9
|
-
retries: process.env.CI ? 2 : 0,
|
|
10
|
-
reporter: process.env.CI ? "github" : "list",
|
|
11
|
-
use: {
|
|
12
|
-
baseURL: `http://127.0.0.1:${port}`,
|
|
13
|
-
screenshot: "only-on-failure",
|
|
14
|
-
trace: "on-first-retry",
|
|
15
|
-
video: "retain-on-failure",
|
|
16
|
-
},
|
|
17
|
-
webServer: {
|
|
18
|
-
command: "pnpm serve:e2e",
|
|
19
|
-
url: `http://127.0.0.1:${port}`,
|
|
20
|
-
reuseExistingServer: !process.env.CI,
|
|
21
|
-
timeout: 120_000,
|
|
22
|
-
},
|
|
23
|
-
projects: [
|
|
24
|
-
{
|
|
25
|
-
name: "chromium",
|
|
26
|
-
use: {
|
|
27
|
-
...devices["Desktop Chrome"],
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
});
|