create-zoijs 0.1.4 → 0.3.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 +142 -88
- package/LICENSE +21 -21
- package/README.md +98 -97
- package/bin/create-zoijs.js +197 -171
- package/core-cdn.json +36 -0
- package/package.json +44 -43
- package/templates/app/README.md +68 -48
- package/templates/app/_gitignore +1 -1
- package/templates/app/dev-server.mjs +124 -74
- package/templates/app/index.html +24 -22
- package/templates/app/jsconfig.json +2 -2
- package/templates/app/package.json +12 -12
- package/templates/app/src/app.js +98 -98
- package/templates/app/src/components/Header.js +16 -16
- package/templates/app/src/components/StatCard.js +13 -13
- package/templates/app/src/components/TaskItem.js +18 -18
- package/templates/app/src/style.css +241 -241
- package/templates/basic/README.md +50 -30
- package/templates/basic/_gitignore +1 -1
- package/templates/basic/dev-server.mjs +124 -74
- package/templates/basic/index.html +24 -22
- package/templates/basic/jsconfig.json +2 -2
- package/templates/basic/package.json +12 -12
- package/templates/basic/src/app.js +18 -18
- package/templates/basic/src/style.css +33 -33
- package/templates/library/package.json +2 -2
- package/templates/minimal/README.md +29 -8
- package/templates/minimal/dev-server.mjs +124 -0
- package/templates/minimal/index.html +5 -3
- package/templates/minimal/package.json +9 -0
- package/templates/typescript/README.md +20 -0
- package/templates/typescript/_gitignore +1 -1
- package/templates/typescript/dev-server.mjs +124 -74
- package/templates/typescript/index.html +24 -22
- package/templates/typescript/package.json +1 -1
- package/templates/typescript/src/style.css +33 -33
- package/templates/app/_vscode/extensions.json +0 -7
- package/templates/basic/_vscode/extensions.json +0 -7
- package/templates/library/_vscode/extensions.json +0 -7
- package/templates/typescript/_vscode/extensions.json +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,88 +1,142 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to `create-zoijs` are documented here.
|
|
4
|
-
|
|
5
|
-
## 0.
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
`
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
`@zoijs/core`
|
|
88
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `create-zoijs` are documented here.
|
|
4
|
+
|
|
5
|
+
## 0.3.0 — 2026-10-12
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- **New apps use `@zoijs/core` 1.10.0.** Package templates depend on `^1.10.0` and the `minimal`
|
|
9
|
+
template loads core 1.10.0 from jsDelivr with an integrity hash for every module file
|
|
10
|
+
(`core-cdn.json`, regenerated from the published tarball). 1.10.0 fixes SVG/MathML lists,
|
|
11
|
+
style bindings under a strict `style-src` CSP, `each()` item spread/`JSON.stringify`, multi-root
|
|
12
|
+
list items, and class bindings that wiped classes added by other code — see the core CHANGELOG.
|
|
13
|
+
- **Scaffolded apps are editor-neutral.** The `app`, `basic`, `typescript` and `library`
|
|
14
|
+
templates no longer write `.vscode/extensions.json`, which recommended three third-party
|
|
15
|
+
extensions. Zoijs doesn't recommend editors or editor extensions; autocomplete and
|
|
16
|
+
optional type-checking still come from the types every package ships, through the
|
|
17
|
+
`jsconfig.json` (`app`, `basic`) or `tsconfig.json` (`typescript`, `library`) that the
|
|
18
|
+
templates keep. Existing apps are unaffected — delete `.vscode/` if you don't want it.
|
|
19
|
+
|
|
20
|
+
## 0.2.0 — 2026-10-05
|
|
21
|
+
|
|
22
|
+
### Security
|
|
23
|
+
- **Generated apps pin `@zoijs/core` exactly and securely (SEC-7).** Templates allowed `^1.1.0` /
|
|
24
|
+
`^1.2.0` (older than the 1.7.0 URL-guard fixes), and the `minimal` template loaded a floating
|
|
25
|
+
`esm.sh/@zoijs/core@1` URL with no integrity check. Every template now takes its core version from
|
|
26
|
+
one file, `core-cdn.json` (an exact, published version plus a jsDelivr import map with a sha384
|
|
27
|
+
integrity hash for every module file, generated from the npm tarball and verified at release):
|
|
28
|
+
package templates get `^<that version>`, and `minimal` gets the exact, integrity-pinned import map.
|
|
29
|
+
- **Hardened the scaffolded dev server (SEC-6)** (templates `app`, `basic`, `typescript`).
|
|
30
|
+
It listened on every network interface, served dotfiles (`/.env`, `/.git/config`, `.npmrc`)
|
|
31
|
+
and followed symlinks out of the project to anyone on the LAN, and a malformed URL such as
|
|
32
|
+
`/%E0` crashed it. It now listens on `127.0.0.1` only (opt into the LAN explicitly with
|
|
33
|
+
`ZOIJS_HOST=0.0.0.0`, which prints a warning), never serves a path with a dot-segment,
|
|
34
|
+
confines every file — including symlink targets — to the project folder (package-manager
|
|
35
|
+
links under `node_modules/` excepted), answers malformed or null-byte paths with `400`
|
|
36
|
+
and keeps running, and sends `X-Content-Type-Options: nosniff` and `Cache-Control: no-store`.
|
|
37
|
+
`npm run dev` and the URL it prints are unchanged.
|
|
38
|
+
- **The `minimal` template no longer recommends `npx serve`.** `npx serve . -l 7310`
|
|
39
|
+
downloaded a mutable package at run time and used that package's own (non-loopback)
|
|
40
|
+
defaults. `minimal` now ships the same hardened `dev-server.mjs` as the other templates,
|
|
41
|
+
plus a dependency-free `package.json` whose `dev` script runs it — still nothing to
|
|
42
|
+
install (`@zoijs/core` stays on the integrity-pinned CDN). All four template copies of
|
|
43
|
+
the server are byte-identical, and a test enforces that.
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
- **Deploy guidance for the production entry (SEC-4).** Every app template's README and
|
|
47
|
+
`index.html` explain switching the import map to `@zoijs/core`'s production entry
|
|
48
|
+
(`src/prod.js`: no dev warnings, no devtools hook) before deploying. `minimal`'s map
|
|
49
|
+
already carries the integrity hash for `prod.js`.
|
|
50
|
+
- **"Next steps" match the template.** `minimal` prints `npm run dev` with no install step;
|
|
51
|
+
`library` prints `npm install` / `npm test` instead of a `dev` script it doesn't have.
|
|
52
|
+
|
|
53
|
+
### Changed
|
|
54
|
+
- **Generated apps target `@zoijs/core` 1.9.0.** Package templates depend on `^1.9.0`; the
|
|
55
|
+
`minimal` template's import map points at the exact 1.9.0 files on jsDelivr with an sha384
|
|
56
|
+
integrity hash for every module, including the production entry `src/prod.js` (first
|
|
57
|
+
shipped in 1.9.0), so the deploy step in each README works as written.
|
|
58
|
+
|
|
59
|
+
## 0.1.4 — 2026-06-27
|
|
60
|
+
|
|
61
|
+
Scaffolded apps now come with editor config for a great out-of-the-box experience —
|
|
62
|
+
no toolchain required. The CLI API and the app code are unchanged.
|
|
63
|
+
|
|
64
|
+
- **`.vscode/extensions.json`** (templates `app`, `basic`, `typescript`, `library`) —
|
|
65
|
+
recommends a highlighter for `` html`` `` templates (`bierner.lit-html`), the ESLint
|
|
66
|
+
extension, and Prettier. VS Code suggests them when you open the project.
|
|
67
|
+
- **`jsconfig.json`** (templates `app`, `basic`) — IntelliSense (autocomplete, hover,
|
|
68
|
+
go-to-definition) from the types every Zoijs package ships, with no build step. Flip
|
|
69
|
+
`checkJs` on to also type-check your JavaScript. (The `typescript` and `library`
|
|
70
|
+
templates already carry a `tsconfig.json`.)
|
|
71
|
+
- See the [Editor Setup guide](https://zoijs.dev/editor-setup).
|
|
72
|
+
|
|
73
|
+
## 0.1.3 — 2026-06-26
|
|
74
|
+
|
|
75
|
+
Three new templates (now five total). No change to existing templates or the CLI
|
|
76
|
+
API; `app` stays the default.
|
|
77
|
+
|
|
78
|
+
- **`typescript`** — the counter as **type-checked JavaScript**: `// @ts-check` +
|
|
79
|
+
a strict `tsconfig.json` + `npm run typecheck` (`tsc --noEmit`) give full
|
|
80
|
+
TypeScript safety using `@zoijs/core`'s shipped types, with **no build step** (the
|
|
81
|
+
browser runs the `.js` as-is). Keeps the dev server on 7310.
|
|
82
|
+
- **`minimal`** — the smallest scaffold: two flat files (`index.html` + `app.js`)
|
|
83
|
+
loading `@zoijs/core` from a CDN. No `package.json`, no install, no dev server —
|
|
84
|
+
run with `npx serve . -l 7310`.
|
|
85
|
+
- **`library`** — a starter for authoring a Zoijs-based package: `src/index.js` +
|
|
86
|
+
hand-written `index.d.ts`, an `exports`/`types` `package.json` with a peer
|
|
87
|
+
dependency on `@zoijs/core`, and a `node:test` suite — the shape the official
|
|
88
|
+
optional packages use.
|
|
89
|
+
- The scaffolder now treats `.ts`/`.d.ts` as text (token substitution), and the
|
|
90
|
+
CLI's own `npm test` targets its own test file so it no longer runs the
|
|
91
|
+
templates' bundled test files.
|
|
92
|
+
|
|
93
|
+
## 0.1.2 — 2026-06-26
|
|
94
|
+
|
|
95
|
+
Dev-server output polish. No CLI API changes; same zero-dependency server on the
|
|
96
|
+
same ports.
|
|
97
|
+
|
|
98
|
+
- **Cleaner banner:** `npm run dev` now prints a tidy banner with the local URL
|
|
99
|
+
on its own line, and only mentions fallback ports when one was actually busy:
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
Zoijs dev server
|
|
103
|
+
|
|
104
|
+
- Local: http://localhost:7310
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
(Previously a single `ZoiJS dev server: http://localhost:7310` line plus a
|
|
108
|
+
static `If busy: …` note.) Plain ASCII so it renders cleanly in every terminal,
|
|
109
|
+
including the Windows console. Brand casing normalized to **Zoijs**. Still port
|
|
110
|
+
**7310** with **7311 / 7312 / 7313** fallbacks; still Node built-ins only.
|
|
111
|
+
|
|
112
|
+
## 0.1.1 — 2026-06-25
|
|
113
|
+
|
|
114
|
+
Starter polish. No CLI API changes.
|
|
115
|
+
|
|
116
|
+
- **Dev server:** generated apps now run `npm run dev` on a tiny zero-dependency
|
|
117
|
+
static server (`dev-server.mjs`, Node built-ins only) that uses port **7310**
|
|
118
|
+
and falls back to **7311 / 7312 / 7313** if busy — replacing the old default
|
|
119
|
+
of port 3000. It prints `ZoiJS dev server: http://localhost:<port>`.
|
|
120
|
+
- **Default `app` template redesigned** into a polished "project dashboard":
|
|
121
|
+
a hero header, a reusable `StatCard` (used ×4), filter chips (All / Active /
|
|
122
|
+
Done), an empty state, and a developer-hint footer — demonstrating component
|
|
123
|
+
composition, conditional rendering, and filtering alongside `createState` /
|
|
124
|
+
`computed` / `each` and parent⇄child communication. Still depends only on
|
|
125
|
+
`@zoijs/core`; still no build step.
|
|
126
|
+
- **`basic` template** keeps the minimal counter and adopts the same dev server.
|
|
127
|
+
|
|
128
|
+
## 0.1.0 — 2026-06-25
|
|
129
|
+
|
|
130
|
+
Initial release of the Zoijs starter CLI.
|
|
131
|
+
|
|
132
|
+
- `npm create zoijs@latest my-app` — scaffold a new Zoijs app in one command.
|
|
133
|
+
- Uses the provided folder name as the project name; derives `package.json`
|
|
134
|
+
`name` (lowercased) and a readable `index.html` `<title>` from it.
|
|
135
|
+
- Two templates: `app` (default — a small task dashboard demonstrating
|
|
136
|
+
`html` / `mount` / `createState` / `computed` / `each` and parent⇄child
|
|
137
|
+
communication) and `basic` (a minimal counter). Select with `--template`.
|
|
138
|
+
- Validates the project name (npm-safe) and refuses to overwrite a non-empty
|
|
139
|
+
directory.
|
|
140
|
+
- Generated apps are plain HTML/CSS/JS with **no build step** and depend only on
|
|
141
|
+
`@zoijs/core` (served via an import map from `node_modules`).
|
|
142
|
+
- Zero runtime dependencies; the CLI is a single small file.
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Zoijs contributors
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zoijs contributors
|
|
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
CHANGED
|
@@ -1,97 +1,98 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
# create-zoijs
|
|
4
|
-
|
|
5
|
-
**Create a new [Zoijs](https://zoijs.dev) app with one command.** Plain HTML, CSS, and JavaScript — no build step.
|
|
6
|
-
|
|
7
|
-
[](https://www.npmjs.com/package/create-zoijs)
|
|
8
|
-
[](LICENSE)
|
|
9
|
-
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Usage
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm create zoijs@latest my-app
|
|
18
|
-
cd my-app
|
|
19
|
-
npm install
|
|
20
|
-
npm run dev
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
`npm run dev` starts a tiny zero-dependency static server (no `serve`, no
|
|
24
|
-
bundler, no build step):
|
|
25
|
-
|
|
26
|
-
```text
|
|
27
|
-
Zoijs dev server
|
|
28
|
-
|
|
29
|
-
- Local: http://localhost:7310
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
(It falls back to 7311–7313 if the port is busy.)
|
|
33
|
-
|
|
34
|
-
Or with `npx`:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npx create-zoijs my-app
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
> **A note on the name.** npm maps `npm create zoijs` to the package
|
|
41
|
-
> `create-zoijs` (that's npm's convention for `npm create <name>`), which is why
|
|
42
|
-
> this package is `create-zoijs` rather than `@zoijs/create`.
|
|
43
|
-
|
|
44
|
-
## Naming your app
|
|
45
|
-
|
|
46
|
-
The folder name you pass becomes the project name:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
npm create zoijs@latest task-manager
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
produces a `package.json` with `"name": "task-manager"` and an `index.html`
|
|
53
|
-
with `<title>Task Manager</title>`. If you don't pass a name, the CLI asks for
|
|
54
|
-
one.
|
|
55
|
-
|
|
56
|
-
## Templates
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
npm create zoijs@latest my-app # default: the "app" template
|
|
60
|
-
npm create zoijs@latest my-app --template app # a polished project dashboard
|
|
61
|
-
npm create zoijs@latest my-app --template basic # a basic counter
|
|
62
|
-
npm create zoijs@latest my-app --template typescript # type-checked JS, no build step
|
|
63
|
-
npm create zoijs@latest my-app --template minimal # two flat files, CDN, no install
|
|
64
|
-
npm create zoijs@latest my-app --template library # author a Zoijs-based package
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
- **`app`** (default) — a polished project dashboard (hero, stat cards, filters,
|
|
68
|
-
empty state) showing `html`, `mount`, `createState`, `computed`, `each`,
|
|
69
|
-
conditional rendering, and parent⇄child component communication.
|
|
70
|
-
- **`basic`** — a basic counter, a small local app with a dev server.
|
|
71
|
-
- **`typescript`** — the counter as type-checked JavaScript (`// @ts-check` +
|
|
72
|
-
strict `tsconfig.json` + `npm run typecheck`). Full TS safety, **no build step**.
|
|
73
|
-
- **`minimal`** — the smallest scaffold: two flat files loading `@zoijs/core` from a
|
|
74
|
-
CDN
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# create-zoijs
|
|
4
|
+
|
|
5
|
+
**Create a new [Zoijs](https://zoijs.dev) app with one command.** Plain HTML, CSS, and JavaScript — no build step.
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/create-zoijs)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm create zoijs@latest my-app
|
|
18
|
+
cd my-app
|
|
19
|
+
npm install
|
|
20
|
+
npm run dev
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`npm run dev` starts a tiny zero-dependency static server (no `serve`, no
|
|
24
|
+
bundler, no build step):
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
Zoijs dev server
|
|
28
|
+
|
|
29
|
+
- Local: http://localhost:7310
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
(It falls back to 7311–7313 if the port is busy.)
|
|
33
|
+
|
|
34
|
+
Or with `npx`:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx create-zoijs my-app
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
> **A note on the name.** npm maps `npm create zoijs` to the package
|
|
41
|
+
> `create-zoijs` (that's npm's convention for `npm create <name>`), which is why
|
|
42
|
+
> this package is `create-zoijs` rather than `@zoijs/create`.
|
|
43
|
+
|
|
44
|
+
## Naming your app
|
|
45
|
+
|
|
46
|
+
The folder name you pass becomes the project name:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm create zoijs@latest task-manager
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
produces a `package.json` with `"name": "task-manager"` and an `index.html`
|
|
53
|
+
with `<title>Task Manager</title>`. If you don't pass a name, the CLI asks for
|
|
54
|
+
one.
|
|
55
|
+
|
|
56
|
+
## Templates
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm create zoijs@latest my-app # default: the "app" template
|
|
60
|
+
npm create zoijs@latest my-app --template app # a polished project dashboard
|
|
61
|
+
npm create zoijs@latest my-app --template basic # a basic counter
|
|
62
|
+
npm create zoijs@latest my-app --template typescript # type-checked JS, no build step
|
|
63
|
+
npm create zoijs@latest my-app --template minimal # two flat files, CDN, no install
|
|
64
|
+
npm create zoijs@latest my-app --template library # author a Zoijs-based package
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
- **`app`** (default) — a polished project dashboard (hero, stat cards, filters,
|
|
68
|
+
empty state) showing `html`, `mount`, `createState`, `computed`, `each`,
|
|
69
|
+
conditional rendering, and parent⇄child component communication.
|
|
70
|
+
- **`basic`** — a basic counter, a small local app with a dev server.
|
|
71
|
+
- **`typescript`** — the counter as type-checked JavaScript (`// @ts-check` +
|
|
72
|
+
strict `tsconfig.json` + `npm run typecheck`). Full TS safety, **no build step**.
|
|
73
|
+
- **`minimal`** — the smallest scaffold: two flat files loading `@zoijs/core` from a
|
|
74
|
+
CDN (exact version, integrity-pinned). No install — `npm run dev` runs the same
|
|
75
|
+
hardened dev server as the other templates.
|
|
76
|
+
- **`library`** — a starter for authoring a Zoijs-based package: `src` + `.d.ts`,
|
|
77
|
+
`exports`/`types`, a peer dep on `@zoijs/core`, and a `node:test` suite.
|
|
78
|
+
|
|
79
|
+
## What it does
|
|
80
|
+
|
|
81
|
+
- Copies a template, fills in the app name, and prints the next commands to run.
|
|
82
|
+
- Validates the name (npm-safe) and won't overwrite a non-empty folder.
|
|
83
|
+
|
|
84
|
+
## What it does **not** do
|
|
85
|
+
|
|
86
|
+
By design, to keep Zoijs simple: no build system, no bundler, no compiler, no
|
|
87
|
+
JSX transform, no code generation, no plugin system, no template DSL, and no
|
|
88
|
+
complex prompts. The generated app is plain files you can read.
|
|
89
|
+
|
|
90
|
+
## You don't need this tool
|
|
91
|
+
|
|
92
|
+
Zoijs works without the CLI — it's only a convenience. You can create an app by
|
|
93
|
+
hand with an import map and a `<script type="module">`, or with
|
|
94
|
+
`npm install @zoijs/core`. See the [Start guide](https://zoijs.dev/start).
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
[MIT](LICENSE) © Zoijs contributors
|