@biffo/cli 0.61.1 → 0.62.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.
Files changed (2) hide show
  1. package/dist/index.js +30 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1538,7 +1538,16 @@ function applyMigrationCarry(instanceDir, plan) {
1538
1538
  }
1539
1539
 
1540
1540
  // src/lib/core-upgrade.ts
1541
- import { existsSync as existsSync6, mkdirSync as mkdirSync2, mkdtempSync as mkdtempSync2, readFileSync as readFileSync4, rmSync as rmSync2, writeFileSync as writeFileSync3 } from "fs";
1541
+ import {
1542
+ chmodSync,
1543
+ existsSync as existsSync6,
1544
+ mkdirSync as mkdirSync2,
1545
+ mkdtempSync as mkdtempSync2,
1546
+ readFileSync as readFileSync4,
1547
+ rmSync as rmSync2,
1548
+ statSync,
1549
+ writeFileSync as writeFileSync3
1550
+ } from "fs";
1542
1551
  import { tmpdir as tmpdir2 } from "os";
1543
1552
  import { dirname as dirname4, join as join6 } from "path";
1544
1553
  import { execa as execa2 } from "execa";
@@ -1635,7 +1644,7 @@ async function classify(path, base, ours, theirs, opts, mergeFile) {
1635
1644
  const { conflicted, content } = await mergeFile(baseContent, oursContent, theirsContent);
1636
1645
  return { path, status: conflicted ? "conflict" : "merged", conflicted, content };
1637
1646
  }
1638
- function applyUpgradePlan(instanceDir, plan) {
1647
+ function applyUpgradePlan(instanceDir, plan, theirsDir) {
1639
1648
  const written = [];
1640
1649
  const deleted = [];
1641
1650
  for (const e of plan.entries) {
@@ -1650,6 +1659,12 @@ function applyUpgradePlan(instanceDir, plan) {
1650
1659
  if (e.content !== void 0) {
1651
1660
  mkdirSync2(dirname4(abs), { recursive: true });
1652
1661
  writeFileSync3(abs, e.content);
1662
+ if (theirsDir !== void 0) {
1663
+ const source = join6(theirsDir, e.path);
1664
+ if (existsSync6(source) && (statSync(source).mode & 73) !== 0) {
1665
+ chmodSync(abs, 493);
1666
+ }
1667
+ }
1653
1668
  written.push(e.path);
1654
1669
  }
1655
1670
  }
@@ -2148,9 +2163,9 @@ async function runCoreUpgradeResolved(options, deps, cleanups) {
2148
2163
  );
2149
2164
  return;
2150
2165
  }
2151
- await applyAndOpenPr(options, deps, plan, migrations, fromVersion, toVersion, breaking);
2166
+ await applyAndOpenPr(options, deps, plan, migrations, fromVersion, toVersion, breaking, theirsDir);
2152
2167
  }
2153
- async function applyAndOpenPr(options, deps, plan, migrations, fromVersion, toVersion, breaking) {
2168
+ async function applyAndOpenPr(options, deps, plan, migrations, fromVersion, toVersion, breaking, theirsDir) {
2154
2169
  if (breaking.length > 0 && !options.acknowledgeBreaking) {
2155
2170
  throw new Error(
2156
2171
  `This upgrade crosses ${breaking.length} documented breaking change(s): ${breaking.map((b) => b.version).join(", ")}. They are printed above and in ${UPGRADE_GUIDE_PATH}. Read what each one requires \u2014 some destroy data or need manual work after the deploy \u2014 then re-run with --acknowledge-breaking.`
@@ -2172,7 +2187,7 @@ async function applyAndOpenPr(options, deps, plan, migrations, fromVersion, toVe
2172
2187
  const branch = upgradeBranchName(fromVersion, toVersion);
2173
2188
  log.step(1, 4, `Creating branch ${branch}`);
2174
2189
  await git.createBranch(options.cwd, branch);
2175
- const applied = applyUpgradePlan(options.cwd, plan);
2190
+ const applied = applyUpgradePlan(options.cwd, plan, theirsDir);
2176
2191
  const carried = applyMigrationCarry(options.cwd, migrations);
2177
2192
  writeInstanceCoreVersion(options.cwd, toVersion);
2178
2193
  log.step(
@@ -2863,7 +2878,7 @@ import {
2863
2878
  readdirSync as readdirSync4,
2864
2879
  readFileSync as readFileSync7,
2865
2880
  rmSync as rmSync5,
2866
- statSync,
2881
+ statSync as statSync2,
2867
2882
  writeFileSync as writeFileSync5
2868
2883
  } from "fs";
2869
2884
  import { homedir } from "os";
@@ -2897,7 +2912,7 @@ function findLatestSession() {
2897
2912
  if (files.length === 0) return null;
2898
2913
  const sorted = files.map((f) => {
2899
2914
  const fullPath = join12(dir, f);
2900
- const mtime = existsSync11(fullPath) ? statSync(fullPath).mtimeMs : -1;
2915
+ const mtime = existsSync11(fullPath) ? statSync2(fullPath).mtimeMs : -1;
2901
2916
  return { f, mtime };
2902
2917
  }).sort((a, b) => b.mtime - a.mtime);
2903
2918
  try {
@@ -3095,7 +3110,7 @@ async function resolveConfig(options) {
3095
3110
 
3096
3111
  // src/commands/data-import.ts
3097
3112
  import { execSync as execSync3 } from "child_process";
3098
- import { cpSync, existsSync as existsSync13, mkdirSync as mkdirSync5, readdirSync as readdirSync5, statSync as statSync2 } from "fs";
3113
+ import { cpSync, existsSync as existsSync13, mkdirSync as mkdirSync5, readdirSync as readdirSync5, statSync as statSync3 } from "fs";
3099
3114
  import { join as join13, resolve as resolve5 } from "path";
3100
3115
  import chalk6 from "chalk";
3101
3116
  import { Command as Command6 } from "commander";
@@ -3148,7 +3163,7 @@ async function runDataImport(name, options, deps) {
3148
3163
  `DDL import '${name}' is already present at db/imports/${name}/. Remove it first to re-import.`
3149
3164
  );
3150
3165
  }
3151
- const isLocalDir = existsSync13(options.source) && statSync2(options.source).isDirectory();
3166
+ const isLocalDir = existsSync13(options.source) && statSync3(options.source).isDirectory();
3152
3167
  let sourceDir;
3153
3168
  let cleanupClone = null;
3154
3169
  if (isLocalDir) {
@@ -4218,7 +4233,7 @@ import { Command as Command12 } from "commander";
4218
4233
  import inquirer5 from "inquirer";
4219
4234
 
4220
4235
  // src/lib/build-freshness.ts
4221
- import { existsSync as existsSync16, readdirSync as readdirSync7, statSync as statSync3 } from "fs";
4236
+ import { existsSync as existsSync16, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
4222
4237
  import { dirname as dirname5, join as join15, relative as relative2, sep as sep2 } from "path";
4223
4238
  import { fileURLToPath as fileURLToPath3 } from "url";
4224
4239
  var SKIP_ENV_VAR = "BIFFO_SKIP_BUILD_FRESHNESS_CHECK";
@@ -4253,8 +4268,8 @@ function checkBuildFreshness(options = {}) {
4253
4268
  if (!existsSync16(entry)) {
4254
4269
  return { status: "skipped", reason: `${entry} not found`, newerSources: [] };
4255
4270
  }
4256
- const builtAt = statSync3(entry).mtimeMs;
4257
- const newer = collectSourceFiles(srcDir).map((file) => ({ file, mtimeMs: statSync3(file).mtimeMs })).filter((f) => f.mtimeMs > builtAt).sort((a, b) => b.mtimeMs - a.mtimeMs).map((f) => relative2(packageRoot, f.file));
4271
+ const builtAt = statSync4(entry).mtimeMs;
4272
+ const newer = collectSourceFiles(srcDir).map((file) => ({ file, mtimeMs: statSync4(file).mtimeMs })).filter((f) => f.mtimeMs > builtAt).sort((a, b) => b.mtimeMs - a.mtimeMs).map((f) => relative2(packageRoot, f.file));
4258
4273
  if (newer.length === 0) {
4259
4274
  return { status: "fresh", reason: "dist is newer than src", newerSources: [] };
4260
4275
  }
@@ -4607,7 +4622,7 @@ import {
4607
4622
  readdirSync as readdirSync8,
4608
4623
  readFileSync as readFileSync12,
4609
4624
  rmSync as rmSync6,
4610
- statSync as statSync4,
4625
+ statSync as statSync5,
4611
4626
  writeFileSync as writeFileSync6
4612
4627
  } from "fs";
4613
4628
  import { homedir as homedir3 } from "os";
@@ -6225,7 +6240,7 @@ function printEntry(entry) {
6225
6240
  }
6226
6241
 
6227
6242
  // src/commands/plugin-install.ts
6228
- import { cpSync as cpSync3, existsSync as existsSync23, mkdirSync as mkdirSync9, readFileSync as readFileSync17, statSync as statSync5 } from "fs";
6243
+ import { cpSync as cpSync3, existsSync as existsSync23, mkdirSync as mkdirSync9, readFileSync as readFileSync17, statSync as statSync6 } from "fs";
6229
6244
  import { basename, join as join24, relative as relative3, resolve as resolve12 } from "path";
6230
6245
  import chalk15 from "chalk";
6231
6246
  import { Command as Command15 } from "commander";
@@ -6317,7 +6332,7 @@ function resolveLocalPlugin(localPath) {
6317
6332
  if (!existsSync23(localPath)) {
6318
6333
  throw new Error(`--local path does not exist: ${localPath}`);
6319
6334
  }
6320
- if (!statSync5(localPath).isDirectory()) {
6335
+ if (!statSync6(localPath).isDirectory()) {
6321
6336
  throw new Error(`--local path is not a directory: ${localPath}`);
6322
6337
  }
6323
6338
  const manifestPath = join24(localPath, "biffo.plugin.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biffo/cli",
3
- "version": "0.61.1",
3
+ "version": "0.62.0",
4
4
  "description": "Biffo project scaffolding CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",