@genesislcap/build-kit 14.449.0 → 14.449.1-alpha-c71262a.0

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.
@@ -5,7 +5,7 @@ export interface RunOptions {
5
5
  env?: Record<string, string>;
6
6
  nodeArgs?: string;
7
7
  }
8
- export declare const run: (cwd: any, command: any, options?: RunOptions) => import("child_process").SpawnSyncReturns<Buffer<ArrayBufferLike>>;
8
+ export declare const run: (cwd: any, command: any, options?: RunOptions) => import("child_process").SpawnSyncReturns<NonSharedBuffer>;
9
9
  export declare const runAsync: (cwd: any, command: any, options?: RunOptions) => Promise<Error | null>;
10
10
  export declare const startShell: (cwd: string) => void;
11
11
  //# sourceMappingURL=child-process.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"child-process.d.ts","sourceRoot":"","sources":["../../src/utils/child-process.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,GAAG,GAAI,QAAG,EAAE,YAAO,EAAE,UAAS,UAAe,sEAwBzD,CAAC;AASF,eAAO,MAAM,QAAQ,GAAU,QAAG,EAAE,YAAO,EAAE,UAAS,UAAe,KAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAwC3F,CAAC;AAcF,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,SAerC,CAAC"}
1
+ {"version":3,"file":"child-process.d.ts","sourceRoot":"","sources":["../../src/utils/child-process.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,GAAG,GAAI,QAAG,EAAE,YAAO,EAAE,UAAS,UAAe,8DAwBzD,CAAC;AASF,eAAO,MAAM,QAAQ,GAAU,QAAG,EAAE,YAAO,EAAE,UAAS,UAAe,KAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAwC3F,CAAC;AAcF,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,SAerC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"federation.d.ts","sourceRoot":"","sources":["../../src/utils/federation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C,eAAO,MAAM,mBAAmB,GAAI,gBAAY,WAAwC,CAAC;AAwBzF,eAAO,MAAM,uBAAuB,GAClC;;;CAAwC,EACxC,aAAa,WAAW;;;EASzB,CAAC"}
1
+ {"version":3,"file":"federation.d.ts","sourceRoot":"","sources":["../../src/utils/federation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C,eAAO,MAAM,mBAAmB,GAAI,gBAAY,WAAwC,CAAC;AA0BzF,eAAO,MAAM,uBAAuB,GAClC;;;CAAwC,EACxC,aAAa,WAAW;;;EASzB,CAAC"}
@@ -18,9 +18,11 @@ const resolveFederatedRemotes = (...args_1) => tslib_1.__awaiter(void 0, [...arg
18
18
  }, {});
19
19
  });
20
20
  const resolveSharedRemotes = (packages = [], packageJSON) => packages.reduce((acc, p) => {
21
+ const ver = packageJSON.dependencies[p];
21
22
  acc[p] = {
22
23
  singleton: true,
23
- requiredVersion: packageJSON.dependencies[p],
24
+ // workspace:* is a pnpm-only specifier; webpack needs a semver range or false.
25
+ requiredVersion: (ver === null || ver === void 0 ? void 0 : ver.startsWith('workspace:')) ? false : ver,
24
26
  };
25
27
  return acc;
26
28
  }, {});
@@ -1 +1 @@
1
- {"version":3,"file":"npm.d.ts","sourceRoot":"","sources":["../../src/utils/npm.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,UAAU,GAAI,OAAE,EAAE,gBAAuB,QAUrD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAU,KAAK,MAAM,EAAE,SAAQ,MAAY,EAAE,OAAO,MAAM,oBAShF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,WAAW,CAUvE,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,gBAAa,KAAG,OAAO,CAAC,WAAW,EAAE,CAM7E,CAAC;AAeJ,eAAO,MAAM,gBAAgB,GAAI,SAAI,EAAE,cAAgB,EAAE,iBAAc,QAqBtE,CAAC;AAGF,eAAO,MAAM,iBAAiB,GAAI,YAAO,QAGxC,CAAC;AAGF,eAAO,MAAM,SAAS,GAAI,KAAK,YAAY;;;;;;;;WAqC/B,CAAC;aACF,CAAC;;;;;;iBAqB2P,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAAu/M,CAAC;WAA+G,CAAC;cAA2H,CAAC;uBAA+d,CAAC;iBAA0Z,CAAC;qBAAkQ,CAAC;;;CAxDzmQ,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAU,KAAK,WAAW,kBAOvD,CAAC;AAoCF,eAAO,MAAM,cAAc,GACzB,KAAK,WAAW,EAChB,YAAY,MAAM,EAClB,SAAS,MAAM,EAAE,EACjB,UAAS,MAAM,EAAqB;UAjC3B,MAAM;QAAM,MAAM;UAAQ,MAAM;GAuC1C,CAAC"}
1
+ {"version":3,"file":"npm.d.ts","sourceRoot":"","sources":["../../src/utils/npm.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,UAAU,GAAI,OAAE,EAAE,gBAAuB,QAUrD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAU,KAAK,MAAM,EAAE,SAAQ,MAAY,EAAE,OAAO,MAAM,oBAShF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,WAAW,CAUvE,CAAC;AAmCF,eAAO,MAAM,oBAAoB,GAAU,gBAAa,KAAG,OAAO,CAAC,WAAW,EAAE,CAoB7E,CAAC;AAeJ,eAAO,MAAM,gBAAgB,GAAI,SAAI,EAAE,cAAgB,EAAE,iBAAc,QAqBtE,CAAC;AAGF,eAAO,MAAM,iBAAiB,GAAI,YAAO,QAGxC,CAAC;AAGF,eAAO,MAAM,SAAS,GAAI,KAAK,YAAY;;;;;;;;WArCR,CAAC;aAG/B,CAAC;;;;;;iBA8BqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA+DutJ,CAAC;WAA+G,CAAC;cAA2H,CAAC;uBAA+d,CAAC;iBAA0Z,CAAC;qBAAkQ,CAAC;;;CAxD7lM,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAU,KAAK,WAAW,kBAOvD,CAAC;AAoCF,eAAO,MAAM,cAAc,GACzB,KAAK,WAAW,EAChB,YAAY,MAAM,EAClB,SAAS,MAAM,EAAE,EACjB,UAAS,MAAM,EAAqB;UAjC3B,MAAM;QAAM,MAAM;UAAQ,MAAM;GAuC1C,CAAC"}
package/dist/utils/npm.js CHANGED
@@ -4,13 +4,14 @@ exports.updateVersions = exports.updatePackageJSON = exports.getRawPkg = exports
4
4
  const tslib_1 = require("tslib");
5
5
  const node_child_process_1 = require("node:child_process");
6
6
  const node_fs_1 = require("node:fs");
7
+ const promises_1 = require("node:fs/promises");
7
8
  const node_path_1 = require("node:path");
8
9
  const consola_1 = tslib_1.__importDefault(require("consola"));
9
10
  const jiti_1 = tslib_1.__importDefault(require("jiti"));
10
11
  const pkg_types_1 = require("pkg-types");
11
12
  // Attempt to load id.{js,json,ts} file
12
13
  const tryRequire = (id, rootDir = process.cwd()) => {
13
- const _require = (0, jiti_1.default)(rootDir, { interopDefault: true, esmResolve: true });
14
+ const _require = (0, jiti_1.default)(rootDir, { interopDefault: true });
14
15
  try {
15
16
  return _require(id);
16
17
  }
@@ -45,11 +46,72 @@ const loadPackageJSON = (dir) => tslib_1.__awaiter(void 0, void 0, void 0, funct
45
46
  return pkg;
46
47
  });
47
48
  exports.loadPackageJSON = loadPackageJSON;
49
+ // Walk up from start looking for pnpm-workspace.yaml or lerna.json (workspace root markers).
50
+ const findWorkspaceRoot = (start) => {
51
+ let dir = start;
52
+ while (true) {
53
+ if ((0, node_fs_1.existsSync)((0, node_path_1.join)(dir, 'pnpm-workspace.yaml')) || (0, node_fs_1.existsSync)((0, node_path_1.join)(dir, 'lerna.json')))
54
+ return dir;
55
+ const parent = (0, node_path_1.dirname)(dir);
56
+ if (parent === dir)
57
+ return null;
58
+ dir = parent;
59
+ }
60
+ };
61
+ // Resolve a package name to its directory by searching workspace packages.
62
+ // Used as a fallback when nodeLinker:hoisted means workspace link: packages
63
+ // are not present in node_modules (unlike npm which always symlinks them).
64
+ const findInWorkspace = (pkgName, root) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
65
+ var _a;
66
+ const rootPkg = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(root, 'package.json'), 'utf8'));
67
+ const patterns = (_a = rootPkg.workspaces) !== null && _a !== void 0 ? _a : [];
68
+ const collectEntries = (pattern) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
69
+ var _a, e_1, _b, _c;
70
+ const entries = [];
71
+ try {
72
+ for (var _d = true, _e = tslib_1.__asyncValues((0, promises_1.glob)((0, node_path_1.join)(root, pattern, 'package.json'))), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
73
+ _c = _f.value;
74
+ _d = false;
75
+ const entry = _c;
76
+ entries.push(entry);
77
+ }
78
+ }
79
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
80
+ finally {
81
+ try {
82
+ if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
83
+ }
84
+ finally { if (e_1) throw e_1.error; }
85
+ }
86
+ return entries;
87
+ });
88
+ const allEntries = (yield Promise.all(patterns.map(collectEntries))).flat();
89
+ for (const entry of allEntries) {
90
+ const pkg = JSON.parse((0, node_fs_1.readFileSync)(entry, 'utf8'));
91
+ if (pkg.name === pkgName)
92
+ return (0, node_path_1.dirname)(entry);
93
+ }
94
+ return null;
95
+ });
48
96
  const loadPackageJSONFiles = (...args_1) => tslib_1.__awaiter(void 0, [...args_1], void 0, function* (packages = []) {
49
- return Promise.all(packages.map((p) => {
50
- const dir = (0, node_path_1.dirname)(require.resolve(p));
51
- return (0, exports.loadPackageJSON)(dir);
52
- }));
97
+ return Promise.all(packages.map((p) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
98
+ // Fast path: package is in node_modules (direct dep or npm workspace symlink).
99
+ try {
100
+ const dir = (0, node_path_1.dirname)(require.resolve(p + '/package.json', { paths: [process.cwd()] }));
101
+ return (0, exports.loadPackageJSON)(dir);
102
+ }
103
+ catch (_a) { }
104
+ // Fallback: pnpm hoisted mode does not put workspace link: packages into
105
+ // node_modules. Search the workspace by name using the root package.json globs.
106
+ const root = findWorkspaceRoot(process.cwd());
107
+ if (root) {
108
+ const dir = yield findInWorkspace(p, root);
109
+ if (dir)
110
+ return (0, exports.loadPackageJSON)(dir);
111
+ }
112
+ consola_1.default.warn(`Federation remote '${p}' not found — PORT will be undefined in dev mode`);
113
+ return { name: p };
114
+ })));
53
115
  });
54
116
  exports.loadPackageJSONFiles = loadPackageJSONFiles;
55
117
  /*
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/build-kit",
3
3
  "description": "Build utilities & types",
4
- "version": "14.449.0",
4
+ "version": "14.449.1-alpha-c71262a.0",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -38,7 +38,7 @@
38
38
  "unparse-args": "^1.2.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@genesislcap/foundation-testing": "14.449.0",
41
+ "@genesislcap/foundation-testing": "14.449.1-alpha-c71262a.0",
42
42
  "@types/http-proxy": "^1.17.8",
43
43
  "@types/node": "^22.10.2",
44
44
  "tsx": "^4.7.0",
@@ -52,5 +52,5 @@
52
52
  "publishConfig": {
53
53
  "access": "public"
54
54
  },
55
- "gitHead": "f12978be0dece5ab995762c4811e201080669496"
55
+ "gitHead": "89ebde619216d4d5f9681a884ec9bb77b4f90b8f"
56
56
  }