@_linked/cli 1.44.0 → 1.44.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.44.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#232](https://github.com/linked-fw/cli/pull/232) [`494a99c`](https://github.com/linked-fw/cli/commit/494a99c6fc0f1b6a2d5b3d2f9a2a01506b8f6793) Thanks [@flyon](https://github.com/flyon)! - `@types/node` is no longer installed into consumers. It was declared as a runtime dependency (`^20.12.7`), which forced a second, older copy of the Node typings into every project that installed the CLI — even ones that already declare a newer `@types/node`. It is now a development dependency of the CLI only (`^24.0.0`, matching the Node 24 runtime).
|
|
8
|
+
|
|
9
|
+
Nothing the CLI scaffolds relies on it: the app, package and React Native templates each declare their own `@types/node`. If your project's `tsconfig.json` lists `"types": ["node"]` (or imports the CLI's Node-facing helpers such as `vite-config`, whose declarations use `NodeJS.ProcessEnv`) and does not declare `@types/node` itself, add it to your own `devDependencies`.
|
|
10
|
+
|
|
3
11
|
## 1.44.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localize.d.ts","sourceRoot":"","sources":["../../../src/commands/localize.ts"],"names":[],"mappings":"AAkDA,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,+FAA+F;IAC/F,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;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CAAC,KAAK,GAAE,OAAO,GAAG,SAAgB,GAAG;IAC/D,KAAK,EAAE,OAAO,CAAC;CAChB,CAEA;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,GAAE,MAAM,EAAO,EACvB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,IAAI,CAAC,CA6Ef;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,CAYjB;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,CAOf"}
|
|
@@ -77,9 +77,10 @@ export function runLocalize() {
|
|
|
77
77
|
}
|
|
78
78
|
// `--ensure --no-prune` asks for nothing: a no-op, so a script can turn
|
|
79
79
|
// the check off without removing the hook.
|
|
80
|
-
// For an app's npm `pre*` scripts: never fails the script it guards.
|
|
81
80
|
if (prune.prune)
|
|
82
81
|
checkOneCopy(deps.appRoot, deps);
|
|
82
|
+
// Run from an app's npm `pre*` scripts, so it never fails the script it
|
|
83
|
+
// guards (`checkOneCopy` never throws; it warns instead).
|
|
83
84
|
process.exitCode = 0;
|
|
84
85
|
return;
|
|
85
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localize.js","sourceRoot":"","sources":["../../../src/commands/localize.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,EACL,KAAK,EACL,YAAY,EACZ,WAAW,EACX,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AK,IACF,KAAK,GAEV,IAAI,CACL,CAAC;IACJ,CAAC;CAAA;AAED;;;;;;;GAOG;AACH,MAAM,UAAgB,YAAY,CAChC,IAAY,EACZ,OAAwD;;QAExD,0EAA0E;QAC1E,+EAA+E;QAC/E,OAAO,KAAK,CACV,CAAC,IAAI,CAAC,kBAEJ,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,IAAI,EAAE,OAAO,CAAC,IAAI,IACf,YAAY,EAAE,GAEnB,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAC7B,CAAC;IACJ,CAAC;CAAA;AAED,iFAAiF;AACjF,MAAM,UAAgB,aAAa;yDACjC,WAAqB,EAAE,EACvB,UAA2D,EAAE;QAE7D,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACxC,OAAO,CAAC,QAAQ,GAAG,UAAU,CAC3B,QAAQ,EACR,EAAC,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAC,EAC5C,IAAI,CACL,CAAC;IACJ,CAAC;CAAA","sourcesContent":["/**\n * `linked localize` / `linked delocalize` — develop an npm dependency from a\n * git checkout.\n *\n * All of the work lives in `../localize/` (once the separate\n * `@_linked/localize` package), which knows nothing about this framework on\n * purpose: it resolves a package's repository from the registry, clones it,\n * installs inside the checkout and symlinks it into `node_modules`, without\n * touching `package.json` or `package-lock.json`. This module is the commander\n * adapter over it.\n *\n * The one thing it deliberately does not know is how to build what it cloned.\n * That is the seam this module fills: `@_linked/cli` passes `build: 'linked\n * build'`, because in this ecosystem that is what building a package means.\n * A failing build only warns — a package whose build is broken is usually\n * exactly what you localized it to fix.\n *\n * Packages are named exactly as npm names them (`@_linked/rdfs`, `lodash`).\n * There is no short-name expansion and no org probing: the repository comes\n * from the registry's `repository` field, so a name that npm cannot resolve is\n * an error rather than a guess.\n *\n * A checkout's own install leaves its own copies of `@_linked/core`, React and\n * any localized sibling in its `node_modules`, and Node loads those instead of\n * the app's: a localized package then never sees a localized sibling, and core\n * loads once per copy. localize removes those copies by default wherever the\n * app's version satisfies the checkout's ranges (`--no-prune` turns it off for\n * that checkout, and is recorded so the run-time check honours it too).\n * What the app provides is one rule, `providedPackages` (localize/provided.ts),\n * shared with the run-time check (`--ensure`, and before `linked start` etc.)\n * and Vite's dedupe.\n *\n * `--adopt` is the exception to \"clone from the registry\": it links a git\n * checkout that is already in `packages-local/` under its localize name, with\n * no clone and no lookup — a package created locally, or a clone put there by\n * hand. It takes no `--subdir`: an adopted checkout is the package itself.\n */\nimport process from 'node:process';\n\nimport {\n adopt,\n checkOneCopy,\n defaultDeps,\n delocalize,\n list,\n localize,\n reinstall,\n relink,\n} from '../localize/index.js';\n\n/** The build command `localize` runs inside a fresh checkout by default. */\nexport const DEFAULT_BUILD_COMMAND = 'linked build';\n\nexport interface LocalizeCommandOptions {\n adopt?: boolean;\n list?: boolean;\n check?: boolean;\n relink?: boolean;\n /** Check every checkout for a copy of what the app provides and prune it; exit 0. No names. */\n ensure?: boolean;\n /** `npm install` in this package's checkout, then prune it. */\n reinstall?: string;\n dir?: string;\n repo?: string;\n subdir?: string;\n build?: string;\n force?: boolean;\n purge?: boolean;\n /** Commander's `--no-prune` sets this to false; absent means on. */\n prune?: boolean;\n}\n\n/** localize's prune options for a run: on unless explicitly turned off. */\nexport function pruneOptions(prune: boolean | undefined = true): {\n prune: boolean;\n} {\n return {prune: prune !== false};\n}\n\n/**\n * `localize` reports failure through an exit code rather than by throwing, so\n * that a partial run still prints what it did. Mirror that: set `exitCode` and\n * return, instead of exiting, so pending output is flushed.\n */\nexport async function runLocalize(\n packages: string[] = [],\n options: LocalizeCommandOptions = {},\n): Promise<void> {\n const deps = defaultDeps(process.cwd());\n const prune = pruneOptions(options.prune);\n\n if (options.relink) {\n process.exitCode = relink(deps, prune);\n return;\n }\n if (options.ensure) {\n if (packages.length) {\n // A name would read as \"check only these\", which it is not: say so\n // rather than ignore it.\n console.error(\n '[localize] --ensure takes no package names: it checks every recorded checkout ' +\n '(one localized with --no-prune is skipped). To reinstall one checkout and prune it: ' +\n '`linked localize --reinstall <package>`.',\n );\n process.exitCode = 2;\n return;\n }\n // `--ensure --no-prune` asks for nothing: a no-op, so a script can turn\n // the check off without removing the hook.\n // For an app's npm `pre*` scripts: never fails the script it guards.\n if (prune.prune) checkOneCopy(deps.appRoot, deps);\n process.exitCode = 0;\n return;\n }\n if (options.reinstall) {\n process.exitCode = reinstall(options.reinstall, prune, deps);\n return;\n }\n if (options.adopt && packages.length === 0) {\n console.error('[localize] --adopt needs at least one package name.');\n process.exitCode = 2;\n return;\n }\n if (options.adopt && options.subdir) {\n console.error(\n '[localize] --adopt takes no --subdir: an adopted checkout is the package itself.',\n );\n process.exitCode = 2;\n return;\n }\n if (options.list || packages.length === 0) {\n process.exitCode = list({check: options.check}, deps);\n return;\n }\n // `--build ''` is how you ask for no build at all.\n const build =\n options.build === undefined ? DEFAULT_BUILD_COMMAND : options.build;\n if (options.adopt) {\n process.exitCode = adopt(\n packages,\n {\n force: options.force,\n dir: options.dir,\n repo: options.repo,\n build,\n ...prune,\n },\n deps,\n );\n return;\n }\n process.exitCode = localize(\n packages,\n {\n force: options.force,\n dir: options.dir,\n repo: options.repo,\n subdir: options.subdir,\n build,\n ...prune,\n },\n deps,\n );\n}\n\n/**\n * Adopt one checkout that already sits in `packages-local/` under its localize\n * name: install inside it, build it, link it and record it. This is how\n * `create-package` hands a new package with its own repository to localize.\n *\n * @returns localize's exit code, rather than setting `process.exitCode`, so the\n * caller decides what a failure means.\n */\nexport async function adoptPackage(\n name: string,\n options: {appRoot: string; build: string; repo?: string},\n): Promise<number> {\n // Exit codes are localize's public contract; EXIT_WARNED (5) is the one a\n // caller usually tolerates, meaning the build failed but the link is in place.\n return adopt(\n [name],\n {\n build: options.build,\n repo: options.repo,\n ...pruneOptions(),\n },\n defaultDeps(options.appRoot),\n );\n}\n\n/** `linked delocalize [packages...]` — unlink and forget; no names means all. */\nexport async function runDelocalize(\n packages: string[] = [],\n options: Pick<LocalizeCommandOptions, 'purge' | 'force'> = {},\n): Promise<void> {\n const deps = defaultDeps(process.cwd());\n process.exitCode = delocalize(\n packages,\n {purge: options.purge, force: options.force},\n deps,\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"localize.js","sourceRoot":"","sources":["../../../src/commands/localize.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,EACL,KAAK,EACL,YAAY,EACZ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,MAAM,GACP,MAAM,sBAAsB,CAAC;AAE9B,4EAA4E;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAqBpD,2EAA2E;AAC3E,MAAM,UAAU,YAAY,CAAC,QAA6B,IAAI;IAG5D,OAAO,EAAC,KAAK,EAAE,KAAK,KAAK,KAAK,EAAC,CAAC;AAClC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAgB,WAAW;yDAC/B,WAAqB,EAAE,EACvB,UAAkC,EAAE;QAEpC,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACxC,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAE1C,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACnB,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACvC,OAAO;QACT,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACnB,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;gBACpB,mEAAmE;gBACnE,yBAAyB;gBACzB,OAAO,CAAC,KAAK,CACX,gFAAgF;oBAC9E,sFAAsF;oBACtF,0CAA0C,CAC7C,CAAC;g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,GAAG,KAAK,CACtB,QAAQ,kBAEN,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,GAAG,EAAE,OAAO,CAAC,GAAG,EAChB,IAAI,EAAE,OAAO,CAAC,IAAI,EAClB,KAAK,IACF,KAAK,GAEV,IAAI,CACL,CAAC;YACF,OAAO;QACT,CAAC;QACD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CACzB,QAAQ,kBAEN,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,GAAG,EAAE,OAAO,CAAC,GAAG,EAChB,IAAI,EAAE,OAAO,CAAC,IAAI,EAClB,MAAM,EAAE,OAAO,CAAC,MAAM,EACtB,KAAK,IACF,KAAK,GAEV,IAAI,CACL,CAAC;IACJ,CAAC;CAAA;AAED;;;;;;;GAOG;AACH,MAAM,UAAgB,YAAY,CAChC,IAAY,EACZ,OAAwD;;QAExD,0EAA0E;QAC1E,+EAA+E;QAC/E,OAAO,KAAK,CACV,CAAC,IAAI,CAAC,kBAEJ,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,IAAI,EAAE,OAAO,CAAC,IAAI,IACf,YAAY,EAAE,GAEnB,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAC7B,CAAC;IACJ,CAAC;CAAA;AAED,iFAAiF;AACjF,MAAM,UAAgB,aAAa;yDACjC,WAAqB,EAAE,EACvB,UAA2D,EAAE;QAE7D,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACxC,OAAO,CAAC,QAAQ,GAAG,UAAU,CAC3B,QAAQ,EACR,EAAC,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAC,EAC5C,IAAI,CACL,CAAC;IACJ,CAAC;CAAA","sourcesContent":["/**\n * `linked localize` / `linked delocalize` — develop an npm dependency from a\n * git checkout.\n *\n * All of the work lives in `../localize/` (once the separate\n * `@_linked/localize` package), which knows nothing about this framework on\n * purpose: it resolves a package's repository from the registry, clones it,\n * installs inside the checkout and symlinks it into `node_modules`, without\n * touching `package.json` or `package-lock.json`. This module is the commander\n * adapter over it.\n *\n * The one thing it deliberately does not know is how to build what it cloned.\n * That is the seam this module fills: `@_linked/cli` passes `build: 'linked\n * build'`, because in this ecosystem that is what building a package means.\n * A failing build only warns — a package whose build is broken is usually\n * exactly what you localized it to fix.\n *\n * Packages are named exactly as npm names them (`@_linked/rdfs`, `lodash`).\n * There is no short-name expansion and no org probing: the repository comes\n * from the registry's `repository` field, so a name that npm cannot resolve is\n * an error rather than a guess.\n *\n * A checkout's own install leaves its own copies of `@_linked/core`, React and\n * any localized sibling in its `node_modules`, and Node loads those instead of\n * the app's: a localized package then never sees a localized sibling, and core\n * loads once per copy. localize removes those copies by default wherever the\n * app's version satisfies the checkout's ranges (`--no-prune` turns it off for\n * that checkout, and is recorded so the run-time check honours it too).\n * What the app provides is one rule, `providedPackages` (localize/provided.ts),\n * shared with the run-time check (`--ensure`, and before `linked start` etc.)\n * and Vite's dedupe.\n *\n * `--adopt` is the exception to \"clone from the registry\": it links a git\n * checkout that is already in `packages-local/` under its localize name, with\n * no clone and no lookup — a package created locally, or a clone put there by\n * hand. It takes no `--subdir`: an adopted checkout is the package itself.\n */\nimport process from 'node:process';\n\nimport {\n adopt,\n checkOneCopy,\n defaultDeps,\n delocalize,\n list,\n localize,\n reinstall,\n relink,\n} from '../localize/index.js';\n\n/** The build command `localize` runs inside a fresh checkout by default. */\nexport const DEFAULT_BUILD_COMMAND = 'linked build';\n\nexport interface LocalizeCommandOptions {\n adopt?: boolean;\n list?: boolean;\n check?: boolean;\n relink?: boolean;\n /** Check every checkout for a copy of what the app provides and prune it; exit 0. No names. */\n ensure?: boolean;\n /** `npm install` in this package's checkout, then prune it. */\n reinstall?: string;\n dir?: string;\n repo?: string;\n subdir?: string;\n build?: string;\n force?: boolean;\n purge?: boolean;\n /** Commander's `--no-prune` sets this to false; absent means on. */\n prune?: boolean;\n}\n\n/** localize's prune options for a run: on unless explicitly turned off. */\nexport function pruneOptions(prune: boolean | undefined = true): {\n prune: boolean;\n} {\n return {prune: prune !== false};\n}\n\n/**\n * `localize` reports failure through an exit code rather than by throwing, so\n * that a partial run still prints what it did. Mirror that: set `exitCode` and\n * return, instead of exiting, so pending output is flushed.\n */\nexport async function runLocalize(\n packages: string[] = [],\n options: LocalizeCommandOptions = {},\n): Promise<void> {\n const deps = defaultDeps(process.cwd());\n const prune = pruneOptions(options.prune);\n\n if (options.relink) {\n process.exitCode = relink(deps, prune);\n return;\n }\n if (options.ensure) {\n if (packages.length) {\n // A name would read as \"check only these\", which it is not: say so\n // rather than ignore it.\n console.error(\n '[localize] --ensure takes no package names: it checks every recorded checkout ' +\n '(one localized with --no-prune is skipped). To reinstall one checkout and prune it: ' +\n '`linked localize --reinstall <package>`.',\n );\n process.exitCode = 2;\n return;\n }\n // `--ensure --no-prune` asks for nothing: a no-op, so a script can turn\n // the check off without removing the hook.\n if (prune.prune) checkOneCopy(deps.appRoot, deps);\n // Run from an app's npm `pre*` scripts, so it never fails the script it\n // guards (`checkOneCopy` never throws; it warns instead).\n process.exitCode = 0;\n return;\n }\n if (options.reinstall) {\n process.exitCode = reinstall(options.reinstall, prune, deps);\n return;\n }\n if (options.adopt && packages.length === 0) {\n console.error('[localize] --adopt needs at least one package name.');\n process.exitCode = 2;\n return;\n }\n if (options.adopt && options.subdir) {\n console.error(\n '[localize] --adopt takes no --subdir: an adopted checkout is the package itself.',\n );\n process.exitCode = 2;\n return;\n }\n if (options.list || packages.length === 0) {\n process.exitCode = list({check: options.check}, deps);\n return;\n }\n // `--build ''` is how you ask for no build at all.\n const build =\n options.build === undefined ? DEFAULT_BUILD_COMMAND : options.build;\n if (options.adopt) {\n process.exitCode = adopt(\n packages,\n {\n force: options.force,\n dir: options.dir,\n repo: options.repo,\n build,\n ...prune,\n },\n deps,\n );\n return;\n }\n process.exitCode = localize(\n packages,\n {\n force: options.force,\n dir: options.dir,\n repo: options.repo,\n subdir: options.subdir,\n build,\n ...prune,\n },\n deps,\n );\n}\n\n/**\n * Adopt one checkout that already sits in `packages-local/` under its localize\n * name: install inside it, build it, link it and record it. This is how\n * `create-package` hands a new package with its own repository to localize.\n *\n * @returns localize's exit code, rather than setting `process.exitCode`, so the\n * caller decides what a failure means.\n */\nexport async function adoptPackage(\n name: string,\n options: {appRoot: string; build: string; repo?: string},\n): Promise<number> {\n // Exit codes are localize's public contract; EXIT_WARNED (5) is the one a\n // caller usually tolerates, meaning the build failed but the link is in place.\n return adopt(\n [name],\n {\n build: options.build,\n repo: options.repo,\n ...pruneOptions(),\n },\n defaultDeps(options.appRoot),\n );\n}\n\n/** `linked delocalize [packages...]` — unlink and forget; no names means all. */\nexport async function runDelocalize(\n packages: string[] = [],\n options: Pick<LocalizeCommandOptions, 'purge' | 'force'> = {},\n): Promise<void> {\n const deps = defaultDeps(process.cwd());\n process.exitCode = delocalize(\n packages,\n {purge: options.purge, force: options.force},\n deps,\n );\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_linked/cli",
|
|
3
|
-
"version": "1.44.
|
|
3
|
+
"version": "1.44.1",
|
|
4
4
|
"packageManager": "npm@11.21.0",
|
|
5
5
|
"description": "Command line tools for the @_linked/* packages and apps",
|
|
6
6
|
"main": "lib/esm/index.js",
|
|
@@ -72,7 +72,6 @@
|
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"@_linked/core": "^2.22.8",
|
|
74
74
|
"@tailwindcss/vite": "^4.1.4",
|
|
75
|
-
"@types/node": "^20.12.7",
|
|
76
75
|
"@types/react": "^19.3.0",
|
|
77
76
|
"@types/react-dom": "^19.3.0",
|
|
78
77
|
"@vitejs/plugin-react": "^4.3.0",
|
|
@@ -108,6 +107,7 @@
|
|
|
108
107
|
"@changesets/cli": "^2.29.8",
|
|
109
108
|
"@playwright/test": "^1.49.0",
|
|
110
109
|
"@types/jest": "^29.5.12",
|
|
110
|
+
"@types/node": "^24.0.0",
|
|
111
111
|
"@types/semver": "^7.8.0",
|
|
112
112
|
"babel-jest": "^29.7.0",
|
|
113
113
|
"husky": "^9.0.11",
|