create-quadrokit 0.2.1 → 0.2.2

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 CHANGED
@@ -27,7 +27,7 @@ Interactive mode: run without `--template` / `--dir` to be prompted for those; y
27
27
 
28
28
  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).
29
29
  2. Rewrites `src/lib/quadro-client.ts` to import from `../../.quadrokit/generated/client.gen.js`.
30
- 3. Removes `@quadrokit/sample-client` and rewrites other `workspace:*` deps to published semver (`@quadrokit/client` `^0.2.1`, other `@quadrokit/*` `^0.2.0`) unless `--keep-workspace`.
30
+ 3. Removes `@quadrokit/sample-client` and rewrites `workspace:*` on `@quadrokit/*` deps to `^<version>` matching **create-quadrokit**’s own `package.json` `version` (run `bun run version:set` at repo root to bump public packages) unless `--keep-workspace`.
31
31
  4. Writes `QUADROKIT.md` with proxy and `quadrokit:generate` instructions. Does **not** copy `.quadrokit/generated` — run `bun run quadrokit:generate` after install.
32
32
  5. Optionally runs `git init` and installs dependencies (`bun` if available, otherwise `npm`).
33
33
 
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { spawnSync } from 'node:child_process';
3
+ import { readFileSync } from 'node:fs';
3
4
  import { cp, mkdir, readdir, readFile, stat, writeFile } from 'node:fs/promises';
4
5
  import path from 'node:path';
5
6
  import { fileURLToPath } from 'node:url';
@@ -151,15 +152,29 @@ async function copyTemplate(src, dest) {
151
152
  }
152
153
  }
153
154
  }
155
+ /** Caret range for published @quadrokit/* deps (matches create-quadrokit release line). */
156
+ function quadrokitPublishedSemverRange() {
157
+ try {
158
+ const raw = readFileSync(path.join(packageRoot(), 'package.json'), 'utf8');
159
+ const v = JSON.parse(raw).version;
160
+ if (v)
161
+ return `^${v}`;
162
+ }
163
+ catch {
164
+ /* ignore */
165
+ }
166
+ return '^0.0.0';
167
+ }
154
168
  function rewriteWorkspaceDeps(pkg) {
169
+ const range = quadrokitPublishedSemverRange();
155
170
  for (const key of ['dependencies', 'devDependencies']) {
156
171
  const deps = pkg[key];
157
172
  if (!deps) {
158
173
  continue;
159
174
  }
160
175
  for (const name of Object.keys(deps)) {
161
- if (deps[name] === 'workspace:*') {
162
- deps[name] = name === '@quadrokit/client' ? '^0.2.1' : '^0.2.0';
176
+ if (deps[name] === 'workspace:*' && name.startsWith('@quadrokit/')) {
177
+ deps[name] = range;
163
178
  }
164
179
  }
165
180
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-quadrokit",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Scaffold a QuadroKit Vite + React app from a template",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.mjs",