everything-dev 0.0.13 → 0.0.14

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/plugin.ts +13 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "everything-dev",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
package/src/plugin.ts CHANGED
@@ -1327,9 +1327,6 @@ export default createPlugin({
1327
1327
  };
1328
1328
  }
1329
1329
 
1330
- const npmPkg = await npmResponse.json() as { catalog?: Record<string, string> };
1331
- const cliCatalog = npmPkg.catalog ?? {};
1332
-
1333
1330
  const bosConfigPath = `${configDir}/bos.config.json`;
1334
1331
  const updatedBosConfig = {
1335
1332
  ...bosConfig,
@@ -1339,6 +1336,16 @@ export default createPlugin({
1339
1336
  };
1340
1337
  await Bun.write(bosConfigPath, JSON.stringify(updatedBosConfig, null, 2));
1341
1338
 
1339
+ const sharedUiDeps: Record<string, string> = {};
1340
+ const sharedUi = updatedBosConfig.shared?.ui as Record<string, { requiredVersion?: string }> | undefined;
1341
+ if (sharedUi) {
1342
+ for (const [name, config] of Object.entries(sharedUi)) {
1343
+ if (config.requiredVersion) {
1344
+ sharedUiDeps[name] = config.requiredVersion;
1345
+ }
1346
+ }
1347
+ }
1348
+
1342
1349
  const rootPkgPath = `${configDir}/package.json`;
1343
1350
  const rootPkg = await Bun.file(rootPkgPath).json() as {
1344
1351
  workspaces: { packages: string[]; catalog: Record<string, string> };
@@ -1346,7 +1353,8 @@ export default createPlugin({
1346
1353
  };
1347
1354
 
1348
1355
  rootPkg.workspaces.catalog = {
1349
- ...cliCatalog,
1356
+ ...rootPkg.workspaces.catalog,
1357
+ ...sharedUiDeps,
1350
1358
  "everything-dev": cliVersion,
1351
1359
  };
1352
1360
  await Bun.write(rootPkgPath, JSON.stringify(rootPkg, null, 2));
@@ -1373,7 +1381,7 @@ export default createPlugin({
1373
1381
  if (!deps) continue;
1374
1382
 
1375
1383
  for (const [name, version] of Object.entries(deps)) {
1376
- if (name in cliCatalog && version !== "catalog:") {
1384
+ if (name in rootPkg.workspaces.catalog && version !== "catalog:") {
1377
1385
  deps[name] = "catalog:";
1378
1386
  updated = true;
1379
1387
  }