@forgecart/cli 2.202609292044.0 → 2.202609301225.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.
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The storefront's package manifest under `forgecart refresh --adopt` (#2666).
3
+ *
4
+ * `package.json` is the one platform file a storefront extends in place: the
5
+ * merchant's own blocks declare the packages they import in it (`recharts`,
6
+ * `motion`, …). Adopting it therefore cannot replace it wholesale — that
7
+ * dropped those packages, and the workspace's next compile gate failed on
8
+ * `Cannot find module` for every block importing one.
9
+ *
10
+ * Ownership is by package NAME. The template owns every field it declares and
11
+ * every package its dependency fields name; the workspace owns every other
12
+ * package it declares. The adopted manifest is the template's, with each
13
+ * workspace-owned package kept in the dependency field the workspace declared
14
+ * it in. A package both declare takes the template's field and range — which is
15
+ * how a workspace's stale `@forgecart/sdk` range reaches the template's floor.
16
+ */
17
+ /** Workspace-relative path of the package manifest. */
18
+ export declare const PACKAGE_MANIFEST_RELPATH = "package.json";
19
+ /**
20
+ * The bytes an adopted package manifest lands as. When the workspace declares
21
+ * no package the template does not own, the template's bytes land unchanged;
22
+ * otherwise the template's manifest lands with those packages merged into their
23
+ * fields, each merged field in package-name order.
24
+ */
25
+ export declare function adoptPackageManifest(templateBytes: Buffer, workspaceBytes: Buffer): Buffer;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * The storefront's package manifest under `forgecart refresh --adopt` (#2666).
3
+ *
4
+ * `package.json` is the one platform file a storefront extends in place: the
5
+ * merchant's own blocks declare the packages they import in it (`recharts`,
6
+ * `motion`, …). Adopting it therefore cannot replace it wholesale — that
7
+ * dropped those packages, and the workspace's next compile gate failed on
8
+ * `Cannot find module` for every block importing one.
9
+ *
10
+ * Ownership is by package NAME. The template owns every field it declares and
11
+ * every package its dependency fields name; the workspace owns every other
12
+ * package it declares. The adopted manifest is the template's, with each
13
+ * workspace-owned package kept in the dependency field the workspace declared
14
+ * it in. A package both declare takes the template's field and range — which is
15
+ * how a workspace's stale `@forgecart/sdk` range reaches the template's floor.
16
+ */
17
+ /** Workspace-relative path of the package manifest. */
18
+ export const PACKAGE_MANIFEST_RELPATH = 'package.json';
19
+ /** The package manifest fields that declare dependencies. */
20
+ const DEPENDENCY_FIELDS = [
21
+ 'dependencies',
22
+ 'devDependencies',
23
+ 'peerDependencies',
24
+ 'optionalDependencies',
25
+ ];
26
+ /**
27
+ * The bytes an adopted package manifest lands as. When the workspace declares
28
+ * no package the template does not own, the template's bytes land unchanged;
29
+ * otherwise the template's manifest lands with those packages merged into their
30
+ * fields, each merged field in package-name order.
31
+ */
32
+ export function adoptPackageManifest(templateBytes, workspaceBytes) {
33
+ const template = parseManifest(templateBytes, "the template's copy");
34
+ const workspace = parseManifest(workspaceBytes, "the workspace's copy");
35
+ const templateOwned = new Set(DEPENDENCY_FIELDS.flatMap((field) => Object.keys(dependenciesOf(template, field))));
36
+ const kept = DEPENDENCY_FIELDS.map((field) => ({
37
+ field,
38
+ packages: workspaceOwned(dependenciesOf(workspace, field), templateOwned),
39
+ })).filter(({ packages }) => Object.keys(packages).length > 0);
40
+ if (kept.length === 0)
41
+ return templateBytes;
42
+ const adopted = { ...template };
43
+ for (const { field, packages } of kept) {
44
+ adopted[field] = inNameOrder({ ...dependenciesOf(template, field), ...packages });
45
+ }
46
+ return Buffer.from(`${JSON.stringify(adopted, null, 2)}\n`, 'utf8');
47
+ }
48
+ /** The declarations whose package the template does not own. */
49
+ function workspaceOwned(dependencies, templateOwned) {
50
+ return Object.fromEntries(Object.entries(dependencies).filter(([name]) => !templateOwned.has(name)));
51
+ }
52
+ /**
53
+ * A manifest's declarations in one dependency field. Only a JSON object's
54
+ * string-valued entries declare packages; an absent field, or one of any other
55
+ * shape, declares none.
56
+ */
57
+ function dependenciesOf(manifest, field) {
58
+ const declared = manifest[field];
59
+ if (!isJsonObject(declared))
60
+ return {};
61
+ return Object.fromEntries(Object.entries(declared).filter((entry) => typeof entry[1] === 'string'));
62
+ }
63
+ /** A dependency field in package-name order — the order npm writes one in. */
64
+ function inNameOrder(dependencies) {
65
+ return Object.fromEntries(Object.entries(dependencies).sort(([a], [b]) => a.localeCompare(b, 'en')));
66
+ }
67
+ /**
68
+ * Parse one copy of the manifest. A copy that is not a JSON object cannot say
69
+ * which packages it declares, so the adopt refuses it instead of dropping them
70
+ * unread.
71
+ */
72
+ function parseManifest(bytes, copy) {
73
+ const manifest = parseJson(bytes, copy);
74
+ if (!isJsonObject(manifest))
75
+ throw new Error(unmergeableMessage(copy));
76
+ return manifest;
77
+ }
78
+ function parseJson(bytes, copy) {
79
+ try {
80
+ const parsed = JSON.parse(bytes.toString('utf8'));
81
+ return parsed;
82
+ }
83
+ catch (error) {
84
+ throw new Error(unmergeableMessage(copy), { cause: error });
85
+ }
86
+ }
87
+ function unmergeableMessage(copy) {
88
+ return `Cannot adopt ${PACKAGE_MANIFEST_RELPATH}: ${copy} is not a JSON object, so the packages the workspace declares cannot be merged into the template's.`;
89
+ }
90
+ /** A JSON object — neither null nor an array. */
91
+ function isJsonObject(value) {
92
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
93
+ }
94
+ //# sourceMappingURL=package-manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-manifest.js","sourceRoot":"","sources":["../../../src/commands/package-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,uDAAuD;AACvD,MAAM,CAAC,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAEvD,6DAA6D;AAC7D,MAAM,iBAAiB,GAAG;IACxB,cAAc;IACd,iBAAiB;IACjB,kBAAkB;IAClB,sBAAsB;CACd,CAAC;AAUX;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,aAAqB,EAAE,cAAsB;IAChF,MAAM,QAAQ,GAAG,aAAa,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;IACrE,MAAM,SAAS,GAAG,aAAa,CAAC,cAAc,EAAE,sBAAsB,CAAC,CA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,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO,gBAAgB,wBAAwB,KAAK,IAAI,qGAAqG,CAAC;AAChK,CAAC;AAED,iDAAiD;AACjD,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
@@ -15,10 +15,14 @@ import { Command } from 'commander';
15
15
  *
16
16
  * Workspaces generated before the manifest existed cannot prove pristineness,
17
17
  * so every divergent file refuses by default; `--adopt <relpath>` takes the
18
- * template version for explicitly reviewed paths. The refresh always (re)writes
19
- * the manifest, so a pre-manifest workspace becomes precise after its first
20
- * refresh. The JSON report (`--json`) is the machine seam the provisioning
21
- * orchestrator parses.
18
+ * template version for explicitly reviewed paths — for `package.json`, the
19
+ * template's manifest with every package the workspace declared beyond it kept
20
+ * (`package-manifest.ts`, #2666). Every file is decided before any is written,
21
+ * so a refresh that stops on a file it cannot decide — an adopted
22
+ * `package.json` whose packages cannot be read — leaves the workspace as it
23
+ * found it. The refresh always (re)writes the manifest, so a pre-manifest
24
+ * workspace becomes precise after its first refresh. The JSON report
25
+ * (`--json`) is the machine seam the provisioning orchestrator parses.
22
26
  */
23
27
  interface RefreshOptions {
24
28
  json?: boolean;
@@ -4,6 +4,7 @@ import { Command } from 'commander';
4
4
  import { print } from '../output.js';
5
5
  import { readPackageVersion } from '../version.js';
6
6
  import { getStorefrontTemplateDir } from './init.js';
7
+ import { PACKAGE_MANIFEST_RELPATH, adoptPackageManifest } from './package-manifest.js';
7
8
  import { TEMPLATE_MANIFEST_RELPATH, TEMPLATE_MANIFEST_SCHEMA_VERSION, hashContent, listTemplateFiles, readTemplateManifest, } from './template-manifest.js';
8
9
  /** True if the path exists and is a regular file. */
9
10
  async function isFile(path) {
@@ -41,29 +42,59 @@ function decideFile(workspaceHash, templateHash, recordedHash, adopt) {
41
42
  return 'conflict';
42
43
  }
43
44
  /**
44
- * Judge one template file against the workspace and apply the write when the
45
- * verdict says so. Returns the verdict plus the template hash the manifest
46
- * update needs.
45
+ * Decide every template file against the workspace. Reads only: a file the
46
+ * refresh cannot decide stops it before anything is written.
47
47
  */
48
- async function refreshTemplateFile(targetDir, templateDir, relpath, recordedHash, adopt) {
48
+ async function decideTemplateFiles(targetDir, templateDir, manifest, adopt) {
49
+ const decisions = [];
50
+ for (const relpath of await listTemplateFiles(templateDir)) {
51
+ decisions.push(await decideTemplateFile(targetDir, templateDir, relpath, manifest?.files[relpath], adopt.has(relpath)));
52
+ }
53
+ return decisions;
54
+ }
55
+ /** Judge one template file against the workspace, and settle the bytes its write lands. */
56
+ async function decideTemplateFile(targetDir, templateDir, relpath, recordedHash, adopt) {
49
57
  const templateBytes = await readFile(join(templateDir, ...relpath.split('/')));
50
58
  const templateHash = hashContent(templateBytes);
51
- const workspacePath = join(targetDir, ...relpath.split('/'));
52
- const workspaceBytes = await readBytesIfPresent(workspacePath);
59
+ const workspaceBytes = await readBytesIfPresent(join(targetDir, ...relpath.split('/')));
53
60
  const verdict = decideFile(workspaceBytes === null ? null : hashContent(workspaceBytes), templateHash, recordedHash, adopt);
54
- if (verdict === 'rendered' || verdict === 'adopted') {
55
- await mkdir(dirname(workspacePath), { recursive: true });
56
- await writeFile(workspacePath, templateBytes);
61
+ return {
62
+ relpath,
63
+ verdict,
64
+ templateHash,
65
+ recordedHash,
66
+ landed: landedBytes(relpath, verdict, templateBytes, workspaceBytes),
67
+ };
68
+ }
69
+ /**
70
+ * The bytes a verdict lands in the workspace, or null when it writes nothing.
71
+ * A written file lands as the template's bytes — except an ADOPTED
72
+ * `package.json`, which keeps every package the workspace declared beyond the
73
+ * template (#2666).
74
+ */
75
+ function landedBytes(relpath, verdict, templateBytes, workspaceBytes) {
76
+ if (verdict === 'conflict' || verdict === 'upToDate')
77
+ return null;
78
+ if (verdict === 'adopted' && relpath === PACKAGE_MANIFEST_RELPATH && workspaceBytes !== null) {
79
+ return adoptPackageManifest(templateBytes, workspaceBytes);
57
80
  }
58
- return { verdict, templateHash };
81
+ return templateBytes;
82
+ }
83
+ /** Apply one decision: write the bytes it lands, creating their directory. */
84
+ async function writeDecision(targetDir, { relpath, landed }) {
85
+ if (landed === null)
86
+ return;
87
+ const workspacePath = join(targetDir, ...relpath.split('/'));
88
+ await mkdir(dirname(workspacePath), { recursive: true });
89
+ await writeFile(workspacePath, landed);
59
90
  }
60
91
  /**
61
- * Fold one file's verdict into the report and the next manifest: bucket the
92
+ * Fold one file's decision into the report and the next manifest: bucket the
62
93
  * relpath, flip the install flag when package.json was (re)written, and
63
94
  * record the inventory entry.
64
95
  */
65
- function recordVerdict(report, nextFiles, relpath, verdict, templateHash, recordedHash) {
66
- if (relpath === 'package.json' && (verdict === 'rendered' || verdict === 'adopted')) {
96
+ function recordVerdict(report, nextFiles, { relpath, verdict, templateHash, recordedHash }) {
97
+ if (relpath === PACKAGE_MANIFEST_RELPATH && (verdict === 'rendered' || verdict === 'adopted')) {
67
98
  report.dependenciesChanged = true;
68
99
  }
69
100
  report[verdict === 'conflict' ? 'conflicts' : verdict].push(relpath);
@@ -75,7 +106,10 @@ function recordVerdict(report, nextFiles, relpath, verdict, templateHash, record
75
106
  /**
76
107
  * The next manifest entry for a file: written/current files record the
77
108
  * template hash; a conflict keeps its previous inventory (or stays
78
- * uninventoried), so it keeps conflicting until adopted.
109
+ * uninventoried), so it keeps conflicting until adopted. An adopted
110
+ * `package.json` that kept workspace packages records the template hash too:
111
+ * it differs from that hash, so a later refresh reports it as a conflict and
112
+ * never re-renders the template's bytes over the packages it kept.
79
113
  */
80
114
  function nextManifestHash(verdict, templateHash, recordedHash) {
81
115
  if (verdict === 'conflict')
@@ -85,12 +119,10 @@ function nextManifestHash(verdict, templateHash, recordedHash) {
85
119
  /** Run `forgecart refresh`. */
86
120
  export async function runRefresh(name, options) {
87
121
  const targetDir = name ? resolve(process.cwd(), name) : process.cwd();
88
- if (!(await isFile(join(targetDir, 'package.json')))) {
122
+ if (!(await isFile(join(targetDir, PACKAGE_MANIFEST_RELPATH)))) {
89
123
  throw new Error(`refresh requires an existing storefront at ${targetDir} (no package.json found).`);
90
124
  }
91
- const templateDir = getStorefrontTemplateDir();
92
- const manifest = await readTemplateManifest(targetDir);
93
- const adoptSet = new Set(options.adopt ?? []);
125
+ const decisions = await decideTemplateFiles(targetDir, getStorefrontTemplateDir(), await readTemplateManifest(targetDir), new Set(options.adopt ?? []));
94
126
  const report = {
95
127
  rendered: [],
96
128
  conflicts: [],
@@ -99,10 +131,9 @@ export async function runRefresh(name, options) {
99
131
  dependenciesChanged: false,
100
132
  };
101
133
  const nextFiles = {};
102
- for (const relpath of await listTemplateFiles(templateDir)) {
103
- const recordedHash = manifest?.files[relpath];
104
- const { verdict, templateHash } = await refreshTemplateFile(targetDir, templateDir, relpath, recordedHash, adoptSet.has(relpath));
105
- recordVerdict(report, nextFiles, relpath, verdict, templateHash, recordedHash);
134
+ for (const decision of decisions) {
135
+ await writeDecision(targetDir, decision);
136
+ recordVerdict(report, nextFiles, decision);
106
137
  }
107
138
  const nextManifest = {
108
139
  schemaVersion: TEMPLATE_MANIFEST_SCHEMA_VERSION,
@@ -1 +1 @@
1
- {"version":3,"file":"refresh.js","sourceRoot":"","sources":["../../../src/commands/refresh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eA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SACrF,MAAM,CAAC,KAAK,EAAE,IAAwB,EAAE,OAAuB,EAAE,EAAE;QAClE,MAAM,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACP,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgecart/cli",
3
- "version": "2.202609292044.0",
3
+ "version": "2.202609301225.0",
4
4
  "type": "module",
5
5
  "description": "CLI for scaffolding and operating ForgeCart channel storefronts",
6
6
  "bin": {
@@ -402,8 +402,11 @@ Typical ones: `src/app/page.tsx`, `src/app/products/page.tsx`, `src/components/H
402
402
 
403
403
  - links as `LocaleLink`; route metadata through `routeMetadata` with
404
404
  `staticPathsByLocale(languageCodes, '<route>')`; images with `alt={getAssetAlt(asset)}`;
405
- - `package.json`: adopt it, then declare every package the merchant's code still imports with
406
- `EnsureDeps`. Leave out the packages the deletion list removed, such as `next-sitemap`.
405
+ - `package.json`: adopt it. Adopting keeps every package the storefront declares that the platform
406
+ version does not, and takes the platform's range for a package both declare. Then delete the
407
+ packages the deletion list removed, such as `next-sitemap`, from it; the promote reinstalls the
408
+ dependencies. A `package.json` that still declares a package of the storefront's is Merged, with
409
+ those packages as its customizations.
407
410
 
408
411
  ### Routes the platform does not ship
409
412
 
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "@forgecart/designer-runtime": "^1.202607161748.0",
12
- "@forgecart/sdk": "^1.2.6",
12
+ "@forgecart/sdk": "^1.202609282317.0",
13
13
  "@nestjs/common": "^11.1.14",
14
14
  "@nestjs/core": "^11.1.14",
15
15
  "class-transformer": "^0.5.1",