mb-run 0.0.1 → 0.0.2-dev-20260701-879b9df
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/CHANGELOG.md +9 -1
- package/README.md +1 -1
- package/dist/help.js +1 -1
- package/dist/module.js +4 -1
- package/dist/upgrade.js +33 -2
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -21,9 +21,17 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
21
21
|
|
|
22
22
|
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="120"></a>
|
|
23
23
|
|
|
24
|
+
## [0.0.2] - Dev branch
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- [package]: Update dependencies.
|
|
29
|
+
|
|
30
|
+
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="80"></a>
|
|
31
|
+
|
|
24
32
|
## [0.0.1] - 2026-06-27
|
|
25
33
|
|
|
26
|
-
- [package]: Initial release
|
|
34
|
+
- [package]: Initial release.
|
|
27
35
|
|
|
28
36
|
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="80"></a>
|
|
29
37
|
|
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ Multiple flags can be combined. They are always executed in this fixed order reg
|
|
|
65
65
|
| -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
66
66
|
| `--install` | Runs `npm install --no-fund --no-audit`. In a Matterbridge plugin project, also runs `npm link matterbridge`. |
|
|
67
67
|
| `--update` | Upgrades all dependencies with `npm-check-updates` (`ncu -u`) across the root and all workspaces, then runs `npm install`. |
|
|
68
|
-
| `--upgrade [keywords...]` | Upgrades the project's config and scaffolding files, then runs `npm install`. Optional keywords enable extras: `jest`, `vitest`, `bundle`, `obfuscate`.
|
|
68
|
+
| `--upgrade [keywords...]` | Upgrades the project's config and scaffolding files, then runs `npm install`. Optional keywords enable extras: `node`, `bun`, `jest`, `vitest`, `buntest`, `bundle`, `obfuscate`. |
|
|
69
69
|
| `--reset` | Empties `.cache/` and `node_modules/` (preserving directory structure for devcontainer named volumes), then runs `npm install` and rebuilds. Implies `--install` and `--build`. |
|
|
70
70
|
| `--reset --production` | Same as `--reset` but rebuilds using the production tsconfig. |
|
|
71
71
|
| `--deep-clean` | Same filesystem cleanup as `--reset` but skips the install and build steps. |
|
package/dist/help.js
CHANGED
|
@@ -32,7 +32,7 @@ ${brightYellow('Options:')}
|
|
|
32
32
|
${f('--fix')}with --lint, apply automatic fixes
|
|
33
33
|
${f('--sort')}sort top-level keys in all package.json files
|
|
34
34
|
${f('--update')}run ncu -u across all workspaces then npm install
|
|
35
|
-
${f('--upgrade', '[keywords...]')}upgrade config files; keywords: jest | vitest | promiserules | typeaware | experimental
|
|
35
|
+
${f('--upgrade', '[keywords...]')}upgrade config files; keywords: node | bun | jest | vitest | buntest | bundle | obfuscate | promiserules | typeaware | experimental
|
|
36
36
|
${f('--pack', '[tag] [minify]')}back up, clean, build, npm pack, and restore; bumps version first if tag is provided
|
|
37
37
|
${f('--publish', '[tag]')}back up, npm publish for root and all workspaces, and restore; bumps version first if tag is provided
|
|
38
38
|
${f('--esbuild', '[minify]')}bundle with esbuild; minify compresses output and removes comments
|
package/dist/module.js
CHANGED
|
@@ -96,7 +96,7 @@ export async function main() {
|
|
|
96
96
|
const candidatePublishArg = publishIndex >= 0 ? rawArgs[publishIndex + 1] : undefined;
|
|
97
97
|
const rawPublishTag = typeof candidatePublishArg === 'string' && !candidatePublishArg.startsWith('-') ? candidatePublishArg : undefined;
|
|
98
98
|
const upgradeIndex = rawArgs.indexOf('--upgrade');
|
|
99
|
-
const upgradeValidKeywords = new Set(['jest', 'vitest', 'promiserules', 'typeaware', 'experimental']);
|
|
99
|
+
const upgradeValidKeywords = new Set(['node', 'bun', 'jest', 'vitest', 'buntest', 'bundle', 'obfuscate', 'promiserules', 'typeaware', 'experimental']);
|
|
100
100
|
const upgradeArgIndices = new Set();
|
|
101
101
|
const upgradeArgs = new Set();
|
|
102
102
|
if (upgradeIndex >= 0) {
|
|
@@ -242,8 +242,11 @@ export async function main() {
|
|
|
242
242
|
rootDir: repoRoot,
|
|
243
243
|
isWindows,
|
|
244
244
|
dryRun: dryRunMode,
|
|
245
|
+
useNode: upgradeArgs.has('node'),
|
|
246
|
+
useBun: upgradeArgs.has('bun'),
|
|
245
247
|
enableJest: upgradeArgs.has('jest'),
|
|
246
248
|
enableVitest: upgradeArgs.has('vitest'),
|
|
249
|
+
enableBuntest: upgradeArgs.has('buntest'),
|
|
247
250
|
enableBundle: upgradeArgs.has('bundle'),
|
|
248
251
|
enableObfuscate: upgradeArgs.has('obfuscate'),
|
|
249
252
|
});
|
package/dist/upgrade.js
CHANGED
|
@@ -38,10 +38,16 @@ export async function runPackageJsonUpgrade(opts, pkgPath, pkgJson, isMonorepo =
|
|
|
38
38
|
log(`Automator:${reset()}\n${inspect(automator, true, 2, true)}`);
|
|
39
39
|
const coverage = automator?.coverage;
|
|
40
40
|
log(`Automator coverage:${reset()}\n${inspect(coverage, true, 2, true)}`);
|
|
41
|
+
if (automator?.node !== undefined)
|
|
42
|
+
opts.useNode = automator.node;
|
|
43
|
+
if (automator?.bun !== undefined)
|
|
44
|
+
opts.useBun = automator.bun;
|
|
41
45
|
if (automator?.jest !== undefined)
|
|
42
46
|
opts.enableJest = automator.jest;
|
|
43
47
|
if (automator?.vitest !== undefined)
|
|
44
48
|
opts.enableVitest = automator.vitest;
|
|
49
|
+
if (automator?.buntest !== undefined)
|
|
50
|
+
opts.enableBuntest = automator.buntest;
|
|
45
51
|
log(`Upgrading dependencies in ${magenta(dstDir)} ${isMonorepo ? '(monorepo)' : isWorkspace ? '(workspace)' : isPlugin ? '(plugin)' : isLibrary ? '(library)' : ''}...`);
|
|
46
52
|
if (pkgJson.name === undefined) {
|
|
47
53
|
log('No name field found in package.json. It is recommended to add a name field for better compatibility with npm and to explicitly define the name of your package. For example:\n\n"name": "your-package-name"\n\nThis helps ensure that consumers of your package can correctly identify and install your package.');
|
|
@@ -156,10 +162,18 @@ export async function runPackageJsonUpgrade(opts, pkgPath, pkgJson, isMonorepo =
|
|
|
156
162
|
unlinkSafe('.prettierignore');
|
|
157
163
|
unlinkSafe('eslint.config.js');
|
|
158
164
|
unlinkSafe('prettier.config.js');
|
|
159
|
-
if (opts.enableJest)
|
|
165
|
+
if (opts.enableJest) {
|
|
160
166
|
copyRecursive('jest.config.js', 'jest.config.js');
|
|
161
|
-
|
|
167
|
+
mkDirSafe(path.join(dstDir, 'test'));
|
|
168
|
+
}
|
|
169
|
+
if (opts.enableVitest) {
|
|
162
170
|
copyRecursive('vite.config.ts', 'vite.config.ts');
|
|
171
|
+
mkDirSafe(path.join(dstDir, 'vitest'));
|
|
172
|
+
}
|
|
173
|
+
if (opts.enableBuntest) {
|
|
174
|
+
copyRecursive('bunfig.toml', 'bunfig.toml');
|
|
175
|
+
mkDirSafe(path.join(dstDir, 'buntest'));
|
|
176
|
+
}
|
|
163
177
|
if (!opts.enableJest) {
|
|
164
178
|
log(magenta('No Jest flag set, removing Jest...'));
|
|
165
179
|
unlinkSafe('tsconfig.jest.json');
|
|
@@ -170,6 +184,10 @@ export async function runPackageJsonUpgrade(opts, pkgPath, pkgJson, isMonorepo =
|
|
|
170
184
|
unlinkSafe('tsconfig.vitest.json');
|
|
171
185
|
unlinkSafe('vite.config.ts');
|
|
172
186
|
}
|
|
187
|
+
if (!opts.enableBuntest) {
|
|
188
|
+
log(magenta('No Bun test flag set, removing Bun test...'));
|
|
189
|
+
unlinkSafe('bunfig.toml');
|
|
190
|
+
}
|
|
173
191
|
}
|
|
174
192
|
unlinkSafe('tsconfig.production.json');
|
|
175
193
|
unlinkSafe('tsconfig.vitest.json');
|
|
@@ -186,6 +204,11 @@ export async function runPackageJsonUpgrade(opts, pkgPath, pkgJson, isMonorepo =
|
|
|
186
204
|
else {
|
|
187
205
|
copyRecursive('tsconfig.build.json', 'tsconfig.build.json');
|
|
188
206
|
copyRecursive(isLibrary ? 'tsconfig.build.production.library.json' : 'tsconfig.build.production.json', 'tsconfig.build.production.json');
|
|
207
|
+
if (opts.useBun) {
|
|
208
|
+
fileReplace('tsconfig.json', '["node"', '["node", "bun"');
|
|
209
|
+
fileReplace('tsconfig.build.json', '["node"]', '["node", "bun"]');
|
|
210
|
+
fileReplace('tsconfig.build.production.json', '["node"]', '["node", "bun"]');
|
|
211
|
+
}
|
|
189
212
|
if (isWorkspace) {
|
|
190
213
|
fileReplace('tsconfig.json', '"extends": "./tsconfig.base.json"', '"extends": "../../tsconfig.base.json"');
|
|
191
214
|
fileReplace('tsconfig.build.json', '"extends": "./tsconfig.base.json"', '"extends": "../../tsconfig.base.json"');
|
|
@@ -530,6 +553,14 @@ export function copyRecursive(sourceFileName, destinationFileName) {
|
|
|
530
553
|
export function resolveDstPath(filePath) {
|
|
531
554
|
return path.isAbsolute(filePath) ? filePath : path.join(dstDir, filePath);
|
|
532
555
|
}
|
|
556
|
+
export function mkDirSafe(dirPath) {
|
|
557
|
+
const resolvedPath = resolveDstPath(dirPath);
|
|
558
|
+
if (existsSync(resolvedPath))
|
|
559
|
+
return false;
|
|
560
|
+
mkdirSync(resolvedPath, { recursive: true });
|
|
561
|
+
log(`${green('Created:')} ${path.relative(process.cwd(), resolvedPath)}`);
|
|
562
|
+
return true;
|
|
563
|
+
}
|
|
533
564
|
export function unlinkSafe(filePath) {
|
|
534
565
|
const resolvedPath = resolveDstPath(filePath);
|
|
535
566
|
if (!existsSync(resolvedPath))
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mb-run",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2-dev-20260701-879b9df",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "mb-run",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.2-dev-20260701-879b9df",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"cross-spawn": "7.0.6",
|