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,17 +1,14 @@
1
1
  [template]
2
- <section class="page-card">
2
+ <section class="page">
3
3
  <div class="page-copy">
4
- <p class="section-label">Home route</p>
5
- <h2 class="page-title">A small starter, now with real navigation</h2>
6
- <p class="page-text">
7
- The home page keeps the original interactive counter so the starter still
8
- shows local state, while the navigation above now switches routes through
9
- the published KoppaJS router.
4
+ <p class="eyebrow">Home route</p>
5
+ <h1>KoppaJS router starter</h1>
6
+ <p>
7
+ This page is rendered for <code>/</code>. The counter stays here so the
8
+ starter shows component state and route rendering in the same small app.
10
9
  </p>
11
10
 
12
- <div class="page-actions">
13
- <a data-route="/router" href="/router" class="page-link">Open the second page</a>
14
- </div>
11
+ <a data-route="/router" href="/router" class="page-link">Open router page</a>
15
12
  </div>
16
13
 
17
14
  <counter-component></counter-component>
@@ -19,82 +16,48 @@
19
16
  [/template]
20
17
 
21
18
  [css]
22
- .page-card {
19
+ .page {
23
20
  display: grid;
24
- grid-template-columns: minmax(0, 1.1fr) auto;
25
- gap: 1.5rem;
21
+ grid-template-columns: minmax(0, 1fr) auto;
22
+ gap: 2rem;
26
23
  align-items: start;
27
- padding: 1.5rem;
28
- border: 1px solid var(--border);
29
- border-radius: 1.75rem;
30
- background: var(--surface);
31
- box-shadow: var(--shadow);
32
- backdrop-filter: blur(18px);
33
24
  }
34
25
 
35
26
  .page-copy {
36
- display: flex;
37
- flex-direction: column;
27
+ display: grid;
38
28
  gap: 1rem;
39
29
  }
40
30
 
41
- .section-label {
31
+ .eyebrow {
42
32
  color: var(--accent);
43
33
  font-size: 0.8rem;
44
- letter-spacing: 0.28em;
34
+ letter-spacing: 0.2em;
45
35
  text-transform: uppercase;
46
36
  }
47
37
 
48
- .page-title {
49
- font-size: clamp(1.7rem, 3vw, 2.7rem);
38
+ h1 {
39
+ font-size: clamp(2rem, 4vw, 3rem);
50
40
  line-height: 1.1;
51
41
  }
52
42
 
53
- .page-text {
43
+ p {
44
+ max-width: 58ch;
54
45
  color: var(--muted);
55
46
  line-height: 1.7;
56
- max-width: 54ch;
57
47
  }
58
48
 
59
- .page-actions {
60
- display: flex;
61
- flex-wrap: wrap;
62
- gap: 0.8rem;
49
+ code {
50
+ color: var(--accent);
63
51
  }
64
52
 
65
53
  .page-link {
66
- display: inline-flex;
67
- align-items: center;
68
- justify-content: center;
69
- min-height: 2.8rem;
70
- padding: 0 1.25rem;
71
- border-radius: 999px;
72
- background: rgba(100, 220, 232, 0.1);
73
- border: 1px solid rgba(100, 220, 232, 0.3);
74
- color: var(--accent-strong);
75
- text-decoration: none;
76
- transition: background 0.25s ease, transform 0.15s ease;
77
- }
78
-
79
- .page-link:hover {
80
- background: rgba(100, 220, 232, 0.18);
81
- }
82
-
83
- .page-link:active {
84
- transform: translateY(1px);
54
+ width: fit-content;
55
+ color: var(--accent);
85
56
  }
86
57
 
87
- @media (max-width: 840px) {
88
- .page-card {
58
+ @media (max-width: 760px) {
59
+ .page {
89
60
  grid-template-columns: 1fr;
90
- justify-items: start;
91
- }
92
- }
93
-
94
- @media (max-width: 640px) {
95
- .page-card {
96
- padding: 1.15rem;
97
- border-radius: 1.25rem;
98
61
  }
99
62
  }
100
63
  [/css]
@@ -16,23 +16,14 @@ const ROUTE_LINK_SELECTOR = "a[data-route]";
16
16
  const routes = [
17
17
  {
18
18
  path: "/",
19
- name: "home",
20
- title: "Home",
21
- description: "Landing page for the KoppaJS router starter.",
22
19
  componentTag: "home-page",
23
20
  },
24
21
  {
25
22
  path: "/router",
26
- name: "router",
27
- title: "Router",
28
- description: "Second page showing how the KoppaJS router starter works.",
29
23
  componentTag: "router-page",
30
24
  },
31
25
  {
32
26
  path: "*",
33
- name: "not-found",
34
- title: "Not found",
35
- description: "Fallback page for unmatched routes in the router starter.",
36
27
  componentTag: "not-found-page",
37
28
  },
38
29
  ] satisfies readonly RouteDefinition[];
@@ -1,69 +1,37 @@
1
1
  [template]
2
- <section class="page-card page-card--missing">
3
- <p class="section-label">404</p>
4
- <h2 class="page-title">Page not found</h2>
5
- <p class="page-text">
6
- The router starter includes an explicit catch-all route, so unmatched URLs
7
- still render a predictable fallback page instead of failing silently.
8
- </p>
9
-
10
- <div class="page-actions">
11
- <a data-route="/" href="/" class="page-link">Return home</a>
12
- </div>
2
+ <section class="page">
3
+ <p class="eyebrow">404</p>
4
+ <h1>Page not found</h1>
5
+ <p>The router fallback route rendered this page for an unknown URL.</p>
6
+ <a data-route="/" href="/" class="page-link">Return home</a>
13
7
  </section>
14
8
  [/template]
15
9
 
16
10
  [css]
17
- .page-card {
18
- display: flex;
19
- flex-direction: column;
11
+ .page {
12
+ display: grid;
20
13
  gap: 1rem;
21
- padding: 1.5rem;
22
- border: 1px solid rgba(248, 113, 113, 0.24);
23
- border-radius: 1.75rem;
24
- background: linear-gradient(180deg, rgba(61, 12, 22, 0.5), rgba(11, 22, 40, 0.88));
25
- box-shadow: var(--shadow);
26
14
  }
27
15
 
28
- .section-label {
29
- color: #fda4af;
16
+ .eyebrow {
17
+ color: var(--accent);
30
18
  font-size: 0.8rem;
31
- letter-spacing: 0.28em;
19
+ letter-spacing: 0.2em;
32
20
  text-transform: uppercase;
33
21
  }
34
22
 
35
- .page-title {
36
- font-size: clamp(1.7rem, 3vw, 2.5rem);
23
+ h1 {
24
+ font-size: clamp(2rem, 4vw, 3rem);
37
25
  line-height: 1.1;
38
26
  }
39
27
 
40
- .page-text {
41
- color: #fecdd3;
28
+ p {
29
+ color: var(--muted);
42
30
  line-height: 1.7;
43
- max-width: 58ch;
44
- }
45
-
46
- .page-actions {
47
- display: flex;
48
31
  }
49
32
 
50
33
  .page-link {
51
- display: inline-flex;
52
- align-items: center;
53
- justify-content: center;
54
- min-height: 2.8rem;
55
- padding: 0 1.25rem;
56
- border-radius: 999px;
57
- background: rgba(253, 164, 175, 0.12);
58
- border: 1px solid rgba(253, 164, 175, 0.4);
59
- color: #fff1f2;
60
- text-decoration: none;
61
- }
62
-
63
- @media (max-width: 640px) {
64
- .page-card {
65
- padding: 1.15rem;
66
- border-radius: 1.25rem;
67
- }
34
+ width: fit-content;
35
+ color: var(--accent);
68
36
  }
69
37
  [/css]
@@ -1,102 +1,67 @@
1
1
  [template]
2
- <section class="page-card">
3
- <div class="page-copy">
4
- <p class="section-label">Second page</p>
5
- <h2 class="page-title">Router is active</h2>
6
- <p class="page-text">
7
- This view is rendered into <code>#app-outlet</code> by
8
- <code>KoppajsRouter</code>. The active navigation state and the browser
9
- URL are both managed by the router runtime.
10
- </p>
2
+ <section class="page">
3
+ <p class="eyebrow">Router route</p>
4
+ <h1>Routing is active</h1>
5
+ <p>
6
+ This page is rendered for <code>/router</code>. Links with
7
+ <code>data-route</code> are handled by <code>KoppajsRouter</code>, and a
8
+ catch-all route handles unknown paths.
9
+ </p>
11
10
 
12
- <ul class="feature-list">
13
- <li>Routes are defined in <code>src/main.ts</code>.</li>
14
- <li>Links opt into delegated navigation through <code>data-route</code>.</li>
15
- <li>A catch-all route is already wired for unmatched paths.</li>
16
- </ul>
11
+ <ul class="route-list" aria-label="Configured routes">
12
+ <li><code>/</code> renders <code>home-page</code></li>
13
+ <li><code>/router</code> renders <code>router-page</code></li>
14
+ <li><code>*</code> renders <code>not-found-page</code></li>
15
+ </ul>
17
16
 
18
- <div class="page-actions">
19
- <a data-route="/" href="/" class="page-link">Back to home</a>
20
- </div>
21
- </div>
17
+ <a data-route="/" href="/" class="page-link">Back home</a>
22
18
  </section>
23
19
  [/template]
24
20
 
25
21
  [css]
26
- .page-card {
27
- padding: 1.5rem;
28
- border: 1px solid var(--border);
29
- border-radius: 1.75rem;
30
- background: var(--surface-strong);
31
- box-shadow: var(--shadow);
32
- backdrop-filter: blur(18px);
33
- }
34
-
35
- .page-copy {
36
- display: flex;
37
- flex-direction: column;
22
+ .page {
23
+ display: grid;
38
24
  gap: 1rem;
39
25
  }
40
26
 
41
- .section-label {
27
+ .eyebrow {
42
28
  color: var(--accent);
43
29
  font-size: 0.8rem;
44
- letter-spacing: 0.28em;
30
+ letter-spacing: 0.2em;
45
31
  text-transform: uppercase;
46
32
  }
47
33
 
48
- .page-title {
49
- font-size: clamp(1.7rem, 3vw, 2.5rem);
34
+ h1 {
35
+ font-size: clamp(2rem, 4vw, 3rem);
50
36
  line-height: 1.1;
51
37
  }
52
38
 
53
- .page-text {
39
+ p {
40
+ max-width: 62ch;
54
41
  color: var(--muted);
55
42
  line-height: 1.7;
56
- max-width: 58ch;
57
43
  }
58
44
 
59
45
  code {
60
- color: var(--accent-strong);
46
+ color: var(--accent);
61
47
  }
62
48
 
63
- .feature-list {
64
- list-style: none;
49
+ .route-list {
65
50
  display: grid;
66
- gap: 0.8rem;
67
- color: var(--text);
68
- }
69
-
70
- .feature-list li {
71
- padding: 0.95rem 1rem;
72
- border-radius: 1rem;
73
- border: 1px solid rgba(100, 220, 232, 0.18);
74
- background: rgba(100, 220, 232, 0.06);
51
+ gap: 0.6rem;
52
+ list-style: none;
53
+ max-width: 34rem;
75
54
  }
76
55
 
77
- .page-actions {
78
- display: flex;
79
- flex-wrap: wrap;
80
- gap: 0.8rem;
56
+ .route-list li {
57
+ padding: 0.8rem 1rem;
58
+ border: 1px solid var(--border);
59
+ border-radius: 0.75rem;
60
+ background: var(--surface);
81
61
  }
82
62
 
83
63
  .page-link {
84
- display: inline-flex;
85
- align-items: center;
86
- justify-content: center;
87
- min-height: 2.8rem;
88
- padding: 0 1.25rem;
89
- border-radius: 999px;
90
- background: rgba(100, 220, 232, 0.1);
91
- border: 1px solid rgba(100, 220, 232, 0.3);
92
- color: var(--accent-strong);
93
- text-decoration: none;
94
- }
95
-
96
- @media (max-width: 640px) {
97
- .page-card {
98
- padding: 1.15rem;
99
- border-radius: 1.25rem;
100
- }
64
+ width: fit-content;
65
+ color: var(--accent);
101
66
  }
102
67
  [/css]
@@ -1,16 +1,12 @@
1
1
  :root {
2
2
  color-scheme: dark;
3
- --app-bg: #08111f;
4
- --app-bg-accent: #102742;
5
- --surface: rgba(9, 16, 31, 0.78);
6
- --surface-strong: rgba(11, 22, 40, 0.92);
7
- --border: rgba(148, 163, 184, 0.2);
3
+ --app-bg: #0f1117;
4
+ --surface: #171b29;
5
+ --border: #2a3042;
8
6
  --text: #edf6ff;
9
7
  --muted: #a7bfd7;
10
8
  --accent: #64dce8;
11
- --accent-strong: #97f3fb;
12
- --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
13
- font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
9
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
14
10
  }
15
11
 
16
12
  * {
@@ -19,29 +15,9 @@
19
15
  padding: 0;
20
16
  }
21
17
 
22
- html {
23
- min-height: 100%;
24
- background:
25
- radial-gradient(
26
- circle at top left,
27
- rgba(100, 220, 232, 0.16),
28
- transparent 30%
29
- ),
30
- radial-gradient(
31
- circle at bottom right,
32
- rgba(16, 39, 66, 0.55),
33
- transparent 32%
34
- ),
35
- linear-gradient(
36
- 160deg,
37
- var(--app-bg) 0%,
38
- #060c18 45%,
39
- var(--app-bg-accent) 100%
40
- );
41
- }
42
-
43
18
  body {
44
19
  min-height: 100vh;
20
+ background: var(--app-bg);
45
21
  color: var(--text);
46
22
  }
47
23
 
@@ -1,50 +0,0 @@
1
- # AI Constitution
2
-
3
- ## Purpose
4
-
5
- This repository is a KoppaJS starter scaffolded from the official minimal Vite
6
- and TypeScript baseline. Its job is to stay small, understandable, runnable,
7
- and trustworthy.
8
-
9
- ## Core principles
10
-
11
- - Optimize for clarity over feature breadth.
12
- - Keep the bootstrap path obvious: one HTML shell, one TypeScript entrypoint, one root view.
13
- - Prefer published npm packages over local `file:` links in this repository.
14
- - Keep the starter close to real production usage, but do not turn it into a framework showcase.
15
- - Treat the meta layer as part of the product. If architecture or workflow changes, the documentation must change in the same update.
16
-
17
- ## Architectural philosophy
18
-
19
- - `index.html` is the static document shell only.
20
- - `src/main.ts` is the only bootstrap module and the only place that registers root-level components with `Core.take(...)`.
21
- - `.kpa` files are the primary unit for simple UI composition, local state, and component-scoped styling.
22
- - When logic becomes reusable, branch-heavy, or worth unit testing, extract it from `.kpa` blocks into `.ts` modules.
23
- - Global CSS stays minimal. Component visuals belong inside component-local CSS blocks unless they are true application-wide primitives.
24
-
25
- ## Collaboration rules for humans and AI
26
-
27
- 1. Read [DECISION_HIERARCHY.md](./DECISION_HIERARCHY.md), [ARCHITECTURE.md](./ARCHITECTURE.md), [DEVELOPMENT_RULES.md](./DEVELOPMENT_RULES.md), [TESTING_STRATEGY.md](./TESTING_STRATEGY.md), and any relevant spec or ADR before editing code.
28
- 2. Follow `spec -> quality plan -> implementation -> documentation` for any non-trivial change.
29
- 3. Do not silently change public component tags, bootstrap flow, dependency sourcing, or the starter's setup instructions.
30
- 4. Prefer existing repository patterns over inventing new structure.
31
- 5. If a change affects architecture, module boundaries, build tooling, testing, or contributor workflow, update the meta layer in the same change.
32
- 6. Record durable architectural decisions in `docs/adr/`.
33
- 7. If code and documentation disagree, resolve the mismatch before merging further changes.
34
-
35
- ## Change triggers
36
-
37
- - New subsystem or folder: update [ARCHITECTURE.md](./ARCHITECTURE.md) and [docs/architecture/module-boundaries.md](./docs/architecture/module-boundaries.md).
38
- - New enduring technical decision: add or update an ADR in [docs/adr](./docs/adr).
39
- - New development convention: update [DEVELOPMENT_RULES.md](./DEVELOPMENT_RULES.md).
40
- - New quality gate or test level: update [TESTING_STRATEGY.md](./TESTING_STRATEGY.md) and [docs/quality/quality-gates.md](./docs/quality/quality-gates.md).
41
- - New user-visible capability: create or update a spec in [docs/specs](./docs/specs).
42
-
43
- ## Definition of done
44
-
45
- A change is not complete until:
46
-
47
- - the code or docs are aligned with the actual repository state,
48
- - applicable specs and ADRs are updated,
49
- - required quality checks have run,
50
- - contributor-facing guidance still matches the project.
@@ -1,86 +0,0 @@
1
- # Architecture
2
-
3
- This repository is a minimal KoppaJS application starter. It intentionally demonstrates a small end-to-end path: HTML shell, TypeScript bootstrap, a root KoppaJS view, and a single interactive child component. The repository also carries a small quality and release automation layer so the starter stays runnable, trustworthy, and maintainable as it evolves.
4
-
5
- ## System overview
6
-
7
- - `index.html` provides the document shell, loads global CSS, declares the `<app-view>` root element, and imports the TypeScript entrypoint.
8
- - `src/main.ts` imports `@koppajs/koppajs-core`, registers local components with `Core.take(...)`, and invokes `Core()` exactly once to bootstrap the app.
9
- - `src/app-view.kpa` is the root UI shell. It arranges the page and composes the interactive example component.
10
- - `src/counter-component.kpa` is the example stateful leaf component. It owns its own `count` state and button event handlers.
11
- - `src/style.css` contains the global reset only.
12
- - `public/` contains static assets referenced by the HTML shell or components.
13
- - `vite.config.mjs` wires the KoppaJS Vite plugin into the build and applies a small repo-local compatibility transform so `.kpa` files are emitted as valid ES modules.
14
- - `vitest.config.mjs` reuses the Vite config so unit and integration tests exercise the same `.kpa` loading path as the application.
15
- - `playwright.config.ts` runs a Chromium smoke test against `vite preview`, which keeps the minimal UI starter covered by one real browser path.
16
- - `CHANGELOG.md` records official tagged milestones for the repository.
17
- - `RELEASE.md` documents the maintainer release path across `develop`, `release/*`, and `main`.
18
- - `commitlint.config.mjs` defines the repository's commit message convention.
19
- - `.github/workflows/release.yml` reruns validation for `vX.Y.Z` tags, checks version alignment, and creates GitHub Releases.
20
- - `tests/unit/` covers isolated logic such as the `.kpa` module export normalization helper.
21
- - `tests/integration/` covers application bootstrap wiring without requiring a full browser run.
22
- - `tests/e2e/` covers the observable starter flow in a real browser.
23
- - `tsconfig.json` enforces strict TypeScript rules for source, tests, and TypeScript config files. `.kpa` compilation is still handled by the KoppaJS Vite plugin.
24
-
25
- More detailed boundaries live in [docs/architecture/module-boundaries.md](./docs/architecture/module-boundaries.md).
26
-
27
- ## Runtime flow
28
-
29
- 1. The browser loads [`index.html`](./index.html).
30
- 2. The document loads [`src/style.css`](./src/style.css) and [`src/main.ts`](./src/main.ts).
31
- 3. [`src/main.ts`](./src/main.ts) registers `app-view` and `counter-component` with KoppaJS Core, then calls `Core()`.
32
- 4. KoppaJS instantiates `<app-view>`.
33
- 5. [`src/app-view.kpa`](./src/app-view.kpa) renders the starter shell and nests `<counter-component>`.
34
- 6. [`src/counter-component.kpa`](./src/counter-component.kpa) handles button clicks, mutates local state, and re-renders the displayed value.
35
-
36
- ## Quality automation layer
37
-
38
- - `eslint.config.mjs` lint-checks TypeScript source plus the TypeScript- and JavaScript-based tooling files.
39
- - `prettier.config.mjs` and `.editorconfig` keep supported text files consistent without introducing formatter-specific rules into ESLint.
40
- - `.npmrc` enforces the declared engine floor during installs.
41
- - `.husky/pre-commit` runs `lint-staged` so staged files get a fast local quality pass before commit.
42
- - `.husky/commit-msg` validates commit headers with `commitlint`.
43
- - `.github/workflows/ci.yml` runs the full repository validation flow on GitHub.
44
- - `.github/workflows/release.yml` runs tagged release validation and creates GitHub Releases for matching versions.
45
- - Stylelint is intentionally absent for now because the important styles live inside `.kpa` blocks and the repository does not yet have a low-friction, first-class way to lint those embedded blocks without giving a misleading sense of coverage.
46
-
47
- ## Module responsibilities
48
-
49
- | Module | Responsibility | Must not do |
50
- | ------------------------------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------- |
51
- | `index.html` | Declare root tag and static assets | Hold business logic or feature wiring |
52
- | `CHANGELOG.md` | Record official tagged release notes | Become a scratchpad for speculative work or duplicate repository docs |
53
- | `RELEASE.md` | Define the maintainer release procedure | Drift away from actual branch, tag, or workflow behavior |
54
- | `commitlint.config.mjs` | Define commit message validation rules | Expand into unrelated repository lint policy |
55
- | `src/main.ts` | Bootstrap and component registration | Accumulate feature logic, state, or DOM manipulation |
56
- | `src/app-view.kpa` | Root layout and composition | Own unrelated business workflows or register components |
57
- | `src/counter-component.kpa` | Local interactive example state | Reach into global DOM or mutate app shell concerns |
58
- | `src/style.css` | Global reset/base rules | Contain feature-specific visuals that belong to components |
59
- | `public/` | Static assets | Store generated build output or source code |
60
- | `tests/unit/` | Isolated tests for helper or tooling logic | Production runtime side effects or browser-only expectations |
61
- | `tests/integration/` | Wiring tests across bootstrap boundaries | Full browser assertions already covered by Playwright |
62
- | `tests/e2e/` | Real browser smoke coverage of the starter UI | Deep implementation-detail assertions or brittle CSS-driven flows |
63
- | `vite.config.mjs` | Build and dev server integration, including the `.kpa` module export compatibility wrapper | Application runtime logic |
64
- | `vitest.config.mjs` | Unit and integration test runner configuration | Runtime feature code |
65
- | `playwright.config.ts` | Browser smoke-test orchestration against preview output | Application runtime logic |
66
- | `.github/workflows/release.yml` | Tagged release validation and GitHub Release creation | Publish to npm while the repository remains private |
67
-
68
- ## Invariants
69
-
70
- - There is exactly one application bootstrap path.
71
- - The root tag in `index.html` must match a component registered in `src/main.ts`.
72
- - `Core()` is called once from `src/main.ts`.
73
- - Official releases require matching versions across `package.json`, `CHANGELOG.md`, and `vX.Y.Z` tags.
74
- - Maintainer commits are expected to follow Conventional Commits.
75
- - No routing, persistence, network calls, or global client-side state are part of the baseline starter.
76
- - Stateful behavior remains local unless a documented new subsystem justifies centralization.
77
- - `pnpm check` remains fast enough for routine local use.
78
- - Playwright coverage stays focused on critical smoke coverage unless the UI grows into a broader workflow surface.
79
- - The repository remains `private` until an explicit decision changes the release target.
80
-
81
- ## Extension guidance
82
-
83
- - Add new components under `src/` and compose them from `app-view.kpa` or other components.
84
- - Extract shared logic into `.ts` modules when it becomes reusable or deserves focused testing.
85
- - Add a spec before introducing new user-visible behavior.
86
- - Add an ADR before introducing architecture-changing capabilities such as routing, data fetching, persistence, state containers, SSR, or a new testing stack.
@@ -1,34 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to **__PROJECT_NAME__** are documented in this file.
4
-
5
- This project uses a manual, tag-driven release process.
6
- Only tagged versions represent official releases.
7
-
8
- ---
9
-
10
- ## [Unreleased]
11
-
12
- This section is intentionally empty.
13
-
14
- Changes will only appear here when they:
15
-
16
- - alter the project's observable behavior,
17
- - change contributor or maintainer workflow,
18
- - or modify documented repository guarantees.
19
-
20
- ---
21
-
22
- ## [1.0.0] — Initial Scaffold Baseline
23
-
24
- **2026-03-17**
25
-
26
- Initial scaffold created from the current official KoppaJS starter baseline.
27
-
28
- ### Included
29
-
30
- - a minimal KoppaJS app shell with `app-view` and `counter-component`
31
- - bootstrap through `Core.take(...)` and `Core()`
32
- - ESLint, Prettier, Vitest, Playwright, Husky, and GitHub Actions CI
33
- - explicit architecture, ADR, spec, testing, and contributor documentation
34
- - a tag-driven GitHub release workflow for repository snapshots