mb-run 1.0.4 → 1.0.5-dev-20261005-0f11fc7

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 CHANGED
@@ -23,6 +23,10 @@ If you like this project and find it useful, please consider giving it a star on
23
23
 
24
24
  <a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="120"></a>
25
25
 
26
+ ## [1.0.5] - Dev branch
27
+
28
+ <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
+
26
30
  ## [1.0.4] - 2026-10-03
27
31
 
28
32
  ### Changed
package/dist/upgrade.js CHANGED
@@ -249,14 +249,13 @@ export async function runPackageJsonUpgrade(opts, pkgPath, pkgJson, isMonorepo =
249
249
  if (!isMonorepo)
250
250
  unlinkSafe('vitest.config.ts');
251
251
  }
252
- if (opts.enableBuntest) {
252
+ if (opts.useBun || opts.enableBuntest) {
253
253
  copyRecursive('bunfig.toml', 'bunfig.toml');
254
254
  mkDirSafe(path.join(dstDir, 'buntest'));
255
255
  }
256
256
  else {
257
257
  log(magenta('No Bun test flag set, removing Bun test...'));
258
- if (!isMonorepo)
259
- unlinkSafe('bunfig.toml');
258
+ unlinkSafe('bunfig.toml');
260
259
  }
261
260
  }
262
261
  if (automator?.app !== true && automator?.skipTsconfig !== true) {
@@ -270,15 +269,15 @@ export async function runPackageJsonUpgrade(opts, pkgPath, pkgJson, isMonorepo =
270
269
  if (opts.enableJest && !isWorkspace)
271
270
  copyRecursive('tsconfig.jest.json', 'tsconfig.jest.json');
272
271
  if (isMonorepo) {
273
- fileReplace('tsconfig.json', '["src/**/*.ts", "test/**/*.ts", "vitest/**/*.ts"]', '["src/**/*.ts", "test/**/*.ts", "vitest/**/*.ts", "packages/*/src/**/*.ts", "packages/*/test/**/*.ts", "packages/*/vitest/**/*.ts"]');
272
+ fileReplace('tsconfig.json', '["src/**/*.ts", "test/**/*.ts", "vitest/**/*.ts", "buntest/**/*.ts"]', '["src/**/*.ts", "test/**/*.ts", "vitest/**/*.ts", "buntest/**/*.ts", "packages/*/src/**/*.ts", "packages/*/test/**/*.ts", "packages/*/vitest/**/*.ts", "packages/*/buntest/**/*.ts"]');
274
273
  }
275
274
  else {
276
275
  copyRecursive('tsconfig.build.json', 'tsconfig.build.json');
277
276
  copyRecursive(isLibrary ? 'tsconfig.build.production.library.json' : 'tsconfig.build.production.json', 'tsconfig.build.production.json');
278
277
  if (opts.useBun) {
279
- fileReplace('tsconfig.json', '["node"', '["node", "bun"');
280
- fileReplace('tsconfig.build.json', '["node"]', '["node", "bun"]');
281
- fileReplace('tsconfig.build.production.json', '["node"]', '["node", "bun"]');
278
+ fileReplace('tsconfig.json', '["node"', '["bun"');
279
+ fileReplace('tsconfig.build.json', '["node"]', '["bun"]');
280
+ fileReplace('tsconfig.build.production.json', '["node"]', '["bun"]');
282
281
  }
283
282
  if (isWorkspace) {
284
283
  fileReplace('tsconfig.json', '"extends": "./tsconfig.base.json"', '"extends": "../../tsconfig.base.json"');
@@ -301,6 +300,11 @@ export async function runPackageJsonUpgrade(opts, pkgPath, pkgJson, isMonorepo =
301
300
  fileReplace('tsconfig.json', ', "vitest/**/*.ts"', '');
302
301
  fileReplace('tsconfig.json', ', "packages/*/vitest/**/*.ts"', '');
303
302
  }
303
+ if (!opts.enableBuntest) {
304
+ log(magenta('No BunTest flag set, removing BunTest from tsconfig.json...'));
305
+ fileReplace('tsconfig.json', ', "buntest/**/*.ts"', '');
306
+ fileReplace('tsconfig.json', ', "packages/*/buntest/**/*.ts"', '');
307
+ }
304
308
  }
305
309
  }
306
310
  if (!isWorkspace && automator?.private !== true)
@@ -366,7 +370,7 @@ export async function runPackageJsonUpgrade(opts, pkgPath, pkgJson, isMonorepo =
366
370
  if (opts.useNode)
367
371
  npmPkgSets.push(['engines.node', '>=20.19.0 <21.0.0 || >=22.13.0 <23.0.0 || >=24.0.0 <25.0.0 || >=26.0.0 <27.0.0']);
368
372
  else if (opts.useBun)
369
- npmPkgSets.push(['engines.bun', '>=1.0.0']);
373
+ npmPkgSets.push(['engines.bun', '>=1.4.2']);
370
374
  if (!pkgJson.license)
371
375
  npmPkgSets.push(['license', 'Apache-2.0']);
372
376
  if (!pkgJson.type)
@@ -389,6 +393,10 @@ export async function runPackageJsonUpgrade(opts, pkgPath, pkgJson, isMonorepo =
389
393
  if (automator?.skipPackageJson !== true)
390
394
  runSafe(`npm pkg set "${key}=${value}"`);
391
395
  }
396
+ if (opts.useNode)
397
+ runSafe(`npm pkg delete engines.bun`);
398
+ else if (opts.useBun)
399
+ runSafe(`npm pkg delete engines.node`);
392
400
  unlinkSafe('yellow-button.png');
393
401
  unlinkSafe('bmc-button.svg');
394
402
  unlinkSafe('matterbridge.svg');
@@ -501,6 +509,9 @@ export async function runPackageJsonUpgrade(opts, pkgPath, pkgJson, isMonorepo =
501
509
  'test:vitest:watch': opts.enableJest && opts.enableVitest ? 'vitest watch' : undefined,
502
510
  'test:vitest:verbose': opts.enableJest && opts.enableVitest ? 'vitest run --reporter verbose' : undefined,
503
511
  'test:vitest:coverage': opts.enableJest && opts.enableVitest ? vitestCoverageScript : undefined,
512
+ 'test:bun': opts.enableBuntest ? 'bun test --parallel' : undefined,
513
+ 'test:bun:watch': opts.enableBuntest ? 'bun test --parallel --watch ' : undefined,
514
+ 'test:bun:coverage': opts.enableBuntest ? 'bun test --parallel --coverage' : undefined,
504
515
  'lint': 'oxlint --disable-nested-config',
505
516
  'lint:fix': 'oxlint --disable-nested-config --fix',
506
517
  'format': 'oxfmt',
@@ -524,8 +535,12 @@ export async function runPackageJsonUpgrade(opts, pkgPath, pkgJson, isMonorepo =
524
535
  'chip:test': automator?.chip === true ? 'node scripts/run-chip-tests.mjs' : undefined,
525
536
  'chip:stop': automator?.chip === true ? 'node scripts/run-chip-tests.mjs --stop' : undefined,
526
537
  'reset': 'npm run deepClean && npm run softReset',
527
- 'softReset': `npm install --no-fund --no-audit && npm prune --no-fund --no-audit${isPlugin ? ' && npm link --no-fund --no-audit matterbridge' : ''} && npm run build && npm run typecheck`,
528
- 'softReset:bun': `bun install && bun prune${isPlugin ? ' && bun link matterbridge' : ''} && bun run build && bun run typecheck`,
538
+ 'softReset': opts.useNode
539
+ ? `npm install --no-fund --no-audit && npm prune --no-fund --no-audit${isPlugin ? ' && npm link --no-fund --no-audit matterbridge' : ''} && npm run build && npm run typecheck`
540
+ : opts.useBun
541
+ ? `bun install && bun prune${isPlugin ? ' && bun link matterbridge' : ''} && bun run build && bun run typecheck`
542
+ : undefined,
543
+ 'softReset:bun': opts.useNode && opts.useBun ? `bun install && bun prune${isPlugin ? ' && bun link matterbridge' : ''} && bun run build && bun run typecheck` : undefined,
529
544
  'checkDependencies': `npm install --no-fund --no-audit --no-save npm-check-updates && ncu && npm run softReset`,
530
545
  'updateDependencies': `npm install --no-fund --no-audit --no-save npm-check-updates && ncu -u && npm run softReset`,
531
546
  'runMeBeforePublish': 'npm run cleanBuild && npm run format && npm run lint && npm run build && npm run typecheck' +
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "mb-run",
3
- "version": "1.0.4",
3
+ "version": "1.0.5-dev-20261005-0f11fc7",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "mb-run",
9
- "version": "1.0.4",
9
+ "version": "1.0.5-dev-20261005-0f11fc7",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "cross-spawn": "7.0.6",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mb-run",
3
- "version": "1.0.4",
3
+ "version": "1.0.5-dev-20261005-0f11fc7",
4
4
  "description": "Matterbridge command line executor",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",
@@ -1,4 +1,17 @@
1
- # Matterbridge — Bun-native test runner config v 1.0.1.
1
+ # Matterbridge — Bun-native test runner config v 1.0.2.
2
+
3
+ [install]
4
+ # Installation strategy: "hoisted" places dependencies in the shared node_modules root;
5
+ # "isolated" keeps each package's dependencies in its own node_modules directory.
6
+ # Default: "hoisted".
7
+ linker = "isolated"
8
+
9
+ # globalStore (isolated linker only) symlinks packages from a store shared by all projects in
10
+ # ~/.bun/install/cache/links instead of copying them into node_modules/.bun.
11
+ # Their real path is outside the project, so a dependency's undeclared import can't reach the
12
+ # project's fallback node_modules (e.g. bun-types -> undici-types until Bun 1.4.3).
13
+ # Default: false.
14
+ globalStore = false
2
15
 
3
16
  [test]
4
17
  # Optional setup run before any test (env, global mocks):
@@ -22,6 +35,9 @@ pathIgnorePatterns = [
22
35
  '**/vitest/',
23
36
  ]
24
37
 
38
+ # Source files kept out of the coverage report. pathIgnorePatterns above decides which files are
39
+ # scanned for tests; this one decides which files are measured. Whole paths only: Bun has no
40
+ # line-level ignore, so /* istanbul ignore */, /* c8 ignore */ and /* v8 ignore */ do nothing.
25
41
  coveragePathIgnorePatterns = [
26
42
  '**/.cache/',
27
43
  '**/apps/',
@@ -39,11 +55,21 @@ coveragePathIgnorePatterns = [
39
55
  '**/src/**/*.d.ts',
40
56
  '**/src/**/*.{spec,test}.{ts,mts,cts}',
41
57
  ]
42
- coverage = true
58
+
59
+ # 'text' prints the table at the end of the run, 'lcov' writes coverageDir/lcov.info for CI and
60
+ # editor gutters. Keep 'text': outside --parallel the coverageThreshold check below only runs when
61
+ # the text reporter is enabled, and an lcov-only run exits 0 however low the coverage is.
43
62
  coverageReporter = ['lcov', 'text']
63
+
64
+ # Where the lcov reporter writes. Covered by the '**/coverage/' entries in both ignore lists above,
65
+ # so the report never measures itself.
44
66
  coverageDir = "./coverage/bun"
45
67
 
46
68
  # Exclude test files from coverage reports
47
69
  coverageSkipTestFiles = true
48
- # Don't use sourcemaps for coverage analysis
49
- coverageIgnoreSourcemaps = true
70
+
71
+ # Use sourcemaps so coverage line numbers map to the TypeScript sources
72
+ coverageIgnoreSourcemaps = false
73
+
74
+ # Fail the run if coverage drops below 100%. Applies to the whole run, not per file.
75
+ coverageThreshold = { lines = 1.0, functions = 1.0 }
@@ -6,5 +6,5 @@
6
6
  "rootDir": "src"
7
7
  },
8
8
  "include": ["src/**/*.ts"],
9
- "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/__test__/*"]
9
+ "exclude": ["**/*.spec.ts", "**/*.test.ts"]
10
10
  }
@@ -12,5 +12,5 @@
12
12
  "removeComments": true
13
13
  },
14
14
  "include": ["src/**/*.ts"],
15
- "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/__test__/*"]
15
+ "exclude": ["**/*.spec.ts", "**/*.test.ts"]
16
16
  }
@@ -12,5 +12,5 @@
12
12
  "removeComments": false
13
13
  },
14
14
  "include": ["src/**/*.ts"],
15
- "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/__test__/*"]
15
+ "exclude": ["**/*.spec.ts", "**/*.test.ts"]
16
16
  }
@@ -12,5 +12,5 @@
12
12
  "removeComments": true
13
13
  },
14
14
  "include": ["src/**/*.ts"],
15
- "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/__test__/*"]
15
+ "exclude": ["**/*.spec.ts", "**/*.test.ts"]
16
16
  }
@@ -5,5 +5,5 @@
5
5
  "rootDir": ".",
6
6
  "noEmit": true
7
7
  },
8
- "include": ["src/**/*.ts", "test/**/*.ts", "vitest/**/*.ts"]
8
+ "include": ["src/**/*.ts", "test/**/*.ts", "vitest/**/*.ts", "buntest/**/*.ts"]
9
9
  }