@nzz/q-cli 2.2.4 → 2.2.6
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 +6 -3
- package/dist/commands/newCustomCode.js +5 -8
- package/dist/index.js +0 -0
- package/package.json +22 -21
- package/src/index.ts +24 -0
package/README.md
CHANGED
|
@@ -70,10 +70,13 @@ Q update-item -e local -c ./tests/q.config.json
|
|
|
70
70
|
|
|
71
71
|
## Release
|
|
72
72
|
|
|
73
|
-
Changes to the Q-cli won't be automatically released by the CI/CD. After the changes have been merged into the `main` branch, and the changeset got applied, the Q-cli needs to be manually published
|
|
73
|
+
Changes to the Q-cli won't be automatically released by the CI/CD. After the changes have been merged into the `main` branch, and the changeset got applied, the Q-cli needs to be manually published.
|
|
74
|
+
|
|
75
|
+
Use `pnpm publish` (not `npm publish`) so `catalog:` deps are rewritten to real versions in the published package. `npm publish` ships `catalog:` as-is and breaks `npm install -g @nzz/q-cli`.
|
|
74
76
|
|
|
75
77
|
```bash
|
|
76
78
|
pnpm build
|
|
77
|
-
|
|
78
|
-
npm publish
|
|
79
|
+
pnpm publish
|
|
79
80
|
```
|
|
81
|
+
|
|
82
|
+
Optional: run `pnpm pack` first and inspect the tarball's `package.json` to confirm `catalog:` was replaced with concrete versions.
|
|
@@ -39,19 +39,16 @@ function newCustomCode(command) {
|
|
|
39
39
|
execSync(`git sparse-checkout set ${skeletonCustomCodeDir}`);
|
|
40
40
|
console.log('Pulling content from remote...');
|
|
41
41
|
execSync('git pull origin main');
|
|
42
|
-
// Remove all files, except the skeletons directory
|
|
42
|
+
// Remove all files, except the skeletons directory.
|
|
43
|
+
// Use rmSync (not stat+unlink): cone sparse-checkout also pulls monorepo root
|
|
44
|
+
// files, including CLAUDE.md → AGENTS.md. Deleting AGENTS.md first would make
|
|
45
|
+
// CLAUDE.md a dangling symlink; statSync follows it and throws ENOENT.
|
|
43
46
|
console.log('Cleaning up...');
|
|
44
47
|
const cwdFiles = fs.readdirSync(process.cwd());
|
|
45
48
|
for (const file of cwdFiles) {
|
|
46
49
|
if (file === skeletonDir)
|
|
47
50
|
continue; // Skip the skeletons directory
|
|
48
|
-
|
|
49
|
-
if (fs.statSync(filePath).isDirectory()) {
|
|
50
|
-
fs.rmSync(filePath, { recursive: true, force: true });
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
fs.unlinkSync(filePath);
|
|
54
|
-
}
|
|
51
|
+
fs.rmSync(path.join(process.cwd(), file), { recursive: true, force: true });
|
|
55
52
|
}
|
|
56
53
|
// Copy the skeletons/custom-code-project content to the root
|
|
57
54
|
const cwdSkeletonCustomCodeDir = path.join(process.cwd(), skeletonCustomCodeDir);
|
package/dist/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nzz/q-cli",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -10,19 +10,6 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
|
-
"scripts": {
|
|
14
|
-
"build": "tsc && npm run copy-assets",
|
|
15
|
-
"copy-assets": "cp -R src/assets dist/",
|
|
16
|
-
"create-custom-code-item": "tsx ./src/index.ts create-custom-code-item -e local -c ./tests/q.config.json -t 'TEST CUSTOM CODE ITEM'",
|
|
17
|
-
"update-item": "tsx ./src/index.ts update-item -e local -c ./tests/q.config.json",
|
|
18
|
-
"new-custom-code": "tsx ./src/index.ts new-custom-code my-custom-code-project",
|
|
19
|
-
"test": "vitest",
|
|
20
|
-
"test:run": "vitest run",
|
|
21
|
-
"test:coverage": "vitest run --coverage",
|
|
22
|
-
"eslint": "TIMING=1 eslint --ext .svelte,.ts --config .eslintrc.cjs .",
|
|
23
|
-
"lint:all": "run-s -c tscheck lint svelte-check",
|
|
24
|
-
"tscheck": "tsc --noEmit"
|
|
25
|
-
},
|
|
26
13
|
"author": "",
|
|
27
14
|
"license": "MIT",
|
|
28
15
|
"dependencies": {
|
|
@@ -33,12 +20,26 @@
|
|
|
33
20
|
"node-fetch": "^3.3.2"
|
|
34
21
|
},
|
|
35
22
|
"devDependencies": {
|
|
36
|
-
"@
|
|
37
|
-
"@repo/types-db": "workspace:^",
|
|
38
|
-
"@repo/types-files": "workspace:^",
|
|
39
|
-
"@vitest/coverage-v8": "^3.0.8",
|
|
40
|
-
"delivery-server": "workspace:*",
|
|
23
|
+
"@vitest/coverage-v8": "^4.1.5",
|
|
41
24
|
"typescript": "^5.9.3",
|
|
42
|
-
"vitest": "^
|
|
25
|
+
"vitest": "^4.1.5",
|
|
26
|
+
"@repo/types-custom-code": "^1.4.0",
|
|
27
|
+
"@repo/types-db": "^1.4.1",
|
|
28
|
+
"delivery-server": "3.12.9",
|
|
29
|
+
"eslint-config-custom": "2.0.0",
|
|
30
|
+
"@repo/types-files": "^1.2.0"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc && npm run copy-assets",
|
|
34
|
+
"copy-assets": "cp -R src/assets dist/",
|
|
35
|
+
"create-custom-code-item": "tsx ./src/index.ts create-custom-code-item -e local -c ./tests/q.config.json -t 'TEST CUSTOM CODE ITEM'",
|
|
36
|
+
"update-item": "tsx ./src/index.ts update-item -e local -c ./tests/q.config.json",
|
|
37
|
+
"new-custom-code": "tsx ./src/index.ts new-custom-code my-custom-code-project",
|
|
38
|
+
"test": "vitest",
|
|
39
|
+
"test:run": "vitest run",
|
|
40
|
+
"test:coverage": "vitest run --coverage",
|
|
41
|
+
"eslint": "TIMING=1 eslint .",
|
|
42
|
+
"lint:all": "run-s -c tscheck lint svelte-check",
|
|
43
|
+
"tscheck": "tsc --noEmit"
|
|
43
44
|
}
|
|
44
|
-
}
|
|
45
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander';
|
|
4
|
+
import packageJson from '../package.json' with { type: 'json' };
|
|
5
|
+
import { createCreateCustomCodeItemCommand } from './commands/createCustomCodeItem.js';
|
|
6
|
+
import { createUpdateItemCommand } from './commands/updateItem.js';
|
|
7
|
+
import { createNewCustomCodeCommand } from './commands/newCustomCode.js';
|
|
8
|
+
|
|
9
|
+
const program = new Command();
|
|
10
|
+
const version = packageJson.version;
|
|
11
|
+
|
|
12
|
+
async function main() {
|
|
13
|
+
program.version(version).description('Q Toolbox cli');
|
|
14
|
+
|
|
15
|
+
createNewCustomCodeCommand(program);
|
|
16
|
+
|
|
17
|
+
createUpdateItemCommand(program);
|
|
18
|
+
|
|
19
|
+
createCreateCustomCodeItemCommand(program);
|
|
20
|
+
|
|
21
|
+
await program.parseAsync(process.argv);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
main();
|