everything-dev 0.0.12 → 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.
- package/package.json +1 -1
- package/src/plugin.ts +20 -13
package/package.json
CHANGED
package/src/plugin.ts
CHANGED
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
getRemotes,
|
|
16
16
|
loadConfig,
|
|
17
17
|
type RemoteConfig,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
type SourceMode,
|
|
19
|
+
setConfig
|
|
20
20
|
} from "./config";
|
|
21
21
|
import { bosContract } from "./contract";
|
|
22
22
|
import { getBuildEnv, hasZephyrConfig, loadBosEnv, ZEPHYR_DOCS_URL } from "./lib/env";
|
|
@@ -401,16 +401,15 @@ export default createPlugin({
|
|
|
401
401
|
const bosEnv = yield* loadBosEnv;
|
|
402
402
|
const privateKey = nearPrivateKey || bosEnv.NEAR_PRIVATE_KEY;
|
|
403
403
|
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
});
|
|
404
|
+
const cliVersion = bosConfig.cli?.version;
|
|
405
|
+
if (!cliVersion) {
|
|
406
|
+
return yield* Effect.fail(new Error("bos.config.json is missing 'cli.version'. Add it before publishing."));
|
|
407
|
+
}
|
|
409
408
|
|
|
410
409
|
const configToPublish = {
|
|
411
410
|
...bosConfig,
|
|
412
411
|
cli: {
|
|
413
|
-
version:
|
|
412
|
+
version: cliVersion,
|
|
414
413
|
},
|
|
415
414
|
};
|
|
416
415
|
|
|
@@ -1328,9 +1327,6 @@ export default createPlugin({
|
|
|
1328
1327
|
};
|
|
1329
1328
|
}
|
|
1330
1329
|
|
|
1331
|
-
const npmPkg = await npmResponse.json() as { catalog?: Record<string, string> };
|
|
1332
|
-
const cliCatalog = npmPkg.catalog ?? {};
|
|
1333
|
-
|
|
1334
1330
|
const bosConfigPath = `${configDir}/bos.config.json`;
|
|
1335
1331
|
const updatedBosConfig = {
|
|
1336
1332
|
...bosConfig,
|
|
@@ -1340,6 +1336,16 @@ export default createPlugin({
|
|
|
1340
1336
|
};
|
|
1341
1337
|
await Bun.write(bosConfigPath, JSON.stringify(updatedBosConfig, null, 2));
|
|
1342
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
|
+
|
|
1343
1349
|
const rootPkgPath = `${configDir}/package.json`;
|
|
1344
1350
|
const rootPkg = await Bun.file(rootPkgPath).json() as {
|
|
1345
1351
|
workspaces: { packages: string[]; catalog: Record<string, string> };
|
|
@@ -1347,7 +1353,8 @@ export default createPlugin({
|
|
|
1347
1353
|
};
|
|
1348
1354
|
|
|
1349
1355
|
rootPkg.workspaces.catalog = {
|
|
1350
|
-
...
|
|
1356
|
+
...rootPkg.workspaces.catalog,
|
|
1357
|
+
...sharedUiDeps,
|
|
1351
1358
|
"everything-dev": cliVersion,
|
|
1352
1359
|
};
|
|
1353
1360
|
await Bun.write(rootPkgPath, JSON.stringify(rootPkg, null, 2));
|
|
@@ -1374,7 +1381,7 @@ export default createPlugin({
|
|
|
1374
1381
|
if (!deps) continue;
|
|
1375
1382
|
|
|
1376
1383
|
for (const [name, version] of Object.entries(deps)) {
|
|
1377
|
-
if (name in
|
|
1384
|
+
if (name in rootPkg.workspaces.catalog && version !== "catalog:") {
|
|
1378
1385
|
deps[name] = "catalog:";
|
|
1379
1386
|
updated = true;
|
|
1380
1387
|
}
|