jiek 1.0.5 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cli.cjs +13 -98
- package/dist/cli.js +11 -97
- package/dist/cli.min.cjs +3 -3
- package/dist/cli.min.js +4 -4
- package/dist/rollup/index.cjs +2 -2
- package/dist/rollup/index.js +2 -2
- package/dist/rollup/index.min.cjs +1 -1
- package/dist/rollup/index.min.js +1 -1
- package/package.json +1 -1
- package/src/commands/build.ts +5 -1
- package/src/rollup/utils/externalResolver.ts +2 -1
package/dist/cli.cjs
CHANGED
@@ -7,6 +7,7 @@ var filterWorkspacePackages = require('@pnpm/filter-workspace-packages');
|
|
7
7
|
var commander = require('commander');
|
8
8
|
var jsYaml = require('js-yaml');
|
9
9
|
var getWorkspaceDir = require('@jiek/utils/getWorkspaceDir');
|
10
|
+
var pkg = require('jiek/package.json');
|
10
11
|
var cliProgress = require('cli-progress');
|
11
12
|
var execa = require('execa');
|
12
13
|
var detectIndent = require('detect-indent');
|
@@ -41,6 +42,7 @@ function _interopNamespace(e) {
|
|
41
42
|
|
42
43
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
43
44
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
45
|
+
var pkg__default = /*#__PURE__*/_interopDefault(pkg);
|
44
46
|
var detectIndent__default = /*#__PURE__*/_interopDefault(detectIndent);
|
45
47
|
var inquirer__default = /*#__PURE__*/_interopDefault(inquirer);
|
46
48
|
var require$$0__default = /*#__PURE__*/_interopDefault(require$$0);
|
@@ -63,13 +65,13 @@ function getWD() {
|
|
63
65
|
return { wd, notWorkspace };
|
64
66
|
const root = getRoot();
|
65
67
|
if (root !== void 0) {
|
66
|
-
const isWorkspace = getWorkspaceDir.isWorkspaceDir(root, type
|
68
|
+
const isWorkspace = getWorkspaceDir.isWorkspaceDir(root, type);
|
67
69
|
notWorkspace = !isWorkspace;
|
68
70
|
wd = root;
|
69
71
|
return { wd, notWorkspace };
|
70
72
|
}
|
71
73
|
try {
|
72
|
-
wd = getWorkspaceDir.getWorkspaceDir(type
|
74
|
+
wd = getWorkspaceDir.getWorkspaceDir(type);
|
73
75
|
} catch (e) {
|
74
76
|
if ("message" in e && e.message === "workspace root not found") {
|
75
77
|
wd = root;
|
@@ -81,21 +83,21 @@ function getWD() {
|
|
81
83
|
return { wd, notWorkspace };
|
82
84
|
}
|
83
85
|
|
84
|
-
let type
|
86
|
+
let type = "";
|
85
87
|
try {
|
86
88
|
const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('cli.cjs', document.baseURI).href)));
|
87
89
|
require$1.resolve("@pnpm/filter-workspace-packages");
|
88
|
-
type
|
90
|
+
type = "pnpm";
|
89
91
|
} catch {
|
90
92
|
}
|
91
|
-
if (type
|
93
|
+
if (type !== "") {
|
92
94
|
commander.program.option("-f, --filter <filter>", "filter packages");
|
93
95
|
}
|
94
96
|
async function getSelectedProjectsGraph() {
|
95
97
|
let filter = commander.program.getOptionValue("filter");
|
96
98
|
const root = getRoot();
|
97
99
|
const { wd, notWorkspace } = getWD();
|
98
|
-
if (!notWorkspace && type
|
100
|
+
if (!notWorkspace && type === "pnpm") {
|
99
101
|
const pnpmWorkspaceFilePath = path__default.default.resolve(wd, "pnpm-workspace.yaml");
|
100
102
|
const pnpmWorkspaceFileContent = fs__default.default.readFileSync(pnpmWorkspaceFilePath, "utf-8");
|
101
103
|
const pnpmWorkspace = jsYaml.load(pnpmWorkspaceFileContent);
|
@@ -139,96 +141,7 @@ async function getSelectedProjectsGraph() {
|
|
139
141
|
};
|
140
142
|
}
|
141
143
|
|
142
|
-
|
143
|
-
var type = "module";
|
144
|
-
var version = "1.0.4";
|
145
|
-
var description = "YiJie's personal kits.";
|
146
|
-
var bin = {
|
147
|
-
jiek: "bin/jiek.js",
|
148
|
-
jk: "bin/jiek.js"
|
149
|
-
};
|
150
|
-
var files = [
|
151
|
-
"dist",
|
152
|
-
"src",
|
153
|
-
"bin",
|
154
|
-
"LICENSE",
|
155
|
-
"README.md"
|
156
|
-
];
|
157
|
-
var typesVersions = {
|
158
|
-
"<5.0": {
|
159
|
-
"*": [
|
160
|
-
"*",
|
161
|
-
"./dist/*",
|
162
|
-
"./dist/*/index.d.ts"
|
163
|
-
]
|
164
|
-
}
|
165
|
-
};
|
166
|
-
var exports$1 = {
|
167
|
-
"./package.json": "./package.json",
|
168
|
-
".": "./src/index.ts",
|
169
|
-
"./cli": "./src/cli.ts",
|
170
|
-
"./rollup": "./src/rollup/index.ts"
|
171
|
-
};
|
172
|
-
var imports = {
|
173
|
-
"#~/*": "./src/*"
|
174
|
-
};
|
175
|
-
var dependencies = {
|
176
|
-
"@jiek/pkger": "workspace:^",
|
177
|
-
"@jiek/rollup-plugin-dts": "^6.1.1",
|
178
|
-
"@jiek/utils": "workspace:^",
|
179
|
-
"@rollup/plugin-commonjs": "^28.0.0",
|
180
|
-
"@rollup/plugin-json": "^6.0.1",
|
181
|
-
"@rollup/plugin-node-resolve": "^15.3.0",
|
182
|
-
"@rollup/plugin-terser": "^0.4.4",
|
183
|
-
autoprefixer: "^10.4.16",
|
184
|
-
"cli-progress": "^3.12.0",
|
185
|
-
commander: "^12.0.0",
|
186
|
-
"detect-indent": "^6.1.0",
|
187
|
-
execa: "9.3.1",
|
188
|
-
inquirer: "^8.2.6",
|
189
|
-
"js-yaml": "^4.1.0",
|
190
|
-
"jsonc-parser": "^3.2.1",
|
191
|
-
rollup: "^4.1.5",
|
192
|
-
"rollup-plugin-copy": "^3.5.0",
|
193
|
-
"rollup-plugin-esbuild": "^6.1.0",
|
194
|
-
typescript: "^5.0.0"
|
195
|
-
};
|
196
|
-
var optionalDependencies = {
|
197
|
-
"@pnpm/filter-workspace-packages": "^7.2.13",
|
198
|
-
"esbuild-register": "^3.5.0",
|
199
|
-
postcss: "^8.4.47",
|
200
|
-
"rollup-plugin-postcss": "^4.0.2"
|
201
|
-
};
|
202
|
-
var devDependencies = {
|
203
|
-
"@npm/types": "^1.0.2",
|
204
|
-
"@pnpm/filter-workspace-packages": "^7.2.13",
|
205
|
-
"@pnpm/workspace.pkgs-graph": "^2.0.15",
|
206
|
-
"@types/cli-progress": "^3.11.5",
|
207
|
-
"@types/inquirer": "^9.0.7",
|
208
|
-
"@types/js-yaml": "^4.0.9",
|
209
|
-
"@types/micromatch": "^4.0.6",
|
210
|
-
"esbuild-register": "^3.5.0",
|
211
|
-
micromatch: "^4.0.5",
|
212
|
-
"node-sass": "^9.0.0",
|
213
|
-
postcss: "^8.4.47",
|
214
|
-
"rollup-plugin-postcss": "^4.0.2"
|
215
|
-
};
|
216
|
-
var pkg = {
|
217
|
-
name: name,
|
218
|
-
type: type,
|
219
|
-
version: version,
|
220
|
-
description: description,
|
221
|
-
bin: bin,
|
222
|
-
files: files,
|
223
|
-
typesVersions: typesVersions,
|
224
|
-
exports: exports$1,
|
225
|
-
imports: imports,
|
226
|
-
dependencies: dependencies,
|
227
|
-
optionalDependencies: optionalDependencies,
|
228
|
-
devDependencies: devDependencies
|
229
|
-
};
|
230
|
-
|
231
|
-
commander.program.version(pkg.version).description(pkg.description).option("--root <root>", "root path").option("-c, --config-path <configPath>", "config path");
|
144
|
+
commander.program.version(pkg__default.default.version).description(pkg__default.default.description).option("--root <root>", "root path").option("-c, --config-path <configPath>", "config path");
|
232
145
|
|
233
146
|
let resolve;
|
234
147
|
function actionDone() {
|
@@ -339,9 +252,10 @@ const FILE_TEMPLATE = (manifest) => `
|
|
339
252
|
module.exports = require('jiek/rollup').template(${JSON.stringify(manifest, null, 2)})
|
340
253
|
`.trimStart();
|
341
254
|
const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('cli.cjs', document.baseURI).href)));
|
342
|
-
commander.program.command("build").option("-s, --silent", "Don't display logs.").option("-e, --entries <ENTRIES>", "Specify the entries of the package.json's 'exports' field.(support glob)").action(async ({
|
255
|
+
commander.program.command("build").option("-s, --silent", "Don't display logs.").option("-e, --entries <ENTRIES>", "Specify the entries of the package.json's 'exports' field.(support glob)").option("-v, --verbose", "Display debug logs.").action(async ({
|
343
256
|
silent,
|
344
|
-
entries
|
257
|
+
entries,
|
258
|
+
verbose
|
345
259
|
}) => {
|
346
260
|
actionRestore();
|
347
261
|
const { build } = loadConfig();
|
@@ -454,6 +368,7 @@ commander.program.command("build").option("-s, --silent", "Don't display logs.")
|
|
454
368
|
});
|
455
369
|
child.once("exit", (code) => code === 0 ? resolve() : reject(new Error(`rollup build failed:
|
456
370
|
${errorStr}`)));
|
371
|
+
verbose && child.stdout?.pipe(process.stdout);
|
457
372
|
});
|
458
373
|
})
|
459
374
|
).finally(() => {
|
package/dist/cli.js
CHANGED
@@ -5,6 +5,7 @@ import { filterPackagesFromDir } from '@pnpm/filter-workspace-packages';
|
|
5
5
|
import { program } from 'commander';
|
6
6
|
import { load } from 'js-yaml';
|
7
7
|
import { isWorkspaceDir, getWorkspaceDir } from '@jiek/utils/getWorkspaceDir';
|
8
|
+
import pkg from 'jiek/package.json';
|
8
9
|
import { MultiBar, Presets } from 'cli-progress';
|
9
10
|
import { execaCommand } from 'execa';
|
10
11
|
import detectIndent from 'detect-indent';
|
@@ -32,13 +33,13 @@ function getWD() {
|
|
32
33
|
return { wd, notWorkspace };
|
33
34
|
const root = getRoot();
|
34
35
|
if (root !== void 0) {
|
35
|
-
const isWorkspace = isWorkspaceDir(root, type
|
36
|
+
const isWorkspace = isWorkspaceDir(root, type);
|
36
37
|
notWorkspace = !isWorkspace;
|
37
38
|
wd = root;
|
38
39
|
return { wd, notWorkspace };
|
39
40
|
}
|
40
41
|
try {
|
41
|
-
wd = getWorkspaceDir(type
|
42
|
+
wd = getWorkspaceDir(type);
|
42
43
|
} catch (e) {
|
43
44
|
if ("message" in e && e.message === "workspace root not found") {
|
44
45
|
wd = root;
|
@@ -50,21 +51,21 @@ function getWD() {
|
|
50
51
|
return { wd, notWorkspace };
|
51
52
|
}
|
52
53
|
|
53
|
-
let type
|
54
|
+
let type = "";
|
54
55
|
try {
|
55
56
|
const require = createRequire(import.meta.url);
|
56
57
|
require.resolve("@pnpm/filter-workspace-packages");
|
57
|
-
type
|
58
|
+
type = "pnpm";
|
58
59
|
} catch {
|
59
60
|
}
|
60
|
-
if (type
|
61
|
+
if (type !== "") {
|
61
62
|
program.option("-f, --filter <filter>", "filter packages");
|
62
63
|
}
|
63
64
|
async function getSelectedProjectsGraph() {
|
64
65
|
let filter = program.getOptionValue("filter");
|
65
66
|
const root = getRoot();
|
66
67
|
const { wd, notWorkspace } = getWD();
|
67
|
-
if (!notWorkspace && type
|
68
|
+
if (!notWorkspace && type === "pnpm") {
|
68
69
|
const pnpmWorkspaceFilePath = path.resolve(wd, "pnpm-workspace.yaml");
|
69
70
|
const pnpmWorkspaceFileContent = fs.readFileSync(pnpmWorkspaceFilePath, "utf-8");
|
70
71
|
const pnpmWorkspace = load(pnpmWorkspaceFileContent);
|
@@ -108,95 +109,6 @@ async function getSelectedProjectsGraph() {
|
|
108
109
|
};
|
109
110
|
}
|
110
111
|
|
111
|
-
var name = "jiek";
|
112
|
-
var type = "module";
|
113
|
-
var version = "1.0.4";
|
114
|
-
var description = "YiJie's personal kits.";
|
115
|
-
var bin = {
|
116
|
-
jiek: "bin/jiek.js",
|
117
|
-
jk: "bin/jiek.js"
|
118
|
-
};
|
119
|
-
var files = [
|
120
|
-
"dist",
|
121
|
-
"src",
|
122
|
-
"bin",
|
123
|
-
"LICENSE",
|
124
|
-
"README.md"
|
125
|
-
];
|
126
|
-
var typesVersions = {
|
127
|
-
"<5.0": {
|
128
|
-
"*": [
|
129
|
-
"*",
|
130
|
-
"./dist/*",
|
131
|
-
"./dist/*/index.d.ts"
|
132
|
-
]
|
133
|
-
}
|
134
|
-
};
|
135
|
-
var exports = {
|
136
|
-
"./package.json": "./package.json",
|
137
|
-
".": "./src/index.ts",
|
138
|
-
"./cli": "./src/cli.ts",
|
139
|
-
"./rollup": "./src/rollup/index.ts"
|
140
|
-
};
|
141
|
-
var imports = {
|
142
|
-
"#~/*": "./src/*"
|
143
|
-
};
|
144
|
-
var dependencies = {
|
145
|
-
"@jiek/pkger": "workspace:^",
|
146
|
-
"@jiek/rollup-plugin-dts": "^6.1.1",
|
147
|
-
"@jiek/utils": "workspace:^",
|
148
|
-
"@rollup/plugin-commonjs": "^28.0.0",
|
149
|
-
"@rollup/plugin-json": "^6.0.1",
|
150
|
-
"@rollup/plugin-node-resolve": "^15.3.0",
|
151
|
-
"@rollup/plugin-terser": "^0.4.4",
|
152
|
-
autoprefixer: "^10.4.16",
|
153
|
-
"cli-progress": "^3.12.0",
|
154
|
-
commander: "^12.0.0",
|
155
|
-
"detect-indent": "^6.1.0",
|
156
|
-
execa: "9.3.1",
|
157
|
-
inquirer: "^8.2.6",
|
158
|
-
"js-yaml": "^4.1.0",
|
159
|
-
"jsonc-parser": "^3.2.1",
|
160
|
-
rollup: "^4.1.5",
|
161
|
-
"rollup-plugin-copy": "^3.5.0",
|
162
|
-
"rollup-plugin-esbuild": "^6.1.0",
|
163
|
-
typescript: "^5.0.0"
|
164
|
-
};
|
165
|
-
var optionalDependencies = {
|
166
|
-
"@pnpm/filter-workspace-packages": "^7.2.13",
|
167
|
-
"esbuild-register": "^3.5.0",
|
168
|
-
postcss: "^8.4.47",
|
169
|
-
"rollup-plugin-postcss": "^4.0.2"
|
170
|
-
};
|
171
|
-
var devDependencies = {
|
172
|
-
"@npm/types": "^1.0.2",
|
173
|
-
"@pnpm/filter-workspace-packages": "^7.2.13",
|
174
|
-
"@pnpm/workspace.pkgs-graph": "^2.0.15",
|
175
|
-
"@types/cli-progress": "^3.11.5",
|
176
|
-
"@types/inquirer": "^9.0.7",
|
177
|
-
"@types/js-yaml": "^4.0.9",
|
178
|
-
"@types/micromatch": "^4.0.6",
|
179
|
-
"esbuild-register": "^3.5.0",
|
180
|
-
micromatch: "^4.0.5",
|
181
|
-
"node-sass": "^9.0.0",
|
182
|
-
postcss: "^8.4.47",
|
183
|
-
"rollup-plugin-postcss": "^4.0.2"
|
184
|
-
};
|
185
|
-
var pkg = {
|
186
|
-
name: name,
|
187
|
-
type: type,
|
188
|
-
version: version,
|
189
|
-
description: description,
|
190
|
-
bin: bin,
|
191
|
-
files: files,
|
192
|
-
typesVersions: typesVersions,
|
193
|
-
exports: exports,
|
194
|
-
imports: imports,
|
195
|
-
dependencies: dependencies,
|
196
|
-
optionalDependencies: optionalDependencies,
|
197
|
-
devDependencies: devDependencies
|
198
|
-
};
|
199
|
-
|
200
112
|
program.version(pkg.version).description(pkg.description).option("--root <root>", "root path").option("-c, --config-path <configPath>", "config path");
|
201
113
|
|
202
114
|
let resolve;
|
@@ -308,9 +220,10 @@ const FILE_TEMPLATE = (manifest) => `
|
|
308
220
|
module.exports = require('jiek/rollup').template(${JSON.stringify(manifest, null, 2)})
|
309
221
|
`.trimStart();
|
310
222
|
const require$1 = createRequire(import.meta.url);
|
311
|
-
program.command("build").option("-s, --silent", "Don't display logs.").option("-e, --entries <ENTRIES>", "Specify the entries of the package.json's 'exports' field.(support glob)").action(async ({
|
223
|
+
program.command("build").option("-s, --silent", "Don't display logs.").option("-e, --entries <ENTRIES>", "Specify the entries of the package.json's 'exports' field.(support glob)").option("-v, --verbose", "Display debug logs.").action(async ({
|
312
224
|
silent,
|
313
|
-
entries
|
225
|
+
entries,
|
226
|
+
verbose
|
314
227
|
}) => {
|
315
228
|
actionRestore();
|
316
229
|
const { build } = loadConfig();
|
@@ -423,6 +336,7 @@ program.command("build").option("-s, --silent", "Don't display logs.").option("-
|
|
423
336
|
});
|
424
337
|
child.once("exit", (code) => code === 0 ? resolve() : reject(new Error(`rollup build failed:
|
425
338
|
${errorStr}`)));
|
339
|
+
verbose && child.stdout?.pipe(process.stdout);
|
426
340
|
});
|
427
341
|
})
|
428
342
|
).finally(() => {
|