create-koppajs 1.2.2 → 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 +37 -0
- package/README.md +12 -10
- package/bin/create-koppajs.js +0 -14
- package/package.json +4 -4
- package/template/README.md +19 -206
- 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-overlays/router/README.md +25 -200
- 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 -84
- package/template/CHANGELOG.md +0 -35
- package/template/CONTRIBUTING.md +0 -89
- package/template/DECISION_HIERARCHY.md +0 -32
- package/template/DEVELOPMENT_RULES.md +0 -57
- package/template/LICENSE +0 -201
- package/template/RELEASE.md +0 -227
- package/template/ROADMAP.md +0 -34
- package/template/TESTING_STRATEGY.md +0 -96
- package/template/_editorconfig +0 -12
- package/template/_github/instructions/ai-workflow.md +0 -33
- package/template/_github/workflows/ci.yml +0 -41
- 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-rely-on-upstream-kpa-es-module-output.md +0 -32
- 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 -47
- 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/vite.config.d.mts +0 -5
- package/template/vitest.config.mjs +0 -19
- package/template-overlays/router/ARCHITECTURE.md +0 -86
- package/template-overlays/router/CHANGELOG.md +0 -50
- 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,69 +1,37 @@
|
|
|
1
1
|
[template]
|
|
2
|
-
<section class="page
|
|
3
|
-
<p class="
|
|
4
|
-
<
|
|
5
|
-
<p
|
|
6
|
-
|
|
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
|
|
18
|
-
display:
|
|
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
|
-
.
|
|
29
|
-
color:
|
|
16
|
+
.eyebrow {
|
|
17
|
+
color: var(--accent);
|
|
30
18
|
font-size: 0.8rem;
|
|
31
|
-
letter-spacing: 0.
|
|
19
|
+
letter-spacing: 0.2em;
|
|
32
20
|
text-transform: uppercase;
|
|
33
21
|
}
|
|
34
22
|
|
|
35
|
-
|
|
36
|
-
font-size: clamp(
|
|
23
|
+
h1 {
|
|
24
|
+
font-size: clamp(2rem, 4vw, 3rem);
|
|
37
25
|
line-height: 1.1;
|
|
38
26
|
}
|
|
39
27
|
|
|
40
|
-
|
|
41
|
-
color:
|
|
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
|
-
|
|
52
|
-
|
|
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
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
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
|
|
27
|
-
|
|
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
|
-
.
|
|
27
|
+
.eyebrow {
|
|
42
28
|
color: var(--accent);
|
|
43
29
|
font-size: 0.8rem;
|
|
44
|
-
letter-spacing: 0.
|
|
30
|
+
letter-spacing: 0.2em;
|
|
45
31
|
text-transform: uppercase;
|
|
46
32
|
}
|
|
47
33
|
|
|
48
|
-
|
|
49
|
-
font-size: clamp(
|
|
34
|
+
h1 {
|
|
35
|
+
font-size: clamp(2rem, 4vw, 3rem);
|
|
50
36
|
line-height: 1.1;
|
|
51
37
|
}
|
|
52
38
|
|
|
53
|
-
|
|
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
|
|
46
|
+
color: var(--accent);
|
|
61
47
|
}
|
|
62
48
|
|
|
63
|
-
.
|
|
64
|
-
list-style: none;
|
|
49
|
+
.route-list {
|
|
65
50
|
display: grid;
|
|
66
|
-
gap: 0.
|
|
67
|
-
|
|
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
|
-
.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
85
|
-
|
|
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: #
|
|
4
|
-
--
|
|
5
|
-
--
|
|
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
|
-
|
|
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.
|
package/template/ARCHITECTURE.md
DELETED
|
@@ -1,84 +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 without local compatibility layers.
|
|
14
|
-
- `vitest.config.mjs` reuses the Vite config so 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/integration/` covers application bootstrap wiring without requiring a full browser run.
|
|
21
|
-
- `tests/e2e/` covers the observable starter flow in a real browser.
|
|
22
|
-
- `tsconfig.json` enforces strict TypeScript rules for source, tests, and TypeScript config files. `.kpa` compilation is still handled by the KoppaJS Vite plugin.
|
|
23
|
-
|
|
24
|
-
More detailed boundaries live in [docs/architecture/module-boundaries.md](./docs/architecture/module-boundaries.md).
|
|
25
|
-
|
|
26
|
-
## Runtime flow
|
|
27
|
-
|
|
28
|
-
1. The browser loads [`index.html`](./index.html).
|
|
29
|
-
2. The document loads [`src/style.css`](./src/style.css) and [`src/main.ts`](./src/main.ts).
|
|
30
|
-
3. [`src/main.ts`](./src/main.ts) registers `app-view` and `counter-component` with KoppaJS Core, then calls `Core()`.
|
|
31
|
-
4. KoppaJS instantiates `<app-view>`.
|
|
32
|
-
5. [`src/app-view.kpa`](./src/app-view.kpa) renders the starter shell and nests `<counter-component>`.
|
|
33
|
-
6. [`src/counter-component.kpa`](./src/counter-component.kpa) handles button clicks, mutates local state, and re-renders the displayed value.
|
|
34
|
-
|
|
35
|
-
## Quality automation layer
|
|
36
|
-
|
|
37
|
-
- `eslint.config.mjs` lint-checks TypeScript source plus the TypeScript- and JavaScript-based tooling files.
|
|
38
|
-
- `prettier.config.mjs` and `.editorconfig` keep supported text files consistent without introducing formatter-specific rules into ESLint.
|
|
39
|
-
- `.npmrc` enforces the declared engine floor during installs.
|
|
40
|
-
- `.husky/pre-commit` runs `lint-staged` so staged files get a fast local quality pass before commit.
|
|
41
|
-
- `.husky/commit-msg` validates commit headers with `commitlint`.
|
|
42
|
-
- `.github/workflows/ci.yml` runs the full repository validation flow on GitHub.
|
|
43
|
-
- `.github/workflows/release.yml` runs tagged release validation and creates GitHub Releases for matching versions.
|
|
44
|
-
- 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.
|
|
45
|
-
|
|
46
|
-
## Module responsibilities
|
|
47
|
-
|
|
48
|
-
| Module | Responsibility | Must not do |
|
|
49
|
-
| ------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
|
50
|
-
| `index.html` | Declare root tag and static assets | Hold business logic or feature wiring |
|
|
51
|
-
| `CHANGELOG.md` | Record official tagged release notes | Become a scratchpad for speculative work or duplicate repository docs |
|
|
52
|
-
| `RELEASE.md` | Define the maintainer release procedure | Drift away from actual branch, tag, or workflow behavior |
|
|
53
|
-
| `commitlint.config.mjs` | Define commit message validation rules | Expand into unrelated repository lint policy |
|
|
54
|
-
| `src/main.ts` | Bootstrap and component registration | Accumulate feature logic, state, or DOM manipulation |
|
|
55
|
-
| `src/app-view.kpa` | Root layout and composition | Own unrelated business workflows or register components |
|
|
56
|
-
| `src/counter-component.kpa` | Local interactive example state | Reach into global DOM or mutate app shell concerns |
|
|
57
|
-
| `src/style.css` | Global reset/base rules | Contain feature-specific visuals that belong to components |
|
|
58
|
-
| `public/` | Static assets | Store generated build output or source code |
|
|
59
|
-
| `tests/integration/` | Wiring tests across bootstrap boundaries | Full browser assertions already covered by Playwright |
|
|
60
|
-
| `tests/e2e/` | Real browser smoke coverage of the starter UI | Deep implementation-detail assertions or brittle CSS-driven flows |
|
|
61
|
-
| `vite.config.mjs` | Build and dev server integration through the upstream KoppaJS Vite plugin | Application runtime logic |
|
|
62
|
-
| `vitest.config.mjs` | Unit and integration test runner configuration | Runtime feature code |
|
|
63
|
-
| `playwright.config.ts` | Browser smoke-test orchestration against preview output | Application runtime logic |
|
|
64
|
-
| `.github/workflows/release.yml` | Tagged release validation and GitHub Release creation | Publish to npm while the repository remains private |
|
|
65
|
-
|
|
66
|
-
## Invariants
|
|
67
|
-
|
|
68
|
-
- There is exactly one application bootstrap path.
|
|
69
|
-
- The root tag in `index.html` must match a component registered in `src/main.ts`.
|
|
70
|
-
- `Core()` is called once from `src/main.ts`.
|
|
71
|
-
- Official releases require matching versions across `package.json`, `CHANGELOG.md`, and `vX.Y.Z` tags.
|
|
72
|
-
- Maintainer commits are expected to follow Conventional Commits.
|
|
73
|
-
- No routing, persistence, network calls, or global client-side state are part of the baseline starter.
|
|
74
|
-
- Stateful behavior remains local unless a documented new subsystem justifies centralization.
|
|
75
|
-
- `pnpm check` remains fast enough for routine local use.
|
|
76
|
-
- Playwright coverage stays focused on critical smoke coverage unless the UI grows into a broader workflow surface.
|
|
77
|
-
- The repository remains `private` until an explicit decision changes the release target.
|
|
78
|
-
|
|
79
|
-
## Extension guidance
|
|
80
|
-
|
|
81
|
-
- Add new components under `src/` and compose them from `app-view.kpa` or other components.
|
|
82
|
-
- Extract shared logic into `.ts` modules when it becomes reusable or deserves focused testing.
|
|
83
|
-
- Add a spec before introducing new user-visible behavior.
|
|
84
|
-
- Add an ADR before introducing architecture-changing capabilities such as routing, data fetching, persistence, state containers, SSR, or a new testing stack.
|
package/template/CHANGELOG.md
DELETED
|
@@ -1,35 +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
|
-
### Changed
|
|
13
|
-
|
|
14
|
-
- raised the minimum Node.js version to `>=22` and expanded CI coverage to
|
|
15
|
-
Node 24
|
|
16
|
-
- refreshed the starter dependency baseline to the current `@koppajs/koppajs-core`
|
|
17
|
-
and `@koppajs/koppajs-vite-plugin` releases
|
|
18
|
-
- removed the obsolete local `.kpa` export wrapper because the upstream Vite
|
|
19
|
-
plugin already emits valid ES modules
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## [1.0.0] — Initial Scaffold Baseline
|
|
24
|
-
|
|
25
|
-
**2026-03-17**
|
|
26
|
-
|
|
27
|
-
Initial scaffold created from the current official KoppaJS starter baseline.
|
|
28
|
-
|
|
29
|
-
### Included
|
|
30
|
-
|
|
31
|
-
- a minimal KoppaJS app shell with `app-view` and `counter-component`
|
|
32
|
-
- bootstrap through `Core.take(...)` and `Core()`
|
|
33
|
-
- ESLint, Prettier, Vitest, Playwright, Husky, and GitHub Actions CI
|
|
34
|
-
- explicit architecture, ADR, spec, testing, and contributor documentation
|
|
35
|
-
- a tag-driven GitHub release workflow for repository snapshots
|
package/template/CONTRIBUTING.md
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# Contributing
|
|
2
|
-
|
|
3
|
-
## Setup
|
|
4
|
-
|
|
5
|
-
Requirements:
|
|
6
|
-
|
|
7
|
-
- Node.js >= 22
|
|
8
|
-
- pnpm 10 or newer
|
|
9
|
-
|
|
10
|
-
Install and run:
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
pnpm install
|
|
14
|
-
pnpm dev
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Install the Playwright browser once if you plan to run browser smoke tests locally:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
pnpm exec playwright install chromium
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Useful commands:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
pnpm lint
|
|
27
|
-
pnpm format:check
|
|
28
|
-
pnpm typecheck
|
|
29
|
-
pnpm test:run
|
|
30
|
-
pnpm test:coverage
|
|
31
|
-
pnpm test:e2e
|
|
32
|
-
pnpm check
|
|
33
|
-
pnpm validate
|
|
34
|
-
pnpm release:check
|
|
35
|
-
pnpm build
|
|
36
|
-
pnpm serve
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Commit messages use Conventional Commits.
|
|
40
|
-
Examples:
|
|
41
|
-
|
|
42
|
-
```text
|
|
43
|
-
feat: add release baseline
|
|
44
|
-
docs: update contributing guide
|
|
45
|
-
fix: align bootstrap docs
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Workflow
|
|
49
|
-
|
|
50
|
-
1. Read [DECISION_HIERARCHY.md](./DECISION_HIERARCHY.md), [ARCHITECTURE.md](./ARCHITECTURE.md), and any relevant spec or ADR before changing source files.
|
|
51
|
-
2. For non-trivial work, update or create the relevant spec in [docs/specs](./docs/specs) first.
|
|
52
|
-
3. If the change alters architecture, tooling, public tags, or repository workflow, add or update an ADR in [docs/adr](./docs/adr).
|
|
53
|
-
4. Implement the smallest change that satisfies the spec.
|
|
54
|
-
5. Run the applicable quality gates from [TESTING_STRATEGY.md](./TESTING_STRATEGY.md). Use `pnpm check` for the local baseline and `pnpm validate` before merge when the UI, bootstrap, or tooling changed.
|
|
55
|
-
6. If the change touches versioning, changelog, or release automation, update `CHANGELOG.md`, `RELEASE.md`, and the affected workflow in the same change.
|
|
56
|
-
7. Update architecture, development, testing, and README docs when the actual project state changes.
|
|
57
|
-
|
|
58
|
-
## Releases
|
|
59
|
-
|
|
60
|
-
- Release notes live in [`CHANGELOG.md`](./CHANGELOG.md).
|
|
61
|
-
- The maintainer release procedure lives in [`RELEASE.md`](./RELEASE.md).
|
|
62
|
-
- Releases are prepared on `develop`, moved through `release/*`, merged into `main`, and tagged as `vX.Y.Z`.
|
|
63
|
-
- The release workflow creates GitHub Releases only. The repository starts
|
|
64
|
-
`private`, so no npm publish step is configured by default.
|
|
65
|
-
- Run `pnpm release:check` before cutting a release tag.
|
|
66
|
-
|
|
67
|
-
## Commit policy
|
|
68
|
-
|
|
69
|
-
- Commit messages are validated by `.husky/commit-msg` using `commitlint`.
|
|
70
|
-
- Use Conventional Commits such as `feat: ...`, `fix: ...`, `docs: ...`, `test: ...`, `ci: ...`, or `chore: ...`.
|
|
71
|
-
- Keep the commit header at 72 characters or fewer.
|
|
72
|
-
- Merge, revert, `fixup!`, and `squash!` commits may bypass validation when Git creates them automatically.
|
|
73
|
-
|
|
74
|
-
## Pull request expectations
|
|
75
|
-
|
|
76
|
-
- Keep the starter minimal unless expansion is explicitly approved.
|
|
77
|
-
- Explain user-visible behavior changes and architecture-impacting decisions.
|
|
78
|
-
- Do not silently swap dependency sources, add build tools, or introduce new subsystems.
|
|
79
|
-
- Keep docs and code aligned in the same change.
|
|
80
|
-
- Keep hooks fast; heavy validation belongs in `pnpm validate` and CI, not in `pre-commit`.
|
|
81
|
-
|
|
82
|
-
## AI-assisted contributions
|
|
83
|
-
|
|
84
|
-
AI contributors follow the same rules as humans:
|
|
85
|
-
|
|
86
|
-
- read governing docs before editing,
|
|
87
|
-
- prefer existing patterns,
|
|
88
|
-
- do not invent architecture casually,
|
|
89
|
-
- update the meta layer whenever structure or rules change.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# Decision Hierarchy
|
|
2
|
-
|
|
3
|
-
When repository documents conflict, use this order of precedence.
|
|
4
|
-
|
|
5
|
-
1. Approved specifications in [`docs/specs/`](./docs/specs)
|
|
6
|
-
2. Architecture Decision Records in [`docs/adr/`](./docs/adr)
|
|
7
|
-
3. [`AI_CONSTITUTION.md`](./AI_CONSTITUTION.md)
|
|
8
|
-
4. [`ARCHITECTURE.md`](./ARCHITECTURE.md) and supporting architecture docs in [`docs/architecture/`](./docs/architecture)
|
|
9
|
-
5. [`DEVELOPMENT_RULES.md`](./DEVELOPMENT_RULES.md) and [`TESTING_STRATEGY.md`](./TESTING_STRATEGY.md)
|
|
10
|
-
6. Quality and maintenance guidance in [`docs/quality/`](./docs/quality) and [`docs/meta/`](./docs/meta)
|
|
11
|
-
7. Contributor guidance and examples in [`CONTRIBUTING.md`](./CONTRIBUTING.md), [`README.md`](./README.md), and inline comments
|
|
12
|
-
|
|
13
|
-
## Interpretation rules
|
|
14
|
-
|
|
15
|
-
- The most specific document wins when two documents have the same rank.
|
|
16
|
-
- A newer document does not override a higher-ranked document by default.
|
|
17
|
-
- If a lower-ranked document is wrong, fix it instead of following it.
|
|
18
|
-
- If no applicable spec exists for a non-trivial change, create or update one before implementation.
|
|
19
|
-
- If a change would invalidate an ADR, create a superseding ADR instead of silently drifting away from it.
|
|
20
|
-
|
|
21
|
-
## Required reading order for non-trivial changes
|
|
22
|
-
|
|
23
|
-
1. This file
|
|
24
|
-
2. [AI_CONSTITUTION.md](./AI_CONSTITUTION.md)
|
|
25
|
-
3. [ARCHITECTURE.md](./ARCHITECTURE.md)
|
|
26
|
-
4. Relevant spec in [docs/specs](./docs/specs)
|
|
27
|
-
5. Relevant ADR in [docs/adr](./docs/adr)
|
|
28
|
-
6. [DEVELOPMENT_RULES.md](./DEVELOPMENT_RULES.md) and [TESTING_STRATEGY.md](./TESTING_STRATEGY.md)
|
|
29
|
-
|
|
30
|
-
## Escalation rule
|
|
31
|
-
|
|
32
|
-
When a change creates a new lasting rule, boundary, or tradeoff, encode it as a spec or ADR rather than relying on chat history or commit messages.
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# Development Rules
|
|
2
|
-
|
|
3
|
-
## Scope
|
|
4
|
-
|
|
5
|
-
These rules describe how code and documentation are expected to evolve in this repository.
|
|
6
|
-
|
|
7
|
-
## Source layout rules
|
|
8
|
-
|
|
9
|
-
- Keep `index.html` as a static shell with asset references and the single root element.
|
|
10
|
-
- Keep `src/main.ts` limited to bootstrap concerns: imports, `Core.take(...)` registrations, and the single public bootstrap call via `Core()`.
|
|
11
|
-
- Use `.kpa` files for UI composition, local component state, and component-scoped CSS.
|
|
12
|
-
- If logic becomes reusable, asynchronous, or branch-heavy, move it into `.ts` modules under `src/`.
|
|
13
|
-
- Keep `public/` for static assets only.
|
|
14
|
-
- Keep automated tests under `tests/`, split by `unit`, `integration`, and `e2e` only when each level is meaningfully used.
|
|
15
|
-
|
|
16
|
-
## Naming conventions
|
|
17
|
-
|
|
18
|
-
- Custom element names must be kebab-case.
|
|
19
|
-
- Root-level application components should use `app-` prefixes when they represent app shells or app-wide structure.
|
|
20
|
-
- Component filenames should match their primary exported or registered concept.
|
|
21
|
-
- New files and folders should use descriptive names over abbreviations.
|
|
22
|
-
|
|
23
|
-
## Dependency rules
|
|
24
|
-
|
|
25
|
-
- Runtime dependencies must be justified by a concrete need in a spec or ADR.
|
|
26
|
-
- Prefer browser APIs and KoppaJS primitives before adding helper libraries.
|
|
27
|
-
- Keep this repository wired to published npm packages unless there is an explicit ADR stating otherwise.
|
|
28
|
-
- Build tooling changes must update contributor docs and architecture docs in the same change.
|
|
29
|
-
- Quality tooling must stay proportionate to the starter. Prefer one clear tool per job over overlapping stacks.
|
|
30
|
-
|
|
31
|
-
## Coding patterns
|
|
32
|
-
|
|
33
|
-
- Favor simple, local state over premature abstraction.
|
|
34
|
-
- Keep methods short and named by behavior.
|
|
35
|
-
- Avoid hidden side effects during import.
|
|
36
|
-
- Keep CSS local to components unless the style truly applies application-wide.
|
|
37
|
-
- Preserve strict TypeScript settings; do not weaken `tsconfig.json` to work around errors.
|
|
38
|
-
- Give interactive controls stable accessible names when feasible so smoke tests can target public semantics instead of brittle selectors.
|
|
39
|
-
- Keep Playwright assertions user-facing. Implementation-detail checks belong in Vitest, not in browser tests.
|
|
40
|
-
|
|
41
|
-
## Forbidden without a spec and ADR
|
|
42
|
-
|
|
43
|
-
- Introducing routing
|
|
44
|
-
- Adding global state containers
|
|
45
|
-
- Adding network or persistence layers
|
|
46
|
-
- Introducing SSR, multi-page bootstraps, or multiple root entries
|
|
47
|
-
- Switching dependency sourcing from npm packages to local monorepo links
|
|
48
|
-
- Expanding the starter into a multi-feature demo application
|
|
49
|
-
- Adding heavyweight hooks that run the entire suite on every commit
|
|
50
|
-
|
|
51
|
-
## Documentation obligations
|
|
52
|
-
|
|
53
|
-
- Update [ARCHITECTURE.md](./ARCHITECTURE.md) when source layout or runtime flow changes.
|
|
54
|
-
- Update [TESTING_STRATEGY.md](./TESTING_STRATEGY.md) when quality gates or tooling change.
|
|
55
|
-
- Update or create a spec in [docs/specs](./docs/specs) for user-visible changes.
|
|
56
|
-
- Add an ADR in [docs/adr](./docs/adr) for durable technical decisions.
|
|
57
|
-
- Update [docs/quality/quality-gates.md](./docs/quality/quality-gates.md) when scripts, hooks, CI checks, or browser-smoke expectations change.
|