@rshono/create 1.0.0-rc.6 → 1.0.0-rc.7
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/README.md +54 -45
- package/dist/api.mjs +1 -1
- package/dist/cli.mjs +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -26,49 +26,72 @@ arrived in pnpm 10.16, before which it is `pnpm dlx`.
|
|
|
26
26
|
|
|
27
27
|
Six, each with a default, and each answerable by a flag instead:
|
|
28
28
|
|
|
29
|
-
| Question | Default | Flag
|
|
30
|
-
| --------------------- | ------------------ |
|
|
31
|
-
| Where should it go? | `my-rshono-app` | first positional argument, or `.`
|
|
32
|
-
| Where is it deployed? | `node` |
|
|
33
|
-
| Styling | plain CSS | `--tailwind` / `--no-tailwind`
|
|
34
|
-
| Formatting & linting | Prettier + oxlint | `--quality prettier-oxlint\|prettier-eslint\|biome\|oxc\|none`
|
|
35
|
-
| Install dependencies? | yes | `--no-install`
|
|
36
|
-
| Initialize git? | yes, unless nested | `--no-git`
|
|
37
|
-
|
|
38
|
-
Plus `--formatter` and `--linter` to set either half
|
|
39
|
-
the
|
|
40
|
-
`--
|
|
41
|
-
given. **A non-interactive terminal implies `-y`**,
|
|
29
|
+
| Question | Default | Flag |
|
|
30
|
+
| --------------------- | ------------------ | -------------------------------------------------------------- |
|
|
31
|
+
| Where should it go? | `my-rshono-app` | first positional argument, or `.` |
|
|
32
|
+
| Where is it deployed? | `node` | `-d, --deploy node\|cloudflare\|vercel\|aws-lambda` |
|
|
33
|
+
| Styling | plain CSS | `--tailwind` / `--no-tailwind` |
|
|
34
|
+
| Formatting & linting | Prettier + oxlint | `--quality prettier-oxlint\|prettier-eslint\|biome\|oxc\|none` |
|
|
35
|
+
| Install dependencies? | yes | `--no-install` |
|
|
36
|
+
| Initialize git? | yes, unless nested | `--no-git` |
|
|
37
|
+
|
|
38
|
+
Plus `--formatter prettier\|biome\|oxfmt\|none` and `--linter oxlint\|eslint\|biome\|none` to set either half
|
|
39
|
+
of the quality preset on its own, `--pm npm\|pnpm\|yarn\|bun` to override the package manager that was
|
|
40
|
+
detected, `--force` to scaffold into a directory that is not empty, `--dry-run` to see the file list and write
|
|
41
|
+
nothing, and `-y` to take the defaults for everything not given. **A non-interactive terminal implies `-y`**,
|
|
42
|
+
so this is one command in CI or from an agent:
|
|
42
43
|
|
|
43
44
|
```bash
|
|
44
45
|
npx @rshono/create@latest my-app -y --deploy cloudflare --tailwind --quality biome
|
|
45
46
|
```
|
|
46
47
|
|
|
47
|
-
The deploy targets, and the deploy command each one prints, are generated from the framework's own
|
|
48
|
-
|
|
48
|
+
The deploy targets, and the deploy command each one prints, are generated from the framework's own presets —
|
|
49
|
+
a target added to rshono appears here with no edit.
|
|
49
50
|
|
|
50
51
|
## What you get
|
|
51
52
|
|
|
52
53
|
```
|
|
54
|
+
package.json scripts, and the exact dependency versions rshono is tested against
|
|
53
55
|
rshono.config.ts the chosen deploy target; every other setting takes its default
|
|
54
56
|
tsconfig.json strict, with @/* → ./src/*
|
|
55
57
|
.env committed defaults; secrets go in .env.local
|
|
58
|
+
.gitignore plus whatever each chosen feature adds, under a heading naming it
|
|
59
|
+
README.md the app's own commands, layout and deploy step
|
|
56
60
|
public/ favicon.svg, robots.txt
|
|
57
61
|
src/routes.ts one page, a 404 and a 500
|
|
58
62
|
src/server.ts error reporting, trailing-slash and old-path redirects, AppType
|
|
59
63
|
src/components/ layout, home, 404, 500
|
|
60
64
|
src/styles.css element-level CSS, or the Tailwind entry
|
|
65
|
+
src/env.d.ts the CSS-import declaration the compiler needs
|
|
61
66
|
pnpm-workspace.yaml pnpm only: which dependency install scripts this app runs (none of them)
|
|
62
67
|
```
|
|
63
68
|
|
|
64
|
-
Scaffolding runs the install and nothing else — no formatter, no linter. The templates are written to
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
Scaffolding runs the install and nothing else — no formatter, no linter. The templates are written to satisfy
|
|
70
|
+
every formatter option at its configured width, so a fresh project passes its own `format:check` without a
|
|
71
|
+
write pass first.
|
|
67
72
|
|
|
68
73
|
`react` and `react-dom` are pinned **exactly**, at the versions the framework is tested against, and those
|
|
69
74
|
pins are generated from rshono's own manifest. That is not tidiness: the RSC runtime reaches into React's
|
|
70
75
|
internals, and an app installed with npm or bun has no workspace overrides to keep a single copy of it.
|
|
71
76
|
|
|
77
|
+
## Two things worth knowing
|
|
78
|
+
|
|
79
|
+
**The ESLint preset pins TypeScript 6.** Linting TypeScript with ESLint means `typescript-eslint`, which reads
|
|
80
|
+
the compiler API directly rather than through a stable interface, so its peer range is
|
|
81
|
+
`typescript >=4.8.4 <6.1.0` — below the TypeScript rshono is built and tested against. An app that chooses
|
|
82
|
+
ESLint therefore gets `typescript ~6.0.3`, the newest that range allows: `npm install` would otherwise fail
|
|
83
|
+
outright on the conflict, and forcing past it hands you a linter running against a compiler API it was never
|
|
84
|
+
built for. The framework's declarations compile identically under either version, which is what makes this the
|
|
85
|
+
app's pin and not the framework's — every other preset leaves TypeScript alone. What you trade for type-aware
|
|
86
|
+
rules is a compiler one major behind, and the JavaScript implementation rather than the native one, so
|
|
87
|
+
`typecheck` on a large app is several times slower. When upstream widens the range, the pin in
|
|
88
|
+
`features/quality.ts` is the only thing to delete.
|
|
89
|
+
|
|
90
|
+
**Tailwind is four packages, a `postcss.config.mjs` and one rule in `rshono.config.ts`.** rshono compiles CSS
|
|
91
|
+
natively and has no PostCSS in it — that is deliberate, and it means an app that wants a plugin chain brings
|
|
92
|
+
its own, through the `rspack` hook. The overlay writes all of it, with a comment saying what to delete to go
|
|
93
|
+
back to plain CSS.
|
|
94
|
+
|
|
72
95
|
## Adding an option
|
|
73
96
|
|
|
74
97
|
Every difference between two scaffolds is a `Feature` — files to overlay, dependencies, scripts,
|
|
@@ -77,37 +100,19 @@ edits and no new machinery:
|
|
|
77
100
|
|
|
78
101
|
1. A `Feature` in `src/features/` — `templates/<id>` for the files it brings, plus whatever it adds to the
|
|
79
102
|
manifest.
|
|
80
|
-
2. The template directory itself, as **real files**. They are copied over the base, so an overlay replaces
|
|
81
|
-
|
|
82
|
-
|
|
103
|
+
2. The template directory itself, as **real files**. They are copied over the base, so an overlay replaces a
|
|
104
|
+
file rather than patching it, and template files stay valid TypeScript that an editor can check. `_name`
|
|
105
|
+
becomes `.name` on write, because npm strips a literal `.gitignore` out of a published tarball.
|
|
83
106
|
3. A prompt in `src/cli.ts`, if it deserves a question of its own — and a flag, which it always does.
|
|
84
107
|
|
|
85
|
-
`plan(answers)` is pure: answers in, a `Map` of path → contents out, no directory touched. That is what
|
|
86
|
-
makes the whole matrix of options testable in milliseconds (`test/plan.test.mjs`) and `--dry-run` free. It
|
|
87
|
-
|
|
108
|
+
`plan(answers, pm)` is pure: answers in, a `Map` of path → contents out, no directory touched. That is what
|
|
109
|
+
makes the whole matrix of options testable in milliseconds (`test/plan.test.mjs`) and `--dry-run` free. It is
|
|
110
|
+
also exported, for a tool that wants to scaffold without the prompts:
|
|
88
111
|
|
|
89
112
|
```ts
|
|
90
113
|
import { plan, writePlan } from '@rshono/create';
|
|
91
114
|
```
|
|
92
115
|
|
|
93
|
-
## Two things worth knowing
|
|
94
|
-
|
|
95
|
-
**The ESLint preset pins TypeScript 6.** Linting TypeScript with ESLint means `typescript-eslint`, which
|
|
96
|
-
reads the compiler API directly rather than through a stable interface, so its peer range is
|
|
97
|
-
`typescript >=4.8.4 <6.1.0` — below the TypeScript rshono is built and tested against. An app that chooses
|
|
98
|
-
ESLint therefore gets `typescript ~6.0.3`, the newest that range allows: `npm install` would otherwise fail
|
|
99
|
-
outright on the conflict, and forcing past it hands you a linter running against a compiler API it was never
|
|
100
|
-
built for. The framework's declarations compile identically under either version, which is what makes this
|
|
101
|
-
the app's pin and not the framework's — every other preset leaves TypeScript alone. What you trade for
|
|
102
|
-
type-aware rules is a compiler one major behind, and the JavaScript implementation rather than the native
|
|
103
|
-
one, so `typecheck` on a large app is several times slower. When upstream widens the range, the pin in
|
|
104
|
-
`features/quality.ts` is the only thing to delete.
|
|
105
|
-
|
|
106
|
-
**Tailwind is four packages, a `postcss.config.mjs` and one rule in `rshono.config.ts`.** rshono compiles
|
|
107
|
-
CSS natively and has no PostCSS in it — that is deliberate, and it means an app that wants a plugin chain
|
|
108
|
-
brings its own, through the `rspack` hook. The overlay writes all of it, with a comment saying what to
|
|
109
|
-
delete to go back to plain CSS.
|
|
110
|
-
|
|
111
116
|
## Development
|
|
112
117
|
|
|
113
118
|
```bash
|
|
@@ -117,9 +122,13 @@ CREATE_RSHONO_E2E=1 pnpm --filter @rshono/create test # also: pack, install an
|
|
|
117
122
|
```
|
|
118
123
|
|
|
119
124
|
`plan.test.mjs` is the fast one — the whole matrix of answers in memory, no directory touched.
|
|
120
|
-
`cli.test.mjs` spawns the real bin against temp directories, which is where argument parsing and the
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
`cli.test.mjs` spawns the real bin against temp directories, which is where argument parsing and the refusal
|
|
126
|
+
to overwrite somebody's files are checked. `e2e.test.mjs` is the opt-in one, and the only one that installs
|
|
127
|
+
anything.
|
|
128
|
+
|
|
129
|
+
`src/generated/framework.ts` — the rshono version, the Node range, the dependency pins and the deploy target
|
|
130
|
+
list — is written by `scripts/codegen.mjs` from `packages/core`, so `pnpm --filter @rshono/create codegen` is
|
|
131
|
+
what picks up a change there.
|
|
123
132
|
|
|
124
133
|
`@clack/prompts` (MIT) is bundled rather than depended on, so `npx @rshono/create` downloads one tarball
|
|
125
134
|
before it can ask its first question.
|
package/dist/api.mjs
CHANGED
|
@@ -79,7 +79,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
79
79
|
|
|
80
80
|
;// CONCATENATED MODULE: ./src/generated/framework.ts
|
|
81
81
|
// GENERATED by scripts/codegen.mjs from packages/core — do not edit. Run `pnpm --filter @rshono/create codegen`.
|
|
82
|
-
/** The framework release a scaffolded app is pinned to: this package and rshono ship together. */ const RSHONO_VERSION = '1.0.0-rc.
|
|
82
|
+
/** The framework release a scaffolded app is pinned to: this package and rshono ship together. */ const RSHONO_VERSION = '1.0.0-rc.7';
|
|
83
83
|
/**
|
|
84
84
|
* The Node range rshono itself declares, restated in every scaffolded app's `engines` — so a CI image
|
|
85
85
|
* or a contributor on an older Node hears it from their package manager rather than from a stack trace.
|
package/dist/cli.mjs
CHANGED
|
@@ -2943,7 +2943,7 @@ function hasGit(cwd) {
|
|
|
2943
2943
|
|
|
2944
2944
|
;// CONCATENATED MODULE: ./src/generated/framework.ts
|
|
2945
2945
|
// GENERATED by scripts/codegen.mjs from packages/core — do not edit. Run `pnpm --filter @rshono/create codegen`.
|
|
2946
|
-
/** The framework release a scaffolded app is pinned to: this package and rshono ship together. */ const RSHONO_VERSION = '1.0.0-rc.
|
|
2946
|
+
/** The framework release a scaffolded app is pinned to: this package and rshono ship together. */ const RSHONO_VERSION = '1.0.0-rc.7';
|
|
2947
2947
|
/**
|
|
2948
2948
|
* The Node range rshono itself declares, restated in every scaffolded app's `engines` — so a CI image
|
|
2949
2949
|
* or a contributor on an older Node hears it from their package manager rather than from a stack trace.
|
|
@@ -3840,7 +3840,7 @@ function fail(message) {
|
|
|
3840
3840
|
async function main() {
|
|
3841
3841
|
const { values, positionals } = parse();
|
|
3842
3842
|
if (values.help) return console.log(HELP);
|
|
3843
|
-
if (values.version) return console.log("1.0.0-rc.
|
|
3843
|
+
if (values.version) return console.log("1.0.0-rc.7");
|
|
3844
3844
|
/*
|
|
3845
3845
|
* A pipe, a CI job or an agent gets the defaults rather than a prompt nothing can answer. Both streams
|
|
3846
3846
|
* have to be a terminal: the prompts draw on stdout but *read from stdin*, so `echo | npx @rshono/create`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rshono/create",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.7",
|
|
4
4
|
"description": "Scaffold a new rshono app — Hono + Rspack + React Server Components",
|
|
5
5
|
"author": "Lasse <lasse@lassetange.com> (https://www.lassetange.com)",
|
|
6
6
|
"license": "ISC",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@rspack/core": "2.1.5",
|
|
47
47
|
"@types/node": "^26.1.1",
|
|
48
48
|
"typescript": "^7.0.2",
|
|
49
|
-
"@rshono/core": "1.0.0-rc.
|
|
49
|
+
"@rshono/core": "1.0.0-rc.7"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "node scripts/codegen.mjs && node scripts/build.mjs",
|