@sprucelabs/esm-postbuild 6.0.565 → 6.0.567
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/build/esm-postbuild.js +45 -13
- package/package.json +8 -11
package/build/esm-postbuild.js
CHANGED
|
@@ -10,24 +10,56 @@ exports.loadSubstitueWrite = loadSubstitueWrite;
|
|
|
10
10
|
exports.processesByGlob = processesByGlob;
|
|
11
11
|
const fs_1 = __importDefault(require("fs"));
|
|
12
12
|
const path_1 = __importDefault(require("path"));
|
|
13
|
-
const
|
|
14
|
-
const globby_1 = __importDefault(require("globby"));
|
|
15
|
-
const yargs_1 = __importDefault(require("yargs"));
|
|
13
|
+
const globby_1 = __importDefault(require("@sprucelabs/globby"));
|
|
16
14
|
if (require.main === module) {
|
|
17
|
-
const argv =
|
|
18
|
-
target: {
|
|
19
|
-
desc: "Where I'll look to begin mapping paths. Defaults to cwd.",
|
|
20
|
-
},
|
|
21
|
-
patterns: {
|
|
22
|
-
desc: 'Comma separated list of globby patterns, default to **/*.js',
|
|
23
|
-
},
|
|
24
|
-
}).argv;
|
|
15
|
+
const argv = parseArgs();
|
|
25
16
|
const { patterns, target } = argv;
|
|
26
17
|
const targetDir = target ? target : 'build/esm';
|
|
27
18
|
const pattern = patterns ? patterns.split(',') : ['**/*.js'];
|
|
28
|
-
console.log(
|
|
19
|
+
console.log(`Updating ${targetDir}`);
|
|
29
20
|
const results = processesByGlob(targetDir, pattern);
|
|
30
|
-
console.log(
|
|
21
|
+
console.log(`Done! Processed ${results} files.`);
|
|
22
|
+
}
|
|
23
|
+
function parseArgs() {
|
|
24
|
+
const args = {};
|
|
25
|
+
const descriptions = {
|
|
26
|
+
target: "Where I'll look to begin mapping paths. Defaults to build/esm.",
|
|
27
|
+
patterns: 'Comma separated list of globby patterns, default to **/*.js',
|
|
28
|
+
help: 'Show this help message',
|
|
29
|
+
};
|
|
30
|
+
for (let i = 2; i < process.argv.length; i++) {
|
|
31
|
+
let arg = process.argv[i];
|
|
32
|
+
if (arg.startsWith('--')) {
|
|
33
|
+
let key;
|
|
34
|
+
let value;
|
|
35
|
+
if (arg.includes('=')) {
|
|
36
|
+
;
|
|
37
|
+
[key, value] = arg.slice(2).split('=');
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
key = arg.slice(2);
|
|
41
|
+
// Only set value if next arg exists and doesn't start with --
|
|
42
|
+
if (process.argv[i + 1] &&
|
|
43
|
+
!process.argv[i + 1].startsWith('--')) {
|
|
44
|
+
value = process.argv[i + 1];
|
|
45
|
+
i++; // skip next arg
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
value = true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
args[key] = value;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (args.help) {
|
|
55
|
+
console.log('Usage: esm-postbuild [--target dir] [--patterns globs]');
|
|
56
|
+
console.log('\nOptions:');
|
|
57
|
+
Object.entries(descriptions).forEach(([key, desc]) => {
|
|
58
|
+
console.log(` --${key.padEnd(10)} ${desc}`);
|
|
59
|
+
});
|
|
60
|
+
process.exit(0);
|
|
61
|
+
}
|
|
62
|
+
return args;
|
|
31
63
|
}
|
|
32
64
|
function isDir(path) {
|
|
33
65
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sprucelabs/esm-postbuild",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.567",
|
|
4
4
|
"description": "Script to do thins after build of esm modules",
|
|
5
5
|
"main": "build/esm-postbuild.js",
|
|
6
6
|
"repository": "git@github.com:sprucelabsai-community/esm-postbuild.git",
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
"@sprucelabs/resolve-path-aliases",
|
|
13
13
|
"@sprucelabs/spruce-test-fixtures",
|
|
14
14
|
"@sprucelabs/test-utils",
|
|
15
|
-
"@sprucelabs/jest-json-reporter"
|
|
16
|
-
"chalk"
|
|
15
|
+
"@sprucelabs/jest-json-reporter"
|
|
17
16
|
]
|
|
18
17
|
},
|
|
19
18
|
"bin": {
|
|
@@ -48,24 +47,22 @@
|
|
|
48
47
|
"watch.rebuild": "yarn run clean.all && yarn install && yarn run watch.build.dev"
|
|
49
48
|
},
|
|
50
49
|
"dependencies": {
|
|
51
|
-
"@sprucelabs/globby": "^2.0.
|
|
52
|
-
"chalk": "^4.1.2",
|
|
53
|
-
"yargs": "^17.7.2"
|
|
50
|
+
"@sprucelabs/globby": "^2.0.503"
|
|
54
51
|
},
|
|
55
52
|
"devDependencies": {
|
|
56
53
|
"@sprucelabs/semantic-release": "^5.0.2",
|
|
57
|
-
"@sprucelabs/test": "^9.0.
|
|
54
|
+
"@sprucelabs/test": "^9.0.83",
|
|
58
55
|
"@types/fs-extra": "^11.0.4",
|
|
59
|
-
"@types/node": "^22.15.
|
|
56
|
+
"@types/node": "^22.15.29",
|
|
60
57
|
"chokidar-cli": "^3.0.0",
|
|
61
|
-
"eslint": "^9.
|
|
58
|
+
"eslint": "^9.28.0",
|
|
62
59
|
"eslint-config-spruce": "^11.2.26",
|
|
63
60
|
"fs-extra": "^11.3.0",
|
|
64
61
|
"jest": "^29.7.0",
|
|
65
|
-
"jest-circus": "^
|
|
62
|
+
"jest-circus": "^30.0.0-beta.3",
|
|
66
63
|
"prettier": "^3.5.3",
|
|
67
64
|
"ts-node": "^10.9.2",
|
|
68
|
-
"tsc-watch": "^7.
|
|
65
|
+
"tsc-watch": "^7.1.1",
|
|
69
66
|
"tsconfig-paths": "^4.2.0",
|
|
70
67
|
"typescript": "^5.8.3"
|
|
71
68
|
},
|