create-koppajs 1.0.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/README.md +166 -131
  3. package/bin/create-koppajs.js +346 -175
  4. package/package.json +55 -34
  5. package/template/AI_CONSTITUTION.md +50 -0
  6. package/template/ARCHITECTURE.md +86 -0
  7. package/template/CHANGELOG.md +34 -0
  8. package/template/CONTRIBUTING.md +92 -0
  9. package/template/DECISION_HIERARCHY.md +32 -0
  10. package/template/DEVELOPMENT_RULES.md +57 -0
  11. package/template/LICENSE +1 -1
  12. package/template/README.md +241 -49
  13. package/template/RELEASE.md +230 -0
  14. package/template/ROADMAP.md +34 -0
  15. package/template/TESTING_STRATEGY.md +93 -0
  16. package/template/_editorconfig +12 -0
  17. package/template/_gitattributes +1 -0
  18. package/template/_github/instructions/ai-workflow.md +33 -0
  19. package/template/_github/workflows/ci.yml +38 -0
  20. package/template/_github/workflows/release.yml +58 -0
  21. package/template/_gitignore +5 -0
  22. package/template/_husky/commit-msg +8 -0
  23. package/template/_husky/pre-commit +1 -0
  24. package/template/_npmrc +1 -0
  25. package/template/_prettierignore +7 -0
  26. package/template/commitlint.config.mjs +6 -0
  27. package/template/docs/adr/0001-keep-the-starter-minimal.md +32 -0
  28. package/template/docs/adr/0002-adopt-a-living-meta-layer.md +30 -0
  29. package/template/docs/adr/0003-normalize-kpa-plugin-output.md +24 -0
  30. package/template/docs/adr/0004-adopt-an-automated-quality-baseline.md +31 -0
  31. package/template/docs/adr/0005-adopt-a-tag-driven-release-baseline.md +45 -0
  32. package/template/docs/adr/0006-adopt-commit-message-conventions.md +39 -0
  33. package/template/docs/adr/README.md +37 -0
  34. package/template/docs/adr/TEMPLATE.md +18 -0
  35. package/template/docs/architecture/module-boundaries.md +48 -0
  36. package/template/docs/meta/maintenance.md +40 -0
  37. package/template/docs/quality/quality-gates.md +39 -0
  38. package/template/docs/specs/README.md +36 -0
  39. package/template/docs/specs/TEMPLATE.md +34 -0
  40. package/template/docs/specs/app-bootstrap.md +46 -0
  41. package/template/docs/specs/counter-component.md +48 -0
  42. package/template/docs/specs/quality-workflow.md +62 -0
  43. package/template/eslint.config.mjs +54 -0
  44. package/template/package.json +57 -6
  45. package/template/playwright.config.ts +31 -0
  46. package/template/pnpm-lock.yaml +3784 -0
  47. package/template/prettier.config.mjs +6 -0
  48. package/template/src/app-view.kpa +35 -36
  49. package/template/src/counter-component.kpa +87 -87
  50. package/template/src/style.css +5 -5
  51. package/template/tests/e2e/app.spec.ts +18 -0
  52. package/template/tests/integration/main-bootstrap.test.ts +33 -0
  53. package/template/tests/unit/normalize-kpa-module-export.test.ts +46 -0
  54. package/template/tsconfig.json +13 -2
  55. package/template/vite.config.d.mts +7 -0
  56. package/template/vite.config.mjs +39 -4
  57. package/template/vitest.config.mjs +19 -0
  58. package/template-overlays/router/ARCHITECTURE.md +86 -0
  59. package/template-overlays/router/CHANGELOG.md +44 -0
  60. package/template-overlays/router/DEVELOPMENT_RULES.md +57 -0
  61. package/template-overlays/router/README.md +243 -0
  62. package/template-overlays/router/ROADMAP.md +34 -0
  63. package/template-overlays/router/TESTING_STRATEGY.md +67 -0
  64. package/template-overlays/router/docs/adr/0001-keep-the-starter-minimal.md +32 -0
  65. package/template-overlays/router/docs/architecture/module-boundaries.md +39 -0
  66. package/template-overlays/router/docs/meta/maintenance.md +38 -0
  67. package/template-overlays/router/docs/specs/README.md +19 -0
  68. package/template-overlays/router/docs/specs/app-bootstrap.md +42 -0
  69. package/template-overlays/router/docs/specs/router-navigation.md +41 -0
  70. package/template-overlays/router/index.html +14 -0
  71. package/template-overlays/router/package.json +74 -0
  72. package/template-overlays/router/pnpm-lock.yaml +3793 -0
  73. package/template-overlays/router/src/app-view.kpa +128 -0
  74. package/template-overlays/router/src/home-page.kpa +100 -0
  75. package/template-overlays/router/src/main.ts +89 -0
  76. package/template-overlays/router/src/not-found-page.kpa +69 -0
  77. package/template-overlays/router/src/router-page.kpa +102 -0
  78. package/template-overlays/router/src/style.css +51 -0
  79. package/template-overlays/router/tests/e2e/app.spec.ts +38 -0
  80. package/template-overlays/router/tests/integration/main-bootstrap.test.ts +150 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,127 @@
1
+ # Change Log
2
+
3
+ All notable changes to **create-koppajs** 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
+ This changelog documents **intentional milestones and guarantees**,
9
+ not every internal refactor.
10
+
11
+ ---
12
+
13
+ ## [Unreleased]
14
+
15
+ _No unreleased changes yet._
16
+
17
+ ---
18
+
19
+ ## [1.2.0] — Starter Variants And Router Overlay
20
+
21
+ **2026-03-26**
22
+
23
+ ### Added
24
+
25
+ - added an opt-in `router` starter that layers `@koppajs/koppajs-router`, a
26
+ two-page navigation flow, and an explicit fallback route on top of the
27
+ minimal baseline
28
+ - added overlay-based starter support through `template-overlays/` so future
29
+ starter variants can replace only the files that actually differ
30
+
31
+ ### Changed
32
+
33
+ - extended the CLI contract with `--template` and `--router`, plus interactive
34
+ starter selection in TTY runs when no template flag is provided
35
+ - expanded smoke, unit, and generated-template build coverage to validate both
36
+ the default minimal starter and the opt-in router starter
37
+ - updated architecture docs, specs, and ADRs to reflect multi-starter support
38
+
39
+ ---
40
+
41
+ ## [1.1.0] — Starter & Release Baseline Upgrade
42
+
43
+ **2026-03-17**
44
+
45
+ ### Added
46
+
47
+ - Added a repository meta layer covering architecture, decision hierarchy,
48
+ testing strategy, specs, ADRs, quality gates, and AI collaboration rules
49
+ - Added a repository-specific `RELEASE.md` aligned with the `koppajs-core`
50
+ release model and this package's npm publish path
51
+ - Added Conventional Commit enforcement with `commitlint`, Husky, and
52
+ `lint-staged`
53
+ - Added repository-level quality scripts for meta checks, syntax checks,
54
+ formatting hygiene, cleanup, and package dry-run validation
55
+ - Added generated-template build verification and wired it into CI and releases
56
+
57
+ ### Changed
58
+
59
+ - Updated contributing guidance to match the actual scripts, workflows, and
60
+ repository responsibilities
61
+ - Expanded smoke coverage for README patching, invalid project names, and
62
+ scaffolding into an existing empty directory
63
+ - Documented the CI meta-layer presence guard in the quality and architecture
64
+ docs
65
+ - Added importable CLI helper coverage with the Node.js built-in test runner
66
+ - Synced the bundled starter template to the current `koppajs-example`
67
+ technical baseline, including quality tooling, meta docs, tests, and release
68
+ files
69
+ - Switched root CI and release workflows to pnpm-based dependency installation
70
+ so the new hook and commit tooling actually runs in automation
71
+ - Isolated the root pre-commit `lint-staged` config from the generated
72
+ starter's own hook tooling so root commits stay reliable
73
+ - Clarified the starter's supported Node.js lines and added an explicit
74
+ validation guard for unsupported runtimes such as Node 23
75
+
76
+ ---
77
+
78
+ ## [1.0.1] — License & Metadata Fix
79
+
80
+ **2026-03-01**
81
+
82
+ Patch release to align license with the rest of the KoppaJS ecosystem.
83
+ No CLI or template changes.
84
+
85
+ ### Changed
86
+
87
+ - License changed from MIT to Apache License 2.0 (consistent with all KoppaJS projects)
88
+ - Static license badge updated in README
89
+ - Copyright year updated to 2026
90
+
91
+ ---
92
+
93
+ ## [1.0.0] — Initial Stable Release
94
+
95
+ **2026-03-01**
96
+
97
+ First stable release of the official KoppaJS project scaffolder.
98
+
99
+ ### Features
100
+
101
+ - CLI scaffolder: `pnpm create koppajs my-app`
102
+ - Interactive project name prompt when omitted
103
+ - Complete starter template with Vite, TypeScript, and sample `.kpa` components
104
+ - Supports `pnpm`, `npm`, and `npx`
105
+ - Smoke test suite for generated project validation
106
+
107
+ ### Tooling
108
+
109
+ - CI workflow for syntax check and smoke test
110
+ - Tag-driven release workflow for npm publication
111
+ - Code of Conduct and Contributing guidelines
112
+
113
+ ---
114
+
115
+ ## Versioning Policy
116
+
117
+ - Semantic Versioning (SemVer) is followed pragmatically
118
+ - **Breaking changes** include:
119
+ - CLI behavior changes
120
+ - template structure changes
121
+ - Internal refactors without observable behavior change
122
+ do **not** require a major version bump
123
+
124
+ ---
125
+
126
+ _This changelog documents intent.
127
+ If something is not written here, it is not guaranteed._
package/README.md CHANGED
@@ -1,131 +1,166 @@
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="https://www.npmjs.com/package/create-koppajs"><img src="https://img.shields.io/npm/v/create-koppajs?style=flat-square" alt="npm version"></a>
11
- <a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square" alt="License"></a>
12
- </div>
13
-
14
- <br>
15
-
16
- <div align="center">
17
- <h1 align="center">create-koppajs</h1>
18
- <h3 align="center">Scaffold a new KoppaJS project in seconds</h3>
19
- <p align="center">
20
- <i>The fastest way to start building with KoppaJS.</i>
21
- </p>
22
- </div>
23
-
24
- <br>
25
-
26
- <div align="center">
27
- <p align="center">
28
- <a href="https://github.com/koppajs/koppajs-documentation">Documentation</a>
29
- &middot;
30
- <a href="https://github.com/koppajs/koppajs-core">KoppaJS Core</a>
31
- &middot;
32
- <a href="https://github.com/koppajs/koppajs-vite-plugin">Vite Plugin</a>
33
- &middot;
34
- <a href="https://github.com/koppajs/create-koppajs/issues">Issues</a>
35
- </p>
36
- </div>
37
-
38
- <br>
39
-
40
- <details>
41
- <summary>Table of Contents</summary>
42
- <ol>
43
- <li><a href="#what-is-this">What is this?</a></li>
44
- <li><a href="#usage">Usage</a></li>
45
- <li><a href="#what-gets-generated">What gets generated</a></li>
46
- <li><a href="#requirements">Requirements</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
- `create-koppajs` is the **official project scaffolder** for KoppaJS.
57
-
58
- It creates a ready-to-run starter project with a single command — no configuration, no dependencies to install first, no boilerplate to write by hand.
59
-
60
- ---
61
-
62
- ## Usage
63
-
64
- ```bash
65
- pnpm create koppajs my-app
66
- ```
67
-
68
- ```bash
69
- npm create koppajs my-app
70
- ```
71
-
72
- ```bash
73
- npx create-koppajs my-app
74
- ```
75
-
76
- Then:
77
-
78
- ```bash
79
- cd my-app
80
- pnpm install
81
- pnpm dev
82
- ```
83
-
84
- If you omit the project name, the CLI will prompt you for one.
85
-
86
- ---
87
-
88
- ## What gets generated
89
-
90
- ```
91
- my-app/
92
- ├── index.html
93
- ├── package.json
94
- ├── tsconfig.json
95
- ├── vite.config.mjs
96
- ├── .gitignore
97
- ├── LICENSE
98
- ├── README.md
99
- ├── public/
100
- │ └── favicon.svg
101
- └── src/
102
- ├── main.ts
103
- ├── style.css
104
- ├── app-view.kpa
105
- └── counter-component.kpa
106
- ```
107
-
108
- - **Vite** as dev server and bundler
109
- - **TypeScript** support out of the box
110
- - **Two sample components** (app view + counter) to get started
111
- - **Zero unnecessary dependencies**
112
-
113
- ---
114
-
115
- ## Requirements
116
-
117
- - Node.js >= 20
118
-
119
- ---
120
-
121
- ## Community & Contribution
122
-
123
- Issues and pull requests are welcome:
124
-
125
- https://github.com/koppajs/create-koppajs/issues
126
-
127
- ---
128
-
129
- ## License
130
-
131
- Apache-2.0 — © 2026 KoppaJS, Bastian Bensch
1
+ # create-koppajs
2
+
3
+ `create-koppajs` is the official KoppaJS CLI scaffolder. It creates a new
4
+ project by copying the versioned base starter in `template/`, optionally
5
+ applying a supported starter overlay from `template-overlays/`, and patching a
6
+ small, explicit set of identity files.
7
+
8
+ ## Purpose
9
+
10
+ This repository exists to do one job well:
11
+
12
+ - create a fresh project directory
13
+ - copy the current supported KoppaJS starter baseline
14
+ - optionally add a supported starter variant such as `router`
15
+ - preserve a stable, inspectable bootstrap path for new KoppaJS applications
16
+
17
+ It is not a runtime package and it does not own application behavior after
18
+ generation.
19
+
20
+ ## Repository Classification
21
+
22
+ - Repo type: CLI scaffolding package with a bundled starter family
23
+ - Runtime responsibility: one-shot filesystem scaffolding through
24
+ `bin/create-koppajs.js`
25
+ - Build-time responsibility: publish the starter assets, protect the contract,
26
+ and validate tagged releases
27
+ - UI surface: none at the repository root; the generated starter owns the UI
28
+ - Maturity level: stable, contract-governed, maintenance-first
29
+
30
+ ## Ownership Boundaries
31
+
32
+ - `bin/create-koppajs.js` owns argument parsing, prompting, validation, starter
33
+ selection, template copy, placeholder patching, and next-step output.
34
+ - `template/` owns the default `minimal` starter baseline.
35
+ - `template-overlays/` owns the files that differ for opt-in starter variants.
36
+ - `scripts/` and `.github/workflows/` own repository-quality and release
37
+ verification.
38
+ - Root governance files own the repository doctrine and must stay aligned with
39
+ code and workflows.
40
+
41
+ The root package must not take on runtime concerns that belong in generated
42
+ applications, and generated applications must not depend on unpublished root
43
+ files after scaffold completion.
44
+
45
+ ## Public Contract
46
+
47
+ The stable public contract of this repository is:
48
+
49
+ - the `create-koppajs` command and its `--help` / `--version` flags
50
+ - the optional project-name argument and prompt fallback when omitted
51
+ - the optional `--template <name>` and `--router` starter-selection flags
52
+ - the interactive starter-template prompt when no template flag is provided in
53
+ an interactive terminal
54
+ - rejection of invalid project names, invalid template names, and non-empty
55
+ target directories
56
+ - recursive copying of the bundled `template/` directory plus any selected
57
+ overlay
58
+ - restoration of publish-safe dotfiles and dotdirectories during copy
59
+ - patching of generated `package.json`, `README.md`, `CHANGELOG.md`, and
60
+ `RELEASE.md`
61
+ - the generated starter baselines defined by `template/` and
62
+ `template-overlays/`
63
+ - the npm package payload: `bin/`, `template/`, `template-overlays/`,
64
+ `README.md`, `CHANGELOG.md`, and `LICENSE`
65
+
66
+ The governing specs for that contract are:
67
+
68
+ - [docs/specs/cli-scaffolding.md](./docs/specs/cli-scaffolding.md)
69
+ - [docs/specs/template-starter-contract.md](./docs/specs/template-starter-contract.md)
70
+
71
+ ## Usage
72
+
73
+ Default starter:
74
+
75
+ ```bash
76
+ pnpm create koppajs my-app
77
+ ```
78
+
79
+ Router starter:
80
+
81
+ ```bash
82
+ pnpm create koppajs my-app --template router
83
+ ```
84
+
85
+ Alternative entrypoints:
86
+
87
+ ```bash
88
+ npm create koppajs my-app
89
+ ```
90
+
91
+ ```bash
92
+ npx create-koppajs my-app
93
+ ```
94
+
95
+ If the target directory name is omitted, the CLI prompts for one. If no
96
+ template flag is provided in an interactive terminal, the CLI also prompts for
97
+ starter selection. Non-interactive runs default to `minimal`.
98
+
99
+ After generation:
100
+
101
+ ```bash
102
+ cd my-app
103
+ pnpm install
104
+ pnpm dev
105
+ ```
106
+
107
+ ## Requirements
108
+
109
+ - for `create-koppajs`: Node.js `>=20`
110
+ - for generated starter projects: pnpm `>=10` and a starter-supported Node.js
111
+ line, currently `20.19+`, `22.13+`, or `24+`
112
+
113
+ ## Generated Starters
114
+
115
+ The generated project includes one of two supported starters:
116
+
117
+ - `minimal` by default: a small KoppaJS application built on Vite and
118
+ TypeScript
119
+ - `router` as opt-in: the same baseline plus `@koppajs/koppajs-router`, a
120
+ simple two-page navigation flow, and an explicit fallback route
121
+
122
+ Every starter also includes:
123
+
124
+ - quality tooling through ESLint, Prettier, Vitest, and Playwright
125
+ - local workflow guards through Husky, lint-staged, and commitlint
126
+ - starter governance files, ADR/spec structure, and release-process documents
127
+ - GitHub workflows for CI and tagged releases
128
+
129
+ The root repository treats those starters as versioned product surface, not
130
+ test data.
131
+
132
+ ## Ecosystem Fit
133
+
134
+ `create-koppajs` is the canonical entry point for starting a new KoppaJS
135
+ application. It complements:
136
+
137
+ - `@koppajs/koppajs-core` for runtime behavior
138
+ - `@koppajs/koppajs-router` for optional route orchestration in scaffolded apps
139
+ - `@koppajs/koppajs-vite-plugin` for build integration
140
+ - the maintained KoppaJS starter conventions reflected in `template/` and
141
+ `template-overlays/`
142
+
143
+ The repository stays intentionally narrow so the CLI, starter contract, and
144
+ governance baseline can evolve together without hidden behavior.
145
+
146
+ ## Governance
147
+
148
+ The root meta layer defines how this repository changes:
149
+
150
+ - [AI_CONSTITUTION.md](./AI_CONSTITUTION.md)
151
+ - [ARCHITECTURE.md](./ARCHITECTURE.md)
152
+ - [DECISION_HIERARCHY.md](./DECISION_HIERARCHY.md)
153
+ - [DEVELOPMENT_RULES.md](./DEVELOPMENT_RULES.md)
154
+ - [TESTING_STRATEGY.md](./TESTING_STRATEGY.md)
155
+ - [RELEASE.md](./RELEASE.md)
156
+ - [ROADMAP.md](./ROADMAP.md)
157
+ - [docs/meta/README.md](./docs/meta/README.md)
158
+ - [docs/architecture/README.md](./docs/architecture/README.md)
159
+ - [docs/quality/README.md](./docs/quality/README.md)
160
+
161
+ Tagged releases are documented in [CHANGELOG.md](./CHANGELOG.md). Contributor
162
+ workflow rules live in [CONTRIBUTING.md](./CONTRIBUTING.md).
163
+
164
+ ## License
165
+
166
+ Apache License 2.0 — © 2026 KoppaJS, Bastian Bensch