@cellajs/cli 0.1.0 → 0.1.1

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/index.js CHANGED
@@ -97,11 +97,16 @@ var cellaConfigSchema = z.object({
97
97
 
98
98
  // src/utils/managed-files.ts
99
99
  var CONFIG_FILE = "cella/cella.config.ts";
100
+ var LEGACY_CONFIG_FILE = "cella.config.ts";
101
+ var CONFIG_FILE_PATHS = [CONFIG_FILE, LEGACY_CONFIG_FILE];
102
+ function isConfigFile(filePath) {
103
+ return CONFIG_FILE_PATHS.includes(filePath);
104
+ }
100
105
  function isPackageJson(filePath) {
101
106
  return filePath === "package.json" || filePath.endsWith("/package.json");
102
107
  }
103
108
  function isManagedFile(filePath) {
104
- return isPackageJson(filePath) || filePath === "pnpm-lock.yaml" || filePath === CONFIG_FILE;
109
+ return isPackageJson(filePath) || filePath === "pnpm-lock.yaml" || isConfigFile(filePath);
105
110
  }
106
111
 
107
112
  // src/utils/module-territory.ts
@@ -210,7 +215,7 @@ import process4 from "process";
210
215
  // package.json
211
216
  var package_default = {
212
217
  name: "@cellajs/cli",
213
- version: "0.1.0",
218
+ version: "0.1.1",
214
219
  private: false,
215
220
  license: "MIT",
216
221
  description: "CLI for managing your monorepo and syncing with upstream Cella.",
@@ -651,6 +656,30 @@ function printSyncComplete(result, options = {}) {
651
656
  }
652
657
  console.info();
653
658
  }
659
+ function findMaskingPins(files) {
660
+ return files.filter(
661
+ (file) => file.isPinned && file.status === "behind" && file.existsInFork && file.existsInUpstream
662
+ );
663
+ }
664
+ function printMaskingPinWarning(files) {
665
+ const masking = findMaskingPins(files);
666
+ if (masking.length === 0) return;
667
+ const many = masking.length > 1;
668
+ console.info();
669
+ console.info(
670
+ `${warningMark} ${colors_default.yellow(
671
+ `${masking.length} pinned ${many ? "files match" : "file matches"} the previous upstream but changed upstream \u2014`
672
+ )}`
673
+ );
674
+ console.info(colors_default.yellow(" the pin keeps the old fork copy and silently drops those upstream changes:"));
675
+ for (const file of masking) {
676
+ console.info(colors_default.dim(` \u2A00 ${file.path}`));
677
+ }
678
+ console.info(
679
+ colors_default.yellow(" If the fork never customized these, unpin them in cella/cella.config.ts to take upstream.")
680
+ );
681
+ console.info();
682
+ }
654
683
  function printFlagWarnings(options) {
655
684
  const { hard, unpinned } = options;
656
685
  if (!hard && !unpinned) return;
@@ -2294,6 +2323,7 @@ async function runAnalyze(config) {
2294
2323
  };
2295
2324
  printAnalysisFileGroups(result.files, linkOptions);
2296
2325
  printSummary(result.summary, "analysis summary");
2326
+ printMaskingPinWarning(result.files);
2297
2327
  if (config.logFile) {
2298
2328
  const logPath = writeLogFile(config.forkPath, result.files);
2299
2329
  console.info();
@@ -3908,6 +3938,7 @@ async function runSync(config, options) {
3908
3938
  spinnerFail("sync completed with conflicts");
3909
3939
  }
3910
3940
  printSummary(result.summary, "merge summary");
3941
+ printMaskingPinWarning(result.files);
3911
3942
  if (config.logFile) {
3912
3943
  const logPath = writeLogFile(config.forkPath, result.files);
3913
3944
  console.info();