From 53020ba718b07b7a22a224d54b33aa8ce44ffa28 Mon Sep 17 00:00:00 2001 From: Mohammad Bagher Abiyat Date: Tue, 20 Aug 2024 10:07:07 +0330 Subject: [PATCH 1/7] init --- packages/cli/index.ts | 62 ++++++++++++++++++++++++++++++++++++++----- pnpm-lock.yaml | 24 ++++++++--------- 2 files changed, 67 insertions(+), 19 deletions(-) diff --git a/packages/cli/index.ts b/packages/cli/index.ts index 1560f548..f3ffb1dc 100644 --- a/packages/cli/index.ts +++ b/packages/cli/index.ts @@ -26,6 +26,17 @@ declare global { var API_URL: string; } +type OutputMetadata = { + packages: { + name: string; + url: string; + }[]; + templates: { + name: string; + url: string; + }[]; +}; + const apiUrl = process.env.API_URL ?? API_URL; const publishUrl = new URL("/publish", apiUrl); @@ -69,6 +80,10 @@ const main = defineCommand({ description: `generate only stackblitz templates`, default: false, }, + json: { + type: "mixed", + description: `Save metadata to a JSON file. If true, log the output for piping. If a string, save the output to the specified file path.`, + }, }, run: async ({ args }) => { const paths = (args._.length ? args._ : ["."]) @@ -138,6 +153,14 @@ const main = defineCommand({ const deps: Map = new Map(); // pkg.pr.new versions of the package const realDeps: Map | null = isPeerDepsEnabled ? new Map() : null // real versions of the package, useful for peerDependencies + const printJson = typeof args.json === 'boolean'; + const saveJson = typeof args.json === 'string'; + const jsonFilePath = saveJson ? args.json : ''; + const outputMetadata: OutputMetadata = { + packages: [], + templates: [], + }; + for (const p of paths) { if (!(await hasPackageJson(p))) { continue; @@ -170,11 +193,17 @@ const main = defineCommand({ if (resource.ok) { console.warn(`${pJson.name}@${abbreviatedSha} was already published on ${depUrl}`) } + + // Collect package metadata + outputMetadata.packages.push({ + name: pJson.name, + url: depUrl, + }); } for (const templateDir of templates) { if (!(await hasPackageJson(templateDir))) { - console.log( + console.warn( `skipping ${templateDir} because there's no package.json file`, ); continue; @@ -186,7 +215,7 @@ const main = defineCommand({ throw new Error(`"name" field in ${pJsonPath} should be defined`); } - console.log("preparing template:", pJson.name); + console.warn("preparing template:", pJson.name); const restore = await writeDeps(templateDir, deps, realDeps); @@ -221,6 +250,16 @@ const main = defineCommand({ ); } await restore(); + + // Collect template metadata + const templateUrl = new URL( + `/${owner}/${repo}/template/${pJson.name}`, + apiUrl, + ).href; + outputMetadata.templates.push({ + name: pJson.name, + url: templateUrl, + }); } const noDefaultTemplate = args.template === false; @@ -259,7 +298,7 @@ const main = defineCommand({ const shasums: Record = {}; for (const p of paths) { if (!(await hasPackageJson(p))) { - console.log(`skipping ${p} because there's no package.json file`); + console.warn(`skipping ${p} because there's no package.json file`); continue; } const pJsonPath = path.resolve(p, "package.json"); @@ -272,7 +311,7 @@ const main = defineCommand({ ); } if (pJson.private) { - console.log(`skipping ${p} because the package is private`); + console.warn(`skipping ${p} because the package is private`); continue; } @@ -282,7 +321,7 @@ const main = defineCommand({ ); shasums[pJson.name] = shasum; - console.log(`shasum for ${pJson.name}(${filename}): ${shasum}`); + console.warn(`shasum for ${pJson.name}(${filename}): ${shasum}`); const file = await fs.readFile(path.resolve(p, filename)); @@ -316,8 +355,8 @@ const main = defineCommand({ `publishing failed: ${await res.text()}`, ); - console.log("\n"); - console.log( + console.warn("\n"); + console.warn( `⚡️ Your npm packages are published.\n${[...formData.keys()] .filter((k) => k.startsWith("package:")) .map( @@ -326,6 +365,15 @@ const main = defineCommand({ ) .join("\n")}`, ); + + const output = JSON.stringify(outputMetadata, null, 2); + if (printJson) { + console.log(output); // Log output for piping + } + if (saveJson) { + await fs.writeFile(jsonFilePath, output); + console.warn(`Metadata written to ${jsonFilePath}`); + } }, }; }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c8379fd5..106df49b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5481,10 +5481,10 @@ snapshots: dependencies: eslint: 8.57.0 - eslint-config-standard@17.1.0(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0))(eslint-plugin-n@16.6.2(eslint@8.57.0))(eslint-plugin-promise@6.1.1(eslint@8.57.0))(eslint@8.57.0): + eslint-config-standard@17.1.0(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0))(eslint-plugin-n@16.6.2(eslint@8.57.0))(eslint-plugin-promise@6.1.1(eslint@8.57.0))(eslint@8.57.0): dependencies: eslint: 8.57.0 - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-n: 16.6.2(eslint@8.57.0) eslint-plugin-promise: 6.1.1(eslint@8.57.0) @@ -5494,9 +5494,9 @@ snapshots: '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.4.5) eslint: 8.57.0 eslint-config-prettier: 8.10.0(eslint@8.57.0) - eslint-config-standard: 17.1.0(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0))(eslint-plugin-n@16.6.2(eslint@8.57.0))(eslint-plugin-promise@6.1.1(eslint@8.57.0))(eslint@8.57.0) - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-config-standard: 17.1.0(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0))(eslint-plugin-n@16.6.2(eslint@8.57.0))(eslint-plugin-promise@6.1.1(eslint@8.57.0))(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-n: 16.6.2(eslint@8.57.0) eslint-plugin-node: 11.1.0(eslint@8.57.0) eslint-plugin-promise: 6.1.1(eslint@8.57.0) @@ -5515,13 +5515,13 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0): + eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0): dependencies: debug: 4.3.4 enhanced-resolve: 5.16.0 eslint: 8.57.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.3 is-core-module: 2.13.1 @@ -5532,14 +5532,14 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.4.5) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0) transitivePeerDependencies: - supports-color @@ -5556,7 +5556,7 @@ snapshots: eslint-utils: 2.1.0 regexpp: 3.2.0 - eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -5566,7 +5566,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.13.1 is-glob: 4.0.3 From b7ad510527000c297c592d846fb0743ff75b5d78 Mon Sep 17 00:00:00 2001 From: Mohammad Bagher Abiyat Date: Tue, 20 Aug 2024 10:10:29 +0330 Subject: [PATCH 2/7] update --- package.json | 2 +- packages/cli/index.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 02c5fcdd..2550ace2 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "dev": "pnpm -r run dev", "build": "pnpm -r run build", - "publish:playgrounds": "pnpm pkg-pr-new publish './playgrounds/*' ./packages/cli --template './templates/*' --peerDeps", + "publish:playgrounds": "pnpm pkg-pr-new publish './playgrounds/*' ./packages/cli --template './templates/*' --peerDeps --json", "format": "prettier --write --cache .", "lint": "eslint --cache .", "typecheck": "tsc -p scripts --noEmit && pnpm -r --parallel run typecheck", diff --git a/packages/cli/index.ts b/packages/cli/index.ts index f3ffb1dc..e2ff7415 100644 --- a/packages/cli/index.ts +++ b/packages/cli/index.ts @@ -86,6 +86,7 @@ const main = defineCommand({ }, }, run: async ({ args }) => { + console.log("args", args) const paths = (args._.length ? args._ : ["."]) .flatMap((p) => fg.sync(p, { onlyDirectories: true })) .map((p) => path.resolve(p.trim())); From ac5e3dd9a44a09552e7126d64fe81af645e0ad14 Mon Sep 17 00:00:00 2001 From: Mohammad Bagher Abiyat Date: Tue, 20 Aug 2024 10:17:57 +0330 Subject: [PATCH 3/7] update --- packages/cli/index.ts | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/packages/cli/index.ts b/packages/cli/index.ts index e2ff7415..68923520 100644 --- a/packages/cli/index.ts +++ b/packages/cli/index.ts @@ -30,6 +30,7 @@ type OutputMetadata = { packages: { name: string; url: string; + shasum: string; }[]; templates: { name: string; @@ -155,11 +156,11 @@ const main = defineCommand({ const realDeps: Map | null = isPeerDepsEnabled ? new Map() : null // real versions of the package, useful for peerDependencies const printJson = typeof args.json === 'boolean'; - const saveJson = typeof args.json === 'string'; + const saveJson = typeof args.json === 'string'; const jsonFilePath = saveJson ? args.json : ''; const outputMetadata: OutputMetadata = { - packages: [], - templates: [], + packages: [], + templates: [], }; for (const p of paths) { @@ -181,9 +182,9 @@ const main = defineCommand({ } const depUrl = new URL( - `/${owner}/${repo}/${pJson.name}@${abbreviatedSha}`, - apiUrl, - ).href + `/${owner}/${repo}/${pJson.name}@${abbreviatedSha}`, + apiUrl, + ).href deps.set( pJson.name, depUrl, @@ -197,8 +198,9 @@ const main = defineCommand({ // Collect package metadata outputMetadata.packages.push({ - name: pJson.name, - url: depUrl, + name: pJson.name, + url: depUrl, + shasum: "", // will be filled later }); } @@ -254,12 +256,12 @@ const main = defineCommand({ // Collect template metadata const templateUrl = new URL( - `/${owner}/${repo}/template/${pJson.name}`, - apiUrl, + `/${owner}/${repo}/template/${pJson.name}`, + apiUrl, ).href; outputMetadata.templates.push({ - name: pJson.name, - url: templateUrl, + name: pJson.name, + url: templateUrl, }); } @@ -324,6 +326,9 @@ const main = defineCommand({ shasums[pJson.name] = shasum; console.warn(`shasum for ${pJson.name}(${filename}): ${shasum}`); + const outputPkg = outputMetadata.packages.find(p => p.name === pJson.name)!; + outputPkg.shasum = shasum; + const file = await fs.readFile(path.resolve(p, filename)); const blob = new Blob([file], { @@ -381,7 +386,7 @@ const main = defineCommand({ link: () => { return { meta: {}, - run: () => {}, + run: () => { }, }; }, }, From 46880aa30fff1b1f110736b828e63032f7445329 Mon Sep 17 00:00:00 2001 From: Mohammad Bagher Abiyat Date: Tue, 20 Aug 2024 10:21:05 +0330 Subject: [PATCH 4/7] update --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2550ace2..2b98dfc2 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "dev": "pnpm -r run dev", "build": "pnpm -r run build", - "publish:playgrounds": "pnpm pkg-pr-new publish './playgrounds/*' ./packages/cli --template './templates/*' --peerDeps --json", + "publish:playgrounds": "pnpm pkg-pr-new publish './playgrounds/*' ./packages/cli --template './templates/*' --peerDeps --json > test.txt ; cat test.txt", "format": "prettier --write --cache .", "lint": "eslint --cache .", "typecheck": "tsc -p scripts --noEmit && pnpm -r --parallel run typecheck", From 8a22d5411fbdc0609399ad7af297af4b6ba18604 Mon Sep 17 00:00:00 2001 From: Mohammad Bagher Abiyat Date: Tue, 20 Aug 2024 10:26:51 +0330 Subject: [PATCH 5/7] update --- package.json | 2 +- packages/cli/index.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2b98dfc2..8eb7c9fe 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "dev": "pnpm -r run dev", "build": "pnpm -r run build", - "publish:playgrounds": "pnpm pkg-pr-new publish './playgrounds/*' ./packages/cli --template './templates/*' --peerDeps --json > test.txt ; cat test.txt", + "publish:playgrounds": "pnpm pkg-pr-new publish './playgrounds/*' ./packages/cli --template './templates/*' --peerDeps --json > test.txt ; echo 'here' ; cat test.txt", "format": "prettier --write --cache .", "lint": "eslint --cache .", "typecheck": "tsc -p scripts --noEmit && pnpm -r --parallel run typecheck", diff --git a/packages/cli/index.ts b/packages/cli/index.ts index 68923520..d29fa842 100644 --- a/packages/cli/index.ts +++ b/packages/cli/index.ts @@ -87,7 +87,6 @@ const main = defineCommand({ }, }, run: async ({ args }) => { - console.log("args", args) const paths = (args._.length ? args._ : ["."]) .flatMap((p) => fg.sync(p, { onlyDirectories: true })) .map((p) => path.resolve(p.trim())); @@ -145,7 +144,7 @@ const main = defineCommand({ }); if (!checkResponse.ok) { - console.log(await checkResponse.text()); + console.error(await checkResponse.text()); process.exit(1); } From 9648b0ed30e9e32f2389fee131fac82b7f785b9f Mon Sep 17 00:00:00 2001 From: Mohammad Bagher Abiyat Date: Tue, 20 Aug 2024 10:30:37 +0330 Subject: [PATCH 6/7] update --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8eb7c9fe..a0d04f54 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "dev": "pnpm -r run dev", "build": "pnpm -r run build", - "publish:playgrounds": "pnpm pkg-pr-new publish './playgrounds/*' ./packages/cli --template './templates/*' --peerDeps --json > test.txt ; echo 'here' ; cat test.txt", + "publish:playgrounds": "pnpm pkg-pr-new publish './playgrounds/*' ./packages/cli --template './templates/*' --peerDeps --json test.txt ; echo 'test.txt' ; cat test.txt", "format": "prettier --write --cache .", "lint": "eslint --cache .", "typecheck": "tsc -p scripts --noEmit && pnpm -r --parallel run typecheck", From d674dcd49c9f6baf68c00e2cb9344806d66969c1 Mon Sep 17 00:00:00 2001 From: Mohammad Bagher Abiyat Date: Tue, 20 Aug 2024 10:36:52 +0330 Subject: [PATCH 7/7] update --- package.json | 2 +- packages/cli/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a0d04f54..02c5fcdd 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "dev": "pnpm -r run dev", "build": "pnpm -r run build", - "publish:playgrounds": "pnpm pkg-pr-new publish './playgrounds/*' ./packages/cli --template './templates/*' --peerDeps --json test.txt ; echo 'test.txt' ; cat test.txt", + "publish:playgrounds": "pnpm pkg-pr-new publish './playgrounds/*' ./packages/cli --template './templates/*' --peerDeps", "format": "prettier --write --cache .", "lint": "eslint --cache .", "typecheck": "tsc -p scripts --noEmit && pnpm -r --parallel run typecheck", diff --git a/packages/cli/index.ts b/packages/cli/index.ts index d29fa842..a2f9fd9d 100644 --- a/packages/cli/index.ts +++ b/packages/cli/index.ts @@ -377,7 +377,7 @@ const main = defineCommand({ } if (saveJson) { await fs.writeFile(jsonFilePath, output); - console.warn(`Metadata written to ${jsonFilePath}`); + console.warn(`metadata written to ${jsonFilePath}`); } }, };