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 +1 -1
- package/dist/index.mjs +17 -2
- package/package.json +1 -1
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
|
|
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] =
|
|
176
|
+
if (deps[name] === 'workspace:*' && name.startsWith('@quadrokit/')) {
|
|
177
|
+
deps[name] = range;
|
|
163
178
|
}
|
|
164
179
|
}
|
|
165
180
|
}
|