create-quadrokit 0.2.14 → 0.3.1
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 +1 -1
- package/dist/index.mjs +25 -3
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ Interactive mode: run without `--template` / `--dir` / `--name` to be prompted.
|
|
|
34
34
|
1. Copies the chosen template from `create-quadrokit/templates/<name>` when installed from npm, or `packages/templates/<name>` when you run the CLI from the monorepo (skips `node_modules`, `dist`, `.quadrokit`, lockfiles).
|
|
35
35
|
2. Overlays **`template-common/`** (shared across all templates): `.env.example`, `vite.config.ts`, `tailwind.config.ts`, `tsconfig*.json`, `postcss.config.js`, `biome.json`, `src/vite-env.d.ts`, `.cursor/rules/commitlint-conventional.mdc`, etc. In the monorepo, `packages/templates/*` receives the same overlay via `bun run sync:template-common` (root **postinstall** and `bun run build`); those paths are gitignored under `packages/templates/` so only `template-common/` is the source of truth in git.
|
|
36
36
|
3. Rewrites `src/lib/quadro-client.ts` to import from `@quadrokit/generated/client.gen.js` (alias in `vite.config.ts` / `tsconfig.app.json`).
|
|
37
|
-
4. Removes `@quadrokit/sample-client` and rewrites `workspace
|
|
37
|
+
4. Removes `@quadrokit/sample-client` and rewrites any `workspace:…` protocol on `@quadrokit/*` deps to published semver ranges (`package.json` → **`quadrokitScaffoldVersions`**, per package, with fallback `^<create-quadrokit version>`). Update **`quadrokitScaffoldVersions`** when releasing `@quadrokit/client` / `@quadrokit/ui` so `bun install` resolves npm tarballs outside the monorepo. Use **`--keep-workspace`** only for development inside the QuadroKit repo.
|
|
38
38
|
5. Writes `QUADROKIT.md` with proxy and `quadrokit:generate` instructions. Does **not** copy `.quadrokit/generated` — run `bun run quadrokit:generate` after install.
|
|
39
39
|
6. Adds a root `.gitignore` (unless the template already shipped one).
|
|
40
40
|
7. Optionally copies `.env.example` to `.env` (prompt, or defaults with `-y`; use `--no-copy-env` to skip).
|
package/dist/index.mjs
CHANGED
|
@@ -258,7 +258,7 @@ async function injectTemplateCommon(dest) {
|
|
|
258
258
|
}
|
|
259
259
|
await copyTree(common, dest, { skipNames: TEMPLATE_COPY_SKIP });
|
|
260
260
|
}
|
|
261
|
-
/** Caret range
|
|
261
|
+
/** Caret range fallback when a package is not listed in `quadrokitScaffoldVersions`. */
|
|
262
262
|
function quadrokitPublishedSemverRange() {
|
|
263
263
|
try {
|
|
264
264
|
const raw = readFileSync(path.join(packageRoot(), 'package.json'), 'utf8');
|
|
@@ -271,17 +271,39 @@ function quadrokitPublishedSemverRange() {
|
|
|
271
271
|
}
|
|
272
272
|
return '^0.0.0';
|
|
273
273
|
}
|
|
274
|
+
function quadrokitScaffoldVersionMap() {
|
|
275
|
+
try {
|
|
276
|
+
const raw = readFileSync(path.join(packageRoot(), 'package.json'), 'utf8');
|
|
277
|
+
const o = JSON.parse(raw);
|
|
278
|
+
if (o.quadrokitScaffoldVersions && typeof o.quadrokitScaffoldVersions === 'object') {
|
|
279
|
+
return o.quadrokitScaffoldVersions;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
catch {
|
|
283
|
+
/* ignore */
|
|
284
|
+
}
|
|
285
|
+
return {};
|
|
286
|
+
}
|
|
287
|
+
function isWorkspaceProtocol(spec) {
|
|
288
|
+
return spec.startsWith('workspace:');
|
|
289
|
+
}
|
|
274
290
|
function rewriteWorkspaceDeps(pkg) {
|
|
275
291
|
const range = quadrokitPublishedSemverRange();
|
|
292
|
+
const perPkg = quadrokitScaffoldVersionMap();
|
|
276
293
|
for (const key of ['dependencies', 'devDependencies']) {
|
|
277
294
|
const deps = pkg[key];
|
|
278
295
|
if (!deps) {
|
|
279
296
|
continue;
|
|
280
297
|
}
|
|
281
298
|
for (const name of Object.keys(deps)) {
|
|
282
|
-
if (
|
|
283
|
-
|
|
299
|
+
if (!name.startsWith('@quadrokit/')) {
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
const spec = deps[name];
|
|
303
|
+
if (typeof spec !== 'string' || !isWorkspaceProtocol(spec)) {
|
|
304
|
+
continue;
|
|
284
305
|
}
|
|
306
|
+
deps[name] = perPkg[name] ?? range;
|
|
285
307
|
}
|
|
286
308
|
}
|
|
287
309
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-quadrokit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Scaffold a QuadroKit Vite + React app from a template",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./dist/index.mjs",
|
|
@@ -23,5 +23,9 @@
|
|
|
23
23
|
"@types/node": "^25.5.0",
|
|
24
24
|
"@types/prompts": "^2.4.9",
|
|
25
25
|
"typescript": "^5.9.3"
|
|
26
|
+
},
|
|
27
|
+
"quadrokitScaffoldVersions": {
|
|
28
|
+
"@quadrokit/client": "^0.3.0",
|
|
29
|
+
"@quadrokit/ui": "^0.3.0"
|
|
26
30
|
}
|
|
27
31
|
}
|