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.
Files changed (80) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +116 -21
  3. package/bin/create-koppajs.js +10 -16
  4. package/package.json +10 -7
  5. package/template/README.md +19 -209
  6. package/template/_gitignore +0 -3
  7. package/template/index.html +1 -1
  8. package/template/package.json +9 -46
  9. package/template/public/favicon.png +0 -0
  10. package/template/public/koppajs-logo.png +0 -0
  11. package/template/src/app-view.kpa +1 -3
  12. package/template/tsconfig.json +2 -9
  13. package/template/vite.config.mjs +0 -35
  14. package/template-overlays/router/README.md +25 -203
  15. package/template-overlays/router/index.html +1 -1
  16. package/template-overlays/router/package.json +10 -47
  17. package/template-overlays/router/src/app-view.kpa +21 -78
  18. package/template-overlays/router/src/home-page.kpa +23 -60
  19. package/template-overlays/router/src/main.ts +0 -9
  20. package/template-overlays/router/src/not-found-page.kpa +16 -48
  21. package/template-overlays/router/src/router-page.kpa +34 -69
  22. package/template-overlays/router/src/style.css +5 -29
  23. package/template/AI_CONSTITUTION.md +0 -50
  24. package/template/ARCHITECTURE.md +0 -86
  25. package/template/CHANGELOG.md +0 -34
  26. package/template/CONTRIBUTING.md +0 -92
  27. package/template/DECISION_HIERARCHY.md +0 -32
  28. package/template/DEVELOPMENT_RULES.md +0 -57
  29. package/template/LICENSE +0 -201
  30. package/template/RELEASE.md +0 -230
  31. package/template/ROADMAP.md +0 -34
  32. package/template/TESTING_STRATEGY.md +0 -93
  33. package/template/_editorconfig +0 -12
  34. package/template/_github/instructions/ai-workflow.md +0 -33
  35. package/template/_github/workflows/ci.yml +0 -38
  36. package/template/_github/workflows/release.yml +0 -58
  37. package/template/_husky/commit-msg +0 -8
  38. package/template/_husky/pre-commit +0 -1
  39. package/template/_prettierignore +0 -7
  40. package/template/commitlint.config.mjs +0 -6
  41. package/template/docs/adr/0001-keep-the-starter-minimal.md +0 -32
  42. package/template/docs/adr/0002-adopt-a-living-meta-layer.md +0 -30
  43. package/template/docs/adr/0003-normalize-kpa-plugin-output.md +0 -24
  44. package/template/docs/adr/0004-adopt-an-automated-quality-baseline.md +0 -31
  45. package/template/docs/adr/0005-adopt-a-tag-driven-release-baseline.md +0 -45
  46. package/template/docs/adr/0006-adopt-commit-message-conventions.md +0 -39
  47. package/template/docs/adr/README.md +0 -37
  48. package/template/docs/adr/TEMPLATE.md +0 -18
  49. package/template/docs/architecture/module-boundaries.md +0 -48
  50. package/template/docs/meta/maintenance.md +0 -40
  51. package/template/docs/quality/quality-gates.md +0 -39
  52. package/template/docs/specs/README.md +0 -36
  53. package/template/docs/specs/TEMPLATE.md +0 -34
  54. package/template/docs/specs/app-bootstrap.md +0 -46
  55. package/template/docs/specs/counter-component.md +0 -48
  56. package/template/docs/specs/quality-workflow.md +0 -62
  57. package/template/eslint.config.mjs +0 -54
  58. package/template/playwright.config.ts +0 -31
  59. package/template/pnpm-lock.yaml +0 -3777
  60. package/template/prettier.config.mjs +0 -6
  61. package/template/public/favicon.svg +0 -15
  62. package/template/tests/e2e/app.spec.ts +0 -18
  63. package/template/tests/integration/main-bootstrap.test.ts +0 -33
  64. package/template/tests/unit/normalize-kpa-module-export.test.ts +0 -46
  65. package/template/vite.config.d.mts +0 -7
  66. package/template/vitest.config.mjs +0 -19
  67. package/template-overlays/router/ARCHITECTURE.md +0 -86
  68. package/template-overlays/router/CHANGELOG.md +0 -44
  69. package/template-overlays/router/DEVELOPMENT_RULES.md +0 -57
  70. package/template-overlays/router/ROADMAP.md +0 -34
  71. package/template-overlays/router/TESTING_STRATEGY.md +0 -67
  72. package/template-overlays/router/docs/adr/0001-keep-the-starter-minimal.md +0 -32
  73. package/template-overlays/router/docs/architecture/module-boundaries.md +0 -39
  74. package/template-overlays/router/docs/meta/maintenance.md +0 -38
  75. package/template-overlays/router/docs/specs/README.md +0 -19
  76. package/template-overlays/router/docs/specs/app-bootstrap.md +0 -42
  77. package/template-overlays/router/docs/specs/router-navigation.md +0 -41
  78. package/template-overlays/router/pnpm-lock.yaml +0 -3786
  79. package/template-overlays/router/tests/e2e/app.spec.ts +0 -38
  80. package/template-overlays/router/tests/integration/main-bootstrap.test.ts +0 -150
@@ -1,93 +0,0 @@
1
- # Testing Strategy
2
-
3
- ## Current state
4
-
5
- This repository now has a small automated testing stack aligned with the actual starter risk profile:
6
-
7
- - `pnpm test:run` for unit and integration tests in Vitest
8
- - `pnpm test:coverage` for local coverage reporting
9
- - `pnpm test:e2e` for a Playwright smoke test against `vite preview`
10
- - `pnpm check` for the fast repository baseline
11
- - `pnpm validate` for the full local and CI validation path
12
- - `pnpm release:check` for tagged release candidates
13
- - `commitlint` through `.husky/commit-msg` for commit message validation
14
- - `pnpm typecheck`
15
- - `pnpm build`
16
-
17
- ## Philosophy
18
-
19
- - Test the smallest meaningful unit that gives confidence.
20
- - Prefer extracting logic into `.ts` modules when it becomes complex enough to warrant focused unit tests.
21
- - Add test infrastructure only when the repository's behavior justifies it; do not add tools for ceremony alone.
22
- - Avoid brittle tests that mirror implementation details instead of observable behavior.
23
- - Reuse the real Vite loading path in automated tests whenever `.kpa` handling is part of the risk surface.
24
-
25
- ## Test pyramid for this repository
26
-
27
- ### Unit tests
28
-
29
- Use unit tests for isolated logic that can fail independently of the browser runtime. Today that includes the repo-local `.kpa` export normalization helper in `vite.config.mjs`.
30
-
31
- Typical triggers:
32
-
33
- - value transformations
34
- - branching business rules
35
- - reusable helpers
36
- - local tooling helpers
37
-
38
- ### Integration or component tests
39
-
40
- Use integration tests when multiple local boundaries must be verified together but a full browser run would be disproportionate.
41
-
42
- Typical triggers:
43
-
44
- - bootstrap registration in `src/main.ts`
45
- - build-time behavior that depends on the Vite plugin
46
- - shared state or lifecycle interactions that are not yet broad enough for end-to-end coverage
47
-
48
- ### End-to-end tests
49
-
50
- This repository has a real interactive UI, so it carries one Playwright smoke test already. Keep that layer intentionally small and user-facing.
51
-
52
- Typical triggers:
53
-
54
- - root UI rendering
55
- - critical starter interactions such as the counter behavior
56
- - preview/build regressions that would not be caught by Vitest alone
57
-
58
- Escalate E2E coverage beyond smoke scope only when the starter gains broader workflows such as routing, async data flows, persistence, or deployment-sensitive behavior.
59
-
60
- ## Mocking policy
61
-
62
- - Prefer testing pure extracted logic without mocks.
63
- - Mock only at external boundaries such as HTTP, storage, or browser APIs that are expensive or nondeterministic.
64
- - Use selective mocks in integration tests only to observe bootstrap boundaries that would otherwise be opaque.
65
-
66
- ## Coverage expectations
67
-
68
- - There is no blanket repository percentage target right now.
69
- - New non-trivial logic should come with focused tests.
70
- - When a subsystem introduces branching logic, asynchronous behavior, or state shared across components, test automation stops being optional.
71
- - Coverage reports are a decision aid, not a target game. Raise thresholds only when the code surface justifies them.
72
-
73
- ## Quality gates by change size
74
-
75
- - Documentation-only change: verify links and document consistency.
76
- - Small style or copy change: run `pnpm check`.
77
- - Source or config change: run `pnpm check`.
78
- - UI, bootstrap, or browser-sensitive change: run `pnpm validate`.
79
- - Version, changelog, or release workflow change: run `pnpm release:check`.
80
- - Commit convention change: validate `commitlint.config.mjs` and `.husky/commit-msg` together.
81
- - New subsystem or new state model: add tests appropriate to the risk level and update this strategy.
82
-
83
- ## Style linting position
84
-
85
- Stylelint is intentionally not part of the current baseline.
86
-
87
- - The meaningful styling surface lives inside `.kpa` files.
88
- - Adding Stylelint only for `src/style.css` would mostly lint the global reset and miss the component-local styles that matter.
89
- - Revisit this decision only when KoppaJS gains a low-friction way to lint embedded `.kpa` CSS blocks or when the repository starts moving substantial styles into standalone CSS files.
90
-
91
- ## Maintenance rule
92
-
93
- Whenever test tooling, quality gates, or expected confidence levels change, update this file and [docs/quality/quality-gates.md](./docs/quality/quality-gates.md) in the same change.
@@ -1,12 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- charset = utf-8
5
- end_of_line = lf
6
- indent_size = 2
7
- indent_style = space
8
- insert_final_newline = true
9
- trim_trailing_whitespace = true
10
-
11
- [*.md]
12
- trim_trailing_whitespace = false
@@ -1,33 +0,0 @@
1
- # AI Workflow Instructions
2
-
3
- ## Read before editing
4
-
5
- For any non-trivial change, read these documents in order:
6
-
7
- 1. `DECISION_HIERARCHY.md`
8
- 2. `AI_CONSTITUTION.md`
9
- 3. `ARCHITECTURE.md`
10
- 4. the relevant spec in `docs/specs/`
11
- 5. the relevant ADR in `docs/adr/`
12
- 6. `DEVELOPMENT_RULES.md`
13
- 7. `TESTING_STRATEGY.md`
14
-
15
- For release-related work also read `CHANGELOG.md` and `RELEASE.md`.
16
-
17
- ## Required behavior
18
-
19
- - Prefer existing repository patterns over new abstractions.
20
- - Do not silently change public component tags, startup flow, or dependency sourcing.
21
- - Use `spec -> quality plan -> implementation -> documentation`.
22
- - Update the meta layer in the same change when architecture, rules, or workflows change.
23
- - Record durable technical decisions in ADRs.
24
- - Keep hooks fast and put heavier validation into `pnpm validate` and CI.
25
- - If versioning, changelog, or release automation changes, update `CHANGELOG.md`, `RELEASE.md`, and the affected workflow in the same change.
26
- - If you create commits, use Conventional Commits that satisfy `commitlint`.
27
-
28
- ## Required validation
29
-
30
- - Run `pnpm check` for source, config, test, or tooling changes.
31
- - Run `pnpm validate` when UI behavior, bootstrap wiring, browser-facing assets, or quality tooling changes.
32
- - Run `pnpm release:check` when versioning, changelog, or release workflow behavior changes.
33
- - If a local browser check cannot be run, say so explicitly instead of implying it passed.
@@ -1,38 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- pull_request:
5
- branches:
6
- - develop
7
- - main
8
- push:
9
- branches:
10
- - main
11
-
12
- jobs:
13
- validate:
14
- runs-on: ubuntu-latest
15
-
16
- steps:
17
- - name: Check out repository
18
- uses: actions/checkout@v4
19
-
20
- - name: Set up pnpm
21
- uses: pnpm/action-setup@v4
22
- with:
23
- version: 10.12.1
24
-
25
- - name: Set up Node.js
26
- uses: actions/setup-node@v4
27
- with:
28
- node-version: 20
29
- cache: pnpm
30
-
31
- - name: Install dependencies
32
- run: pnpm install --frozen-lockfile
33
-
34
- - name: Install Playwright browser
35
- run: pnpm exec playwright install --with-deps chromium
36
-
37
- - name: Run repository validation
38
- run: pnpm validate
@@ -1,58 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- push:
5
- tags:
6
- - "v*.*.*"
7
-
8
- jobs:
9
- release:
10
- name: Create GitHub Release
11
- runs-on: ubuntu-latest
12
- permissions:
13
- contents: write
14
-
15
- steps:
16
- - name: Check out repository
17
- uses: actions/checkout@v4
18
- with:
19
- fetch-depth: 0
20
-
21
- - name: Set up pnpm
22
- uses: pnpm/action-setup@v4
23
- with:
24
- version: 10.12.1
25
-
26
- - name: Set up Node.js
27
- uses: actions/setup-node@v4
28
- with:
29
- node-version: 20
30
- cache: pnpm
31
-
32
- - name: Install dependencies
33
- run: pnpm install --frozen-lockfile
34
-
35
- - name: Install Playwright browser
36
- run: pnpm exec playwright install --with-deps chromium
37
-
38
- - name: Validate repository
39
- run: pnpm validate
40
-
41
- - name: Verify tag matches package.json version
42
- run: |
43
- TAG_VERSION="${GITHUB_REF_NAME#v}"
44
- PKG_VERSION=$(node -p "require('./package.json').version")
45
- echo "Tag version: $TAG_VERSION"
46
- echo "Package.json version: $PKG_VERSION"
47
- if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
48
- echo "::error::Version mismatch! Tag ($TAG_VERSION) does not match package.json ($PKG_VERSION)"
49
- exit 1
50
- fi
51
- echo "Versions match: $TAG_VERSION"
52
-
53
- - name: Create GitHub Release
54
- uses: softprops/action-gh-release@v2
55
- with:
56
- generate_release_notes: true
57
- env:
58
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -1,8 +0,0 @@
1
- commit_msg_file="$1"
2
- commit_msg_content=$(cat "$commit_msg_file")
3
-
4
- if echo "$commit_msg_content" | grep -qE "^(Merge|Revert|fixup!|squash!)"; then
5
- exit 0
6
- fi
7
-
8
- pnpm exec commitlint --config commitlint.config.mjs --edit "$commit_msg_file"
@@ -1 +0,0 @@
1
- pnpm exec lint-staged
@@ -1,7 +0,0 @@
1
- .ai
2
- coverage
3
- dist
4
- node_modules
5
- playwright-report
6
- pnpm-lock.yaml
7
- test-results
@@ -1,6 +0,0 @@
1
- export default {
2
- extends: ["@commitlint/config-conventional"],
3
- rules: {
4
- "header-max-length": [2, "always", 72],
5
- },
6
- };
@@ -1,32 +0,0 @@
1
- # ADR 0001: Keep the starter minimal
2
-
3
- ## Context
4
-
5
- This repository starts from the maintained minimal starter baseline for KoppaJS
6
- applications. Its primary audience needs a runnable reference with as little
7
- incidental complexity as possible.
8
-
9
- ## Decision
10
-
11
- The starter remains intentionally small:
12
-
13
- - one HTML shell,
14
- - one TypeScript bootstrap file,
15
- - one root KoppaJS view,
16
- - one stateful child component,
17
- - published npm packages instead of local monorepo `file:` dependencies,
18
- - no routing, persistence, shared state, or extra demo subsystems by default.
19
-
20
- Any expansion beyond that baseline requires a spec and ADR.
21
-
22
- ## Consequences
23
-
24
- - New users get a fast, low-noise example.
25
- - The repository stays easy to audit and maintain.
26
- - More advanced features must be introduced deliberately rather than accumulating ad hoc.
27
- - Some capabilities are intentionally absent until justified.
28
-
29
- ## Alternatives considered
30
-
31
- - A feature-rich demo app that showcases many KoppaJS patterns at once
32
- - A monorepo-linked starter that depends on local sibling packages
@@ -1,30 +0,0 @@
1
- # ADR 0002: Adopt a living meta layer
2
-
3
- ## Context
4
-
5
- The repository previously lacked a formal architecture memory, contributor governance, testing philosophy, decision hierarchy, and AI workflow guidance. That made it easy for the implementation and the documentation to drift apart.
6
-
7
- ## Decision
8
-
9
- The project will maintain an in-repository meta layer consisting of:
10
-
11
- - root governance documents,
12
- - architecture support documents under `docs/architecture/`,
13
- - ADRs under `docs/adr/`,
14
- - specs under `docs/specs/`,
15
- - quality and maintenance guidance under `docs/quality/` and `docs/meta/`,
16
- - AI-specific workflow guidance under `.github/instructions/`.
17
-
18
- Whenever architecture, module boundaries, workflow, or quality expectations change, the relevant meta documents must be updated in the same change.
19
-
20
- ## Consequences
21
-
22
- - Contributors and AI agents have a single source of truth inside the repository.
23
- - Architectural drift becomes easier to detect.
24
- - Every meaningful change carries a small documentation obligation.
25
- - The repository gains governance overhead, but the overhead is intentionally light and local.
26
-
27
- ## Alternatives considered
28
-
29
- - Relying on README-only guidance
30
- - Keeping architectural decisions in issues or chat history instead of versioned documents
@@ -1,24 +0,0 @@
1
- # ADR 0003: Normalize KPA plugin output
2
-
3
- ## Context
4
-
5
- The installed `@koppajs/koppajs-vite-plugin` currently transforms `.kpa` files into raw object literals during Vite loading. Rollup expects valid ES module syntax, so production builds fail unless the transformed output is wrapped in an export.
6
-
7
- ## Decision
8
-
9
- Keep using the upstream KoppaJS Vite plugin, but add a small repo-local post-transform in `vite.config.mjs` that converts raw `.kpa` object literals into `export default ...` modules.
10
-
11
- This workaround remains in place until the upstream plugin emits valid module syntax on its own.
12
-
13
- ## Consequences
14
-
15
- - The repository builds successfully without changing application source files.
16
- - The workaround is isolated to build configuration.
17
- - Future maintainers must remove or revise the wrapper if the upstream plugin behavior changes.
18
- - Architecture documentation must reflect that the build stack includes this compatibility layer.
19
-
20
- ## Alternatives considered
21
-
22
- - Patching `node_modules` directly
23
- - Rewriting application imports around the plugin defect
24
- - Leaving the repository in a state where `pnpm build` fails
@@ -1,31 +0,0 @@
1
- # ADR 0004: Adopt an automated quality baseline
2
-
3
- ## Context
4
-
5
- The repository already had a living meta layer and a real interactive UI, but its practical quality gates were still limited to `pnpm typecheck`, `pnpm build`, and manual smoke testing. That left the repo-local `.kpa` build workaround, bootstrap wiring, and browser-visible starter behavior exposed to easy regression.
6
-
7
- ## Decision
8
-
9
- Adopt a proportional automated quality baseline for the starter:
10
-
11
- - ESLint for TypeScript source and tooling files,
12
- - Prettier and `.editorconfig` for supported text formats,
13
- - Vitest for unit and integration coverage of local tooling and bootstrap behavior,
14
- - Playwright for one Chromium smoke path against `vite preview`,
15
- - Husky and lint-staged for fast staged-file checks,
16
- - GitHub Actions CI that runs the same validation flow as local contributors.
17
-
18
- Do not add Stylelint yet. The meaningful styles live inside `.kpa` blocks, and a CSS-file-only lint setup would give false confidence while adding maintenance overhead.
19
-
20
- ## Consequences
21
-
22
- - The starter gets repeatable local and CI validation without inflating the runtime architecture.
23
- - Browser-visible regressions are caught automatically instead of relying only on manual smoke tests.
24
- - Contributors have a clearer script contract: `check` for the fast baseline and `validate` for the full suite.
25
- - Future maintainers must keep the test, hook, CI, and documentation layers aligned when the quality stack changes.
26
- - Stylelint remains an explicit future decision instead of an accidental omission.
27
-
28
- ## Alternatives considered
29
-
30
- - Staying on `typecheck + build + manual smoke test`
31
- - Adding a heavier test and lint stack, including Stylelint, before the repository has enough surface area to justify it
@@ -1,45 +0,0 @@
1
- # ADR 0005: Adopt a tag-driven release baseline
2
-
3
- ## Context
4
-
5
- The repository had gained a real quality baseline, governance documents, and a
6
- `develop`/`main` branch model, but it still lacked an explicit release contract.
7
- That left version bumps, changelog updates, and GitHub tagging behavior too
8
- implicit for a maintained official starter.
9
-
10
- `koppajs-core` already uses a documented tag-driven release path with guarded
11
- automation. This starter benefits from the same clarity, but its release target
12
- is different because the repository currently stays `private` and is not
13
- published to npm.
14
-
15
- ## Decision
16
-
17
- Adopt a manual, tag-driven release baseline for this repository:
18
-
19
- - maintain `CHANGELOG.md` for official tagged milestones,
20
- - document the maintainer procedure in `RELEASE.md`,
21
- - create a GitHub Actions release workflow that runs on `vX.Y.Z` tags,
22
- - rerun full repository validation during the release workflow,
23
- - fail the workflow when the pushed tag does not match `package.json`,
24
- - create GitHub Releases only while the repository remains `private`.
25
-
26
- Release content is prepared on `develop`, moved through `release/*`, merged into
27
- `main`, tagged on `main`, and merged back into `develop` after a successful
28
- release.
29
-
30
- ## Consequences
31
-
32
- - The repository now has an explicit versioning and release contract.
33
- - Maintainers must update `package.json`, `CHANGELOG.md`, and `RELEASE.md` in
34
- sync when release practice changes.
35
- - Tagged releases are guarded against accidental version mismatches.
36
- - The release workflow improves traceability without forcing npm publishing.
37
- - If this repository later becomes publishable, a new ADR must extend or
38
- replace this baseline rather than silently changing the release target.
39
-
40
- ## Alternatives considered
41
-
42
- - Keeping releases informal and undocumented
43
- - Adding automated versioning via Changesets or semantic-release
44
- - Copying the npm publish path from `koppajs-core` even though this repository
45
- is currently `private`
@@ -1,39 +0,0 @@
1
- # ADR 0006: Adopt commit message conventions
2
-
3
- ## Context
4
-
5
- The repository now has staged-file checks, CI validation, and a documented
6
- release process, but commit history still had no enforced structure.
7
-
8
- That makes release review, changelog preparation, and future maintenance harder
9
- than necessary, especially for an official starter that should model a clear
10
- workflow for contributors.
11
-
12
- `koppajs-core` already enforces conventional commit messages with `commitlint`.
13
- The same baseline is appropriate here because it adds little overhead while
14
- improving traceability.
15
-
16
- ## Decision
17
-
18
- Adopt Conventional Commits enforcement through `commitlint`:
19
-
20
- - add `@commitlint/cli` and `@commitlint/config-conventional`,
21
- - validate commit messages in `.husky/commit-msg`,
22
- - keep the rule set intentionally small,
23
- - enforce a maximum header length of 72 characters,
24
- - allow the existing fast `pre-commit` hook to stay focused on staged files.
25
-
26
- ## Consequences
27
-
28
- - Contributors now need to use structured commit headers such as
29
- `feat: add release workflow` or `docs: update quality workflow`.
30
- - Invalid commit messages are rejected before the commit is created.
31
- - The repository gains a cleaner history for release review and maintenance.
32
- - If the project later needs custom commit types or scopes, the change should go
33
- through `commitlint.config.mjs` and matching documentation updates.
34
-
35
- ## Alternatives considered
36
-
37
- - Keeping commit messages informal
38
- - Enforcing commit conventions only socially without a hook
39
- - Adding heavier release automation before stabilizing the commit baseline
@@ -1,37 +0,0 @@
1
- # Architecture Decision Records
2
-
3
- This directory stores durable architectural and workflow decisions.
4
-
5
- ## When to write an ADR
6
-
7
- Write an ADR when a change:
8
-
9
- - changes repository structure,
10
- - introduces or removes a subsystem,
11
- - changes dependency sourcing or build tooling,
12
- - changes public starter behavior in a lasting way,
13
- - adds a new rule that future contributors must follow.
14
-
15
- ## Format
16
-
17
- Use [`TEMPLATE.md`](./TEMPLATE.md). Every ADR must contain:
18
-
19
- - Context
20
- - Decision
21
- - Consequences
22
- - Alternatives considered
23
-
24
- ## Naming
25
-
26
- - Prefix files with a four-digit sequence number.
27
- - Use a short kebab-case slug.
28
- - Never rewrite history silently; supersede older ADRs with new ones when decisions change.
29
-
30
- ## Current ADRs
31
-
32
- - [`0001-keep-the-starter-minimal.md`](./0001-keep-the-starter-minimal.md)
33
- - [`0002-adopt-a-living-meta-layer.md`](./0002-adopt-a-living-meta-layer.md)
34
- - [`0003-normalize-kpa-plugin-output.md`](./0003-normalize-kpa-plugin-output.md)
35
- - [`0004-adopt-an-automated-quality-baseline.md`](./0004-adopt-an-automated-quality-baseline.md)
36
- - [`0005-adopt-a-tag-driven-release-baseline.md`](./0005-adopt-a-tag-driven-release-baseline.md)
37
- - [`0006-adopt-commit-message-conventions.md`](./0006-adopt-commit-message-conventions.md)
@@ -1,18 +0,0 @@
1
- # ADR XXXX: Title
2
-
3
- ## Context
4
-
5
- Describe the situation, constraints, and forces that make a decision necessary.
6
-
7
- ## Decision
8
-
9
- Describe the chosen approach in direct, testable language.
10
-
11
- ## Consequences
12
-
13
- Explain the expected benefits, tradeoffs, and follow-up obligations.
14
-
15
- ## Alternatives considered
16
-
17
- - Alternative 1
18
- - Alternative 2
@@ -1,48 +0,0 @@
1
- # Module Boundaries
2
-
3
- ## Repository boundary model
4
-
5
- This repository is intentionally shallow. Its boundaries are designed to keep the starter easy to understand.
6
-
7
- | Path | Responsibility | Allowed dependencies | Must not depend on |
8
- | ------------------------------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------- | ----------------------------------------------------------------- |
9
- | `index.html` | Document shell, root element, asset references | Static assets, `src/main.ts`, `src/style.css` | Feature logic, extra scripts, framework-specific behavior |
10
- | `CHANGELOG.md` | Tagged release history | Release notes, versioned milestones | Unreleased planning notes or unrelated contributor guidance |
11
- | `RELEASE.md` | Maintainer release procedure | `package.json`, `CHANGELOG.md`, GitHub workflows | Runtime code or undocumented branch conventions |
12
- | `commitlint.config.mjs` | Commit message rules | Conventional commit policy | Source-code linting or release branching rules |
13
- | `src/main.ts` | Application bootstrap and component registration | `@koppajs/koppajs-core`, local `.kpa` modules | UI business logic, ad hoc DOM manipulation, network code |
14
- | `src/app-view.kpa` | Root page layout and composition | Local markup, local CSS, child components | Global bootstrap concerns, unrelated feature orchestration |
15
- | `src/counter-component.kpa` | Example local state and interaction | Local markup, local methods, local CSS | Shared infrastructure, global state, direct root DOM coordination |
16
- | `src/style.css` | Global reset and truly global base rules | Standard CSS | Component-specific visual rules |
17
- | `public/` | Static assets served as-is | Static files only | Source code or generated artifacts |
18
- | `tests/unit/` | Isolated tests for helper and tooling logic | Vitest, local modules | Full browser expectations or long integration chains |
19
- | `tests/integration/` | Bootstrap and boundary-level integration tests | Vitest, local modules, selective mocks | Browser-only smoke assertions |
20
- | `tests/e2e/` | Real-browser smoke coverage | Playwright, preview server | Implementation-detail assertions |
21
- | `vite.config.mjs` | Build and dev server integration, including the `.kpa` module export compatibility wrapper | Vite and the KoppaJS Vite plugin | Application runtime logic |
22
- | `vitest.config.mjs` | Vitest orchestration merged with the Vite config | Vitest and Vite config | Application runtime logic |
23
- | `playwright.config.ts` | Playwright orchestration against preview output | Playwright and preview server script | Application runtime logic |
24
- | `.github/workflows/release.yml` | Tag-triggered validation and GitHub Release creation | GitHub Actions, `package.json`, validation scripts | npm publishing while `package.json` is `private` |
25
- | `tsconfig.json` | TypeScript compiler behavior for source, tests, and TS config files | TypeScript compiler options | Application runtime logic |
26
-
27
- ## Boundary rules
28
-
29
- - Registration happens in `src/main.ts`, not inside component modules.
30
- - `app-view.kpa` may compose child components but should not become a global state hub by accident.
31
- - Component-local behavior stays inside the component until reuse or complexity makes extraction worthwhile.
32
- - Shared logic, once introduced, belongs in dedicated `.ts` modules with tests when justified.
33
- - Vitest owns helper-level and bootstrap-level confidence; Playwright owns browser smoke confidence.
34
- - Pre-commit checks stay limited to staged-file hygiene. Heavy validation belongs to `pnpm validate` and CI.
35
- - Commit-message validation lives in `.husky/commit-msg` and `commitlint.config.mjs`, not in ad hoc contributor lore.
36
- - Release metadata stays aligned across `package.json`, `CHANGELOG.md`, `RELEASE.md`, and `.github/workflows/release.yml`.
37
-
38
- ## Escalation rules
39
-
40
- Before crossing existing boundaries, add a spec and ADR if the change introduces:
41
-
42
- - routing,
43
- - shared state,
44
- - async workflows,
45
- - persistence,
46
- - more than one root entrypoint,
47
- - npm publishing or deployment automation,
48
- - new top-level source folders.
@@ -1,40 +0,0 @@
1
- # Meta-Layer Maintenance
2
-
3
- The meta layer is a living system. Any change that alters the real system must update the corresponding governance document in the same change.
4
-
5
- ## Update matrix
6
-
7
- | Change | Required updates |
8
- | ------------------------------------------ | ---------------------------------------------------------------------------------------------- |
9
- | New feature or behavior | Add or update a spec in `docs/specs/`; update `README.md` if setup or visible behavior changes |
10
- | New enduring technical decision | Add or update an ADR in `docs/adr/` |
11
- | New module, folder, or data flow | Update `ARCHITECTURE.md` and `docs/architecture/module-boundaries.md` |
12
- | New coding pattern or dependency rule | Update `DEVELOPMENT_RULES.md` |
13
- | New test tooling or quality gate | Update `TESTING_STRATEGY.md` and `docs/quality/quality-gates.md` |
14
- | New hook, CI step, or contributor workflow | Update `CONTRIBUTING.md` and `.github/instructions/ai-workflow.md` |
15
- | Version, changelog, or release workflow | Update `CHANGELOG.md`, `RELEASE.md`, `package.json`, and affected GitHub workflow files |
16
-
17
- ## Review triggers
18
-
19
- Perform a meta-layer review when:
20
-
21
- - a pull request changes the repo structure,
22
- - a new dependency is added,
23
- - a public component tag changes,
24
- - a build or test command changes,
25
- - a hook or CI workflow changes,
26
- - a subsystem such as routing or data fetching is introduced,
27
- - a README section no longer matches the actual code.
28
-
29
- ## Periodic review checklist
30
-
31
- - Does [ARCHITECTURE.md](../../ARCHITECTURE.md) still match the runtime flow?
32
- - Do current specs cover the user-visible behaviors in the repo?
33
- - Do ADRs still represent active decisions?
34
- - Do contributor instructions still match the actual toolchain?
35
- - Did a recent change deserve a new quality gate?
36
- - Do `CHANGELOG.md`, `RELEASE.md`, and the release workflow still match actual branch and tag practice?
37
- - Do commit message examples and hook behavior still match `commitlint.config.mjs`?
38
- - Is any omitted tooling, such as Stylelint, still intentionally omitted for good reason?
39
-
40
- If any answer is "no", update the meta layer before considering the repository aligned.
@@ -1,39 +0,0 @@
1
- # Quality Gates
2
-
3
- ## Baseline gates
4
-
5
- For the current repository scope, the baseline gates are:
6
-
7
- - staged files: `lint-staged` via `.husky/pre-commit`
8
- - commit messages: `commitlint` via `.husky/commit-msg`
9
- - fast local repository check: `pnpm check`
10
- - full repository validation: `pnpm validate`
11
- - release candidate verification: `pnpm release:check`
12
- - `pnpm typecheck`
13
- - `pnpm build`
14
- - `pnpm test:run`
15
- - `pnpm test:e2e` for UI, bootstrap, or preview-sensitive changes
16
- - tagged release automation: `.github/workflows/release.yml` reruns validation and checks tag/version alignment
17
-
18
- ## Gate escalation rules
19
-
20
- Raise the quality bar when the repository grows:
21
-
22
- - New extracted logic modules: add unit tests.
23
- - Multi-component behavior: add integration or component tests.
24
- - Routing, async workflows, persistence, or deployment-sensitive behavior: expand end-to-end coverage beyond the current smoke scope.
25
- - If component-local `.kpa` styling grows more complex and a credible linting path appears, revisit the current decision to omit Stylelint.
26
-
27
- ## Review checklist
28
-
29
- - Do setup instructions still work from a clean checkout?
30
- - Does the documented architecture still match the code layout?
31
- - Do specs still match observable behavior?
32
- - Are current quality gates enough for the newest change?
33
- - Do `CHANGELOG.md`, `RELEASE.md`, and the release workflow still agree on the release path?
34
- - Do commit message rules and contributor examples still match `commitlint.config.mjs`?
35
- - Are hooks still fast enough to help rather than hinder contributors?
36
-
37
- ## Ownership rule
38
-
39
- Anyone changing code, tooling, or workflow is responsible for updating the quality gates if the risk profile changes.