jiek 0.1.12 → 0.2.0-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/commands/build.esm.js +10 -32
- package/dist/commands/build.esm.js.map +1 -1
- package/dist/commands/build.esm.min.js +1 -1
- package/dist/commands/build.esm.min.js.map +1 -1
- package/dist/commands/publish.esm.js +50 -34
- package/dist/commands/publish.esm.js.map +1 -1
- package/dist/commands/publish.esm.min.js +1 -1
- package/dist/commands/publish.esm.min.js.map +1 -1
- package/dist/index.esm.js +3 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +194 -67
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.umd.js +196 -69
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/merge-package-json.esm.js +45 -4
- package/dist/merge-package-json.esm.js.map +1 -1
- package/dist/merge-package-json.esm.min.js +1 -1
- package/dist/merge-package-json.esm.min.js.map +1 -1
- package/dist/rollup.esm.js +7 -0
- package/dist/rollup.esm.js.map +1 -1
- package/dist/rollup.esm.min.js +1 -1
- package/dist/rollup.esm.min.js.map +1 -1
- package/dist/rollup.iife.js +9 -2
- package/dist/rollup.iife.js.map +1 -1
- package/dist/rollup.iife.min.js +1 -1
- package/dist/rollup.iife.min.js.map +1 -1
- package/dist/rollup.umd.js +11 -4
- package/dist/rollup.umd.js.map +1 -1
- package/dist/rollup.umd.min.js +1 -1
- package/dist/rollup.umd.min.js.map +1 -1
- package/dist/utils/commondir.esm.js +25 -0
- package/dist/utils/commondir.esm.js.map +1 -0
- package/dist/utils/commondir.esm.min.js +2 -0
- package/dist/utils/commondir.esm.min.js.map +1 -0
- package/dist/utils/filterSupport.esm.js +78 -0
- package/dist/utils/filterSupport.esm.js.map +1 -0
- package/dist/utils/filterSupport.esm.min.js +2 -0
- package/dist/utils/filterSupport.esm.min.js.map +1 -0
- package/package.json +27 -30
@@ -1,12 +1,10 @@
|
|
1
1
|
import * as childProcess from 'node:child_process';
|
2
2
|
import fs from 'node:fs';
|
3
3
|
import path from 'node:path';
|
4
|
-
import { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir';
|
5
|
-
import { filterPackagesFromDir } from '@pnpm/filter-workspace-packages';
|
6
4
|
import { program } from 'commander';
|
7
|
-
import { load } from 'js-yaml';
|
8
5
|
import { actionRestore, actionDone } from '../inner.esm.js';
|
9
6
|
import { mergePackageJson } from '../merge-package-json.esm.js';
|
7
|
+
import { getSelectedProjectsGraph } from '../utils/filterSupport.esm.js';
|
10
8
|
|
11
9
|
const FILE_TEMPLATE = (manifest) => `
|
12
10
|
const pkg = ${JSON.stringify(manifest, null, 2)}
|
@@ -16,43 +14,23 @@ const templateArg = jiek.templateArgFilePath
|
|
16
14
|
: {
|
17
15
|
styled: jiek.styled
|
18
16
|
}
|
19
|
-
module.exports = require('
|
17
|
+
module.exports = require('jiek/rollup').template(templateArg, pkg)
|
20
18
|
`.trimStart();
|
21
|
-
program.command("build").
|
19
|
+
program.command("build").action(async () => {
|
22
20
|
actionRestore();
|
23
|
-
const
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
throw new Error("root path is workspace root, please provide a filter");
|
21
|
+
const {
|
22
|
+
wd,
|
23
|
+
value = {}
|
24
|
+
} = await getSelectedProjectsGraph() ?? {};
|
25
|
+
if (Object.keys(value).length === 0) {
|
26
|
+
throw new Error("no package found");
|
30
27
|
}
|
31
|
-
if (root !== wd && !filter) {
|
32
|
-
const packageJSONIsExist = fs.existsSync(path.resolve(root, "package.json"));
|
33
|
-
if (!packageJSONIsExist) {
|
34
|
-
throw new Error("root path is not workspace root, please provide a filter");
|
35
|
-
}
|
36
|
-
const packageJSON = JSON.parse(fs.readFileSync(path.resolve(root, "package.json"), "utf-8"));
|
37
|
-
if (!packageJSON.name) {
|
38
|
-
throw new Error("root path is not workspace root, please provide a filter");
|
39
|
-
}
|
40
|
-
filter = packageJSON.name;
|
41
|
-
}
|
42
|
-
const { selectedProjectsGraph } = await filterPackagesFromDir(wd, [{
|
43
|
-
filter: filter ?? "",
|
44
|
-
followProdDepsOnly: true
|
45
|
-
}], {
|
46
|
-
prefix: root,
|
47
|
-
workspaceDir: wd,
|
48
|
-
patterns: pnpmWorkspace.packages
|
49
|
-
});
|
50
28
|
const jiekTempDir = (...paths) => path.resolve(wd, "node_modules/.jiek", ...paths);
|
51
29
|
if (!fs.existsSync(jiekTempDir()))
|
52
30
|
fs.mkdirSync(jiekTempDir());
|
53
31
|
const rollupBinaryPath = require.resolve("rollup").replace(/dist\/rollup.js$/, "dist/bin/rollup");
|
54
32
|
let i = 0;
|
55
|
-
for (const [dir,
|
33
|
+
for (const [dir, manifest] of Object.entries(value)) {
|
56
34
|
const newManifest = mergePackageJson(manifest, dir);
|
57
35
|
const escapeManifestName = manifest.name?.replace(/^@/g, "").replace(/\//g, "+");
|
58
36
|
const configFile = jiekTempDir(
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"build.esm.js","sources":["../../src/commands/build.ts"],"sourcesContent":["import * as childProcess from 'node:child_process'\nimport fs from 'node:fs'\nimport path from 'node:path'\n\nimport {
|
1
|
+
{"version":3,"file":"build.esm.js","sources":["../../src/commands/build.ts"],"sourcesContent":["import * as childProcess from 'node:child_process'\nimport fs from 'node:fs'\nimport path from 'node:path'\n\nimport { program } from 'commander'\n\nimport { actionDone, actionRestore } from '../inner'\nimport { mergePackageJson } from '../merge-package-json'\nimport { getSelectedProjectsGraph } from '../utils/filterSupport'\n\nconst FILE_TEMPLATE = (manifest: unknown) => `\nconst pkg = ${JSON.stringify(manifest, null, 2)}\nconst { jiek = {} } = pkg\nconst templateArg = jiek.templateArgFilePath\n ? require.resolve(jiek.templateArgFilePath)\n : {\n styled: jiek.styled\n }\nmodule.exports = require('jiek/rollup').template(templateArg, pkg)\n`.trimStart()\n\nprogram\n .command('build')\n .action(async () => {\n actionRestore()\n const {\n wd, value = {}\n } = await getSelectedProjectsGraph() ?? {}\n\n if (Object.keys(value).length === 0) {\n throw new Error('no package found')\n }\n const jiekTempDir = (...paths: string[]) => path.resolve(wd, 'node_modules/.jiek', ...paths)\n if (!fs.existsSync(jiekTempDir())) fs.mkdirSync(jiekTempDir())\n\n const rollupBinaryPath = require.resolve('rollup')\n .replace(/dist\\/rollup.js$/, 'dist/bin/rollup')\n let i = 0\n for (const [dir, manifest] of Object.entries(value)) {\n const newManifest = mergePackageJson(manifest, dir)\n // TODO support auto build child packages in workspaces\n const escapeManifestName = manifest.name?.replace(/^@/g, '').replace(/\\//g, '+')\n const configFile = jiekTempDir(\n `${escapeManifestName ?? `anonymous-${i++}`}.rollup.config.js`\n )\n fs.writeFileSync(configFile, FILE_TEMPLATE(newManifest))\n let prefix = ''\n if (process.env.NODE_ENV === 'test') {\n const registerPath = require.resolve('esbuild-register')\n const loaderPath = require.resolve('esbuild-register/loader')\n prefix = `node --import ${registerPath} -r ${loaderPath} `\n }\n // TODO replace with `spawn` to support watch mode\n childProcess.execSync(`${prefix}${rollupBinaryPath} -c ${configFile}`, {\n cwd: dir, stdio: 'inherit'\n })\n }\n\n actionDone()\n })\n"],"names":[],"mappings":";;;;;;;;AAUA,MAAM,aAAA,GAAgB,CAAC,QAAsB,KAAA,CAAA;AAAA,YAAA,EAC/B,IAAK,CAAA,SAAA,CAAU,QAAU,EAAA,IAAA,EAAM,CAAC,CAAC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,CAQ7C,SAAU,EAAA,CAAA;AAEZ,OAAA,CACG,OAAQ,CAAA,OAAO,CACf,CAAA,MAAA,CAAO,YAAY;AAClB,EAAc,aAAA,EAAA,CAAA;AACd,EAAM,MAAA;AAAA,IACJ,EAAA;AAAA,IAAI,QAAQ,EAAC;AAAA,GACX,GAAA,MAAM,wBAAyB,EAAA,IAAK,EAAC,CAAA;A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A,OAAA,CAAQ,kBAAkB,CAAA,CAAA;AACvD,MAAM,MAAA,UAAA,GAAa,OAAQ,CAAA,OAAA,CAAQ,yBAAyB,CAAA,CAAA;AAC5D,MAAS,MAAA,GAAA,CAAA,cAAA,EAAiB,YAAY,CAAA,IAAA,EAAO,UAAU,CAAA,CAAA,CAAA,CAAA;AAAA,KACzD;AAEA,IAAA,YAAA,CAAa,SAAS,CAAG,EAAA,MAAM,GAAG,gBAAgB,CAAA,IAAA,EAAO,UAAU,CAAI,CAAA,EAAA;AAAA,MACrE,GAAK,EAAA,GAAA;AAAA,MAAK,KAAO,EAAA,SAAA;AAAA,KAClB,CAAA,CAAA;AAAA,GACH;AAEA,EAAW,UAAA,EAAA,CAAA;AACb,CAAC,CAAA"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"node:child_process";import r from"node:fs";import o from"node:path";import{
|
1
|
+
import*as e from"node:child_process";import r from"node:fs";import o from"node:path";import{program as t}from"commander";import{actionRestore as i,actionDone as n}from"../inner.esm.min.js";import{mergePackageJson as s}from"../merge-package-json.esm.min.js";import{getSelectedProjectsGraph as l}from"../utils/filterSupport.esm.min.js";const m=e=>`\nconst pkg = ${JSON.stringify(e,null,2)}\nconst { jiek = {} } = pkg\nconst templateArg = jiek.templateArgFilePath\n ? require.resolve(jiek.templateArgFilePath)\n : {\n styled: jiek.styled\n }\nmodule.exports = require('jiek/rollup').template(templateArg, pkg)\n`.trimStart();t.command("build").action((async()=>{i();const{wd:t,value:p={}}=await l()??{};if(0===Object.keys(p).length)throw new Error("no package found");const c=(...e)=>o.resolve(t,"node_modules/.jiek",...e);r.existsSync(c())||r.mkdirSync(c());const a=require.resolve("rollup").replace(/dist\/rollup.js$/,"dist/bin/rollup");let d=0;for(const[o,t]of Object.entries(p)){const i=s(t,o),n=t.name?.replace(/^@/g,"").replace(/\//g,"+"),l=c(`${n??"anonymous-"+d++}.rollup.config.js`);r.writeFileSync(l,m(i));let p="";if("test"===process.env.NODE_ENV){p=`node --import ${require.resolve("esbuild-register")} -r ${require.resolve("esbuild-register/loader")} `}e.execSync(`${p}${a} -c ${l}`,{cwd:o,stdio:"inherit"})}n()}));
|
2
2
|
//# sourceMappingURL=build.esm.min.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"build.esm.min.js","sources":["../../src/commands/build.ts"],"sourcesContent":["import * as childProcess from 'node:child_process'\nimport fs from 'node:fs'\nimport path from 'node:path'\n\nimport {
|
1
|
+
{"version":3,"file":"build.esm.min.js","sources":["../../src/commands/build.ts"],"sourcesContent":["import * as childProcess from 'node:child_process'\nimport fs from 'node:fs'\nimport path from 'node:path'\n\nimport { program } from 'commander'\n\nimport { actionDone, actionRestore } from '../inner'\nimport { mergePackageJson } from '../merge-package-json'\nimport { getSelectedProjectsGraph } from '../utils/filterSupport'\n\nconst FILE_TEMPLATE = (manifest: unknown) => `\nconst pkg = ${JSON.stringify(manifest, null, 2)}\nconst { jiek = {} } = pkg\nconst templateArg = jiek.templateArgFilePath\n ? require.resolve(jiek.templateArgFilePath)\n : {\n styled: jiek.styled\n }\nmodule.exports = require('jiek/rollup').template(templateArg, pkg)\n`.trimStart()\n\nprogram\n .command('build')\n .action(async () => {\n actionRestore()\n const {\n wd, value = {}\n } = await getSelectedProjectsGraph() ?? {}\n\n if (Object.keys(value).length === 0) {\n throw new Error('no package found')\n }\n const jiekTempDir = (...paths: string[]) => path.resolve(wd, 'node_modules/.jiek', ...paths)\n if (!fs.existsSync(jiekTempDir())) fs.mkdirSync(jiekTempDir())\n\n const rollupBinaryPath = require.resolve('rollup')\n .replace(/dist\\/rollup.js$/, 'dist/bin/rollup')\n let i = 0\n for (const [dir, manifest] of Object.entries(value)) {\n const newManifest = mergePackageJson(manifest, dir)\n // TODO support auto build child packages in workspaces\n const escapeManifestName = manifest.name?.replace(/^@/g, '').replace(/\\//g, '+')\n const configFile = jiekTempDir(\n `${escapeManifestName ?? `anonymous-${i++}`}.rollup.config.js`\n )\n fs.writeFileSync(configFile, FILE_TEMPLATE(newManifest))\n let prefix = ''\n if (process.env.NODE_ENV === 'test') {\n const registerPath = require.resolve('esbuild-register')\n const loaderPath = require.resolve('esbuild-register/loader')\n prefix = `node --import ${registerPath} -r ${loaderPath} `\n }\n // TODO replace with `spawn` to support watch mode\n childProcess.execSync(`${prefix}${rollupBinaryPath} -c ${configFile}`, {\n cwd: dir, stdio: 'inherit'\n })\n }\n\n actionDone()\n })\n"],"names":["FILE_TEMPLATE","manifest","JSON","stringify","trimStart","program","command","action","async","actionRestore","wd","value","getSelectedProjectsGraph","Object","keys","length","Error","jiekTempDir","paths","path","resolve","fs","existsSync","mkdirSync","rollupBinaryPath","require","replace","i","dir","entries","newManifest","mergePackageJson","escapeManifestName","name","configFile","writeFileSync","prefix","process","env","NODE_ENV","childProcess","execSync","cwd","stdio","actionDone"],"mappings":"8UAUA,MAAMA,EAAiBC,GAAsB,iBAC/BC,KAAKC,UAAUF,EAAU,KAAM,wOAQ3CG,YAEFC,EACGC,QAAQ,SACRC,QAAOC,UACQC,IACR,MAAAC,GACJA,EAAAC,MAAIA,EAAQ,CAAC,SACLC,KAA8B,GAExC,GAAkC,IAA9BC,OAAOC,KAAKH,GAAOI,OACf,MAAA,IAAIC,MAAM,oBAEZ,MAAAC,EAAc,IAAIC,IAAoBC,EAAKC,QAAQV,EAAI,wBAAyBQ,GACjFG,EAAGC,WAAWL,MAAmBI,EAAAE,UAAUN,KAEhD,MAAMO,EAAmBC,QAAQL,QAAQ,UACtCM,QAAQ,mBAAoB,mBAC/B,IAAIC,EAAI,EACR,IAAA,MAAYC,EAAK3B,KAAaY,OAAOgB,QAAQlB,GAAQ,CAC7C,MAAAmB,EAAcC,EAAiB9B,EAAU2B,GAEzCI,EAAqB/B,EAASgC,MAAMP,QAAQ,MAAO,IAAIA,QAAQ,MAAO,KACtEQ,EAAajB,EACjB,GAAGe,GAAsB,aAAaL,wBAExCN,EAAGc,cAAcD,EAAYlC,EAAc8B,IAC3C,IAAIM,EAAS,GACT,GAAyB,SAAzBC,QAAQC,IAAIC,SAAqB,CAG1BH,EAAA,iBAFYX,QAAQL,QAAQ,0BAClBK,QAAQL,QAAQ,6BAErC,CAEAoB,EAAaC,SAAS,GAAGL,IAASZ,QAAuBU,IAAc,CACrEQ,IAAKd,EAAKe,MAAO,WAErB,CAEWC,GAAA"}
|
@@ -1,55 +1,71 @@
|
|
1
1
|
import fs from 'node:fs';
|
2
2
|
import path from 'node:path';
|
3
3
|
import { bump } from '@jiek/utils/bumper';
|
4
|
-
import { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir';
|
5
|
-
import { filterPackagesFromDir } from '@pnpm/filter-workspace-packages';
|
6
4
|
import * as childProcess from 'child_process';
|
7
5
|
import { program } from 'commander';
|
6
|
+
import detectIndent from 'detect-indent';
|
7
|
+
import { applyEdits, modify } from 'jsonc-parser';
|
8
8
|
import { actionRestore, actionDone } from '../inner.esm.js';
|
9
9
|
import { mergePackageJson } from '../merge-package-json.esm.js';
|
10
|
+
import { getSelectedProjectsGraph } from '../utils/filterSupport.esm.js';
|
10
11
|
|
11
|
-
program.command("publish").aliases(["pub", "p"]).option("--
|
12
|
+
program.command("publish").aliases(["pub", "p"]).option("-b, --bumper <bumper>", "bump version", "patch").option("-p, --preview", "preview publish").action(async ({ preview, bumper, ...options }) => {
|
12
13
|
actionRestore();
|
13
|
-
const
|
14
|
-
const
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
mainfests.push([
|
26
|
-
dir,
|
27
|
-
mergePackageJson(manifest, dir)
|
28
|
-
]);
|
29
|
-
});
|
30
|
-
const passArgs = Object.entries(options).reduce((acc, [key, value]) => {
|
31
|
-
if (value) {
|
32
|
-
acc.push(`--${key}`, value);
|
14
|
+
const { value = {} } = await getSelectedProjectsGraph() ?? {};
|
15
|
+
const selectedProjectsGraphEntries = Object.entries(value);
|
16
|
+
if (selectedProjectsGraphEntries.length === 0) {
|
17
|
+
throw new Error("no packages selected");
|
18
|
+
}
|
19
|
+
const mainfests = selectedProjectsGraphEntries.map(([dir, manifest]) => [
|
20
|
+
dir,
|
21
|
+
mergePackageJson(manifest, dir)
|
22
|
+
]);
|
23
|
+
const passArgs = Object.entries(options).reduce((acc, [key, value2]) => {
|
24
|
+
if (value2) {
|
25
|
+
acc.push(`--${key}`, value2);
|
33
26
|
}
|
34
27
|
return acc;
|
35
28
|
}, []);
|
36
|
-
for (const [dir,
|
37
|
-
const
|
38
|
-
const
|
39
|
-
|
40
|
-
|
29
|
+
for (const [dir, manifest] of mainfests) {
|
30
|
+
const oldJSONString = fs.readFileSync(path.join(dir, "package.json"), "utf-8");
|
31
|
+
const oldJSON = JSON.parse(oldJSONString) ?? "0.0.0";
|
32
|
+
const newVersion = bump(oldJSON.version, bumper);
|
33
|
+
const { indent = " " } = detectIndent(oldJSONString);
|
34
|
+
const formattingOptions = {
|
35
|
+
tabSize: indent.length,
|
36
|
+
insertSpaces: true
|
41
37
|
};
|
42
|
-
|
43
|
-
|
44
|
-
|
38
|
+
let newJSONString = oldJSONString;
|
39
|
+
newJSONString = applyEdits(newJSONString, modify(
|
40
|
+
newJSONString,
|
41
|
+
["version"],
|
42
|
+
newVersion,
|
43
|
+
{ formattingOptions }
|
44
|
+
));
|
45
|
+
for (const [key, value2] of Object.entries(manifest)) {
|
46
|
+
if (JSON.stringify(value2) === JSON.stringify(oldJSON[key]))
|
47
|
+
continue;
|
48
|
+
newJSONString = applyEdits(newJSONString, modify(
|
49
|
+
newJSONString,
|
50
|
+
["publishConfig", key],
|
51
|
+
value2,
|
52
|
+
{ formattingOptions }
|
53
|
+
));
|
54
|
+
}
|
45
55
|
try {
|
56
|
+
fs.renameSync(path.join(dir, "package.json"), path.join(dir, "package.json.bak"));
|
57
|
+
fs.writeFileSync(path.join(dir, "package.json"), newJSONString);
|
58
|
+
console.log(newJSONString);
|
59
|
+
if (preview) {
|
60
|
+
console.warn("preview mode");
|
61
|
+
continue;
|
62
|
+
}
|
46
63
|
childProcess.execSync(["pnpm", "publish", "--access", "public", "--no-git-checks", ...passArgs].join(" "), {
|
47
64
|
cwd: dir,
|
48
65
|
stdio: "inherit"
|
49
66
|
});
|
50
|
-
const
|
51
|
-
|
52
|
-
fs.writeFileSync(path.join(dir, "package.json.bak"), JSON.stringify(oldPackageJson, null, 2));
|
67
|
+
const modifyVersionPackageJSON = applyEdits(oldJSONString, modify(oldJSONString, ["version"], newVersion, {}));
|
68
|
+
fs.writeFileSync(path.join(dir, "package.json.bak"), modifyVersionPackageJSON);
|
53
69
|
} finally {
|
54
70
|
fs.unlinkSync(path.join(dir, "package.json"));
|
55
71
|
fs.renameSync(path.join(dir, "package.json.bak"), path.join(dir, "package.json"));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"publish.esm.js","sources":["../../src/commands/publish.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\n\nimport { bump, type BumperType } from '@jiek/utils/bumper'\nimport
|
1
|
+
{"version":3,"file":"publish.esm.js","sources":["../../src/commands/publish.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\n\nimport { bump, type BumperType } from '@jiek/utils/bumper'\nimport * as childProcess from 'child_process'\nimport { program } from 'commander'\nimport detectIndent from 'detect-indent'\nimport { applyEdits, modify } from 'jsonc-parser'\n\nimport { actionDone, actionRestore } from '../inner'\nimport { mergePackageJson } from '../merge-package-json'\nimport { getSelectedProjectsGraph } from '../utils/filterSupport'\n\nprogram\n .command('publish')\n .aliases(['pub', 'p'])\n .option('-b, --bumper <bumper>', 'bump version', 'patch')\n .option('-p, --preview', 'preview publish')\n .action(async ({ preview, bumper, ...options }: {\n preview?: boolean\n bumper: BumperType\n }) => {\n actionRestore()\n\n const { value = {} } = await getSelectedProjectsGraph() ?? {}\n const selectedProjectsGraphEntries = Object.entries(value)\n if (selectedProjectsGraphEntries.length === 0) {\n throw new Error('no packages selected')\n }\n const mainfests = selectedProjectsGraphEntries\n .map(([dir, manifest]) => [\n dir, mergePackageJson(manifest, dir)\n ] as const)\n const passArgs = Object\n .entries(options)\n .reduce((acc, [key, value]) => {\n if (value) {\n acc.push(`--${key}`, value as string)\n }\n return acc\n }, [] as string[])\n for (const [dir, manifest] of mainfests) {\n const oldJSONString = fs.readFileSync(path.join(dir, 'package.json'), 'utf-8')\n const oldJSON = JSON.parse(oldJSONString) ?? '0.0.0'\n const newVersion = bump(oldJSON.version, bumper)\n // TODO detectIndent by editorconfig\n const { indent = ' ' } = detectIndent(oldJSONString)\n const formattingOptions = {\n tabSize: indent.length,\n insertSpaces: true\n }\n let newJSONString = oldJSONString\n newJSONString = applyEdits(newJSONString, modify(\n newJSONString, ['version'], newVersion, { formattingOptions }\n ))\n for (const [key, value] of Object.entries(manifest)) {\n if (JSON.stringify(value) === JSON.stringify(oldJSON[key])) continue\n\n newJSONString = applyEdits(newJSONString, modify(\n newJSONString, ['publishConfig', key], value, { formattingOptions }\n ))\n }\n try {\n fs.renameSync(path.join(dir, 'package.json'), path.join(dir, 'package.json.bak'))\n fs.writeFileSync(path.join(dir, 'package.json'), newJSONString)\n console.log(newJSONString)\n if (preview) {\n console.warn('preview mode')\n continue\n }\n childProcess.execSync(['pnpm', 'publish', '--access', 'public', '--no-git-checks', ...passArgs].join(' '), {\n cwd: dir,\n stdio: 'inherit'\n })\n const modifyVersionPackageJSON = applyEdits(oldJSONString, modify(oldJSONString, ['version'], newVersion, {}))\n fs.writeFileSync(path.join(dir, 'package.json.bak'), modifyVersionPackageJSON)\n } finally {\n fs.unlinkSync(path.join(dir, 'package.json'))\n fs.renameSync(path.join(dir, 'package.json.bak'), path.join(dir, 'package.json'))\n }\n }\n actionDone()\n })\n"],"names":["value"],"mappings":";;;;;;;;;;;AAaA,OACG,CAAA,OAAA,CAAQ,SAAS,CAAA,CACjB,OAAQ,CAAA,CAAC,OAAO,GAAG,CAAC,CACpB,CAAA,MAAA,CAAO,uBAAyB,EAAA,cAAA,EAAg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,IAAI,OAAS,EAAA;AACX,QAAA,OAAA,CAAQ,KAAK,cAAc,CAAA,CAAA;AAC3B,QAAA,SAAA;AAAA,OACF;AACA,MAAA,YAAA,CAAa,QAAS,CAAA,CAAC,MAAQ,EAAA,SAAA,EAAW,UAAY,EAAA,QAAA,EAAU,iBAAmB,EAAA,GAAG,QAAQ,CAAA,CAAE,IAAK,CAAA,GAAG,CAAG,EAAA;AAAA,QACzG,GAAK,EAAA,GAAA;AAAA,QACL,KAAO,EAAA,SAAA;AAAA,OACR,CAAA,CAAA;AACD,MAAM,MAAA,wBAAA,GAA2B,UAAW,CAAA,aAAA,EAAe,MAAO,CAAA,aAAA,EAAe,CAAC,SAAS,CAAG,EAAA,UAAA,EAAY,EAAE,CAAC,CAAA,CAAA;AAC7G,MAAA,EAAA,CAAG,cAAc,IAAK,CAAA,IAAA,CAAK,GAAK,EAAA,kBAAkB,GAAG,wBAAwB,CAAA,CAAA;AAAA,KAC7E,SAAA;AACA,MAAA,EAAA,CAAG,UAAW,CAAA,IAAA,CAAK,IAAK,CAAA,GAAA,EAAK,cAAc,CAAC,CAAA,CAAA;AAC5C,MAAG,EAAA,CAAA,UAAA,CAAW,IAAK,CAAA,IAAA,CAAK,GAAK,EAAA,kBAAkB,GAAG,IAAK,CAAA,IAAA,CAAK,GAAK,EAAA,cAAc,CAAC,CAAA,CAAA;AAAA,KAClF;AAAA,GACF;AACA,EAAW,UAAA,EAAA,CAAA;AACb,CAAC,CAAA"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import e from"node:fs";import n from"node:path";import{bump as o}from"@jiek/utils/bumper";import*as i from"child_process";import{program as r}from"commander";import s from"detect-indent";import{applyEdits as t,modify as p}from"jsonc-parser";import{actionRestore as a,actionDone as c}from"../inner.esm.min.js";import{mergePackageJson as m}from"../merge-package-json.esm.min.js";import{getSelectedProjectsGraph as j}from"../utils/filterSupport.esm.min.js";r.command("publish").aliases(["pub","p"]).option("-b, --bumper <bumper>","bump version","patch").option("-p, --preview","preview publish").action((async({preview:r,bumper:f,...l})=>{a();const{value:g={}}=await j()??{},u=Object.entries(g);if(0===u.length)throw new Error("no packages selected");const b=u.map((([e,n])=>[e,m(n,e)])),k=Object.entries(l).reduce(((e,[n,o])=>(o&&e.push(`--${n}`,o),e)),[]);for(const[a,c]of b){const m=e.readFileSync(n.join(a,"package.json"),"utf-8"),j=JSON.parse(m)??"0.0.0",l=o(j.version,f),{indent:g=" "}=s(m),u={tabSize:g.length,insertSpaces:!0};let b=m;b=t(b,p(b,["version"],l,{formattingOptions:u}));for(const[e,n]of Object.entries(c))JSON.stringify(n)!==JSON.stringify(j[e])&&(b=t(b,p(b,["publishConfig",e],n,{formattingOptions:u})));try{if(e.renameSync(n.join(a,"package.json"),n.join(a,"package.json.bak")),e.writeFileSync(n.join(a,"package.json"),b),console.log(b),r){console.warn("preview mode");continue}i.execSync(["pnpm","publish","--access","public","--no-git-checks",...k].join(" "),{cwd:a,stdio:"inherit"});const o=t(m,p(m,["version"],l,{}));e.writeFileSync(n.join(a,"package.json.bak"),o)}finally{e.unlinkSync(n.join(a,"package.json")),e.renameSync(n.join(a,"package.json.bak"),n.join(a,"package.json"))}}c()}));
|
2
2
|
//# sourceMappingURL=publish.esm.min.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"publish.esm.min.js","sources":["../../src/commands/publish.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\n\nimport { bump, type BumperType } from '@jiek/utils/bumper'\nimport
|
1
|
+
{"version":3,"file":"publish.esm.min.js","sources":["../../src/commands/publish.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\n\nimport { bump, type BumperType } from '@jiek/utils/bumper'\nimport * as childProcess from 'child_process'\nimport { program } from 'commander'\nimport detectIndent from 'detect-indent'\nimport { applyEdits, modify } from 'jsonc-parser'\n\nimport { actionDone, actionRestore } from '../inner'\nimport { mergePackageJson } from '../merge-package-json'\nimport { getSelectedProjectsGraph } from '../utils/filterSupport'\n\nprogram\n .command('publish')\n .aliases(['pub', 'p'])\n .option('-b, --bumper <bumper>', 'bump version', 'patch')\n .option('-p, --preview', 'preview publish')\n .action(async ({ preview, bumper, ...options }: {\n preview?: boolean\n bumper: BumperType\n }) => {\n actionRestore()\n\n const { value = {} } = await getSelectedProjectsGraph() ?? {}\n const selectedProjectsGraphEntries = Object.entries(value)\n if (selectedProjectsGraphEntries.length === 0) {\n throw new Error('no packages selected')\n }\n const mainfests = selectedProjectsGraphEntries\n .map(([dir, manifest]) => [\n dir, mergePackageJson(manifest, dir)\n ] as const)\n const passArgs = Object\n .entries(options)\n .reduce((acc, [key, value]) => {\n if (value) {\n acc.push(`--${key}`, value as string)\n }\n return acc\n }, [] as string[])\n for (const [dir, manifest] of mainfests) {\n const oldJSONString = fs.readFileSync(path.join(dir, 'package.json'), 'utf-8')\n const oldJSON = JSON.parse(oldJSONString) ?? '0.0.0'\n const newVersion = bump(oldJSON.version, bumper)\n // TODO detectIndent by editorconfig\n const { indent = ' ' } = detectIndent(oldJSONString)\n const formattingOptions = {\n tabSize: indent.length,\n insertSpaces: true\n }\n let newJSONString = oldJSONString\n newJSONString = applyEdits(newJSONString, modify(\n newJSONString, ['version'], newVersion, { formattingOptions }\n ))\n for (const [key, value] of Object.entries(manifest)) {\n if (JSON.stringify(value) === JSON.stringify(oldJSON[key])) continue\n\n newJSONString = applyEdits(newJSONString, modify(\n newJSONString, ['publishConfig', key], value, { formattingOptions }\n ))\n }\n try {\n fs.renameSync(path.join(dir, 'package.json'), path.join(dir, 'package.json.bak'))\n fs.writeFileSync(path.join(dir, 'package.json'), newJSONString)\n console.log(newJSONString)\n if (preview) {\n console.warn('preview mode')\n continue\n }\n childProcess.execSync(['pnpm', 'publish', '--access', 'public', '--no-git-checks', ...passArgs].join(' '), {\n cwd: dir,\n stdio: 'inherit'\n })\n const modifyVersionPackageJSON = applyEdits(oldJSONString, modify(oldJSONString, ['version'], newVersion, {}))\n fs.writeFileSync(path.join(dir, 'package.json.bak'), modifyVersionPackageJSON)\n } finally {\n fs.unlinkSync(path.join(dir, 'package.json'))\n fs.renameSync(path.join(dir, 'package.json.bak'), path.join(dir, 'package.json'))\n }\n }\n actionDone()\n })\n"],"names":["program","command","aliases","option","action","async","preview","bumper","options","actionRestore","value","getSelectedProjectsGraph","selectedProjectsGraphEntries","Object","entries","length","Error","mainfests","map","dir","manifest","mergePackageJson","passArgs","reduce","acc","key","push","oldJSONString","fs","readFileSync","path","join","oldJSON","JSON","parse","newVersion","bump","version","indent","detectIndent","formattingOptions","tabSize","insertSpaces","newJSONString","applyEdits","modify","stringify","renameSync","writeFileSync","console","log","warn","childProcess","execSync","cwd","stdio","modifyVersionPackageJSON","unlinkSync","actionDone"],"mappings":"scAaAA,EACGC,QAAQ,WACRC,QAAQ,CAAC,MAAO,MAChBC,OAAO,wBAAyB,eAAgB,SAChDA,OAAO,gBAAiB,mBACxBC,QAAOC,OAASC,UAASC,YAAWC,MAIrBC,IAER,MAAAC,MAAEA,EAAQ,CAAC,SAAYC,KAA8B,CAAA,EACrDC,EAA+BC,OAAOC,QAAQJ,GAChD,GAAwC,IAAxCE,EAA6BG,OACzB,MAAA,IAAIC,MAAM,wBAElB,MAAMC,EAAYL,EACfM,KAAI,EAAEC,EAAKC,KAAc,CACxBD,EAAKE,EAAiBD,EAAUD,MAE9BG,EAAWT,OACdC,QAAQN,GACRe,QAAO,CAACC,GAAMC,EAAKf,MACdA,GACFc,EAAIE,KAAK,KAAKD,IAAOf,GAEhBc,IACN,IACL,IAAA,MAAYL,EAAKC,KAAaH,EAAW,CACjC,MAAAU,EAAgBC,EAAGC,aAAaC,EAAKC,KAAKZ,EAAK,gBAAiB,SAChEa,EAAUC,KAAKC,MAAMP,IAAkB,QACvCQ,EAAaC,EAAKJ,EAAQK,QAAS9B,IAEnC+B,OAAEA,EAAS,QAAWC,EAAaZ,GACnCa,EAAoB,CACxBC,QAASH,EAAOvB,OAChB2B,cAAc,GAEhB,IAAIC,EAAgBhB,EACpBgB,EAAgBC,EAAWD,EAAeE,EACxCF,EAAe,CAAC,WAAYR,EAAY,CAAEK,uBAE5C,IAAA,MAAYf,EAAKf,KAAUG,OAAOC,QAAQM,GACpCa,KAAKa,UAAUpC,KAAWuB,KAAKa,UAAUd,EAAQP,MAErDkB,EAAgBC,EAAWD,EAAeE,EACxCF,EAAe,CAAC,gBAAiBlB,GAAMf,EAAO,CAAE8B,wBAGhD,IAIF,GAHGZ,EAAAmB,WAAWjB,EAAKC,KAAKZ,EAAK,gBAAiBW,EAAKC,KAAKZ,EAAK,qBAC7DS,EAAGoB,cAAclB,EAAKC,KAAKZ,EAAK,gBAAiBwB,GACjDM,QAAQC,IAAIP,GACRrC,EAAS,CACX2C,QAAQE,KAAK,gBACb,QACF,CACAC,EAAaC,SAAS,CAAC,OAAQ,UAAW,WAAY,SAAU,qBAAsB/B,GAAUS,KAAK,KAAM,CACzGuB,IAAKnC,EACLoC,MAAO,YAEH,MAAAC,EAA2BZ,EAAWjB,EAAekB,EAAOlB,EAAe,CAAC,WAAYQ,EAAY,CAAE,IAC5GP,EAAGoB,cAAclB,EAAKC,KAAKZ,EAAK,oBAAqBqC,EAAwB,CAC7E,QACA5B,EAAG6B,WAAW3B,EAAKC,KAAKZ,EAAK,iBAC1BS,EAAAmB,WAAWjB,EAAKC,KAAKZ,EAAK,oBAAqBW,EAAKC,KAAKZ,EAAK,gBACnE,CACF,CACWuC,GAAA"}
|
package/dist/index.esm.js
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
import './utils/filterSupport.esm.js';
|
1
2
|
import './commands/publish.esm.js';
|
2
3
|
import './commands/build.esm.js';
|
3
4
|
import { program } from 'commander';
|
4
5
|
|
6
|
+
const pkg = require("../package.json");
|
7
|
+
program.version(pkg.version).description(pkg.description).option("--root <root>", "root path");
|
5
8
|
program.parse(process.argv);
|
6
9
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":["import './commands/publish'\nimport './commands/build'\n\nimport { program } from 'commander'\n\nprogram.parse(process.argv)\n"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":["import './utils/filterSupport'\nimport './commands/publish'\nimport './commands/build'\n\nimport { program } from 'commander'\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst pkg = require('../package.json')\n\nprogram\n .version(pkg.version)\n .description(pkg.description)\n .option('--root <root>', 'root path')\n\nprogram.parse(process.argv)\n"],"names":[],"mappings":";;;;;AAOA,MAAM,GAAA,GAAM,QAAQ,iBAAiB,CAAA,CAAA;AAErC,OACG,CAAA,OAAA,CAAQ,GAAI,CAAA,OAAO,CACnB,CAAA,WAAA,CAAY,IAAI,WAAW,CAAA,CAC3B,MAAO,CAAA,eAAA,EAAiB,WAAW,CAAA,CAAA;AAEtC,OAAQ,CAAA,KAAA,CAAM,QAAQ,IAAI,CAAA"}
|
package/dist/index.esm.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import"./commands/publish.esm.min.js";import"./commands/build.esm.min.js";import{program as
|
1
|
+
import"./utils/filterSupport.esm.min.js";import"./commands/publish.esm.min.js";import"./commands/build.esm.min.js";import{program as o}from"commander";const r=require("../package.json");o.version(r.version).description(r.description).option("--root <root>","root path"),o.parse(process.argv);
|
2
2
|
//# sourceMappingURL=index.esm.min.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.esm.min.js","sources":["../src/index.ts"],"sourcesContent":["import './commands/publish'\nimport './commands/build'\n\nimport { program } from 'commander'\n\nprogram.parse(process.argv)\n"],"names":["program","parse","process","argv"],"mappings":"
|
1
|
+
{"version":3,"file":"index.esm.min.js","sources":["../src/index.ts"],"sourcesContent":["import './utils/filterSupport'\nimport './commands/publish'\nimport './commands/build'\n\nimport { program } from 'commander'\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst pkg = require('../package.json')\n\nprogram\n .version(pkg.version)\n .description(pkg.description)\n .option('--root <root>', 'root path')\n\nprogram.parse(process.argv)\n"],"names":["pkg","require","program","version","description","option","parse","process","argv"],"mappings":"uJAOA,MAAMA,EAAMC,QAAQ,mBAEpBC,EACGC,QAAQH,EAAIG,SACZC,YAAYJ,EAAII,aAChBC,OAAO,gBAAiB,aAE3BH,EAAQI,MAAMC,QAAQC"}
|