@_linked/cli 1.39.0 → 1.40.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +73 -9
  3. package/defaults/app-react-native/apps/mobile/package.json +4 -4
  4. package/defaults/app-react-native/docker-compose.yml +1 -1
  5. package/defaults/app-react-native/packages/app-shapes/package.json +2 -2
  6. package/defaults/app-react-native/services/api/package.json +7 -7
  7. package/lib/esm/cli.js +1 -0
  8. package/lib/esm/cli.js.map +1 -1
  9. package/lib/esm/commands/build-package.d.ts +1 -1
  10. package/lib/esm/commands/build-package.d.ts.map +1 -1
  11. package/lib/esm/commands/build-package.js +3 -2
  12. package/lib/esm/commands/build-package.js.map +1 -1
  13. package/lib/esm/commands/localize.d.ts +19 -0
  14. package/lib/esm/commands/localize.d.ts.map +1 -1
  15. package/lib/esm/commands/localize.js +36 -10
  16. package/lib/esm/commands/localize.js.map +1 -1
  17. package/lib/esm/installed-packages.d.ts +45 -5
  18. package/lib/esm/installed-packages.d.ts.map +1 -1
  19. package/lib/esm/installed-packages.js +90 -5
  20. package/lib/esm/installed-packages.js.map +1 -1
  21. package/lib/esm/lifecycle.d.ts +1 -1
  22. package/lib/esm/lifecycle.d.ts.map +1 -1
  23. package/lib/esm/lifecycle.js +4 -5
  24. package/lib/esm/lifecycle.js.map +1 -1
  25. package/lib/esm/localized-dedupe.d.ts +20 -0
  26. package/lib/esm/localized-dedupe.d.ts.map +1 -0
  27. package/lib/esm/localized-dedupe.js +182 -0
  28. package/lib/esm/localized-dedupe.js.map +1 -0
  29. package/lib/esm/utils.d.ts.map +1 -1
  30. package/lib/esm/utils.js +2 -1
  31. package/lib/esm/utils.js.map +1 -1
  32. package/lib/esm/vite-config.d.ts +8 -0
  33. package/lib/esm/vite-config.d.ts.map +1 -1
  34. package/lib/esm/vite-config.js +67 -48
  35. package/lib/esm/vite-config.js.map +1 -1
  36. package/package.json +3 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.40.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#216](https://github.com/linked-fw/cli/pull/216) [`2f9a3b5`](https://github.com/linked-fw/cli/commit/2f9a3b5e668e638d94384f6996ba4336d28b60d8) Thanks [@flyon](https://github.com/flyon)! - Remove unused dependencies: express, open, postcss-import, postcss-nested, postcss-preset-env
8
+
9
+ ## 1.40.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#211](https://github.com/linked-fw/cli/pull/211) [`c268b22`](https://github.com/linked-fw/cli/commit/c268b22efc68384470e90dc391729dcf5911d185) Thanks [@flyon](https://github.com/flyon)! - `linked localize` now leaves one copy of each framework package. A checkout's install leaves its own `@_linked/core` (pinned by the checkout's lockfile, often older than the app's) and a registry copy of any localized sibling in its `node_modules`, and plain Node and `tsx` loaded those: measured with three localized linked packages, three cores in one process, and a localized package that never saw its localized sibling. `@_linked/localize` 0.3.0 removes a checkout's copies of what the app provides after every install and on every `--relink`; this CLI requires it and tells it what the app provides: the linked packages it has installed (by their `linkedPackage` flag, not their scope), `react` and `react-dom`. A copy is removed only when the app's version satisfies the checkout's range (a localized sibling always counts); otherwise it is kept, with a warning. Measured afterwards: one core in Node, `tsx` and Vite SSR, and every checkout still builds — `npx linked build` in a checkout runs the app's `linked` — and passes its tests. `--no-prune` turns it off.
14
+
15
+ ### Patch Changes
16
+
17
+ - [#211](https://github.com/linked-fw/cli/pull/211) [`01d3dc0`](https://github.com/linked-fw/cli/commit/01d3dc02b68245b79e1bb2855e96f969d5942026) Thanks [@flyon](https://github.com/flyon)! - The dev resolver registers every localized package as source, including one that another localized package depends on. The dependency walk used to key "visited" on the package name and go depth-first, so reaching a checkout's own `node_modules` copy of a sibling (a lib-only registry install) first hid the app's localized checkout of that sibling: Vite served it from `lib/`, and the depending checkout's imports went to its nested copy. The walk is now breadth-first and keyed on the installed directory.
18
+
19
+ - [#211](https://github.com/linked-fw/cli/pull/211) [`c268b22`](https://github.com/linked-fw/cli/commit/c268b22efc68384470e90dc391729dcf5911d185) Thanks [@flyon](https://github.com/flyon)! - `createViteConfig` dedupes what localization can duplicate, in every mode: every localized package (from `local-packages.json`), every runtime dependency a localized checkout declares that the app has at a version satisfying that checkout's range, and `react`/`react-dom`. Before, it deduped only `@_linked/server-utils` and `@_linked/react`, and only in a standalone app, so an app with a localized package had Vite resolve `@_linked/core` from that checkout's own `node_modules`: its dev SSR backend loaded one core per copy (three, measured). A dependency whose range the app does not satisfy is left out and reported in the dev log, and so is a name a registry install nests its own copy of, because a dedupe hands every importer the app's copy without checking versions. A standalone app's `optimizeDeps.exclude` now picks linked packages by their `linkedPackage` flag rather than the `@_linked/` scope, and the legacy `lincd: true` flag is no longer read anywhere.
20
+
3
21
  ## 1.39.0
4
22
 
5
23
  ### Minor Changes
package/README.md CHANGED
@@ -8,13 +8,16 @@ Command-line tools for the `@_linked/*` packages and apps.
8
8
  npm install --save-dev @_linked/cli
9
9
  ```
10
10
 
11
- ## Binaries
11
+ ## Binary
12
12
 
13
- Three executables ship in this package:
13
+ One executable ships in this package: `linked`. (`lnk`, `lincd` and `lincd-cli` were dropped in
14
+ [#40](https://github.com/linked-fw/cli/pull/40).)
14
15
 
15
- - `linked` — primary command
16
- - `lnk` — short alias for `linked`
17
- - `lincd` — deprecated alias; prints a warning and forwards to `linked`. Will be removed in a future major release.
16
+ In a project that has `@_linked/cli` installed — any linked app, including Create Now — run it as
17
+ `npx linked <command>`. Everywhere else, name the package: `npx @_linked/cli <command>`.
18
+ A bare `npx linked` outside such a project does **not** reach this CLI: npm resolves it to the
19
+ unrelated `linked` package on the registry, which has no binary, and fails with
20
+ `could not determine executable to run`.
18
21
 
19
22
  ## Commands
20
23
 
@@ -24,11 +27,31 @@ Run `linked --help` for the full list. The commonly used ones:
24
27
 
25
28
  ```bash
26
29
  linked create-app <name> # scaffold a new app (interactive)
27
- linked create-package <name> # scaffold a new linkedPackage
30
+ linked create-package <name> # scaffold a new linkedPackage (see below for where it goes)
28
31
  linked create-shape <name> # add a shape file to the current package
29
32
  linked create-component <name> # add a React component file
30
33
  ```
31
34
 
35
+ Inside an app (a `package.json` with `"linkedApp": true` above the current directory),
36
+ `create-package` puts the package in one of two places, and asks which on a terminal:
37
+
38
+ ```bash
39
+ linked create-package @_linked/foo --location packages # part of the app's repository
40
+ linked create-package @_linked/foo --location packages-local # a repository of its own
41
+ linked create-package @_linked/foo --remote <git-url> [--push] # the same, with an origin
42
+ ```
43
+
44
+ - `packages/foo` — a workspace member: added to the app's `dependencies` (and `packages/*` to its
45
+ `workspaces` if missing), installed at the app root.
46
+ - `packages-local/_linked-foo` — the name `linked localize` uses. `git init` and a first commit,
47
+ `origin` and `repository.url` from `--remote`, pushed with `--push`; then installed, built,
48
+ linked and recorded by `linked localize --adopt`. It is not added to the app's `dependencies`
49
+ until it is published. `--remote` or `--push` imply this location.
50
+
51
+ Any of the three flags skips the question. With none of them and no terminal, it exits 1 and says
52
+ which flag to pass. An existing target folder is refused. Outside an app nothing changes: the
53
+ package goes in `./packages/`, `./modules/` or the current directory, and installs on its own.
54
+
32
55
  ### Building
33
56
 
34
57
  ```bash
@@ -214,10 +237,18 @@ linked localize @_linked/rdfs # clone, install, build, symlink into node_mod
214
237
  linked localize # report what is localized (same as --list)
215
238
  linked localize --list --check # exit 1 when something recorded is not actually linked
216
239
  linked localize --relink # recreate the recorded symlinks — run this from postinstall
240
+ linked localize @_linked/rdfs --adopt # link a checkout already in packages-local/_linked-rdfs, no clone
217
241
  linked delocalize @_linked/rdfs # unlink and forget, keeping the checkout
218
242
  linked delocalize --purge # undo everything and delete the checkouts
219
243
  ```
220
244
 
245
+ Checkouts go in `packages-local/` under the npm name with the scope flattened:
246
+ `@_linked/rdfs` → `packages-local/_linked-rdfs`.
247
+
248
+ `npm install <name>` — with a package name — does not run the app's own `postinstall`, so it
249
+ replaces every localized link with the registry copy and prunes the checkouts' dependencies,
250
+ silently. Run `linked localize --relink` after it (a bare `npm install` runs the hook itself).
251
+
221
252
  Name packages exactly as npm names them (`@_linked/rdfs`, `lodash`): the
222
253
  repository is read from the package's published `repository` field, so there is
223
254
  no short-name expansion and no org guessing. `--dir` moves the checkout
@@ -226,9 +257,42 @@ published metadata does not point at the right place, and `--build "<cmd>"`
226
257
  replaces `linked build` (an empty string builds nothing). A failing build only
227
258
  warns — a package whose build is broken is usually why you localized it.
228
259
 
260
+ **One copy of each framework package.** A checkout's own install leaves its own
261
+ `@_linked/core` (pinned by the checkout's lockfile, often older than the app's)
262
+ and a registry copy of any localized sibling in its `node_modules`, and Node
263
+ loads those instead of the app's. So after installing, and on every `--relink`,
264
+ `linked localize` removes from every checkout's `node_modules` its own copy of
265
+ a linked package the app has installed, `react` and `react-dom` (plus its
266
+ peerDependencies) when the app has a version that satisfies the checkout's range; a localized sibling always
267
+ counts. A copy the app's version does not satisfy is kept, with a warning naming
268
+ the package, the range and the app's version. The checkout still builds and runs
269
+ its tests, resolving those packages from the app — this CLI included: npm puts
270
+ every ancestor's `node_modules/.bin` on the `PATH`, so `npx linked build` in a
271
+ checkout runs the app's `linked`. `--no-prune` keeps every checkout's
272
+ `node_modules` as npm left it. The
273
+ A linked package is one whose `package.json` says `"linkedPackage": true` — the
274
+ definition `build-all` and `linked build` use — whatever its npm scope;
275
+ `@_linked/localize`, a plain tool, is not one.
276
+
277
+ The dev server gets the same guarantee from Vite's `resolve.dedupe`, which
278
+ `createViteConfig` derives from what is localized: the localized packages
279
+ themselves, plus every runtime dependency a localized checkout declares that the
280
+ app has at a version satisfying the checkout's range, plus React. A dependency
281
+ whose range the app does not satisfy keeps the checkout's own copy (the dev log
282
+ says which), and so does a name some registry install nests its own copy of —
283
+ a dedupe hands every importer the app's copy without checking versions. With
284
+ nothing localized, only React is deduped. The dedupe covers what Vite loads; the
285
+ removal on disk covers plain Node, `tsx` and test runners, which never read it.
286
+
229
287
  The work is done by [`@_linked/localize`](https://www.npmjs.com/package/@_linked/localize),
230
- which is dependency-free and framework-agnostic; this CLI only supplies the
231
- build command.
288
+ which is dependency-free and framework-agnostic; this CLI supplies the
289
+ build command and the list of what an app provides. That package's own binary, `linked-localize`, is the same mechanism with
290
+ three differences: it builds nothing unless given `--build "<cmd>"`, it treats only localized
291
+ siblings and peerDependencies as provided unless given `--provided "<name>,…"`,
292
+ and its verbs are subcommands —
293
+ `linked-localize adopt <pkg>` and `linked-localize remove <pkg>` where this CLI has
294
+ `linked localize --adopt <pkg>` and `linked delocalize <pkg>`. In a linked app, use
295
+ `linked localize`.
232
296
 
233
297
  ### Registry / dev utilities
234
298
 
@@ -375,4 +439,4 @@ Metro iOS bundle. It builds nothing itself, needs network and takes several minu
375
439
 
376
440
  ## Repository
377
441
 
378
- `linked-cm/cli` on GitHub. License: MPL-2.0.
442
+ `linked-fw/cli` on GitHub. License: MPL-2.0.
@@ -11,10 +11,10 @@
11
11
  "test:integration": "jest -c jest.integration.config.js --runInBand"
12
12
  },
13
13
  "dependencies": {
14
- "@_linked/core": "2.18.1",
15
- "@_linked/react": "1.5.0",
16
- "@_linked/schema": "1.1.2",
17
- "@_linked/server": "2.3.0",
14
+ "@_linked/core": "2.26.0",
15
+ "@_linked/react": "1.6.4",
16
+ "@_linked/schema": "1.4.0",
17
+ "@_linked/server": "2.24.0",
18
18
  "app-shapes": "*",
19
19
  "expo": "57.0.25",
20
20
  "expo-constants": "57.0.19",
@@ -2,7 +2,7 @@
2
2
  # `npm run fuseki:up` starts it and waits for the healthcheck; `npm run fuseki:down` stops it (data persists).
3
3
  services:
4
4
  fuseki:
5
- image: secoresearch/fuseki:5.5.0
5
+ image: secoresearch/fuseki:5.6.0
6
6
  ports:
7
7
  # Override the host port when 3030 is taken (another project's Fuseki); set FUSEKI_BASE_URL to match.
8
8
  - "${FUSEKI_PORT:-3030}:3030"
@@ -16,9 +16,9 @@
16
16
  "build": "linked build"
17
17
  },
18
18
  "dependencies": {
19
- "@_linked/core": "2.18.1"
19
+ "@_linked/core": "2.26.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@_linked/cli": "1.13.0"
22
+ "@_linked/cli": "1.40.0"
23
23
  }
24
24
  }
@@ -14,17 +14,17 @@
14
14
  "test": "node --experimental-strip-types --no-warnings=ExperimentalWarning --test test/*.test.mjs"
15
15
  },
16
16
  "dependencies": {
17
- "@_linked/core": "2.18.1",
18
- "@_linked/fuseki": "3.0.0",
19
- "@_linked/s3": "1.1.0",
20
- "@_linked/schema": "1.1.2",
21
- "@_linked/server": "2.3.0",
22
- "@_linked/server-utils": "1.2.0",
17
+ "@_linked/core": "2.26.0",
18
+ "@_linked/fuseki": "3.4.0",
19
+ "@_linked/s3": "1.6.0",
20
+ "@_linked/schema": "1.4.0",
21
+ "@_linked/server": "2.24.0",
22
+ "@_linked/server-utils": "1.12.0",
23
23
  "app-shapes": "*",
24
24
  "react-dom": "19.2.3"
25
25
  },
26
26
  "devDependencies": {
27
- "@_linked/cli": "1.13.0",
27
+ "@_linked/cli": "1.40.0",
28
28
  "@types/node": "22.20.4",
29
29
  "typescript": "6.0.3"
30
30
  }
package/lib/esm/cli.js CHANGED
@@ -314,6 +314,7 @@ program
314
314
  .option('--subdir <path>', "The package's directory inside the repository (monorepos).")
315
315
  .option('--build <cmd>', 'Run this in the checkout after installing; a failure only warns. Defaults to `linked build`; pass an empty string to build nothing.')
316
316
  .option('--force', 'Overwrite a symlink pointing outside the checkout directory.')
317
+ .option('--no-prune', "Keep every checkout's node_modules as npm installed it. By default, after installing (and on --relink) a checkout's own copy of a linked package (one with linkedPackage: true in its package.json), react or react-dom is removed when the app has a version that satisfies the checkout's range, so the checkout loads the app's copy (and a localized sibling) instead of a second one. A copy the app's version does not satisfy is kept, with a warning.")
317
318
  .action((packages, options) => __awaiter(void 0, void 0, void 0, function* () {
318
319
  const { runLocalize } = yield import('./commands/localize.js');
319
320
  return runLocalize(packages, options);
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";A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AAK,CAAC,KAAK,CAAC;KACZ,KAAK,CAAC,GAAG,CAAC;KACV,KAAK,CAAC,QAAQ,CAAC;KACf,WAAW,CACV,gLAAgL,CACjL;KACA,QAAQ,CAAC,QAAQ,EAAE,qDAAqD,CAAC;KACzE,QAAQ,CACP,WAAW,EACX,2DAA2D,CAC5D;KACA,QAAQ,CAAC,WAAW,EAAE,0CAA0C,CAAC,CAAC;AAErE,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE;IAC9C,YAAY,EAAE,CAAC;AACjB,CAAC,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3E,IAAI,cAAc,EAAE,CAAC;IACnB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;IACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AACD,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC","sourcesContent":["#!/usr/bin/env tsx\n//The line above calls the TSX typescript executer as runtime, which extends node.js and supports running typescript\n// see: https://www.npmjs.com/package/tsx\n\nimport chalk from 'chalk';\nimport {\n addCapacitor,\n buildAll,\n buildPackage,\n buildUpdated,\n checkImports,\n compilePackage,\n createApp,\n createComponent,\n createOntology,\n createPackage,\n createSetComponent,\n createShape,\n depCheck,\n depCheckStaged,\n developPackage,\n executeCommandForEachPackage,\n executeCommandForPackage,\n getLincdPackages,\n getScriptDir,\n publishPackage,\n publishUpdated,\n register,\n runMethod,\n runScript,\n startServer,\n upgradePackages,\n} from './cli-methods.js';\n// import {buildMetadata} from './metadata';\nimport {program} from 'commander';\nimport {CreatePackageError} from './utils/createPackageLocation.js';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport 'require-extensions';\nimport {unknownCommandError} from './unknown-command.js';\n\n/**\n * Run an async command action and report a failure the way the rest of this\n * CLI does — one red message and exit code 1 — instead of letting the rejection\n * escape the action and print a raw unhandled-rejection stack.\n */\nconst runAppCommand = async (run: () => Promise<unknown>): Promise<void> => {\n try {\n await run();\n } catch (error) {\n const message =\n error instanceof Error ? error.message : String(error ?? 'Unknown error');\n console.error(chalk.red(message));\n if (process.env.LINKED_DEBUG && error instanceof Error && error.stack) {\n console.error(error.stack);\n }\n process.exitCode = 1;\n }\n};\n\n/** `--env a,b` → `['a', 'b']`. */\nconst splitEnvOption = (value?: string): string[] =>\n (value || '')\n .split(',')\n .map((name) => name.trim())\n .filter(Boolean);\n\nprogram\n .command('create-app')\n .action((name, options) => {\n return createApp(name, process.cwd(), {\n appName: options.appName,\n appPrefix: options.appPrefix,\n appDomain: options.appDomain,\n skipInstall: options.skipInstall,\n template: options.template,\n }).catch((err) => {\n // Report and fail the process without cutting off pending output.\n console.error(chalk.red(err?.message ?? String(err)));\n process.exitCode = 1;\n });\n })\n .description(\n 'Creates a new folder with all the required files for a Linked app',\n )\n .argument(\n '<name>',\n 'the name of your Linked app. To use spaces, wrap the name in double quotes.',\n )\n .option('--app-name <name>', 'Display name for the app (skip interactive prompt)')\n .option('--app-prefix <prefix>', 'Short code prefix for data files (skip interactive prompt)')\n .option('--app-domain <domain>', 'Domain for the app (skip interactive prompt)')\n .option('--skip-install', 'Skip running npm install after scaffolding')\n .option(\n '--template <template>',\n 'App template: \"web\" (default) or \"react-native\"',\n );\n\nprogram\n .command('start')\n .action(async (options) => {\n const {startWithVite} = await import('./commands/start.js');\n return startWithVite({env: options?.env, apiOnly: options?.apiOnly});\n })\n .option('--env <env>', 'The node environment to use. Default is \"development\"')\n .option(\n '--api-only',\n 'Serve only the backend API: no vite.config, src/App.tsx or src/routes.tsx needed; page requests get a 404',\n )\n .description(\n 'Start the Linked dev server. Vite-backed by default.',\n );\n\nprogram\n .command('call')\n .action((packageName, method, options) => {\n return runMethod(packageName, method, {spawn: options.spawn});\n })\n .option(\n '--spawn',\n 'Start a new server instance instead of using an existing one',\n )\n .option('--env', 'The node environment to use. Default is \"development\"')\n .description(\n 'Start the Linked node.js server but without http server. Instead it immediately calls the specified method of the specified package and exits afterwards',\n )\n .argument(\n '<package>',\n 'the package of the backend provider that contains this method',\n )\n .argument('<method>', 'the name of the method you want to call');\n\nprogram\n .command('script')\n .action((scriptName, options) => {\n return runScript(scriptName, {spawn: options.spawn});\n })\n .option(\n '--spawn',\n 'Start a new server instance instead of using an existing one',\n )\n .option('--env', 'The node environment to use. Default is \"development\"')\n .description(\n 'Start the Linked node.js server but without http server. Instead it immediately runs the specified script and exits afterwards',\n )\n .argument(\n '<scriptName>',\n 'the name of the script file inside the /scripts folder',\n );\n\nprogram\n .command('create-package')\n .action(async (name, uriBase, options) => {\n try {\n await createPackage(name, uriBase, process.cwd(), options);\n } catch (e) {\n if (!(e instanceof CreatePackageError)) throw e;\n console.error(chalk.red(e.message));\n process.exitCode = 1;\n }\n })\n .description(\n \"Create a new folder with all the required files for a new Linked package. Inside an app, it goes in packages/ (part of the app's repository) or packages-local/ (its own git repository, linked with `linked localize`); without --location, --remote or --push you are asked, on a terminal.\",\n )\n .option(\n '--location <where>',\n \"packages: part of this app's repository, a workspace member added to its dependencies. packages-local: its own git repository (git init + a first commit), linked and recorded by `linked localize` and not added to the app's dependencies until it is published.\",\n )\n .option(\n '--remote <git-url>',\n \"The new repository's origin; also written to repository.url. Implies --location packages-local.\",\n )\n .option('--push', 'Push the first commit to --remote.')\n .argument(\n '<name>',\n 'The name of the package. Will be used as package name in package.json',\n )\n .argument(\n '[uri_base]',\n 'The base URL used for data of this package. Leave blank to use the URL of your package on lincd.org after you register it',\n );\n\nprogram\n .command('upgrade-packages')\n .action(() => {\n return upgradePackages();\n })\n .description(\n 'Upgrade all linked packages in the workspace to ESM/CJS dual packages',\n );\n\nprogram\n .command('create-shape')\n .action((name, uriBase) => {\n return createShape(name);\n })\n .description(\n 'Creates a new ShapeClass file for your package. Execute this from your package folder.',\n )\n .argument(\n '<name>',\n 'The name of the shape. Will be used for the file name and the class name',\n );\n\nprogram\n .command('create-component')\n .action((name, uriBase) => {\n return createComponent(name);\n })\n .description(\n 'Creates a new Component file for your package. Execute this from your package folder.',\n )\n .argument(\n '<name>',\n 'The name of the component. Will be used for the file name and the export name',\n );\n\nprogram\n .command('create-set-component')\n .action((name, uriBase) => {\n return createSetComponent(name);\n })\n .description(\n 'Creates a new SetComponent file for your package. Execute this from your package folder.',\n )\n .argument(\n '<name>',\n 'The name of the component. Will be used for the file name and the export name',\n );\n\nprogram\n .command('create-ontology')\n .action((prefix, uriBase) => {\n return createOntology(prefix, uriBase);\n })\n .description(\n 'Creates a new ontology file for your package. Execute this from your package folder.',\n )\n .argument(\n '<suggested-prefix>',\n 'The suggested prefix for your ontology. Also the shorthand code used for the file name and the exported ontology object',\n )\n .argument(\n '[uribase]',\n \"Optional argument to set the URI base for the URI's of all entities in your ontology. Leave blank to use the URI's provided by lincd.org once you register this package\",\n );\n\nprogram.command('app [action]', {hidden: true}).action(() => {\n register('http://localhost:4101');\n});\nprogram.command('register-local', {hidden: true}).action(() => {\n register('http://localhost:4101');\n});\nprogram.command('register-dev', {hidden: true}).action(() => {\n register('https://dev-registry.lincd.org');\n});\nprogram\n .command('register')\n .action(() => {\n register('https://registry.lincd.org');\n })\n .description(\n 'Register (a new version of) this package to the Linked registry. If successful your package will appear on linked.cm',\n );\n\nprogram\n .command('info')\n .action(() => {\n let localDir = getScriptDir();\n let packageJsonPath = path.join(localDir, 'package.json');\n try {\n var ownPackage = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));\n } catch (e) {\n console.warn(\n 'Could not read package.json at ' + packageJsonPath + ': ' + e,\n );\n process.exit();\n }\n console.log(ownPackage.version);\n console.log('Running from: ' + localDir);\n })\n .description(\n \"Log the version of this tool and the path that it's running from\",\n );\n\nprogram\n .command('build [target] [target2]', {isDefault: true})\n .action(async (target, target2, options) => {\n const result = await buildPackage(target, target2, process.cwd(), !options?.silent);\n if (result !== true) {\n process.exitCode = 1;\n }\n })\n .option(\n '--silent',\n 'No output to console unless errors occur. The exit code is unaffected: 0 when the build succeeds (warnings included), 1 when it fails',\n );\n\nprogram\n .command('compile-only')\n .action(() => {\n compilePackage();\n })\n .description(\n 'Compile the package without other build steps. Run this command from the package folder',\n );\nprogram.command('build-metadata').action(() => {\n console.log('Needs to be reimplemented');\n // buildMetadata();\n});\nprogram\n .command('build-app')\n .action(async (options) => {\n // Vite is the only app build. An app without a `vite.config.{ts,js,mjs}`\n // is rejected by name rather than falling back to anything.\n await runAppCommand(async () => {\n const {assertViteApp, buildViteApp} = await import(\n './commands/build-app.js'\n );\n assertViteApp();\n await buildViteApp({\n environmentNames: splitEnvOption(options?.env),\n target: options?.target,\n publish: options?.publish === true,\n revision: options?.revision,\n allowDirty: options?.allowDirty === true,\n });\n });\n })\n .option('--env <env>', 'The node environment to use. Default is \"development\"')\n .option('--target <target>', 'Build target: web or capacitor')\n .option(\n '--publish',\n 'Upload the release after a successful web build (off by default; use `linked publish-app`)',\n )\n .option(\n '--revision <sha>',\n 'Revision identifying the release. Defaults to LINKED_RELEASE_REVISION, GITHUB_SHA, then git HEAD',\n )\n .option(\n '--allow-dirty',\n 'Build from a working tree with uncommitted changes; the release revision gets a \"-dirty\" suffix',\n )\n .description(\n 'Build the linked app frontend and backend for production, and write a release manifest. Requires a vite.config in the app root.',\n );\n\nprogram\n .command('publish-app')\n .option('--env <env>', 'The node environment to use')\n .option(\n '--manifest <path>',\n 'Release manifest to publish, relative to the app root. Default public/bundles/linked-release.json',\n )\n .option('--yes', 'Upload the verified release. Without it this is a dry run')\n .action(async (options) => {\n // Retry or inspect an existing release without rebuilding the app.\n await runAppCommand(async () => {\n const {ensureEnvironmentLoaded} = await import('./lifecycle.js');\n const {resolveAppAssetsStore} = await import(\n './app-release/app-assets-store.js'\n );\n const {publishApp} = await import('./commands/publish-app.js');\n await ensureEnvironmentLoaded(splitEnvOption(options?.env));\n // The store is resolved by publishApp, after the manifest is read.\n await publishApp({\n manifestPath: options?.manifest,\n resolveStore: () => resolveAppAssetsStore(),\n yes: options?.yes === true,\n });\n });\n })\n .description(\n 'Validate or retry publishing a previously built release. Defaults to dry run.',\n );\n\nprogram\n .command('serve-app')\n .option('--env <env>', 'The node environment to use')\n .action(async (options) => {\n // Production runtime loads compiled output and never starts Vite/HMR.\n await runAppCommand(async () => {\n const {serveCompiledApp} = await import('./commands/serve-app.js');\n await serveCompiledApp({environmentNames: splitEnvOption(options?.env)});\n });\n })\n .description('Start a compiled Linked app without Vite or HMR.');\n\nprogram.command('publish-updated').action(() => {\n return publishUpdated();\n});\nprogram.command('publish [version]').action((version) => {\n publishPackage(null, false, null, version);\n});\n\nprogram.command('status').action(() => {\n //log which packages need to be published\n return publishUpdated(true).then(() => {\n //log which packages need to be build\n return buildUpdated(undefined, '', '', true);\n });\n});\nprogram\n .command('build-updated [target] [target2]')\n .action((target, target2, options) => {\n const {useGit}: {useGit?: boolean} = options;\n return buildUpdated(1, target, target2, useGit || false);\n })\n .option(\n '--use-git',\n 'Use git commit timestamps to check which packages have been updated since the last build',\n );\nprogram\n .command('build-updated-since [num-commits-back] [target] [target2]')\n .action((back, target, target2) => {\n return buildUpdated(back, target, target2);\n });\nprogram\n .command('build-all')\n .action((options) => {\n buildAll(options);\n })\n .option(\n '--sync',\n 'build each package 1 by 1 - use this if you have build issues due to low available RAM memory',\n )\n .option('--from <char>', 'start from a specific package');\n\nprogram\n .command('build-workspace')\n .description(\n 'Build all linked packages in the current workspace in dependency order',\n )\n .option('-u, --updated', 'Only build updated packages')\n .option(\n '--use-git',\n 'Use git commit timestamps to determine which packages need updating',\n )\n .action(async (options) => {\n if (options.updated) {\n return buildUpdated(1, undefined, undefined, !!options.useGit);\n }\n return buildAll(options);\n });\n\nprogram\n .command('build-package <filepath>')\n .description(\n 'Given a file path, find its package.json and rebuild that package. Use for editor save hooks.',\n )\n .action(async (filepath) => {\n const {buildPackageByPath} = await import(\n './commands/build-package.js'\n );\n return buildPackageByPath(filepath);\n });\n\nprogram\n .command('localize [packages...]')\n .description(\n 'Develop an npm dependency from a git checkout: clone it, install inside the checkout, build it and symlink it into node_modules — without touching package.json or package-lock.json. Name packages exactly as npm names them (@_linked/rdfs, lodash); the repository is read from the published `repository` field. With no names, reports what is localized.',\n )\n .option('--list', 'Report what is localized rather than localizing anything.')\n .option(\n '--adopt',\n 'Link a checkout that is already in packages-local under its localize name (e.g. packages-local/_linked-foo for @_linked/foo): install, build, link and record it, without cloning or asking the registry. For a package created locally, or a clone put there by hand.',\n )\n .option(\n '--check',\n 'With --list: exit 1 when something recorded is not actually linked.',\n )\n .option(\n '--relink',\n 'Recreate the recorded symlinks. This is what a postinstall runs.',\n )\n .option('--dir <path>', 'Where checkouts live (default: packages-local).')\n .option(\n '--repo <git-url>',\n \"Clone this instead of the published repository, and record it. With --adopt: record this instead of the checkout's origin.\",\n )\n .option(\n '--subdir <path>',\n \"The package's directory inside the repository (monorepos).\",\n )\n .option(\n '--build <cmd>',\n 'Run this in the checkout after installing; a failure only warns. Defaults to `linked build`; pass an empty string to build nothing.',\n )\n .option(\n '--force',\n 'Overwrite a symlink pointing outside the checkout directory.',\n )\n .action(async (packages: string[], options) => {\n const {runLocalize} = await import('./commands/localize.js');\n return runLocalize(packages, options);\n });\n\nprogram\n .command('delocalize [packages...]')\n .description(\n 'Undo localize: unlink the packages and forget them, keeping the checkout. With no names, undoes every localized package.',\n )\n .option('--purge', 'Also delete the checkout.')\n .option('--force', 'With --purge, delete even a checkout localize refuses.')\n .action(async (packages: string[], options) => {\n const {runDelocalize} = await import('./commands/localize.js');\n return runDelocalize(packages, options);\n });\n\nprogram\n .command('app-doctor')\n .description(\n \"Run in an app. Checks how the app uses linked packages: Vite pre-bundle entries that don't resolve (and the fix), linked packages whose dependencies don't support the app's React version (and which to bump), and hand-written entries that are now generated and can be removed. Exits 1 if anything needs fixing.\",\n )\n .action(async () => {\n const {runAppDoctor} = await import('./commands/app-doctor.js');\n return runAppDoctor();\n });\n\nprogram\n .command('setup-publish')\n .description(\n \"Set up the changesets publish pipeline in the current package repo. Writes the pr.yml/publish.yml callers of the shared workflows in the repo's own org .github repo, changesets config, .gitignore entries, and patches package.json.\",\n )\n .option(\n '--configure-github',\n 'Also apply the uniform branch protection on main and enable auto-merge (requires gh CLI installed and authenticated).',\n )\n .option(\n '--dual-branch',\n 'Deprecated and ignored: the main + dev flow and its @next prereleases are retired. Accepted only so stale scripts still set the repo up.',\n )\n .option(\n '--scope <scope>',\n 'Deprecated and ignored: the npm secret is NPM_AUTH_TOKEN in every org, holding that org\\'s own token. Accepted only so stale scripts still set the repo up.',\n )\n .option(\n '--grant-team <slug>',\n 'GitHub team slug to grant push access on the repo. Requires gh CLI.',\n )\n .action(async (options) => {\n const {setupPublish} = await import('./commands/setup-publish.js');\n await setupPublish({\n configureGithub: !!options.configureGithub,\n dualBranch: !!options.dualBranch,\n scope: options.scope,\n grantTeam: options.grantTeam,\n });\n });\n\nprogram\n .command('all [action] [filter] [filter-value]')\n .action((command, filter, filterValue) => {\n executeCommandForEachPackage(\n getLincdPackages(),\n command,\n filter,\n filterValue,\n );\n });\n// program.command('all-except [excludedSpaces] [action]').action((excludedSpaces, command) => {\n// executeCommandForEachModule(getLincdModules(), command, null, excludedSpaces);\n// });\n\nprogram.command('dev [target] [mode]').action((target, mode) => {\n developPackage(target, mode);\n});\n\nprogram.command('depcheck').action((target, mode) => {\n depCheck();\n});\nprogram.command('depcheck-staged').action((target, mode) => {\n depCheckStaged();\n});\nprogram\n .command('check-imports')\n .description(\n 'Check the imports of the package in the current folder. Exits 1 when an invalid import is found',\n )\n .action(async () => {\n try {\n await checkImports();\n } catch (report) {\n // checkImports throws the formatted report of every invalid import.\n console.error(typeof report === 'string' ? report : String(report));\n process.exitCode = 1;\n }\n });\n\nprogram\n .command('package')\n .action((name, command, args: string[]) => {\n let fullCommand = command\n ? command +\n ' ' +\n args\n .slice(0, 3)\n .filter((a) => a && true)\n .join(' ')\n : null;\n\n //TODO: call\n // let pkgName = process.argv[1];\n // console.log(pkgName);\n // let restArgs = process.argv.slice(2)\n // program.parse([],{from:'user'});\n // program.parse(['--port', '80'], { from: 'user' })\n\n executeCommandForPackage(name, fullCommand);\n })\n .alias('p')\n .alias('pkg')\n .alias('m')\n .alias('module')\n .description(\n 'Searches for a package in this workspace with a partially matching name and executes a command for that package (without needing to execute it from the folder of the package)',\n )\n .argument('<name>', 'the name of the package. Can be a part of the name.')\n .argument(\n '[command]',\n 'the linked command you want to execute. Like dev or build',\n )\n .argument('[args...]', 'the additional arguments of that command');\n\nprogram.command('enable-capacitor').action(() => {\n addCapacitor();\n});\n\nconst unknownCommand = unknownCommandError(program, process.argv.slice(2));\nif (unknownCommand) {\n console.error(chalk.red(unknownCommand));\n process.exit(1);\n}\nprogram.parse(process.argv);\n"]}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";AACA,oHAAoH;AACpH,yCAAyC;;;;;;;;;;AAEzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,SAAS,EACT,eAAe,EACf,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,QAAQ,EACR,cAAc,EACd,cAAc,EACd,4BAA4B,EAC5B,wBAAwB,EACxB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,QAAQ,EACR,SAAS,EACT,SAAS,EAET,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,4CAA4C;AAC5C,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,oBAAoB,CAAC;A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AAC,CAAC;IACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AACD,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC","sourcesContent":["#!/usr/bin/env tsx\n//The line above calls the TSX typescript executer as runtime, which extends node.js and supports running typescript\n// see: https://www.npmjs.com/package/tsx\n\nimport chalk from 'chalk';\nimport {\n addCapacitor,\n buildAll,\n buildPackage,\n buildUpdated,\n checkImports,\n compilePackage,\n createApp,\n createComponent,\n createOntology,\n createPackage,\n createSetComponent,\n createShape,\n depCheck,\n depCheckStaged,\n developPackage,\n executeCommandForEachPackage,\n executeCommandForPackage,\n getLincdPackages,\n getScriptDir,\n publishPackage,\n publishUpdated,\n register,\n runMethod,\n runScript,\n startServer,\n upgradePackages,\n} from './cli-methods.js';\n// import {buildMetadata} from './metadata';\nimport {program} from 'commander';\nimport {CreatePackageError} from './utils/createPackageLocation.js';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport 'require-extensions';\nimport {unknownCommandError} from './unknown-command.js';\n\n/**\n * Run an async command action and report a failure the way the rest of this\n * CLI does — one red message and exit code 1 — instead of letting the rejection\n * escape the action and print a raw unhandled-rejection stack.\n */\nconst runAppCommand = async (run: () => Promise<unknown>): Promise<void> => {\n try {\n await run();\n } catch (error) {\n const message =\n error instanceof Error ? error.message : String(error ?? 'Unknown error');\n console.error(chalk.red(message));\n if (process.env.LINKED_DEBUG && error instanceof Error && error.stack) {\n console.error(error.stack);\n }\n process.exitCode = 1;\n }\n};\n\n/** `--env a,b` → `['a', 'b']`. */\nconst splitEnvOption = (value?: string): string[] =>\n (value || '')\n .split(',')\n .map((name) => name.trim())\n .filter(Boolean);\n\nprogram\n .command('create-app')\n .action((name, options) => {\n return createApp(name, process.cwd(), {\n appName: options.appName,\n appPrefix: options.appPrefix,\n appDomain: options.appDomain,\n skipInstall: options.skipInstall,\n template: options.template,\n }).catch((err) => {\n // Report and fail the process without cutting off pending output.\n console.error(chalk.red(err?.message ?? String(err)));\n process.exitCode = 1;\n });\n })\n .description(\n 'Creates a new folder with all the required files for a Linked app',\n )\n .argument(\n '<name>',\n 'the name of your Linked app. To use spaces, wrap the name in double quotes.',\n )\n .option('--app-name <name>', 'Display name for the app (skip interactive prompt)')\n .option('--app-prefix <prefix>', 'Short code prefix for data files (skip interactive prompt)')\n .option('--app-domain <domain>', 'Domain for the app (skip interactive prompt)')\n .option('--skip-install', 'Skip running npm install after scaffolding')\n .option(\n '--template <template>',\n 'App template: \"web\" (default) or \"react-native\"',\n );\n\nprogram\n .command('start')\n .action(async (options) => {\n const {startWithVite} = await import('./commands/start.js');\n return startWithVite({env: options?.env, apiOnly: options?.apiOnly});\n })\n .option('--env <env>', 'The node environment to use. Default is \"development\"')\n .option(\n '--api-only',\n 'Serve only the backend API: no vite.config, src/App.tsx or src/routes.tsx needed; page requests get a 404',\n )\n .description(\n 'Start the Linked dev server. Vite-backed by default.',\n );\n\nprogram\n .command('call')\n .action((packageName, method, options) => {\n return runMethod(packageName, method, {spawn: options.spawn});\n })\n .option(\n '--spawn',\n 'Start a new server instance instead of using an existing one',\n )\n .option('--env', 'The node environment to use. Default is \"development\"')\n .description(\n 'Start the Linked node.js server but without http server. Instead it immediately calls the specified method of the specified package and exits afterwards',\n )\n .argument(\n '<package>',\n 'the package of the backend provider that contains this method',\n )\n .argument('<method>', 'the name of the method you want to call');\n\nprogram\n .command('script')\n .action((scriptName, options) => {\n return runScript(scriptName, {spawn: options.spawn});\n })\n .option(\n '--spawn',\n 'Start a new server instance instead of using an existing one',\n )\n .option('--env', 'The node environment to use. Default is \"development\"')\n .description(\n 'Start the Linked node.js server but without http server. Instead it immediately runs the specified script and exits afterwards',\n )\n .argument(\n '<scriptName>',\n 'the name of the script file inside the /scripts folder',\n );\n\nprogram\n .command('create-package')\n .action(async (name, uriBase, options) => {\n try {\n await createPackage(name, uriBase, process.cwd(), options);\n } catch (e) {\n if (!(e instanceof CreatePackageError)) throw e;\n console.error(chalk.red(e.message));\n process.exitCode = 1;\n }\n })\n .description(\n \"Create a new folder with all the required files for a new Linked package. Inside an app, it goes in packages/ (part of the app's repository) or packages-local/ (its own git repository, linked with `linked localize`); without --location, --remote or --push you are asked, on a terminal.\",\n )\n .option(\n '--location <where>',\n \"packages: part of this app's repository, a workspace member added to its dependencies. packages-local: its own git repository (git init + a first commit), linked and recorded by `linked localize` and not added to the app's dependencies until it is published.\",\n )\n .option(\n '--remote <git-url>',\n \"The new repository's origin; also written to repository.url. Implies --location packages-local.\",\n )\n .option('--push', 'Push the first commit to --remote.')\n .argument(\n '<name>',\n 'The name of the package. Will be used as package name in package.json',\n )\n .argument(\n '[uri_base]',\n 'The base URL used for data of this package. Leave blank to use the URL of your package on lincd.org after you register it',\n );\n\nprogram\n .command('upgrade-packages')\n .action(() => {\n return upgradePackages();\n })\n .description(\n 'Upgrade all linked packages in the workspace to ESM/CJS dual packages',\n );\n\nprogram\n .command('create-shape')\n .action((name, uriBase) => {\n return createShape(name);\n })\n .description(\n 'Creates a new ShapeClass file for your package. Execute this from your package folder.',\n )\n .argument(\n '<name>',\n 'The name of the shape. Will be used for the file name and the class name',\n );\n\nprogram\n .command('create-component')\n .action((name, uriBase) => {\n return createComponent(name);\n })\n .description(\n 'Creates a new Component file for your package. Execute this from your package folder.',\n )\n .argument(\n '<name>',\n 'The name of the component. Will be used for the file name and the export name',\n );\n\nprogram\n .command('create-set-component')\n .action((name, uriBase) => {\n return createSetComponent(name);\n })\n .description(\n 'Creates a new SetComponent file for your package. Execute this from your package folder.',\n )\n .argument(\n '<name>',\n 'The name of the component. Will be used for the file name and the export name',\n );\n\nprogram\n .command('create-ontology')\n .action((prefix, uriBase) => {\n return createOntology(prefix, uriBase);\n })\n .description(\n 'Creates a new ontology file for your package. Execute this from your package folder.',\n )\n .argument(\n '<suggested-prefix>',\n 'The suggested prefix for your ontology. Also the shorthand code used for the file name and the exported ontology object',\n )\n .argument(\n '[uribase]',\n \"Optional argument to set the URI base for the URI's of all entities in your ontology. Leave blank to use the URI's provided by lincd.org once you register this package\",\n );\n\nprogram.command('app [action]', {hidden: true}).action(() => {\n register('http://localhost:4101');\n});\nprogram.command('register-local', {hidden: true}).action(() => {\n register('http://localhost:4101');\n});\nprogram.command('register-dev', {hidden: true}).action(() => {\n register('https://dev-registry.lincd.org');\n});\nprogram\n .command('register')\n .action(() => {\n register('https://registry.lincd.org');\n })\n .description(\n 'Register (a new version of) this package to the Linked registry. If successful your package will appear on linked.cm',\n );\n\nprogram\n .command('info')\n .action(() => {\n let localDir = getScriptDir();\n let packageJsonPath = path.join(localDir, 'package.json');\n try {\n var ownPackage = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));\n } catch (e) {\n console.warn(\n 'Could not read package.json at ' + packageJsonPath + ': ' + e,\n );\n process.exit();\n }\n console.log(ownPackage.version);\n console.log('Running from: ' + localDir);\n })\n .description(\n \"Log the version of this tool and the path that it's running from\",\n );\n\nprogram\n .command('build [target] [target2]', {isDefault: true})\n .action(async (target, target2, options) => {\n const result = await buildPackage(target, target2, process.cwd(), !options?.silent);\n if (result !== true) {\n process.exitCode = 1;\n }\n })\n .option(\n '--silent',\n 'No output to console unless errors occur. The exit code is unaffected: 0 when the build succeeds (warnings included), 1 when it fails',\n );\n\nprogram\n .command('compile-only')\n .action(() => {\n compilePackage();\n })\n .description(\n 'Compile the package without other build steps. Run this command from the package folder',\n );\nprogram.command('build-metadata').action(() => {\n console.log('Needs to be reimplemented');\n // buildMetadata();\n});\nprogram\n .command('build-app')\n .action(async (options) => {\n // Vite is the only app build. An app without a `vite.config.{ts,js,mjs}`\n // is rejected by name rather than falling back to anything.\n await runAppCommand(async () => {\n const {assertViteApp, buildViteApp} = await import(\n './commands/build-app.js'\n );\n assertViteApp();\n await buildViteApp({\n environmentNames: splitEnvOption(options?.env),\n target: options?.target,\n publish: options?.publish === true,\n revision: options?.revision,\n allowDirty: options?.allowDirty === true,\n });\n });\n })\n .option('--env <env>', 'The node environment to use. Default is \"development\"')\n .option('--target <target>', 'Build target: web or capacitor')\n .option(\n '--publish',\n 'Upload the release after a successful web build (off by default; use `linked publish-app`)',\n )\n .option(\n '--revision <sha>',\n 'Revision identifying the release. Defaults to LINKED_RELEASE_REVISION, GITHUB_SHA, then git HEAD',\n )\n .option(\n '--allow-dirty',\n 'Build from a working tree with uncommitted changes; the release revision gets a \"-dirty\" suffix',\n )\n .description(\n 'Build the linked app frontend and backend for production, and write a release manifest. Requires a vite.config in the app root.',\n );\n\nprogram\n .command('publish-app')\n .option('--env <env>', 'The node environment to use')\n .option(\n '--manifest <path>',\n 'Release manifest to publish, relative to the app root. Default public/bundles/linked-release.json',\n )\n .option('--yes', 'Upload the verified release. Without it this is a dry run')\n .action(async (options) => {\n // Retry or inspect an existing release without rebuilding the app.\n await runAppCommand(async () => {\n const {ensureEnvironmentLoaded} = await import('./lifecycle.js');\n const {resolveAppAssetsStore} = await import(\n './app-release/app-assets-store.js'\n );\n const {publishApp} = await import('./commands/publish-app.js');\n await ensureEnvironmentLoaded(splitEnvOption(options?.env));\n // The store is resolved by publishApp, after the manifest is read.\n await publishApp({\n manifestPath: options?.manifest,\n resolveStore: () => resolveAppAssetsStore(),\n yes: options?.yes === true,\n });\n });\n })\n .description(\n 'Validate or retry publishing a previously built release. Defaults to dry run.',\n );\n\nprogram\n .command('serve-app')\n .option('--env <env>', 'The node environment to use')\n .action(async (options) => {\n // Production runtime loads compiled output and never starts Vite/HMR.\n await runAppCommand(async () => {\n const {serveCompiledApp} = await import('./commands/serve-app.js');\n await serveCompiledApp({environmentNames: splitEnvOption(options?.env)});\n });\n })\n .description('Start a compiled Linked app without Vite or HMR.');\n\nprogram.command('publish-updated').action(() => {\n return publishUpdated();\n});\nprogram.command('publish [version]').action((version) => {\n publishPackage(null, false, null, version);\n});\n\nprogram.command('status').action(() => {\n //log which packages need to be published\n return publishUpdated(true).then(() => {\n //log which packages need to be build\n return buildUpdated(undefined, '', '', true);\n });\n});\nprogram\n .command('build-updated [target] [target2]')\n .action((target, target2, options) => {\n const {useGit}: {useGit?: boolean} = options;\n return buildUpdated(1, target, target2, useGit || false);\n })\n .option(\n '--use-git',\n 'Use git commit timestamps to check which packages have been updated since the last build',\n );\nprogram\n .command('build-updated-since [num-commits-back] [target] [target2]')\n .action((back, target, target2) => {\n return buildUpdated(back, target, target2);\n });\nprogram\n .command('build-all')\n .action((options) => {\n buildAll(options);\n })\n .option(\n '--sync',\n 'build each package 1 by 1 - use this if you have build issues due to low available RAM memory',\n )\n .option('--from <char>', 'start from a specific package');\n\nprogram\n .command('build-workspace')\n .description(\n 'Build all linked packages in the current workspace in dependency order',\n )\n .option('-u, --updated', 'Only build updated packages')\n .option(\n '--use-git',\n 'Use git commit timestamps to determine which packages need updating',\n )\n .action(async (options) => {\n if (options.updated) {\n return buildUpdated(1, undefined, undefined, !!options.useGit);\n }\n return buildAll(options);\n });\n\nprogram\n .command('build-package <filepath>')\n .description(\n 'Given a file path, find its package.json and rebuild that package. Use for editor save hooks.',\n )\n .action(async (filepath) => {\n const {buildPackageByPath} = await import(\n './commands/build-package.js'\n );\n return buildPackageByPath(filepath);\n });\n\nprogram\n .command('localize [packages...]')\n .description(\n 'Develop an npm dependency from a git checkout: clone it, install inside the checkout, build it and symlink it into node_modules — without touching package.json or package-lock.json. Name packages exactly as npm names them (@_linked/rdfs, lodash); the repository is read from the published `repository` field. With no names, reports what is localized.',\n )\n .option('--list', 'Report what is localized rather than localizing anything.')\n .option(\n '--adopt',\n 'Link a checkout that is already in packages-local under its localize name (e.g. packages-local/_linked-foo for @_linked/foo): install, build, link and record it, without cloning or asking the registry. For a package created locally, or a clone put there by hand.',\n )\n .option(\n '--check',\n 'With --list: exit 1 when something recorded is not actually linked.',\n )\n .option(\n '--relink',\n 'Recreate the recorded symlinks. This is what a postinstall runs.',\n )\n .option('--dir <path>', 'Where checkouts live (default: packages-local).')\n .option(\n '--repo <git-url>',\n \"Clone this instead of the published repository, and record it. With --adopt: record this instead of the checkout's origin.\",\n )\n .option(\n '--subdir <path>',\n \"The package's directory inside the repository (monorepos).\",\n )\n .option(\n '--build <cmd>',\n 'Run this in the checkout after installing; a failure only warns. Defaults to `linked build`; pass an empty string to build nothing.',\n )\n .option(\n '--force',\n 'Overwrite a symlink pointing outside the checkout directory.',\n )\n .option(\n '--no-prune',\n \"Keep every checkout's node_modules as npm installed it. By default, after installing (and on --relink) a checkout's own copy of a linked package (one with linkedPackage: true in its package.json), react or react-dom is removed when the app has a version that satisfies the checkout's range, so the checkout loads the app's copy (and a localized sibling) instead of a second one. A copy the app's version does not satisfy is kept, with a warning.\",\n )\n .action(async (packages: string[], options) => {\n const {runLocalize} = await import('./commands/localize.js');\n return runLocalize(packages, options);\n });\n\nprogram\n .command('delocalize [packages...]')\n .description(\n 'Undo localize: unlink the packages and forget them, keeping the checkout. With no names, undoes every localized package.',\n )\n .option('--purge', 'Also delete the checkout.')\n .option('--force', 'With --purge, delete even a checkout localize refuses.')\n .action(async (packages: string[], options) => {\n const {runDelocalize} = await import('./commands/localize.js');\n return runDelocalize(packages, options);\n });\n\nprogram\n .command('app-doctor')\n .description(\n \"Run in an app. Checks how the app uses linked packages: Vite pre-bundle entries that don't resolve (and the fix), linked packages whose dependencies don't support the app's React version (and which to bump), and hand-written entries that are now generated and can be removed. Exits 1 if anything needs fixing.\",\n )\n .action(async () => {\n const {runAppDoctor} = await import('./commands/app-doctor.js');\n return runAppDoctor();\n });\n\nprogram\n .command('setup-publish')\n .description(\n \"Set up the changesets publish pipeline in the current package repo. Writes the pr.yml/publish.yml callers of the shared workflows in the repo's own org .github repo, changesets config, .gitignore entries, and patches package.json.\",\n )\n .option(\n '--configure-github',\n 'Also apply the uniform branch protection on main and enable auto-merge (requires gh CLI installed and authenticated).',\n )\n .option(\n '--dual-branch',\n 'Deprecated and ignored: the main + dev flow and its @next prereleases are retired. Accepted only so stale scripts still set the repo up.',\n )\n .option(\n '--scope <scope>',\n 'Deprecated and ignored: the npm secret is NPM_AUTH_TOKEN in every org, holding that org\\'s own token. Accepted only so stale scripts still set the repo up.',\n )\n .option(\n '--grant-team <slug>',\n 'GitHub team slug to grant push access on the repo. Requires gh CLI.',\n )\n .action(async (options) => {\n const {setupPublish} = await import('./commands/setup-publish.js');\n await setupPublish({\n configureGithub: !!options.configureGithub,\n dualBranch: !!options.dualBranch,\n scope: options.scope,\n grantTeam: options.grantTeam,\n });\n });\n\nprogram\n .command('all [action] [filter] [filter-value]')\n .action((command, filter, filterValue) => {\n executeCommandForEachPackage(\n getLincdPackages(),\n command,\n filter,\n filterValue,\n );\n });\n// program.command('all-except [excludedSpaces] [action]').action((excludedSpaces, command) => {\n// executeCommandForEachModule(getLincdModules(), command, null, excludedSpaces);\n// });\n\nprogram.command('dev [target] [mode]').action((target, mode) => {\n developPackage(target, mode);\n});\n\nprogram.command('depcheck').action((target, mode) => {\n depCheck();\n});\nprogram.command('depcheck-staged').action((target, mode) => {\n depCheckStaged();\n});\nprogram\n .command('check-imports')\n .description(\n 'Check the imports of the package in the current folder. Exits 1 when an invalid import is found',\n )\n .action(async () => {\n try {\n await checkImports();\n } catch (report) {\n // checkImports throws the formatted report of every invalid import.\n console.error(typeof report === 'string' ? report : String(report));\n process.exitCode = 1;\n }\n });\n\nprogram\n .command('package')\n .action((name, command, args: string[]) => {\n let fullCommand = command\n ? command +\n ' ' +\n args\n .slice(0, 3)\n .filter((a) => a && true)\n .join(' ')\n : null;\n\n //TODO: call\n // let pkgName = process.argv[1];\n // console.log(pkgName);\n // let restArgs = process.argv.slice(2)\n // program.parse([],{from:'user'});\n // program.parse(['--port', '80'], { from: 'user' })\n\n executeCommandForPackage(name, fullCommand);\n })\n .alias('p')\n .alias('pkg')\n .alias('m')\n .alias('module')\n .description(\n 'Searches for a package in this workspace with a partially matching name and executes a command for that package (without needing to execute it from the folder of the package)',\n )\n .argument('<name>', 'the name of the package. Can be a part of the name.')\n .argument(\n '[command]',\n 'the linked command you want to execute. Like dev or build',\n )\n .argument('[args...]', 'the additional arguments of that command');\n\nprogram.command('enable-capacitor').action(() => {\n addCapacitor();\n});\n\nconst unknownCommand = unknownCommandError(program, process.argv.slice(2));\nif (unknownCommand) {\n console.error(chalk.red(unknownCommand));\n process.exit(1);\n}\nprogram.parse(process.argv);\n"]}
@@ -3,7 +3,7 @@
3
3
  * and run `linked build` in that package's directory. This is the editor-hook
4
4
  * variant of build: the caller knows a file path, we figure out the package.
5
5
  *
6
- * Only rebuilds packages flagged `linkedPackage: true` (or legacy `lincd: true`).
6
+ * Only rebuilds packages flagged `linkedPackage: true`.
7
7
  */
8
8
  export declare function buildPackageByPath(filePath: string): Promise<void>;
9
9
  //# sourceMappingURL=build-package.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-package.d.ts","sourceRoot":"","sources":["../../../src/commands/build-package.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDxE"}
1
+ {"version":3,"file":"build-package.d.ts","sourceRoot":"","sources":["../../../src/commands/build-package.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDxE"}
@@ -12,12 +12,13 @@ import fs from 'fs';
12
12
  import path from 'path';
13
13
  import { execp } from '../utils.js';
14
14
  import { detectPackageManager } from '../utils/packageManager.js';
15
+ import { isLinkedPackageJson } from '../installed-packages.js';
15
16
  /**
16
17
  * Given any file or directory path, walk up to find the nearest package.json
17
18
  * and run `linked build` in that package's directory. This is the editor-hook
18
19
  * variant of build: the caller knows a file path, we figure out the package.
19
20
  *
20
- * Only rebuilds packages flagged `linkedPackage: true` (or legacy `lincd: true`).
21
+ * Only rebuilds packages flagged `linkedPackage: true`.
21
22
  */
22
23
  export function buildPackageByPath(filePath) {
23
24
  return __awaiter(this, void 0, void 0, function* () {
@@ -31,7 +32,7 @@ export function buildPackageByPath(filePath) {
31
32
  const pkgJsonPath = path.join(currentPath, 'package.json');
32
33
  if (fs.existsSync(pkgJsonPath)) {
33
34
  const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
34
- const isLinked = pkgJson.linkedPackage === true || pkgJson.lincd === true;
35
+ const isLinked = isLinkedPackageJson(pkgJson);
35
36
  if (!isLinked) {
36
37
  console.log(chalk.yellow(`Package ${pkgJson.name} is not a linked package (no linkedPackage flag). Skipping.`));
37
38
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"build-package.js","sourceRoot":"","sources":["../../../src/commands/build-package.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAC;AAClC,OAAO,EAAC,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAgB,kBAAkB,CAAC,QAAgB;;QACvD,IAAI,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;YACzC,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;QAE1C,IAAI,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;YACpE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,WAAW,KAAK,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YACjD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;YAC3D,IAAI,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,E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MAAM,eAAe,CAAC;gBAC9D,MAAM,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;gBAClC,OAAO;YACT,CAAC;YACD,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,yCAAyC,QAAQ,EAAE,CAAC,CAAC,CAAC;QAC9E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;CAAA","sourcesContent":["import chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\nimport {execp} from '../utils.js';\nimport {detectPackageManager} from '../utils/packageManager.js';\n\n/**\n * Given any file or directory path, walk up to find the nearest package.json\n * and run `linked build` in that package's directory. This is the editor-hook\n * variant of build: the caller knows a file path, we figure out the package.\n *\n * Only rebuilds packages flagged `linkedPackage: true` (or legacy `lincd: true`).\n */\nexport async function buildPackageByPath(filePath: string): Promise<void> {\n let currentPath = path.isAbsolute(filePath)\n ? filePath\n : path.resolve(process.cwd(), filePath);\n\n if (fs.existsSync(currentPath) && fs.statSync(currentPath).isFile()) {\n currentPath = path.dirname(currentPath);\n }\n\n while (currentPath !== path.dirname(currentPath)) {\n const pkgJsonPath = path.join(currentPath, 'package.json');\n if (fs.existsSync(pkgJsonPath)) {\n const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));\n const isLinked = pkgJson.linkedPackage === true || pkgJson.lincd === true;\n\n if (!isLinked) {\n console.log(\n chalk.yellow(\n `Package ${pkgJson.name} is not a linked package (no linkedPackage flag). Skipping.`,\n ),\n );\n return;\n }\n\n console.log(chalk.cyan(`Rebuilding ${pkgJson.name}`));\n\n // npm is the default. Only a package that actually lives in a yarn\n // project is built through yarn — that keeps existing yarn monorepos\n // (which may vendor their own yarn release) working.\n //\n // Either way we invoke the `linked` BINARY rather than a script: inner\n // packages don't have a \"linked\" script in package.json.\n let runner = 'npx --no-install';\n if (detectPackageManager(currentPath) === 'yarn') {\n let yarnBin = 'yarn';\n const yarnReleasesDir = path.join(process.cwd(), '.yarn', 'releases');\n if (fs.existsSync(yarnReleasesDir)) {\n const releases = fs.readdirSync(yarnReleasesDir);\n if (releases.length > 0) {\n yarnBin = path.join(yarnReleasesDir, releases[0]);\n }\n }\n runner = `${yarnBin} exec`;\n }\n\n const command = `cd ${currentPath} && ${runner} linked build`;\n await execp(command, true, false);\n return;\n }\n currentPath = path.dirname(currentPath);\n }\n\n console.error(chalk.red(`No package.json found walking up from ${filePath}`));\n process.exit(1);\n}\n"]}
1
+ {"version":3,"file":"build-package.js","sourceRoot":"","sources":["../../../src/commands/build-package.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAC;AAClC,OAAO,EAAC,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAC,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,UAAgB,kBAAkB,CAAC,QAAgB;;QACvD,IAAI,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;YACzC,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;QAE1C,IAAI,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;YACpE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,WAAW,KAAK,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YACjD,M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,GAAG,OAAO,OAAO,CAAC;gBAC7B,CAAC;gBAED,MAAM,OAAO,GAAG,MAAM,WAAW,OAAO,MAAM,eAAe,CAAC;gBAC9D,MAAM,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;gBAClC,OAAO;YACT,CAAC;YACD,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,yCAAyC,QAAQ,EAAE,CAAC,CAAC,CAAC;QAC9E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;CAAA","sourcesContent":["import chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\nimport {execp} from '../utils.js';\nimport {detectPackageManager} from '../utils/packageManager.js';\nimport {isLinkedPackageJson} from '../installed-packages.js';\n\n/**\n * Given any file or directory path, walk up to find the nearest package.json\n * and run `linked build` in that package's directory. This is the editor-hook\n * variant of build: the caller knows a file path, we figure out the package.\n *\n * Only rebuilds packages flagged `linkedPackage: true`.\n */\nexport async function buildPackageByPath(filePath: string): Promise<void> {\n let currentPath = path.isAbsolute(filePath)\n ? filePath\n : path.resolve(process.cwd(), filePath);\n\n if (fs.existsSync(currentPath) && fs.statSync(currentPath).isFile()) {\n currentPath = path.dirname(currentPath);\n }\n\n while (currentPath !== path.dirname(currentPath)) {\n const pkgJsonPath = path.join(currentPath, 'package.json');\n if (fs.existsSync(pkgJsonPath)) {\n const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));\n const isLinked = isLinkedPackageJson(pkgJson);\n\n if (!isLinked) {\n console.log(\n chalk.yellow(\n `Package ${pkgJson.name} is not a linked package (no linkedPackage flag). Skipping.`,\n ),\n );\n return;\n }\n\n console.log(chalk.cyan(`Rebuilding ${pkgJson.name}`));\n\n // npm is the default. Only a package that actually lives in a yarn\n // project is built through yarn — that keeps existing yarn monorepos\n // (which may vendor their own yarn release) working.\n //\n // Either way we invoke the `linked` BINARY rather than a script: inner\n // packages don't have a \"linked\" script in package.json.\n let runner = 'npx --no-install';\n if (detectPackageManager(currentPath) === 'yarn') {\n let yarnBin = 'yarn';\n const yarnReleasesDir = path.join(process.cwd(), '.yarn', 'releases');\n if (fs.existsSync(yarnReleasesDir)) {\n const releases = fs.readdirSync(yarnReleasesDir);\n if (releases.length > 0) {\n yarnBin = path.join(yarnReleasesDir, releases[0]);\n }\n }\n runner = `${yarnBin} exec`;\n }\n\n const command = `cd ${currentPath} && ${runner} linked build`;\n await execp(command, true, false);\n return;\n }\n currentPath = path.dirname(currentPath);\n }\n\n console.error(chalk.red(`No package.json found walking up from ${filePath}`));\n process.exit(1);\n}\n"]}
@@ -1,5 +1,17 @@
1
1
  /** The build command `localize` runs inside a fresh checkout by default. */
2
2
  export declare const DEFAULT_BUILD_COMMAND = "linked build";
3
+ /**
4
+ * What a linked app provides to its localized checkouts: the names of the
5
+ * linked packages it has installed — by their `linkedPackage` flag, whatever
6
+ * their scope — plus `react` and `react-dom`. Each one either holds
7
+ * module-level state that must exist once (core's shape registry, React's
8
+ * dispatcher, the context objects in server-utils and react) or is a localized
9
+ * sibling the checkout should reach live (see `appProvidedPackages`). localize
10
+ * itself already treats every localized sibling and a checkout's
11
+ * peerDependencies as provided. Vite's `resolve.dedupe` is derived separately,
12
+ * from what is localized (`localized-dedupe.ts`).
13
+ */
14
+ export declare function providedByApp(appRoot: string): Promise<string[]>;
3
15
  export interface LocalizeCommandOptions {
4
16
  adopt?: boolean;
5
17
  list?: boolean;
@@ -11,7 +23,14 @@ export interface LocalizeCommandOptions {
11
23
  build?: string;
12
24
  force?: boolean;
13
25
  purge?: boolean;
26
+ /** Commander's `--no-prune` sets this to false; absent means on. */
27
+ prune?: boolean;
14
28
  }
29
+ /** localize's prune options for a run: on unless explicitly turned off. */
30
+ export declare function pruneOptions(appRoot: string, prune?: boolean | undefined): Promise<{
31
+ prune: boolean;
32
+ provided: string[];
33
+ }>;
15
34
  /**
16
35
  * `localize` reports failure through an exit code rather than by throwing, so
17
36
  * that a partial run still prints what it did. Mirror that: set `exitCode` and
@@ -1 +1 @@
1
- {"version":3,"file":"localize.d.ts","sourceRoot":"","sources":["../../../src/commands/localize.ts"],"names":[],"mappings":"AA4BA,4EAA4E;AAC5E,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AAEpD,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,GAAE,MAAM,EAAO,EACvB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,IAAI,CAAC,CA+Cf;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAC,GACvD,OAAO,CAAC,MAAM,CAAC,CASjB;AAED,iFAAiF;AACjF,wBAAsB,aAAa,CACjC,QAAQ,GAAE,MAAM,EAAO,EACvB,OAAO,GAAE,IAAI,CAAC,sBAAsB,EAAE,OAAO,GAAG,OAAO,CAAM,GAC5D,OAAO,CAAC,IAAI,CAAC,CAQf"}
1
+ {"version":3,"file":"localize.d.ts","sourceRoot":"","sources":["../../../src/commands/localize.ts"],"names":[],"mappings":"AAoCA,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AI,CAAC,sBAAsB,EAAE,OAAO,GAAG,OAAO,CAAM,GAC5D,OAAO,CAAC,IAAI,CAAC,CAQf"}
@@ -28,6 +28,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
28
28
  * from the registry's `repository` field, so a name that npm cannot resolve is
29
29
  * an error rather than a guess.
30
30
  *
31
+ * The other framework knowledge it supplies is what an app PROVIDES. A
32
+ * checkout's own install leaves its own copies of `@_linked/core`, React and
33
+ * any localized sibling in its `node_modules`, and Node loads those instead of
34
+ * the app's: a localized package then never sees a localized sibling, and core
35
+ * loads once per copy. localize removes those copies by default wherever the
36
+ * app's version satisfies the checkout's range (`--no-prune` turns it off);
37
+ * this CLI tells localize what the app provides: `providedByApp`.
38
+ *
31
39
  * `--adopt` is the exception to "clone from the registry": it links a git
32
40
  * checkout that is already in `packages-local/` under its localize name, with
33
41
  * no clone and no lookup — a package created locally, or a clone put there by
@@ -36,6 +44,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
36
44
  import process from 'node:process';
37
45
  /** The build command `localize` runs inside a fresh checkout by default. */
38
46
  export const DEFAULT_BUILD_COMMAND = 'linked build';
47
+ /**
48
+ * What a linked app provides to its localized checkouts: the names of the
49
+ * linked packages it has installed — by their `linkedPackage` flag, whatever
50
+ * their scope — plus `react` and `react-dom`. Each one either holds
51
+ * module-level state that must exist once (core's shape registry, React's
52
+ * dispatcher, the context objects in server-utils and react) or is a localized
53
+ * sibling the checkout should reach live (see `appProvidedPackages`). localize
54
+ * itself already treats every localized sibling and a checkout's
55
+ * peerDependencies as provided. Vite's `resolve.dedupe` is derived separately,
56
+ * from what is localized (`localized-dedupe.ts`).
57
+ */
58
+ export function providedByApp(appRoot) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ const { appProvidedPackages } = yield import('../installed-packages.js');
61
+ return appProvidedPackages(appRoot);
62
+ });
63
+ }
64
+ /** localize's prune options for a run: on unless explicitly turned off. */
65
+ export function pruneOptions(appRoot_1) {
66
+ return __awaiter(this, arguments, void 0, function* (appRoot, prune = true) {
67
+ return { prune: prune !== false, provided: yield providedByApp(appRoot) };
68
+ });
69
+ }
39
70
  /**
40
71
  * `localize` reports failure through an exit code rather than by throwing, so
41
72
  * that a partial run still prints what it did. Mirror that: set `exitCode` and
@@ -45,8 +76,9 @@ export function runLocalize() {
45
76
  return __awaiter(this, arguments, void 0, function* (packages = [], options = {}) {
46
77
  const { defaultDeps, localize, adopt, list, relink } = yield import('@_linked/localize');
47
78
  const deps = defaultDeps(process.cwd());
79
+ const prune = yield pruneOptions(process.cwd(), options.prune);
48
80
  if (options.relink) {
49
- process.exitCode = relink(deps);
81
+ process.exitCode = relink(deps, prune);
50
82
  return;
51
83
  }
52
84
  if (options.adopt && packages.length === 0) {
@@ -66,16 +98,10 @@ export function runLocalize() {
66
98
  // `--build ''` is how you ask for no build at all.
67
99
  const build = options.build === undefined ? DEFAULT_BUILD_COMMAND : options.build;
68
100
  if (options.adopt) {
69
- process.exitCode = adopt(packages, { force: options.force, dir: options.dir, repo: options.repo, build }, deps);
101
+ process.exitCode = adopt(packages, Object.assign({ force: options.force, dir: options.dir, repo: options.repo, build }, prune), deps);
70
102
  return;
71
103
  }
72
- process.exitCode = localize(packages, {
73
- force: options.force,
74
- dir: options.dir,
75
- repo: options.repo,
76
- subdir: options.subdir,
77
- build,
78
- }, deps);
104
+ process.exitCode = localize(packages, Object.assign({ force: options.force, dir: options.dir, repo: options.repo, subdir: options.subdir, build }, prune), deps);
79
105
  });
80
106
  }
81
107
  /**
@@ -91,7 +117,7 @@ export function adoptPackage(name, options) {
91
117
  const { defaultDeps, adopt } = yield import('@_linked/localize');
92
118
  // Exit codes are localize's public contract; EXIT_WARNED (5) is the one a
93
119
  // caller usually tolerates, meaning the build failed but the link is in place.
94
- return adopt([name], { build: options.build, repo: options.repo }, defaultDeps(options.appRoot));
120
+ return adopt([name], Object.assign({ build: options.build, repo: options.repo }, (yield pruneOptions(options.appRoot))), defaultDeps(options.appRoot));
95
121
  });
96
122
  }
97
123
  /** `linked delocalize [packages...]` — unlink and forget; no names means all. */