@bensandee/tooling 0.50.0 → 0.50.2
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/dist/bin.mjs +28 -6
- package/package.json +2 -2
package/dist/bin.mjs
CHANGED
|
@@ -663,13 +663,22 @@ const MONOREPO_IGNORED_KEYS = new Set(["setupVitest", "projectType"]);
|
|
|
663
663
|
function saveToolingConfig(ctx, config) {
|
|
664
664
|
const defaults = computeDefaults(config.targetDir);
|
|
665
665
|
const isMonorepo = config.structure === "monorepo";
|
|
666
|
+
const existing = ctx.exists(CONFIG_FILE) ? ctx.read(CONFIG_FILE) : void 0;
|
|
667
|
+
const overrideKeySet = new Set(OVERRIDE_KEYS);
|
|
668
|
+
const preserved = {};
|
|
669
|
+
if (existing) {
|
|
670
|
+
const result = ToolingConfigSchema.safeParse(JSON.parse(existing));
|
|
671
|
+
if (result.success) {
|
|
672
|
+
for (const [key, value] of Object.entries(result.data)) if (key !== "$schema" && !overrideKeySet.has(key)) preserved[key] = value;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
666
675
|
const overrides = { $schema: "node_modules/@bensandee/tooling/tooling.schema.json" };
|
|
667
676
|
for (const key of OVERRIDE_KEYS) {
|
|
668
677
|
if (isMonorepo && MONOREPO_IGNORED_KEYS.has(key)) continue;
|
|
669
678
|
if (config[key] !== defaults[key]) overrides[key] = config[key];
|
|
670
679
|
}
|
|
680
|
+
Object.assign(overrides, preserved);
|
|
671
681
|
const content = JSON.stringify(overrides, null, 2) + "\n";
|
|
672
|
-
const existing = ctx.exists(CONFIG_FILE) ? ctx.read(CONFIG_FILE) : void 0;
|
|
673
682
|
if (existing !== void 0 && contentEqual(CONFIG_FILE, existing, content)) return {
|
|
674
683
|
filePath: CONFIG_FILE,
|
|
675
684
|
action: "skipped",
|
|
@@ -1585,7 +1594,7 @@ async function generatePackageJson(ctx) {
|
|
|
1585
1594
|
const devDeps = { ...ROOT_DEV_DEPS };
|
|
1586
1595
|
if (!isMonorepo) Object.assign(devDeps, PER_PACKAGE_DEV_DEPS);
|
|
1587
1596
|
devDeps["@bensandee/config"] = isWorkspacePackage(ctx, "@bensandee/config") ? "workspace:*" : "0.10.2";
|
|
1588
|
-
devDeps["@bensandee/tooling"] = isWorkspacePackage(ctx, "@bensandee/tooling") ? "workspace:*" : "0.50.
|
|
1597
|
+
devDeps["@bensandee/tooling"] = isWorkspacePackage(ctx, "@bensandee/tooling") ? "workspace:*" : "0.50.2";
|
|
1589
1598
|
if (ctx.config.useEslintPlugin) devDeps["@bensandee/eslint-plugin"] = isWorkspacePackage(ctx, "@bensandee/eslint-plugin") ? "workspace:*" : "0.12.0";
|
|
1590
1599
|
if (ctx.config.formatter === "oxfmt") devDeps["oxfmt"] = {
|
|
1591
1600
|
"@changesets/cli": "2.30.0",
|
|
@@ -3359,7 +3368,7 @@ async function runGenerators(ctx) {
|
|
|
3359
3368
|
function generateMigratePrompt(results, config, detected) {
|
|
3360
3369
|
const sections = [];
|
|
3361
3370
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
3362
|
-
sections.push(`# Migration Prompt\n\n_Generated by \`@bensandee/tooling@0.50.
|
|
3371
|
+
sections.push(`# Migration Prompt\n\n_Generated by \`@bensandee/tooling@0.50.2 repo:sync\` on ${timestamp}_\n`);
|
|
3363
3372
|
const changed = results.filter((r) => r.action === "created" || r.action === "updated" || r.action === "archived");
|
|
3364
3373
|
if (changed.length > 0) {
|
|
3365
3374
|
const items = changed.map((r) => {
|
|
@@ -4281,7 +4290,7 @@ async function runVersionMode(executor, config) {
|
|
|
4281
4290
|
};
|
|
4282
4291
|
const existingPr = await findOpenPr(executor, conn, BRANCH);
|
|
4283
4292
|
debug(config, `Existing open PR for ${BRANCH}: ${existingPr === null ? "(none)" : `#${String(existingPr)}`}`);
|
|
4284
|
-
if (existingPr === null) {
|
|
4293
|
+
if (existingPr === null) try {
|
|
4285
4294
|
await createPr(executor, conn, {
|
|
4286
4295
|
title,
|
|
4287
4296
|
head: BRANCH,
|
|
@@ -4293,6 +4302,19 @@ async function runVersionMode(executor, config) {
|
|
|
4293
4302
|
mode: "version",
|
|
4294
4303
|
pr: "created"
|
|
4295
4304
|
};
|
|
4305
|
+
} catch (error) {
|
|
4306
|
+
debug(config, `createPr failed, retrying as update: ${String(error)}`);
|
|
4307
|
+
const racePr = await findOpenPr(executor, conn, BRANCH);
|
|
4308
|
+
if (racePr === null) throw error;
|
|
4309
|
+
await updatePr(executor, conn, racePr, {
|
|
4310
|
+
title,
|
|
4311
|
+
body
|
|
4312
|
+
});
|
|
4313
|
+
log.info(`Updated version PR #${String(racePr)} (recovered from race condition)`);
|
|
4314
|
+
return {
|
|
4315
|
+
mode: "version",
|
|
4316
|
+
pr: "updated"
|
|
4317
|
+
};
|
|
4296
4318
|
}
|
|
4297
4319
|
await updatePr(executor, conn, existingPr, {
|
|
4298
4320
|
title,
|
|
@@ -6437,7 +6459,7 @@ const webhookSendCommand = defineCommand({
|
|
|
6437
6459
|
const main = defineCommand({
|
|
6438
6460
|
meta: {
|
|
6439
6461
|
name: "bst",
|
|
6440
|
-
version: "0.50.
|
|
6462
|
+
version: "0.50.2",
|
|
6441
6463
|
description: "Bootstrap and maintain standardized TypeScript project tooling"
|
|
6442
6464
|
},
|
|
6443
6465
|
subCommands: {
|
|
@@ -6458,7 +6480,7 @@ const main = defineCommand({
|
|
|
6458
6480
|
"webhook:send": webhookSendCommand
|
|
6459
6481
|
}
|
|
6460
6482
|
});
|
|
6461
|
-
console.log(`@bensandee/tooling v0.50.
|
|
6483
|
+
console.log(`@bensandee/tooling v0.50.2`);
|
|
6462
6484
|
async function run() {
|
|
6463
6485
|
await runMain(main);
|
|
6464
6486
|
process.exit(process.exitCode ?? 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bensandee/tooling",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.2",
|
|
4
4
|
"description": "CLI tool to bootstrap and maintain standardized TypeScript project tooling",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@clack/prompts": "^1.2.0",
|
|
40
|
-
"citty": "^0.2.
|
|
40
|
+
"citty": "^0.2.2",
|
|
41
41
|
"json5": "^2.2.3",
|
|
42
42
|
"jsonc-parser": "^3.3.1",
|
|
43
43
|
"picomatch": "^4.0.4",
|