create-koppajs 1.0.1 → 1.2.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/README.md +166 -131
  3. package/bin/create-koppajs.js +346 -175
  4. package/package.json +55 -34
  5. package/template/AI_CONSTITUTION.md +50 -0
  6. package/template/ARCHITECTURE.md +86 -0
  7. package/template/CHANGELOG.md +34 -0
  8. package/template/CONTRIBUTING.md +92 -0
  9. package/template/DECISION_HIERARCHY.md +32 -0
  10. package/template/DEVELOPMENT_RULES.md +57 -0
  11. package/template/LICENSE +1 -1
  12. package/template/README.md +241 -49
  13. package/template/RELEASE.md +230 -0
  14. package/template/ROADMAP.md +34 -0
  15. package/template/TESTING_STRATEGY.md +93 -0
  16. package/template/_editorconfig +12 -0
  17. package/template/_gitattributes +1 -0
  18. package/template/_github/instructions/ai-workflow.md +33 -0
  19. package/template/_github/workflows/ci.yml +38 -0
  20. package/template/_github/workflows/release.yml +58 -0
  21. package/template/_gitignore +5 -0
  22. package/template/_husky/commit-msg +8 -0
  23. package/template/_husky/pre-commit +1 -0
  24. package/template/_npmrc +1 -0
  25. package/template/_prettierignore +7 -0
  26. package/template/commitlint.config.mjs +6 -0
  27. package/template/docs/adr/0001-keep-the-starter-minimal.md +32 -0
  28. package/template/docs/adr/0002-adopt-a-living-meta-layer.md +30 -0
  29. package/template/docs/adr/0003-normalize-kpa-plugin-output.md +24 -0
  30. package/template/docs/adr/0004-adopt-an-automated-quality-baseline.md +31 -0
  31. package/template/docs/adr/0005-adopt-a-tag-driven-release-baseline.md +45 -0
  32. package/template/docs/adr/0006-adopt-commit-message-conventions.md +39 -0
  33. package/template/docs/adr/README.md +37 -0
  34. package/template/docs/adr/TEMPLATE.md +18 -0
  35. package/template/docs/architecture/module-boundaries.md +48 -0
  36. package/template/docs/meta/maintenance.md +40 -0
  37. package/template/docs/quality/quality-gates.md +39 -0
  38. package/template/docs/specs/README.md +36 -0
  39. package/template/docs/specs/TEMPLATE.md +34 -0
  40. package/template/docs/specs/app-bootstrap.md +46 -0
  41. package/template/docs/specs/counter-component.md +48 -0
  42. package/template/docs/specs/quality-workflow.md +62 -0
  43. package/template/eslint.config.mjs +54 -0
  44. package/template/package.json +57 -6
  45. package/template/playwright.config.ts +31 -0
  46. package/template/pnpm-lock.yaml +3784 -0
  47. package/template/prettier.config.mjs +6 -0
  48. package/template/src/app-view.kpa +35 -36
  49. package/template/src/counter-component.kpa +87 -87
  50. package/template/src/style.css +5 -5
  51. package/template/tests/e2e/app.spec.ts +18 -0
  52. package/template/tests/integration/main-bootstrap.test.ts +33 -0
  53. package/template/tests/unit/normalize-kpa-module-export.test.ts +46 -0
  54. package/template/tsconfig.json +13 -2
  55. package/template/vite.config.d.mts +7 -0
  56. package/template/vite.config.mjs +39 -4
  57. package/template/vitest.config.mjs +19 -0
  58. package/template-overlays/router/ARCHITECTURE.md +86 -0
  59. package/template-overlays/router/CHANGELOG.md +44 -0
  60. package/template-overlays/router/DEVELOPMENT_RULES.md +57 -0
  61. package/template-overlays/router/README.md +243 -0
  62. package/template-overlays/router/ROADMAP.md +34 -0
  63. package/template-overlays/router/TESTING_STRATEGY.md +67 -0
  64. package/template-overlays/router/docs/adr/0001-keep-the-starter-minimal.md +32 -0
  65. package/template-overlays/router/docs/architecture/module-boundaries.md +39 -0
  66. package/template-overlays/router/docs/meta/maintenance.md +38 -0
  67. package/template-overlays/router/docs/specs/README.md +19 -0
  68. package/template-overlays/router/docs/specs/app-bootstrap.md +42 -0
  69. package/template-overlays/router/docs/specs/router-navigation.md +41 -0
  70. package/template-overlays/router/index.html +14 -0
  71. package/template-overlays/router/package.json +74 -0
  72. package/template-overlays/router/pnpm-lock.yaml +3793 -0
  73. package/template-overlays/router/src/app-view.kpa +128 -0
  74. package/template-overlays/router/src/home-page.kpa +100 -0
  75. package/template-overlays/router/src/main.ts +89 -0
  76. package/template-overlays/router/src/not-found-page.kpa +69 -0
  77. package/template-overlays/router/src/router-page.kpa +102 -0
  78. package/template-overlays/router/src/style.css +51 -0
  79. package/template-overlays/router/tests/e2e/app.spec.ts +38 -0
  80. package/template-overlays/router/tests/integration/main-bootstrap.test.ts +150 -0
@@ -0,0 +1,230 @@
1
+ # Release Process for `__PROJECT_NAME__`
2
+
3
+ This document describes the repository-specific release workflow for
4
+ `__PROJECT_NAME__`.
5
+
6
+ The project uses a manual, tag-driven release process.
7
+ Only tagged versions are official releases.
8
+
9
+ The effective flow is:
10
+
11
+ 1. Finalize the release content on `develop`
12
+ 2. Update `package.json` and `CHANGELOG.md`
13
+ 3. Validate the release candidate locally
14
+ 4. Create a `release/*` branch from that state
15
+ 5. Merge the release branch into `main`
16
+ 6. Tag the release commit on `main` as `vX.Y.Z`
17
+ 7. Push the tag
18
+ 8. Let GitHub Actions validate and create the GitHub Release
19
+ 9. Merge the updated `main` back into `develop`
20
+
21
+ ---
22
+
23
+ ## Release Model
24
+
25
+ This repository does not use automated versioning tools such as Changesets or
26
+ semantic-release.
27
+
28
+ The release is controlled by:
29
+
30
+ - the version in `package.json`
31
+ - the release entry in `CHANGELOG.md`
32
+ - the merge of the release-ready state into `main`
33
+ - the Git tag in the form `vX.Y.Z`
34
+ - the GitHub Actions workflow in `.github/workflows/release.yml`
35
+
36
+ Important consequences:
37
+
38
+ - A merge to `main` alone does not create a release
39
+ - A tag triggers the release workflow
40
+ - The tag version must exactly match `package.json`
41
+ - The tag must point to the release commit on `main`
42
+ - After a successful release, `main` should be merged back into `develop`
43
+
44
+ The included release workflow creates GitHub Releases only and does not publish
45
+ to npm by default.
46
+
47
+ If this project later needs npm publishing or another release target, update
48
+ this file, `package.json`, and `.github/workflows/release.yml` in the same
49
+ change.
50
+
51
+ Do not tag `develop`.
52
+ Do not tag the `release/*` branch.
53
+ Tag only the release commit that is already on `main`.
54
+
55
+ ---
56
+
57
+ ## Preconditions
58
+
59
+ Before cutting a release, ensure all of the following are true:
60
+
61
+ - The intended release scope is already complete on `develop`
62
+ - `package.json` contains the target version
63
+ - `CHANGELOG.md` contains the corresponding release notes
64
+ - The lockfile is up to date
65
+ - The release content has been reviewed
66
+
67
+ Tooling expectations for local verification:
68
+
69
+ - Node.js 20.19+, 22.13+, or 24+
70
+ - pnpm 10 or newer
71
+
72
+ Node 23 is intentionally not treated as supported here because the current
73
+ upstream frontend toolchain excludes it.
74
+
75
+ This repository also enforces `engine-strict=true` in `.npmrc`, so incompatible
76
+ Node.js or pnpm versions should be treated as a release blocker.
77
+
78
+ ---
79
+
80
+ ## Local Validation Before Branching
81
+
82
+ Before creating the release branch, validate the exact release candidate
83
+ locally.
84
+
85
+ Recommended commands:
86
+
87
+ ```bash
88
+ pnpm install
89
+ pnpm release:check
90
+ ```
91
+
92
+ `pnpm release:check` runs the same full validation path used by the release
93
+ workflow, including Playwright.
94
+
95
+ If Chromium is not installed locally yet, install it once:
96
+
97
+ ```bash
98
+ pnpm exec playwright install chromium
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Step-by-Step Release Workflow
104
+
105
+ ### 1. Finalize the release on `develop`
106
+
107
+ Ensure `develop` already contains the exact release content.
108
+
109
+ Typical release preparation includes:
110
+
111
+ - updating `package.json` from the previous version to the next release version
112
+ - moving the relevant notes into the final section in `CHANGELOG.md`
113
+ - committing any last release fixes
114
+
115
+ Make sure the release-ready state is committed before creating `release/*`.
116
+
117
+ ### 2. Create the `release/*` branch
118
+
119
+ Create a release branch from the validated `develop` state.
120
+
121
+ Example:
122
+
123
+ ```bash
124
+ git checkout develop
125
+ git pull
126
+ git checkout -b release/X.Y.Z
127
+ ```
128
+
129
+ ### 3. Merge the release branch into `main`
130
+
131
+ Merge `release/*` into `main` using the repository's normal process.
132
+
133
+ The critical requirement is:
134
+
135
+ - `main` must contain the final release commit before tagging
136
+
137
+ Conceptually:
138
+
139
+ ```bash
140
+ git checkout main
141
+ git pull
142
+ git merge --no-ff release/X.Y.Z
143
+ ```
144
+
145
+ ### 4. Tag the release commit on `main`
146
+
147
+ After the release branch has been merged, create the Git tag on the release
148
+ commit that is now on `main`.
149
+
150
+ Example:
151
+
152
+ ```bash
153
+ git checkout main
154
+ git pull
155
+ git tag vX.Y.Z
156
+ ```
157
+
158
+ The tag format is mandatory:
159
+
160
+ - `vX.Y.Z` is valid
161
+ - `X.Y.Z` is not valid for this workflow
162
+
163
+ ### 5. Push `main` and the tag
164
+
165
+ Push the merged `main` branch and then the tag.
166
+
167
+ Example:
168
+
169
+ ```bash
170
+ git push origin main
171
+ git push origin vX.Y.Z
172
+ ```
173
+
174
+ ### 6. Wait for the release workflow to finish
175
+
176
+ Verify that:
177
+
178
+ - the GitHub Actions release workflow passed
179
+ - the GitHub Release was created
180
+ - the version-check step confirmed tag and `package.json` alignment
181
+
182
+ ### 7. Merge `main` back into `develop`
183
+
184
+ After the release has completed successfully, merge the updated `main` back
185
+ into `develop`.
186
+
187
+ Conceptually:
188
+
189
+ ```bash
190
+ git checkout develop
191
+ git pull
192
+ git merge --no-ff main
193
+ ```
194
+
195
+ ---
196
+
197
+ ## GitHub Workflow Behavior
198
+
199
+ The workflow `.github/workflows/release.yml` runs on pushed tags matching
200
+ `vX.Y.Z`.
201
+
202
+ For each matching tag it will:
203
+
204
+ 1. install dependencies
205
+ 2. install the Playwright Chromium browser
206
+ 3. run `pnpm validate`
207
+ 4. verify that the tag version matches `package.json`
208
+ 5. create a GitHub Release with generated release notes
209
+
210
+ If any step fails, the release job stops immediately.
211
+
212
+ ---
213
+
214
+ ## Maintainer Checklist
215
+
216
+ Use this as the maintainer checklist for every release:
217
+
218
+ 1. Verify the release scope on `develop`
219
+ 2. Update `package.json`
220
+ 3. Update `CHANGELOG.md`
221
+ 4. Run `pnpm release:check`
222
+ 5. Create `release/*` from `develop`
223
+ 6. Merge `release/*` into `main`
224
+ 7. Confirm the merged commit on `main` has the correct version and changelog
225
+ 8. Create the `vX.Y.Z` tag on `main`
226
+ 9. Push `main`
227
+ 10. Push the tag
228
+ 11. Watch the GitHub Actions release workflow
229
+ 12. Verify the GitHub Release exists
230
+ 13. Merge `main` back into `develop`
@@ -0,0 +1,34 @@
1
+ # Roadmap
2
+
3
+ This roadmap describes intended directions, not guaranteed delivery dates.
4
+
5
+ ## Current priorities
6
+
7
+ - Keep the starter minimal and production-like.
8
+ - Preserve a clear bootstrap path for new KoppaJS users.
9
+ - Keep the meta layer synchronized with the actual repository.
10
+
11
+ ## Near-term opportunities
12
+
13
+ - Add a lightweight automated test runner when the repository gains logic that warrants it.
14
+ - Replace or harden any documentation that still assumes old monorepo-linked dependencies.
15
+ - Add more feature specs only when new starter capabilities are intentionally introduced.
16
+
17
+ ## Longer-term expansion triggers
18
+
19
+ These should happen only with a spec and ADR:
20
+
21
+ - routing
22
+ - async data fetching
23
+ - persistence
24
+ - richer component examples
25
+ - CI automation
26
+
27
+ ## Meta-layer maintenance
28
+
29
+ Every release or architecture-changing change should answer:
30
+
31
+ - Does the architecture document still match the code?
32
+ - Did any new decision deserve an ADR?
33
+ - Did testing expectations change?
34
+ - Did contributor instructions stay accurate?
@@ -0,0 +1,93 @@
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.
@@ -0,0 +1,12 @@
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
@@ -0,0 +1 @@
1
+ * text=auto eol=lf
@@ -0,0 +1,33 @@
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.
@@ -0,0 +1,38 @@
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
@@ -0,0 +1,58 @@
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,5 +1,10 @@
1
1
  node_modules
2
+ coverage
2
3
  dist
4
+ .ai
5
+ playwright-report
6
+ test-results
7
+ pnpm-debug.log*
3
8
  *.log
4
9
  *.local
5
10
  .DS_Store
@@ -0,0 +1,8 @@
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"
@@ -0,0 +1 @@
1
+ pnpm exec lint-staged
@@ -0,0 +1 @@
1
+ engine-strict=true
@@ -0,0 +1,7 @@
1
+ .ai
2
+ coverage
3
+ dist
4
+ node_modules
5
+ playwright-report
6
+ pnpm-lock.yaml
7
+ test-results
@@ -0,0 +1,6 @@
1
+ export default {
2
+ extends: ["@commitlint/config-conventional"],
3
+ rules: {
4
+ "header-max-length": [2, "always", 72],
5
+ },
6
+ };
@@ -0,0 +1,32 @@
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
@@ -0,0 +1,30 @@
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
@@ -0,0 +1,24 @@
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
@@ -0,0 +1,31 @@
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