create-clientkit 0.1.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 (32) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +228 -0
  3. package/THIRD-PARTY.md +61 -0
  4. package/bin/cli.js +52 -0
  5. package/dist/cli.js +2556 -0
  6. package/package.json +84 -0
  7. package/templates/astro-tailwind/base/README.md +131 -0
  8. package/templates/astro-tailwind/base/_gitattributes +5 -0
  9. package/templates/astro-tailwind/base/_gitignore +23 -0
  10. package/templates/astro-tailwind/base/_package.json +28 -0
  11. package/templates/astro-tailwind/base/astro.config.mjs +32 -0
  12. package/templates/astro-tailwind/base/public/favicon.svg +5 -0
  13. package/templates/astro-tailwind/base/src/components/Brand.astro +89 -0
  14. package/templates/astro-tailwind/base/src/components/Footer.astro +88 -0
  15. package/templates/astro-tailwind/base/src/components/Header.astro +104 -0
  16. package/templates/astro-tailwind/base/src/components/LaunchNotice.astro +156 -0
  17. package/templates/astro-tailwind/base/src/components/Seo.astro +73 -0
  18. package/templates/astro-tailwind/base/src/components/SocialLinks.astro +75 -0
  19. package/templates/astro-tailwind/base/src/components/StructuredData.astro +39 -0
  20. package/templates/astro-tailwind/base/src/config/site.config.ts +141 -0
  21. package/templates/astro-tailwind/base/src/layouts/BaseLayout.astro +121 -0
  22. package/templates/astro-tailwind/base/src/lib/seo.ts +87 -0
  23. package/templates/astro-tailwind/base/src/pages/404.astro +147 -0
  24. package/templates/astro-tailwind/base/src/pages/index.astro +31 -0
  25. package/templates/astro-tailwind/base/src/pages/robots.txt.ts +32 -0
  26. package/templates/astro-tailwind/base/src/styles/global.css +330 -0
  27. package/templates/astro-tailwind/base/tsconfig.json +11 -0
  28. package/templates/astro-tailwind/modes/coming-soon/_package.json +3 -0
  29. package/templates/astro-tailwind/modes/coming-soon/src/pages/index.astro +149 -0
  30. package/templates/astro-tailwind/modes/full/_package.json +3 -0
  31. package/templates/astro-tailwind/modes/full/src/pages/index.astro +237 -0
  32. package/templates/astro-tailwind/template.json +23 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Joseph K Anoj
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,228 @@
1
+ # create-clientkit
2
+
3
+ **Create the boring foundation of your next client website in seconds.**
4
+
5
+ A scaffolding CLI for developers who build client websites over and over:
6
+ freelancers, agencies and frontend teams. It generates the foundation you
7
+ rebuild every time — layout, Coming Soon page, 404, SEO, robots, sitemap,
8
+ structured data, favicon, accessibility baseline, build config — and then gets
9
+ out of the way.
10
+
11
+ It is **not** a website builder. You own the generated source from the moment
12
+ it lands on disk.
13
+
14
+ ```sh
15
+ npm create clientkit@latest acme-website
16
+ ```
17
+
18
+ ---
19
+
20
+ > **Status: pre-release (0.1.0).** Feature-complete for V1 and verified in CI
21
+ > across Windows, macOS and Linux, but not yet published to npm.
22
+
23
+ ---
24
+
25
+ ## Requirements
26
+
27
+ | | Node.js | Why |
28
+ | -------------- | ------------------ | ---------------------------------- |
29
+ | The CLI | **20.19** or newer | Enforced before anything else runs |
30
+ | Generated site | **22.12** or newer | Astro 7's own floor |
31
+
32
+ The CLI deliberately supports an older Node than the site it generates, so it
33
+ can host future templates with lower floors. Running the CLI on Node 20 works
34
+ and warns before generating that the project itself will need 22.12+.
35
+
36
+ ### Supported platforms
37
+
38
+ | | CLI | Generated site | Covered by the CI matrix |
39
+ | ------- | --- | -------------- | --------------------------------- |
40
+ | Linux | yes | yes | Node 20.19, 22, 24 (site: 22, 24) |
41
+ | Windows | yes | yes | Node 20.19, 22, 24 (site: 22) |
42
+ | macOS | yes | yes | Node 20.19, 22, 24 (site: 22) |
43
+
44
+ > **Verification status.** Windows is verified directly — the full test suite,
45
+ > clean-room packaging and generated-project builds are run there. The Linux
46
+ > and macOS rows describe what `.github/workflows/ci.yml` covers; that
47
+ > workflow has not yet executed on GitHub-hosted runners, so treat those rows
48
+ > as intended coverage rather than observed results until the first CI run.
49
+
50
+ ## Usage
51
+
52
+ ```sh
53
+ npm create clientkit@latest [directory] [options]
54
+ npx create-clientkit@latest [directory] [options]
55
+ ```
56
+
57
+ | Flag | Description |
58
+ | --------------------- | ----------------------------------------- |
59
+ | `-t, --template <id>` | Template to scaffold from |
60
+ | `--list-templates` | List available templates and exit |
61
+ | `--name <name>` | Client / site name |
62
+ | `--url <url>` | Production URL (omit if not decided yet) |
63
+ | `-m, --mode <mode>` | `coming-soon` or `full` |
64
+ | `-y, --yes` | Accept all defaults; never prompt |
65
+ | `--from <file>` | Read answers from a JSON config file |
66
+ | `--dry-run` | Resolve and print the plan; write nothing |
67
+ | `--no-git` | Skip git initialisation |
68
+ | `--no-install` | Skip dependency installation |
69
+ | `--pm <manager>` | Force `npm`, `pnpm`, `yarn` or `bun` |
70
+ | `--debug` | Print diagnostics and full stack traces |
71
+ | `-h, --help` | Show help |
72
+ | `-v, --version` | Show the version |
73
+
74
+ ### Interactive flow
75
+
76
+ Five questions, and the first is skipped when you pass a directory:
77
+
78
+ 1. **Project directory**
79
+ 2. **Client / site name** — defaults to the title-cased directory name
80
+ 3. **Production URL** — optional; skipping it leaves it explicitly unset
81
+ 4. **Starting mode** — Coming Soon, or Full Starter
82
+ 5. **Setup** — install dependencies, initialise git (both on by default)
83
+
84
+ The package manager is detected from `npm_config_user_agent` and never asked
85
+ about. Override it with `--pm`.
86
+
87
+ ### Non-interactive use
88
+
89
+ Every prompt has a matching flag, so a scripted run needs no config file:
90
+
91
+ ```sh
92
+ npm create clientkit@latest acme-website --yes --name "Acme Ltd" --mode full
93
+ ```
94
+
95
+ `--yes` never prompts, and a non-TTY stdin without `--yes` fails immediately
96
+ rather than hanging.
97
+
98
+ ### Config file (`--from`)
99
+
100
+ Strictly JSON — never executed, and never a way around validation. Unknown keys
101
+ and wrong types are errors. See [`example.preset.json`](./example.preset.json).
102
+
103
+ ### Configuration precedence
104
+
105
+ ```
106
+ CLI flags > --from file > interactive answers > template defaults > built-in defaults
107
+ ```
108
+
109
+ Prompts are only issued for values no higher-precedence source supplied.
110
+
111
+ ## Templates and modes
112
+
113
+ One template ships in V1:
114
+
115
+ | Template | Stack | Modes |
116
+ | ---------------- | --------------------------------------- | --------------------- |
117
+ | `astro-tailwind` | Astro 7, Tailwind CSS 4, TypeScript 5.9 | `coming-soon`, `full` |
118
+
119
+ - **`coming-soon`** — a single polished launch page you can put live today.
120
+ - **`full`** — a small home page with sections, on the same design system.
121
+
122
+ Both include the custom 404, the design system and the full SEO layer.
123
+
124
+ ## The generated project
125
+
126
+ ```sh
127
+ cd acme-website
128
+ npm install
129
+ npm run dev
130
+ ```
131
+
132
+ | Script | What it does |
133
+ | ----------------- | -------------------------------------- |
134
+ | `npm run dev` | Start the dev server |
135
+ | `npm run check` | Type-check `.astro` files and the site |
136
+ | `npm run build` | Build the production site to `dist/` |
137
+ | `npm run preview` | Preview the production build |
138
+
139
+ Everything client-specific lives in **`src/config/site.config.ts`**: identity,
140
+ navigation, social links, contact details, launch date, theme accent and SEO.
141
+ Empty means "not set", and the UI omits that piece rather than inventing one.
142
+
143
+ The generated project is `"private": true` and `"license": "UNLICENSED"`,
144
+ because client work is normally proprietary. Change that if the site is meant
145
+ to be open source.
146
+
147
+ ### SEO and the production URL
148
+
149
+ `SITE.url` starts empty and that is a supported state. While it is empty the
150
+ site omits every absolute tag — canonical, `og:url`, the sitemap and the
151
+ sitemap line in `robots.txt` — rather than pointing them at a domain nobody
152
+ owns. Fill it in and they all appear.
153
+
154
+ | `SITE.url` | `SEO.noindex` | Result |
155
+ | ---------- | ------------- | ------------------------------------------------------------ |
156
+ | set | `false` | Canonical, `og:url`, sitemap, `Sitemap:` line in robots.txt |
157
+ | set | `true` | `noindex, nofollow`, no canonical, no sitemap, `Disallow: /` |
158
+ | empty | `false` | No absolute tags, no sitemap, permissive robots.txt |
159
+ | empty | `true` | No absolute tags, no sitemap, `Disallow: /` |
160
+
161
+ `SEO.noindex` defaults to `false`, including for coming-soon pages: a holding
162
+ page that gets indexed is replaced at the next crawl, whereas a `noindex` left
163
+ on after launch keeps the real site invisible.
164
+
165
+ ### Before you deploy
166
+
167
+ 1. Set `SITE.url` in `src/config/site.config.ts` — canonical URLs and the
168
+ sitemap depend on it.
169
+ 2. Replace `public/favicon.svg` with the client's mark.
170
+ 3. Add a 1200×630 image to `public/` and set `SEO.image` if you want social
171
+ previews. No `og:image` is emitted until you do.
172
+ 4. Fill in `CONTACT` and `SOCIAL` — anything left empty is not rendered, and
173
+ not claimed in the structured data.
174
+ 5. `npm run check && npm run build`, then deploy `dist/` as a static site.
175
+
176
+ Only the origin of `SITE.url` is used. To deploy under a subpath, also set
177
+ `base` in `astro.config.mjs`.
178
+
179
+ ## Troubleshooting
180
+
181
+ **`npm create clientkit@latest` runs an old version.** npm caches initializers.
182
+ Clear the npx cache, or run `npm cache clean --force`. The banner prints the
183
+ version actually running.
184
+
185
+ **"requires Node.js 20.19 or newer".** The CLI refuses to run on older Node.
186
+ Upgrade, or use `nvm`/`fnm`.
187
+
188
+ **The generated project fails to install on Node 20.** Expected: Astro 7
189
+ requires Node 22.12+. The CLI warns about this before generating.
190
+
191
+ **"Directory … already exists and is not empty".** The CLI never writes into a
192
+ non-empty directory without asking. Run it interactively to confirm a merge,
193
+ or choose an empty directory. Files the template does not name are never
194
+ touched.
195
+
196
+ **Nothing was written after an error.** By design — generation stages into a
197
+ temporary sibling directory and only moves into place once every file
198
+ succeeds.
199
+
200
+ ## Development
201
+
202
+ ```sh
203
+ npm ci
204
+ npm run typecheck
205
+ npm run lint
206
+ npm run format:check
207
+ npm test
208
+ npm run build
209
+ ```
210
+
211
+ | Script | What it does |
212
+ | ----------------------- | ----------------------------------------------------------- |
213
+ | `npm run smoke` | Pack, install into a clean dir, generate, check and build |
214
+ | `npm run smoke:audit` | The above, plus axe and Lighthouse on each generated site |
215
+ | `npm run check:package` | Validate tarball contents and dependency guards |
216
+ | `npm run third-party` | Regenerate `THIRD-PARTY.md` from the dependency graph |
217
+ | `npm run drift:report` | Compare template pins against the latest published versions |
218
+ | `npm run preflight` | Every release gate, in order |
219
+
220
+ The CLI publishes with `dependencies: {}` — its dependencies are bundled into
221
+ `dist/cli.js` at build time, so `npm create` is one tarball and no dependency
222
+ resolution. See [THIRD-PARTY.md](./THIRD-PARTY.md) and
223
+ [RELEASING.md](./RELEASING.md).
224
+
225
+ ## Licence
226
+
227
+ MIT — see [LICENSE](./LICENSE). Generated client projects are **not** MIT; they
228
+ ship private and unlicensed.
package/THIRD-PARTY.md ADDED
@@ -0,0 +1,61 @@
1
+ # Third-party notices
2
+
3
+ <!--
4
+ Generated by scripts/generate-third-party.mjs from the installed dependency
5
+ graph. Do not edit by hand - run `npm run third-party` instead.
6
+ -->
7
+
8
+ `create-clientkit` publishes with `dependencies: {}`. The libraries below are
9
+ bundled into `dist/cli.js` at build time so that `npm create clientkit@latest`
10
+ costs a single tarball download and no dependency resolution.
11
+
12
+ Their licences and copyright notices are reproduced here as required.
13
+
14
+ | Package | Version | Licence | Copyright |
15
+ | --- | --- | --- | --- |
16
+ | [@clack/core](https://github.com/bombshell-dev/clack) | 0.5.0 | MIT | Nate Moore |
17
+ | [@clack/prompts](https://github.com/bombshell-dev/clack) | 0.11.0 | MIT | Nate Moore |
18
+ | [picocolors]() | 1.1.1 | ISC | Alexey Raspopov |
19
+ | [sisteransi](https://github.com/terkelg/sisteransi) | 1.0.5 | MIT | Terkel Gjervig |
20
+
21
+ ## ISC License
22
+
23
+ Applies to `picocolors`.
24
+
25
+ ```
26
+ Permission to use, copy, modify, and/or distribute this software for any
27
+ purpose with or without fee is hereby granted, provided that the above
28
+ copyright notice and this permission notice appear in all copies.
29
+
30
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
31
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
32
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
33
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
34
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
35
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
36
+ PERFORMANCE OF THIS SOFTWARE.
37
+ ```
38
+
39
+ ## MIT License
40
+
41
+ Applies to `@clack/core`, `@clack/prompts`, `sisteransi`.
42
+
43
+ ```
44
+ Permission is hereby granted, free of charge, to any person obtaining a copy
45
+ of this software and associated documentation files (the "Software"), to deal
46
+ in the Software without restriction, including without limitation the rights
47
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
48
+ copies of the Software, and to permit persons to whom the Software is
49
+ furnished to do so, subject to the following conditions:
50
+
51
+ The above copyright notice and this permission notice shall be included in all
52
+ copies or substantial portions of the Software.
53
+
54
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
56
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
57
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
58
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
59
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
60
+ SOFTWARE.
61
+ ```
package/bin/cli.js ADDED
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * Hard Node version gate.
4
+ *
5
+ * Deliberately written in ES5-compatible syntax with no static imports: an
6
+ * unsupported Node must reach the message below instead of failing to parse the
7
+ * bundle. The bundle is loaded lazily, after the check passes.
8
+ *
9
+ * MIN_NODE is duplicated from src/util/node.ts on purpose; test/node.test.ts
10
+ * asserts that this literal, that module and package.json `engines` agree.
11
+ */
12
+ 'use strict';
13
+
14
+ var MIN_NODE = '20.19.0';
15
+
16
+ function parse(version) {
17
+ var match = /^v?(\d+)\.(\d+)\.(\d+)/.exec(String(version));
18
+ if (!match) return null;
19
+ return [Number(match[1]), Number(match[2]), Number(match[3])];
20
+ }
21
+
22
+ function satisfies(current, minimum) {
23
+ var a = parse(current);
24
+ var b = parse(minimum);
25
+ if (!a || !b) return true;
26
+ for (var i = 0; i < 3; i++) {
27
+ if (a[i] !== b[i]) return a[i] > b[i];
28
+ }
29
+ return true;
30
+ }
31
+
32
+ if (!satisfies(process.versions.node, MIN_NODE)) {
33
+ process.stderr.write(
34
+ 'create-clientkit requires Node.js ' +
35
+ MIN_NODE +
36
+ ' or newer, but found ' +
37
+ process.versions.node +
38
+ '.\n' +
39
+ ' Upgrade Node.js, or use a version manager such as nvm or fnm.\n',
40
+ );
41
+ process.exit(1);
42
+ }
43
+
44
+ import('../dist/cli.js').then(
45
+ function (module) {
46
+ return module.run();
47
+ },
48
+ function (error) {
49
+ process.stderr.write('create-clientkit failed to start: ' + (error && error.message) + '\n');
50
+ process.exit(1);
51
+ },
52
+ );