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.
- package/CHANGELOG.md +127 -0
- package/README.md +166 -131
- package/bin/create-koppajs.js +346 -175
- package/package.json +55 -34
- package/template/AI_CONSTITUTION.md +50 -0
- package/template/ARCHITECTURE.md +86 -0
- package/template/CHANGELOG.md +34 -0
- package/template/CONTRIBUTING.md +92 -0
- package/template/DECISION_HIERARCHY.md +32 -0
- package/template/DEVELOPMENT_RULES.md +57 -0
- package/template/LICENSE +1 -1
- package/template/README.md +241 -49
- package/template/RELEASE.md +230 -0
- package/template/ROADMAP.md +34 -0
- package/template/TESTING_STRATEGY.md +93 -0
- package/template/_editorconfig +12 -0
- package/template/_gitattributes +1 -0
- package/template/_github/instructions/ai-workflow.md +33 -0
- package/template/_github/workflows/ci.yml +38 -0
- package/template/_github/workflows/release.yml +58 -0
- package/template/_gitignore +5 -0
- package/template/_husky/commit-msg +8 -0
- package/template/_husky/pre-commit +1 -0
- package/template/_npmrc +1 -0
- package/template/_prettierignore +7 -0
- package/template/commitlint.config.mjs +6 -0
- package/template/docs/adr/0001-keep-the-starter-minimal.md +32 -0
- package/template/docs/adr/0002-adopt-a-living-meta-layer.md +30 -0
- package/template/docs/adr/0003-normalize-kpa-plugin-output.md +24 -0
- package/template/docs/adr/0004-adopt-an-automated-quality-baseline.md +31 -0
- package/template/docs/adr/0005-adopt-a-tag-driven-release-baseline.md +45 -0
- package/template/docs/adr/0006-adopt-commit-message-conventions.md +39 -0
- package/template/docs/adr/README.md +37 -0
- package/template/docs/adr/TEMPLATE.md +18 -0
- package/template/docs/architecture/module-boundaries.md +48 -0
- package/template/docs/meta/maintenance.md +40 -0
- package/template/docs/quality/quality-gates.md +39 -0
- package/template/docs/specs/README.md +36 -0
- package/template/docs/specs/TEMPLATE.md +34 -0
- package/template/docs/specs/app-bootstrap.md +46 -0
- package/template/docs/specs/counter-component.md +48 -0
- package/template/docs/specs/quality-workflow.md +62 -0
- package/template/eslint.config.mjs +54 -0
- package/template/package.json +57 -6
- package/template/playwright.config.ts +31 -0
- package/template/pnpm-lock.yaml +3784 -0
- package/template/prettier.config.mjs +6 -0
- package/template/src/app-view.kpa +35 -36
- package/template/src/counter-component.kpa +87 -87
- package/template/src/style.css +5 -5
- package/template/tests/e2e/app.spec.ts +18 -0
- package/template/tests/integration/main-bootstrap.test.ts +33 -0
- package/template/tests/unit/normalize-kpa-module-export.test.ts +46 -0
- package/template/tsconfig.json +13 -2
- package/template/vite.config.d.mts +7 -0
- package/template/vite.config.mjs +39 -4
- package/template/vitest.config.mjs +19 -0
- package/template-overlays/router/ARCHITECTURE.md +86 -0
- package/template-overlays/router/CHANGELOG.md +44 -0
- package/template-overlays/router/DEVELOPMENT_RULES.md +57 -0
- package/template-overlays/router/README.md +243 -0
- package/template-overlays/router/ROADMAP.md +34 -0
- package/template-overlays/router/TESTING_STRATEGY.md +67 -0
- package/template-overlays/router/docs/adr/0001-keep-the-starter-minimal.md +32 -0
- package/template-overlays/router/docs/architecture/module-boundaries.md +39 -0
- package/template-overlays/router/docs/meta/maintenance.md +38 -0
- package/template-overlays/router/docs/specs/README.md +19 -0
- package/template-overlays/router/docs/specs/app-bootstrap.md +42 -0
- package/template-overlays/router/docs/specs/router-navigation.md +41 -0
- package/template-overlays/router/index.html +14 -0
- package/template-overlays/router/package.json +74 -0
- package/template-overlays/router/pnpm-lock.yaml +3793 -0
- package/template-overlays/router/src/app-view.kpa +128 -0
- package/template-overlays/router/src/home-page.kpa +100 -0
- package/template-overlays/router/src/main.ts +89 -0
- package/template-overlays/router/src/not-found-page.kpa +69 -0
- package/template-overlays/router/src/router-page.kpa +102 -0
- package/template-overlays/router/src/style.css +51 -0
- package/template-overlays/router/tests/e2e/app.spec.ts +38 -0
- package/template-overlays/router/tests/integration/main-bootstrap.test.ts +150 -0
|
@@ -0,0 +1,86 @@
|
|
|
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.
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Setup
|
|
4
|
+
|
|
5
|
+
Requirements:
|
|
6
|
+
|
|
7
|
+
- Node.js 20.19+, 22.13+, or 24+
|
|
8
|
+
- pnpm 10 or newer
|
|
9
|
+
|
|
10
|
+
Node 23 is intentionally not part of the supported range because the current
|
|
11
|
+
upstream frontend tooling excludes it.
|
|
12
|
+
|
|
13
|
+
Install and run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm install
|
|
17
|
+
pnpm dev
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Install the Playwright browser once if you plan to run browser smoke tests locally:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pnpm exec playwright install chromium
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Useful commands:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pnpm lint
|
|
30
|
+
pnpm format:check
|
|
31
|
+
pnpm typecheck
|
|
32
|
+
pnpm test:run
|
|
33
|
+
pnpm test:coverage
|
|
34
|
+
pnpm test:e2e
|
|
35
|
+
pnpm check
|
|
36
|
+
pnpm validate
|
|
37
|
+
pnpm release:check
|
|
38
|
+
pnpm build
|
|
39
|
+
pnpm serve
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Commit messages use Conventional Commits.
|
|
43
|
+
Examples:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
feat: add release baseline
|
|
47
|
+
docs: update contributing guide
|
|
48
|
+
fix: align bootstrap docs
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Workflow
|
|
52
|
+
|
|
53
|
+
1. Read [DECISION_HIERARCHY.md](./DECISION_HIERARCHY.md), [ARCHITECTURE.md](./ARCHITECTURE.md), and any relevant spec or ADR before changing source files.
|
|
54
|
+
2. For non-trivial work, update or create the relevant spec in [docs/specs](./docs/specs) first.
|
|
55
|
+
3. If the change alters architecture, tooling, public tags, or repository workflow, add or update an ADR in [docs/adr](./docs/adr).
|
|
56
|
+
4. Implement the smallest change that satisfies the spec.
|
|
57
|
+
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.
|
|
58
|
+
6. If the change touches versioning, changelog, or release automation, update `CHANGELOG.md`, `RELEASE.md`, and the affected workflow in the same change.
|
|
59
|
+
7. Update architecture, development, testing, and README docs when the actual project state changes.
|
|
60
|
+
|
|
61
|
+
## Releases
|
|
62
|
+
|
|
63
|
+
- Release notes live in [`CHANGELOG.md`](./CHANGELOG.md).
|
|
64
|
+
- The maintainer release procedure lives in [`RELEASE.md`](./RELEASE.md).
|
|
65
|
+
- Releases are prepared on `develop`, moved through `release/*`, merged into `main`, and tagged as `vX.Y.Z`.
|
|
66
|
+
- The release workflow creates GitHub Releases only. The repository starts
|
|
67
|
+
`private`, so no npm publish step is configured by default.
|
|
68
|
+
- Run `pnpm release:check` before cutting a release tag.
|
|
69
|
+
|
|
70
|
+
## Commit policy
|
|
71
|
+
|
|
72
|
+
- Commit messages are validated by `.husky/commit-msg` using `commitlint`.
|
|
73
|
+
- Use Conventional Commits such as `feat: ...`, `fix: ...`, `docs: ...`, `test: ...`, `ci: ...`, or `chore: ...`.
|
|
74
|
+
- Keep the commit header at 72 characters or fewer.
|
|
75
|
+
- Merge, revert, `fixup!`, and `squash!` commits may bypass validation when Git creates them automatically.
|
|
76
|
+
|
|
77
|
+
## Pull request expectations
|
|
78
|
+
|
|
79
|
+
- Keep the starter minimal unless expansion is explicitly approved.
|
|
80
|
+
- Explain user-visible behavior changes and architecture-impacting decisions.
|
|
81
|
+
- Do not silently swap dependency sources, add build tools, or introduce new subsystems.
|
|
82
|
+
- Keep docs and code aligned in the same change.
|
|
83
|
+
- Keep hooks fast; heavy validation belongs in `pnpm validate` and CI, not in `pre-commit`.
|
|
84
|
+
|
|
85
|
+
## AI-assisted contributions
|
|
86
|
+
|
|
87
|
+
AI contributors follow the same rules as humans:
|
|
88
|
+
|
|
89
|
+
- read governing docs before editing,
|
|
90
|
+
- prefer existing patterns,
|
|
91
|
+
- do not invent architecture casually,
|
|
92
|
+
- update the meta layer whenever structure or rules change.
|
|
@@ -0,0 +1,32 @@
|
|
|
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.
|
|
@@ -0,0 +1,57 @@
|
|
|
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.
|
package/template/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2026 Bastian Bensch
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/template/README.md
CHANGED
|
@@ -1,49 +1,241 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
1
|
+
<a id="readme-top"></a>
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="https://public-assets-1b57ca06-687a-4142-a525-0635f7649a5c.s3.eu-central-1.amazonaws.com/koppajs/koppajs-logo-text-900x226.png" width="500" alt="KoppaJS Logo">
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<br>
|
|
8
|
+
|
|
9
|
+
<div align="center">
|
|
10
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square" alt="License"></a>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<br>
|
|
14
|
+
|
|
15
|
+
<div align="center">
|
|
16
|
+
<h1 align="center">__PROJECT_NAME__</h1>
|
|
17
|
+
<h3 align="center">KoppaJS starter project</h3>
|
|
18
|
+
<p align="center">
|
|
19
|
+
<i>Scaffolded from the current official KoppaJS starter baseline.</i>
|
|
20
|
+
</p>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<br>
|
|
24
|
+
|
|
25
|
+
<div align="center">
|
|
26
|
+
<p align="center">
|
|
27
|
+
<a href="https://github.com/koppajs/koppajs-documentation">Documentation</a>
|
|
28
|
+
·
|
|
29
|
+
<a href="https://github.com/koppajs/koppajs-core">KoppaJS Core</a>
|
|
30
|
+
·
|
|
31
|
+
<a href="https://github.com/koppajs/koppajs-vite-plugin">Vite Plugin</a>
|
|
32
|
+
</p>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<br>
|
|
36
|
+
|
|
37
|
+
<details>
|
|
38
|
+
<summary>Table of Contents</summary>
|
|
39
|
+
<ol>
|
|
40
|
+
<li><a href="#what-is-this">What is this?</a></li>
|
|
41
|
+
<li><a href="#requirements">Requirements</a></li>
|
|
42
|
+
<li><a href="#getting-started">Getting Started</a></li>
|
|
43
|
+
<li><a href="#quality-workflow">Quality Workflow</a></li>
|
|
44
|
+
<li><a href="#release-workflow">Release Workflow</a></li>
|
|
45
|
+
<li><a href="#project-structure">Project Structure</a></li>
|
|
46
|
+
<li><a href="#meta-layer">Meta Layer</a></li>
|
|
47
|
+
<li><a href="#community--contribution">Community & Contribution</a></li>
|
|
48
|
+
<li><a href="#license">License</a></li>
|
|
49
|
+
</ol>
|
|
50
|
+
</details>
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## What is this?
|
|
55
|
+
|
|
56
|
+
This project was scaffolded from the current official minimal starter baseline
|
|
57
|
+
for KoppaJS.
|
|
58
|
+
|
|
59
|
+
It keeps the runtime intentionally small:
|
|
60
|
+
|
|
61
|
+
- one HTML shell
|
|
62
|
+
- one TypeScript bootstrap file
|
|
63
|
+
- one root view
|
|
64
|
+
- one stateful child component
|
|
65
|
+
|
|
66
|
+
It also carries a small quality baseline so the starter stays runnable and trustworthy:
|
|
67
|
+
|
|
68
|
+
- ESLint for source and tooling files
|
|
69
|
+
- Prettier plus `.editorconfig` for supported text formats
|
|
70
|
+
- Vitest for local unit and integration coverage
|
|
71
|
+
- Playwright for a real-browser smoke test
|
|
72
|
+
- Husky plus lint-staged for fast staged-file checks
|
|
73
|
+
- Conventional Commits enforcement via `commitlint`
|
|
74
|
+
- a tag-driven GitHub release baseline with `CHANGELOG.md` and `RELEASE.md`
|
|
75
|
+
|
|
76
|
+
Use it as a starting point for new KoppaJS projects or as a reference for how components are registered, composed, and validated.
|
|
77
|
+
|
|
78
|
+
> **Note:** This repository uses published npm packages, so it works as a standalone starter after `pnpm install`.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Requirements
|
|
83
|
+
|
|
84
|
+
- Node.js 20.19+, 22.13+, or 24+
|
|
85
|
+
- pnpm >= 10
|
|
86
|
+
|
|
87
|
+
Node 23 is intentionally not treated as supported here because the current
|
|
88
|
+
upstream frontend toolchain excludes it.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Getting Started
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
pnpm install
|
|
96
|
+
pnpm dev
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Install the Playwright browser once if you want to run the browser smoke test locally:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
pnpm exec playwright install chromium
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Useful commands:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
pnpm lint
|
|
109
|
+
pnpm format:check
|
|
110
|
+
pnpm typecheck
|
|
111
|
+
pnpm test:run
|
|
112
|
+
pnpm test:coverage
|
|
113
|
+
pnpm build
|
|
114
|
+
pnpm serve
|
|
115
|
+
pnpm release:check
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Commit messages follow Conventional Commits, for example:
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
feat: add release workflow
|
|
122
|
+
docs: update starter governance
|
|
123
|
+
fix: align counter button labels
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Quality Workflow
|
|
129
|
+
|
|
130
|
+
Fast local baseline:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
pnpm check
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Full validation, including Playwright:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
pnpm validate
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Standalone browser smoke test:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
pnpm test:e2e
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Release Workflow
|
|
151
|
+
|
|
152
|
+
Tagged releases are documented in `CHANGELOG.md`.
|
|
153
|
+
The maintainer procedure lives in `RELEASE.md`.
|
|
154
|
+
|
|
155
|
+
Release tags must use the form `vX.Y.Z` and match `package.json`.
|
|
156
|
+
The included automation creates GitHub Releases only. If your project later
|
|
157
|
+
needs npm publishing or deployment-specific release steps, update `RELEASE.md`
|
|
158
|
+
and `.github/workflows/release.yml` together.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Project Structure
|
|
163
|
+
|
|
164
|
+
```text
|
|
165
|
+
__PROJECT_NAME__/
|
|
166
|
+
├── .editorconfig
|
|
167
|
+
├── .github/
|
|
168
|
+
├── .gitignore
|
|
169
|
+
├── .husky/
|
|
170
|
+
├── .npmrc
|
|
171
|
+
├── .prettierignore
|
|
172
|
+
├── CHANGELOG.md
|
|
173
|
+
├── commitlint.config.mjs
|
|
174
|
+
├── AI_CONSTITUTION.md
|
|
175
|
+
├── ARCHITECTURE.md
|
|
176
|
+
├── CONTRIBUTING.md
|
|
177
|
+
├── DECISION_HIERARCHY.md
|
|
178
|
+
├── DEVELOPMENT_RULES.md
|
|
179
|
+
├── RELEASE.md
|
|
180
|
+
├── ROADMAP.md
|
|
181
|
+
├── TESTING_STRATEGY.md
|
|
182
|
+
├── eslint.config.mjs
|
|
183
|
+
├── index.html
|
|
184
|
+
├── package.json
|
|
185
|
+
├── playwright.config.ts
|
|
186
|
+
├── pnpm-lock.yaml
|
|
187
|
+
├── prettier.config.mjs
|
|
188
|
+
├── tsconfig.json
|
|
189
|
+
├── vite.config.mjs
|
|
190
|
+
├── vitest.config.mjs
|
|
191
|
+
├── docs/
|
|
192
|
+
│ ├── adr/
|
|
193
|
+
│ ├── architecture/
|
|
194
|
+
│ ├── meta/
|
|
195
|
+
│ ├── quality/
|
|
196
|
+
│ └── specs/
|
|
197
|
+
├── public/
|
|
198
|
+
│ └── favicon.svg
|
|
199
|
+
├── src/
|
|
200
|
+
│ ├── main.ts
|
|
201
|
+
│ ├── style.css
|
|
202
|
+
│ ├── app-view.kpa
|
|
203
|
+
│ └── counter-component.kpa
|
|
204
|
+
└── tests/
|
|
205
|
+
├── e2e/
|
|
206
|
+
├── integration/
|
|
207
|
+
└── unit/
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Meta Layer
|
|
213
|
+
|
|
214
|
+
The repository includes an explicit meta layer so architecture, testing, and contributor rules evolve together with the codebase.
|
|
215
|
+
|
|
216
|
+
Start here:
|
|
217
|
+
|
|
218
|
+
- `DECISION_HIERARCHY.md`
|
|
219
|
+
- `AI_CONSTITUTION.md`
|
|
220
|
+
- `ARCHITECTURE.md`
|
|
221
|
+
- `DEVELOPMENT_RULES.md`
|
|
222
|
+
- `TESTING_STRATEGY.md`
|
|
223
|
+
- `CHANGELOG.md`
|
|
224
|
+
- `RELEASE.md`
|
|
225
|
+
- `docs/quality/quality-gates.md`
|
|
226
|
+
- `docs/adr/`
|
|
227
|
+
- `docs/specs/`
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Community & Contribution
|
|
232
|
+
|
|
233
|
+
Contribution workflow details live in `CONTRIBUTING.md`.
|
|
234
|
+
Update this section with your own repository links once the project has a
|
|
235
|
+
canonical home.
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## License
|
|
240
|
+
|
|
241
|
+
Apache License 2.0 — © 2026 KoppaJS, Bastian Bensch
|