zard-cli 1.0.0-beta.99 → 1.0.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/README.md +98 -36
- package/commands/add/component-installer.d.ts +3 -0
- package/commands/add/component-installer.d.ts.map +1 -1
- package/commands/add/component-installer.js +31 -8
- package/commands/add/component-installer.js.map +1 -1
- package/commands/add/component-selector.d.ts +6 -0
- package/commands/add/component-selector.d.ts.map +1 -1
- package/commands/add/component-selector.js +9 -27
- package/commands/add/component-selector.js.map +1 -1
- package/commands/add/dark-mode-setup.d.ts +2 -0
- package/commands/add/dark-mode-setup.d.ts.map +1 -1
- package/commands/add/dark-mode-setup.js +16 -11
- package/commands/add/dark-mode-setup.js.map +1 -1
- package/commands/add/dependency-resolver.d.ts +8 -1
- package/commands/add/dependency-resolver.d.ts.map +1 -1
- package/commands/add/dependency-resolver.js +87 -16
- package/commands/add/dependency-resolver.js.map +1 -1
- package/commands/add/index.d.ts.map +1 -1
- package/commands/add/index.js +142 -96
- package/commands/add/index.js.map +1 -1
- package/commands/add/stylesheet-setup.d.ts +3 -0
- package/commands/add/stylesheet-setup.d.ts.map +1 -0
- package/commands/add/stylesheet-setup.js +92 -0
- package/commands/add/stylesheet-setup.js.map +1 -0
- package/commands/add/wizard.d.ts +35 -0
- package/commands/add/wizard.d.ts.map +1 -0
- package/commands/add/wizard.js +299 -0
- package/commands/add/wizard.js.map +1 -0
- package/commands/init/config-prompter.d.ts +65 -3
- package/commands/init/config-prompter.d.ts.map +1 -1
- package/commands/init/config-prompter.js +93 -74
- package/commands/init/config-prompter.js.map +1 -1
- package/commands/init/dependencies.d.ts +1 -8
- package/commands/init/dependencies.d.ts.map +1 -1
- package/commands/init/dependencies.js +54 -24
- package/commands/init/dependencies.js.map +1 -1
- package/commands/init/index.d.ts.map +1 -1
- package/commands/init/index.js +175 -81
- package/commands/init/index.js.map +1 -1
- package/commands/init/library-peers.d.ts +28 -0
- package/commands/init/library-peers.d.ts.map +1 -0
- package/commands/init/library-peers.js +61 -0
- package/commands/init/library-peers.js.map +1 -0
- package/commands/init/project-kind.d.ts +82 -0
- package/commands/init/project-kind.d.ts.map +1 -0
- package/commands/init/project-kind.js +166 -0
- package/commands/init/project-kind.js.map +1 -0
- package/commands/init/steps.d.ts +15 -0
- package/commands/init/steps.d.ts.map +1 -0
- package/commands/init/steps.js +188 -0
- package/commands/init/steps.js.map +1 -0
- package/commands/init/tailwind-setup.d.ts +9 -2
- package/commands/init/tailwind-setup.d.ts.map +1 -1
- package/commands/init/tailwind-setup.js +47 -12
- package/commands/init/tailwind-setup.js.map +1 -1
- package/commands/init/tsconfig-updater.d.ts +8 -1
- package/commands/init/tsconfig-updater.d.ts.map +1 -1
- package/commands/init/tsconfig-updater.js +30 -11
- package/commands/init/tsconfig-updater.js.map +1 -1
- package/commands/init/update-angular-config.d.ts.map +1 -1
- package/commands/init/update-angular-config.js +28 -50
- package/commands/init/update-angular-config.js.map +1 -1
- package/commands/init/vite-setup.d.ts +11 -0
- package/commands/init/vite-setup.d.ts.map +1 -0
- package/commands/init/vite-setup.js +61 -0
- package/commands/init/vite-setup.js.map +1 -0
- package/commands/init/wizard.d.ts +33 -0
- package/commands/init/wizard.d.ts.map +1 -0
- package/commands/init/wizard.js +561 -0
- package/commands/init/wizard.js.map +1 -0
- package/constants/app.constants.d.ts +17 -0
- package/constants/app.constants.d.ts.map +1 -1
- package/constants/app.constants.js +39 -16
- package/constants/app.constants.js.map +1 -1
- package/core/icons/families.d.ts +38 -0
- package/core/icons/families.d.ts.map +1 -0
- package/core/icons/families.js +26 -0
- package/core/icons/families.js.map +1 -0
- package/core/icons/icon-map.d.ts +24 -0
- package/core/icons/icon-map.d.ts.map +1 -0
- package/core/icons/icon-map.js +141 -0
- package/core/icons/icon-map.js.map +1 -0
- package/core/icons/index.d.ts +107 -0
- package/core/icons/index.d.ts.map +1 -0
- package/core/icons/index.js +183 -0
- package/core/icons/index.js.map +1 -0
- package/core/registry/registry-data.d.ts.map +1 -1
- package/core/registry/registry-data.js +498 -36
- package/core/registry/registry-data.js.map +1 -1
- package/core/themes/theme-definitions.d.ts.map +1 -1
- package/core/themes/theme-definitions.js +61 -72
- package/core/themes/theme-definitions.js.map +1 -1
- package/index.js +6 -3
- package/index.js.map +1 -1
- package/package.json +6 -11
- package/ui/blocks.d.ts +71 -0
- package/ui/blocks.d.ts.map +1 -0
- package/ui/blocks.js +116 -0
- package/ui/blocks.js.map +1 -0
- package/ui/brand.d.ts +14 -0
- package/ui/brand.d.ts.map +1 -0
- package/ui/brand.js +35 -0
- package/ui/brand.js.map +1 -0
- package/ui/engine/animation/index.d.ts +38 -0
- package/ui/engine/animation/index.d.ts.map +1 -0
- package/ui/engine/animation/index.js +102 -0
- package/ui/engine/animation/index.js.map +1 -0
- package/ui/engine/ansi/index.d.ts +51 -0
- package/ui/engine/ansi/index.d.ts.map +1 -0
- package/ui/engine/ansi/index.js +116 -0
- package/ui/engine/ansi/index.js.map +1 -0
- package/ui/engine/components/index.d.ts +211 -0
- package/ui/engine/components/index.d.ts.map +1 -0
- package/ui/engine/components/index.js +109 -0
- package/ui/engine/components/index.js.map +1 -0
- package/ui/engine/cursor/index.d.ts +16 -0
- package/ui/engine/cursor/index.d.ts.map +1 -0
- package/ui/engine/cursor/index.js +40 -0
- package/ui/engine/cursor/index.js.map +1 -0
- package/ui/engine/diff/index.d.ts +26 -0
- package/ui/engine/diff/index.d.ts.map +1 -0
- package/ui/engine/diff/index.js +56 -0
- package/ui/engine/diff/index.js.map +1 -0
- package/ui/engine/events/index.d.ts +24 -0
- package/ui/engine/events/index.d.ts.map +1 -0
- package/ui/engine/events/index.js +60 -0
- package/ui/engine/events/index.js.map +1 -0
- package/ui/engine/focus/index.d.ts +25 -0
- package/ui/engine/focus/index.d.ts.map +1 -0
- package/ui/engine/focus/index.js +77 -0
- package/ui/engine/focus/index.js.map +1 -0
- package/ui/engine/frame/index.d.ts +48 -0
- package/ui/engine/frame/index.d.ts.map +1 -0
- package/ui/engine/frame/index.js +0 -0
- package/ui/engine/frame/index.js.map +1 -0
- package/ui/engine/index.d.ts +28 -0
- package/ui/engine/index.d.ts.map +1 -0
- package/ui/engine/index.js +28 -0
- package/ui/engine/index.js.map +1 -0
- package/ui/engine/input/index.d.ts +36 -0
- package/ui/engine/input/index.d.ts.map +1 -0
- package/ui/engine/input/index.js +224 -0
- package/ui/engine/input/index.js.map +1 -0
- package/ui/engine/layout/index.d.ts +42 -0
- package/ui/engine/layout/index.d.ts.map +1 -0
- package/ui/engine/layout/index.js +241 -0
- package/ui/engine/layout/index.js.map +1 -0
- package/ui/engine/renderer/index.d.ts +43 -0
- package/ui/engine/renderer/index.d.ts.map +1 -0
- package/ui/engine/renderer/index.js +619 -0
- package/ui/engine/renderer/index.js.map +1 -0
- package/ui/engine/scheduler/index.d.ts +22 -0
- package/ui/engine/scheduler/index.d.ts.map +1 -0
- package/ui/engine/scheduler/index.js +77 -0
- package/ui/engine/scheduler/index.js.map +1 -0
- package/ui/engine/screen/index.d.ts +39 -0
- package/ui/engine/screen/index.d.ts.map +1 -0
- package/ui/engine/screen/index.js +255 -0
- package/ui/engine/screen/index.js.map +1 -0
- package/ui/engine/terminal/index.d.ts +84 -0
- package/ui/engine/terminal/index.d.ts.map +1 -0
- package/ui/engine/terminal/index.js +235 -0
- package/ui/engine/terminal/index.js.map +1 -0
- package/ui/engine/testing/index.d.ts +27 -0
- package/ui/engine/testing/index.d.ts.map +1 -0
- package/ui/engine/testing/index.js +63 -0
- package/ui/engine/testing/index.js.map +1 -0
- package/ui/engine/theme/index.d.ts +26 -0
- package/ui/engine/theme/index.d.ts.map +1 -0
- package/ui/engine/theme/index.js +128 -0
- package/ui/engine/theme/index.js.map +1 -0
- package/ui/engine/utils/index.d.ts +12 -0
- package/ui/engine/utils/index.d.ts.map +1 -0
- package/ui/engine/utils/index.js +143 -0
- package/ui/engine/utils/index.js.map +1 -0
- package/ui/gate.d.ts +19 -0
- package/ui/gate.d.ts.map +1 -0
- package/ui/gate.js +36 -0
- package/ui/gate.js.map +1 -0
- package/ui/index.d.ts +18 -0
- package/ui/index.d.ts.map +1 -0
- package/ui/index.js +18 -0
- package/ui/index.js.map +1 -0
- package/ui/log-sink.d.ts +24 -0
- package/ui/log-sink.d.ts.map +1 -0
- package/ui/log-sink.js +35 -0
- package/ui/log-sink.js.map +1 -0
- package/ui/output.d.ts +14 -0
- package/ui/output.d.ts.map +1 -0
- package/ui/output.js +28 -0
- package/ui/output.js.map +1 -0
- package/ui/report.d.ts +30 -0
- package/ui/report.d.ts.map +1 -0
- package/ui/report.js +45 -0
- package/ui/report.js.map +1 -0
- package/ui/runner.d.ts +66 -0
- package/ui/runner.d.ts.map +1 -0
- package/ui/runner.js +135 -0
- package/ui/runner.js.map +1 -0
- package/ui/style.d.ts +24 -0
- package/ui/style.d.ts.map +1 -0
- package/ui/style.js +44 -0
- package/ui/style.js.map +1 -0
- package/ui/testing/fake-tty.d.ts +26 -0
- package/ui/testing/fake-tty.d.ts.map +1 -0
- package/ui/testing/fake-tty.js +61 -0
- package/ui/testing/fake-tty.js.map +1 -0
- package/ui/text-input.d.ts +31 -0
- package/ui/text-input.d.ts.map +1 -0
- package/ui/text-input.js +89 -0
- package/ui/text-input.js.map +1 -0
- package/ui/theme.d.ts +10 -0
- package/ui/theme.d.ts.map +1 -0
- package/ui/theme.js +20 -0
- package/ui/theme.js.map +1 -0
- package/utils/angular-compat.d.ts +21 -0
- package/utils/angular-compat.d.ts.map +1 -0
- package/utils/angular-compat.js +52 -0
- package/utils/angular-compat.js.map +1 -0
- package/utils/config.d.ts +29 -0
- package/utils/config.d.ts.map +1 -1
- package/utils/config.js +50 -4
- package/utils/config.js.map +1 -1
- package/utils/errors.d.ts +11 -0
- package/utils/errors.d.ts.map +1 -1
- package/utils/errors.js +14 -0
- package/utils/errors.js.map +1 -1
- package/utils/get-project-info.d.ts +29 -0
- package/utils/get-project-info.d.ts.map +1 -1
- package/utils/get-project-info.js +246 -1
- package/utils/get-project-info.js.map +1 -1
- package/utils/http-client.d.ts.map +1 -1
- package/utils/http-client.js +18 -3
- package/utils/http-client.js.map +1 -1
- package/utils/icon-catalog.d.ts +34 -0
- package/utils/icon-catalog.d.ts.map +1 -0
- package/utils/icon-catalog.js +63 -0
- package/utils/icon-catalog.js.map +1 -0
- package/utils/logger.d.ts +13 -1
- package/utils/logger.d.ts.map +1 -1
- package/utils/logger.js +95 -15
- package/utils/logger.js.map +1 -1
- package/utils/package-manager.d.ts +42 -1
- package/utils/package-manager.d.ts.map +1 -1
- package/utils/package-manager.js +204 -11
- package/utils/package-manager.js.map +1 -1
- package/utils/registry.d.ts +106 -2
- package/utils/registry.d.ts.map +1 -1
- package/utils/registry.js +155 -21
- package/utils/registry.js.map +1 -1
- package/utils/schema-version.d.ts +21 -0
- package/utils/schema-version.d.ts.map +1 -0
- package/utils/schema-version.js +28 -0
- package/utils/schema-version.js.map +1 -0
- package/utils/source-file.d.ts +40 -0
- package/utils/source-file.d.ts.map +1 -0
- package/utils/source-file.js +104 -0
- package/utils/source-file.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-catalog.d.ts","sourceRoot":"","sources":["../../src/utils/icon-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAsB,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAMjG,6CAA6C;AAC7C,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAID,yEAAyE;AACzE,wBAAgB,WAAW,IAAI,WAAW,CAEzC;AAED,kFAAkF;AAClF,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAqB/E;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,WAA2B,GAAG,IAAI,CAO/F"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The icon catalog in use, fetched from the registry.
|
|
3
|
+
*
|
|
4
|
+
* The CLI carries a copy of the table, but the registry is what counts: that is
|
|
5
|
+
* how a new family reaches someone who already has the CLI installed, without
|
|
6
|
+
* waiting for a release of it. The local copy is the floor — it applies offline,
|
|
7
|
+
* against an old registry that does not publish the file, and on any network
|
|
8
|
+
* failure.
|
|
9
|
+
*
|
|
10
|
+
* It is loaded once per command and read synchronously after that. The
|
|
11
|
+
* alternative would be threading the catalog through the action's parameters
|
|
12
|
+
* down to the file installer, four layers below, with none of them having
|
|
13
|
+
* anything to decide about it.
|
|
14
|
+
*/
|
|
15
|
+
import { LOCAL_ICON_CATALOG } from '../core/icons/index.js';
|
|
16
|
+
import { CliError, SchemaVersionError } from '../utils/errors.js';
|
|
17
|
+
import { fetchJson } from '../utils/http-client.js';
|
|
18
|
+
import { logger } from '../utils/logger.js';
|
|
19
|
+
import { assertSupportedSchema } from '../utils/schema-version.js';
|
|
20
|
+
let current = LOCAL_ICON_CATALOG;
|
|
21
|
+
/** The loaded catalog, or the local copy while nobody has loaded one. */
|
|
22
|
+
export function iconCatalog() {
|
|
23
|
+
return current;
|
|
24
|
+
}
|
|
25
|
+
/** Returns to the initial state. Exists so tests do not leak into one another. */
|
|
26
|
+
export function resetIconCatalog() {
|
|
27
|
+
current = LOCAL_ICON_CATALOG;
|
|
28
|
+
}
|
|
29
|
+
export async function loadIconCatalog(registryUrl) {
|
|
30
|
+
try {
|
|
31
|
+
const document = await fetchJson(`${registryUrl}/icons.json`);
|
|
32
|
+
assertSupportedSchema(document.schemaVersion, 'icons.json');
|
|
33
|
+
if (!document.families || !document.icons)
|
|
34
|
+
throw new Error('missing families or icons');
|
|
35
|
+
current = { families: document.families, icons: document.icons };
|
|
36
|
+
logger.debug(`Icon catalog loaded: ${Object.keys(current.families).join(', ')}`);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
// Only a format incompatibility stops us. Everything else — a 404, the SPA's
|
|
40
|
+
// HTML instead of JSON, a timeout, broken JSON — is a registry without the
|
|
41
|
+
// catalog, which is the state of all of them until the first deploy with the
|
|
42
|
+
// file. Treating that as a failure would take `add` down worldwide over a
|
|
43
|
+
// file that only matters to someone who switched family.
|
|
44
|
+
if (error instanceof SchemaVersionError)
|
|
45
|
+
throw error;
|
|
46
|
+
logger.debug(`Falling back to the bundled icon catalog: ${error instanceof Error ? error.message : error}`);
|
|
47
|
+
current = LOCAL_ICON_CATALOG;
|
|
48
|
+
}
|
|
49
|
+
return current;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Rejects a family the catalog does not know, naming the ones that exist.
|
|
53
|
+
*
|
|
54
|
+
* "Invalid configuration file: components.json" was all an `"icons": "materia"`
|
|
55
|
+
* produced — no field named, no accepted values, and the whole file under
|
|
56
|
+
* suspicion.
|
|
57
|
+
*/
|
|
58
|
+
export function assertIconFamily(family, catalog = iconCatalog()) {
|
|
59
|
+
if (Object.prototype.hasOwnProperty.call(catalog.families, family))
|
|
60
|
+
return;
|
|
61
|
+
throw new CliError(`Unknown icon set "${family}" in components.json. Available: ${Object.keys(catalog.families).sort().join(', ')}.`, 'UNKNOWN_ICON_FAMILY');
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=icon-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-catalog.js","sourceRoot":"","sources":["../../src/utils/icon-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,kBAAkB,EAAqC,MAAM,0BAA0B,CAAC;AACjG,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,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AAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAkB,EAAE,UAAuB,WAAW,EAAE;IACvF,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAE,OAAO;IAE3E,MAAM,IAAI,QAAQ,CAChB,qBAAqB,MAAM,oCAAoC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EACjH,qBAAqB,CACtB,CAAC;AACJ,CAAC"}
|
package/utils/logger.d.ts
CHANGED
|
@@ -8,5 +8,17 @@ export declare const logger: {
|
|
|
8
8
|
debug(...args: unknown[]): void;
|
|
9
9
|
break(): void;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export interface Spinner {
|
|
12
|
+
text: string;
|
|
13
|
+
start(): Spinner;
|
|
14
|
+
stop(): Spinner;
|
|
15
|
+
succeed(text?: string): Spinner;
|
|
16
|
+
fail(text?: string): Spinner;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Progress indicator for the paths that run outside the interactive screen
|
|
20
|
+
* (headless, --yes, CI). Inside a wizard the engine does the animating, and here
|
|
21
|
+
* the transitions become nothing but records in the sink.
|
|
22
|
+
*/
|
|
23
|
+
export declare function spinner(text: string): Spinner;
|
|
12
24
|
//# sourceMappingURL=logger.d.ts.map
|
package/utils/logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAMA,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAwBD,eAAO,MAAM,MAAM;mBACF,OAAO,EAAE;kBAGV,OAAO,EAAE;kBAGT,OAAO,EAAE;qBAGN,OAAO,EAAE;mBAGX,OAAO,EAAE;;CAQzB,CAAC;AAEF,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,IAAI,OAAO,CAAC;IACjB,IAAI,IAAI,OAAO,CAAC;IAChB,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9B;AAKD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAuD7C"}
|
package/utils/logger.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { capture, isCapturing } from '../ui/log-sink.js';
|
|
2
|
+
import { formatRecord, writeLine } from '../ui/output.js';
|
|
3
|
+
import { style } from '../ui/style.js';
|
|
3
4
|
let debugEnabled = false;
|
|
4
5
|
export function enableDebug() {
|
|
5
6
|
debugEnabled = true;
|
|
@@ -7,33 +8,112 @@ export function enableDebug() {
|
|
|
7
8
|
export function isDebugEnabled() {
|
|
8
9
|
return debugEnabled;
|
|
9
10
|
}
|
|
11
|
+
function toMessage(args) {
|
|
12
|
+
return args
|
|
13
|
+
.map(arg => {
|
|
14
|
+
if (typeof arg === 'string')
|
|
15
|
+
return arg;
|
|
16
|
+
if (arg instanceof Error)
|
|
17
|
+
return arg.message;
|
|
18
|
+
return String(arg);
|
|
19
|
+
})
|
|
20
|
+
.join(' ');
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Writes a message — or holds it, while the interactive screen is mounted.
|
|
24
|
+
*
|
|
25
|
+
* Without that diversion, a `logger.warn` fired mid-install would write over the
|
|
26
|
+
* frame the engine just painted.
|
|
27
|
+
*/
|
|
28
|
+
function emit(level, args) {
|
|
29
|
+
const message = toMessage(args);
|
|
30
|
+
if (capture(level, message))
|
|
31
|
+
return;
|
|
32
|
+
writeLine(formatRecord({ level, message }));
|
|
33
|
+
}
|
|
10
34
|
export const logger = {
|
|
11
35
|
error(...args) {
|
|
12
|
-
|
|
36
|
+
emit('error', args);
|
|
13
37
|
},
|
|
14
38
|
warn(...args) {
|
|
15
|
-
|
|
39
|
+
emit('warn', args);
|
|
16
40
|
},
|
|
17
41
|
info(...args) {
|
|
18
|
-
|
|
42
|
+
emit('info', args);
|
|
19
43
|
},
|
|
20
44
|
success(...args) {
|
|
21
|
-
|
|
45
|
+
emit('success', args);
|
|
22
46
|
},
|
|
23
47
|
debug(...args) {
|
|
24
|
-
if (debugEnabled)
|
|
25
|
-
|
|
26
|
-
|
|
48
|
+
if (!debugEnabled)
|
|
49
|
+
return;
|
|
50
|
+
emit('debug', args);
|
|
27
51
|
},
|
|
28
52
|
break() {
|
|
29
|
-
|
|
53
|
+
if (isCapturing())
|
|
54
|
+
return;
|
|
55
|
+
writeLine();
|
|
30
56
|
},
|
|
31
57
|
};
|
|
58
|
+
const FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
59
|
+
const FRAME_MS = 80;
|
|
60
|
+
/**
|
|
61
|
+
* Progress indicator for the paths that run outside the interactive screen
|
|
62
|
+
* (headless, --yes, CI). Inside a wizard the engine does the animating, and here
|
|
63
|
+
* the transitions become nothing but records in the sink.
|
|
64
|
+
*/
|
|
32
65
|
export function spinner(text) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
66
|
+
const animated = Boolean(process.stdout.isTTY) && !isCapturing();
|
|
67
|
+
let timer;
|
|
68
|
+
let frame = 0;
|
|
69
|
+
const clearLine = () => {
|
|
70
|
+
if (animated)
|
|
71
|
+
process.stdout.write('\r\x1b[2K');
|
|
72
|
+
};
|
|
73
|
+
const paint = () => {
|
|
74
|
+
// Capture can start after the spinner was already running; in that case the
|
|
75
|
+
// screen owns the terminal and nothing else may write to it directly.
|
|
76
|
+
if (isCapturing())
|
|
77
|
+
return;
|
|
78
|
+
clearLine();
|
|
79
|
+
process.stdout.write(`${style.primary(FRAMES[frame] ?? FRAMES[0] ?? '')} ${style.dim(instance.text)}`);
|
|
80
|
+
frame = (frame + 1) % FRAMES.length;
|
|
81
|
+
};
|
|
82
|
+
const finish = (level, message) => {
|
|
83
|
+
instance.stop();
|
|
84
|
+
emit(level, [message ?? instance.text]);
|
|
85
|
+
return instance;
|
|
86
|
+
};
|
|
87
|
+
const instance = {
|
|
88
|
+
text,
|
|
89
|
+
start() {
|
|
90
|
+
if (!animated) {
|
|
91
|
+
emit('info', [instance.text]);
|
|
92
|
+
return instance;
|
|
93
|
+
}
|
|
94
|
+
if (timer)
|
|
95
|
+
return instance;
|
|
96
|
+
paint();
|
|
97
|
+
timer = setInterval(paint, FRAME_MS);
|
|
98
|
+
// An active spinner must not keep the process alive on its own.
|
|
99
|
+
timer.unref?.();
|
|
100
|
+
return instance;
|
|
101
|
+
},
|
|
102
|
+
stop() {
|
|
103
|
+
if (timer) {
|
|
104
|
+
clearInterval(timer);
|
|
105
|
+
timer = undefined;
|
|
106
|
+
clearLine();
|
|
107
|
+
}
|
|
108
|
+
return instance;
|
|
109
|
+
},
|
|
110
|
+
succeed(message) {
|
|
111
|
+
return finish('success', message);
|
|
112
|
+
},
|
|
113
|
+
fail(message) {
|
|
114
|
+
return finish('error', message);
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
return instance;
|
|
38
118
|
}
|
|
39
119
|
//# sourceMappingURL=logger.js.map
|
package/utils/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,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project* uses.
|
|
4
|
+
*
|
|
5
|
+
* Order matters. `npm_config_user_agent` describes how the CLI was invoked
|
|
6
|
+
* (`npx` always says npm), not what the project uses — trusting it first gave a
|
|
7
|
+
* bun project `packageManager: "npm"` in its components.json and a
|
|
8
|
+
* package-lock.json next to its bun.lock. The project answers for itself: the
|
|
9
|
+
* package.json `packageManager` field first, then the lockfiles.
|
|
10
|
+
*/
|
|
11
|
+
export declare function detectPackageManager(cwd?: string): Promise<PackageManager>;
|
|
12
|
+
/**
|
|
13
|
+
* How to suggest running the CLI again.
|
|
14
|
+
*
|
|
15
|
+
* A different question: not which manager the project installs dependencies
|
|
16
|
+
* with, but how the CLI was just invoked. Someone who ran `npx zard-cli init`
|
|
17
|
+
* in a bun project does not expect to finish reading `bunx` — and the `npx`
|
|
18
|
+
* they already used works. Only when that cannot be known does the project's
|
|
19
|
+
* manager answer.
|
|
20
|
+
*/
|
|
21
|
+
export declare function suggestedRunner(packageManager: PackageManager): string;
|
|
3
22
|
export declare function getPackageManager(cwd?: string): Promise<'npm' | 'yarn' | 'pnpm' | 'bun'>;
|
|
4
23
|
export declare function getInstallCommand(packageManager: string, isDev?: boolean): Promise<string[]>;
|
|
5
24
|
export declare function installPackages(packages: string[], cwd: string, packageManager: 'npm' | 'yarn' | 'pnpm' | 'bun', isDev?: boolean, legacyPeerDeps?: boolean): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Installs the batch and, if the manager rejects the tree over a peer conflict,
|
|
27
|
+
* retries with the check relaxed.
|
|
28
|
+
*
|
|
29
|
+
* The fallback is remembered for the rest of the run: once the first batch
|
|
30
|
+
* needed it, the following ones will need it for the same reason, and an
|
|
31
|
+
* attempt already known to be doomed costs a full tree resolution.
|
|
32
|
+
*/
|
|
33
|
+
export declare function installPackagesWithRetry(packages: string[], cwd: string, packageManager: PackageManager, isDev?: boolean): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Drops from the batch the packages the project already declares and resolves.
|
|
36
|
+
*
|
|
37
|
+
* The manager charges a lot per invocation — it revalidates the whole tree even
|
|
38
|
+
* when there is nothing to do — so the win is not in making the install faster
|
|
39
|
+
* but in not calling it. An `add` in an already-initialized project asks for
|
|
40
|
+
* exactly the dependencies `init` put there.
|
|
41
|
+
*
|
|
42
|
+
* The filter is deliberately conservative: when in doubt the package stays in
|
|
43
|
+
* the batch and the manager decides. Comparing only the major is enough because
|
|
44
|
+
* the versions the CLI asks for are always of the form `^N`.
|
|
45
|
+
*/
|
|
46
|
+
export declare function filterInstalledPackages(packages: string[], cwd: string): Promise<string[]>;
|
|
6
47
|
export {};
|
|
7
48
|
//# sourceMappingURL=package-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../src/utils/package-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../src/utils/package-manager.ts"],"names":[],"mappings":"AAQA,KAAK,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAYtD;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,cAAc,CAAC,CAgB/F;AASD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,CAStE;AAYD,wBAAsB,iBAAiB,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,CAG7G;AAED,wBAAsB,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAYhG;AAaD,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAAE,EAClB,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,EAC/C,KAAK,UAAQ,EACb,cAAc,UAAQ,GACrB,OAAO,CAAC,IAAI,CAAC,CA8Cf;AAcD;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,MAAM,EAAE,EAClB,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,cAAc,EAC9B,KAAK,UAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAchG"}
|
package/utils/package-manager.js
CHANGED
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
import { detect } from '@antfu/ni';
|
|
2
|
+
import { isCapturing } from '../ui/log-sink.js';
|
|
2
3
|
import { getConfig } from '../utils/config.js';
|
|
4
|
+
import { logger } from '../utils/logger.js';
|
|
5
|
+
import { existsSync } from 'node:fs';
|
|
6
|
+
import { readFile } from 'node:fs/promises';
|
|
7
|
+
import * as path from 'node:path';
|
|
3
8
|
let cachedPackageManager = null;
|
|
4
|
-
|
|
9
|
+
const SUPPORTED = ['npm', 'yarn', 'pnpm', 'bun'];
|
|
10
|
+
function asPackageManager(value) {
|
|
11
|
+
// `yarn@berry`, `pnpm@6`, `bun@1.3.14` — only the family matters.
|
|
12
|
+
const name = value?.split('@')[0];
|
|
13
|
+
return SUPPORTED.includes(name) ? name : null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Which manager the *project* uses.
|
|
17
|
+
*
|
|
18
|
+
* Order matters. `npm_config_user_agent` describes how the CLI was invoked
|
|
19
|
+
* (`npx` always says npm), not what the project uses — trusting it first gave a
|
|
20
|
+
* bun project `packageManager: "npm"` in its components.json and a
|
|
21
|
+
* package-lock.json next to its bun.lock. The project answers for itself: the
|
|
22
|
+
* package.json `packageManager` field first, then the lockfiles.
|
|
23
|
+
*/
|
|
24
|
+
export async function detectPackageManager(cwd = process.cwd()) {
|
|
5
25
|
if (cachedPackageManager)
|
|
6
26
|
return cachedPackageManager;
|
|
27
|
+
const declared = asPackageManager(await readPackageManagerField(cwd));
|
|
28
|
+
if (declared)
|
|
29
|
+
return (cachedPackageManager = declared);
|
|
30
|
+
const fromLockfile = asPackageManager(await detect({ programmatic: true, cwd }));
|
|
31
|
+
if (fromLockfile)
|
|
32
|
+
return (cachedPackageManager = fromLockfile);
|
|
7
33
|
const userAgent = process.env.npm_config_user_agent || '';
|
|
8
34
|
if (userAgent.includes('bun'))
|
|
9
35
|
return (cachedPackageManager = 'bun');
|
|
@@ -11,16 +37,45 @@ export async function detectPackageManager() {
|
|
|
11
37
|
return (cachedPackageManager = 'pnpm');
|
|
12
38
|
if (userAgent.includes('yarn'))
|
|
13
39
|
return (cachedPackageManager = 'yarn');
|
|
14
|
-
if (userAgent.includes('npm'))
|
|
15
|
-
return (cachedPackageManager = 'npm');
|
|
16
|
-
const agent = await detect({ programmatic: true });
|
|
17
|
-
if (agent === 'yarn@berry')
|
|
18
|
-
return (cachedPackageManager = 'yarn');
|
|
19
|
-
if (agent && ['npm', 'yarn', 'pnpm', 'bun'].includes(agent)) {
|
|
20
|
-
return (cachedPackageManager = agent);
|
|
21
|
-
}
|
|
22
40
|
return (cachedPackageManager = 'npm');
|
|
23
41
|
}
|
|
42
|
+
const RUNNER = {
|
|
43
|
+
npm: 'npx',
|
|
44
|
+
yarn: 'yarn dlx',
|
|
45
|
+
pnpm: 'pnpm dlx',
|
|
46
|
+
bun: 'bunx',
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* How to suggest running the CLI again.
|
|
50
|
+
*
|
|
51
|
+
* A different question: not which manager the project installs dependencies
|
|
52
|
+
* with, but how the CLI was just invoked. Someone who ran `npx zard-cli init`
|
|
53
|
+
* in a bun project does not expect to finish reading `bunx` — and the `npx`
|
|
54
|
+
* they already used works. Only when that cannot be known does the project's
|
|
55
|
+
* manager answer.
|
|
56
|
+
*/
|
|
57
|
+
export function suggestedRunner(packageManager) {
|
|
58
|
+
const userAgent = process.env.npm_config_user_agent || '';
|
|
59
|
+
if (userAgent.startsWith('bun'))
|
|
60
|
+
return RUNNER.bun;
|
|
61
|
+
if (userAgent.startsWith('pnpm'))
|
|
62
|
+
return RUNNER.pnpm;
|
|
63
|
+
if (userAgent.startsWith('yarn'))
|
|
64
|
+
return RUNNER.yarn;
|
|
65
|
+
if (userAgent.startsWith('npm'))
|
|
66
|
+
return RUNNER.npm;
|
|
67
|
+
return RUNNER[packageManager];
|
|
68
|
+
}
|
|
69
|
+
/** The package.json `packageManager` field — the Corepack standard, an explicit declaration. */
|
|
70
|
+
async function readPackageManagerField(cwd) {
|
|
71
|
+
try {
|
|
72
|
+
const manifest = JSON.parse(await readFile(path.join(cwd, 'package.json'), 'utf8'));
|
|
73
|
+
return typeof manifest.packageManager === 'string' ? manifest.packageManager : null;
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
24
79
|
export async function getPackageManager(cwd = process.cwd()) {
|
|
25
80
|
const config = await getConfig(cwd);
|
|
26
81
|
return config?.packageManager ?? 'npm';
|
|
@@ -38,13 +93,151 @@ export async function getInstallCommand(packageManager, isDev = false) {
|
|
|
38
93
|
return isDev ? ['install', '-D'] : ['install'];
|
|
39
94
|
}
|
|
40
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Work the manager does out of habit that the install itself does not need.
|
|
98
|
+
*
|
|
99
|
+
* The vulnerability audit sends the whole tree to the registry and waits for an
|
|
100
|
+
* answer; in an Angular project, with over a thousand packages, that alone
|
|
101
|
+
* accounts for several seconds of a call that installs half a dozen.
|
|
102
|
+
*/
|
|
103
|
+
function speedFlags(packageManager) {
|
|
104
|
+
return packageManager === 'npm' ? ['--no-audit', '--no-fund'] : [];
|
|
105
|
+
}
|
|
41
106
|
export async function installPackages(packages, cwd, packageManager, isDev = false, legacyPeerDeps = false) {
|
|
42
107
|
const { execa } = await import('execa');
|
|
43
108
|
const installCmd = await getInstallCommand(packageManager, isDev);
|
|
44
|
-
const args = [...installCmd, ...packages];
|
|
109
|
+
const args = [...installCmd, ...packages, ...speedFlags(packageManager)];
|
|
45
110
|
if (legacyPeerDeps && packageManager === 'npm') {
|
|
46
111
|
args.push('--legacy-peer-deps');
|
|
47
112
|
}
|
|
48
|
-
|
|
113
|
+
if (legacyPeerDeps && packageManager === 'pnpm') {
|
|
114
|
+
args.push('--no-strict-peer-dependencies');
|
|
115
|
+
}
|
|
116
|
+
// With the interactive screen mounted, inheriting stdio would let the package
|
|
117
|
+
// manager write over the frame. In that case the output is captured and only
|
|
118
|
+
// shows up in debug mode; outside it, the behaviour stays "pass the output
|
|
119
|
+
// through live".
|
|
120
|
+
if (isCapturing()) {
|
|
121
|
+
const command = `${packageManager} ${args.join(' ')}`;
|
|
122
|
+
try {
|
|
123
|
+
// stdin ignored, not piped: an open input pipe never sees EOF and the
|
|
124
|
+
// package manager waits on it forever. Closing stdin also guarantees it
|
|
125
|
+
// never opens a prompt, which would be invisible behind the full screen.
|
|
126
|
+
const result = await execa(packageManager, args, {
|
|
127
|
+
cwd,
|
|
128
|
+
stdin: 'ignore',
|
|
129
|
+
stdout: 'pipe',
|
|
130
|
+
stderr: 'pipe',
|
|
131
|
+
});
|
|
132
|
+
logger.debug(`${command}\n${result.stdout}`);
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
// Without this the failure reaches the user as one generic line: the
|
|
136
|
+
// package manager's real output stays in the sink and is printed with the
|
|
137
|
+
// summary.
|
|
138
|
+
logger.error(`${command} failed:\n${outputOf(error)}`);
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
// stdin ignored here too. The install takes its packages as arguments and has
|
|
144
|
+
// nothing to ask; inheriting a stdin that never closes (a pipe, CI, a
|
|
145
|
+
// background job) leaves the manager waiting for an EOF that never comes —
|
|
146
|
+
// output stays live because stdout and stderr are still inherited.
|
|
147
|
+
await execa(packageManager, args, { cwd, stdin: 'ignore', stdout: 'inherit', stderr: 'inherit' });
|
|
148
|
+
}
|
|
149
|
+
function outputOf(error) {
|
|
150
|
+
const { stderr, stdout, message } = (error ?? {});
|
|
151
|
+
return (stderr?.trim() || stdout?.trim() || message || String(error)).trim();
|
|
152
|
+
}
|
|
153
|
+
/** Only npm and pnpm can relax peer checking; elsewhere, retrying repeats the same failure. */
|
|
154
|
+
function canRelaxPeers(packageManager) {
|
|
155
|
+
return packageManager === 'npm' || packageManager === 'pnpm';
|
|
156
|
+
}
|
|
157
|
+
let peerRelaxationEngaged = false;
|
|
158
|
+
/**
|
|
159
|
+
* Installs the batch and, if the manager rejects the tree over a peer conflict,
|
|
160
|
+
* retries with the check relaxed.
|
|
161
|
+
*
|
|
162
|
+
* The fallback is remembered for the rest of the run: once the first batch
|
|
163
|
+
* needed it, the following ones will need it for the same reason, and an
|
|
164
|
+
* attempt already known to be doomed costs a full tree resolution.
|
|
165
|
+
*/
|
|
166
|
+
export async function installPackagesWithRetry(packages, cwd, packageManager, isDev = false) {
|
|
167
|
+
if (packages.length === 0)
|
|
168
|
+
return;
|
|
169
|
+
if (peerRelaxationEngaged) {
|
|
170
|
+
await installPackages(packages, cwd, packageManager, isDev, true);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
await installPackages(packages, cwd, packageManager, isDev);
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
if (!canRelaxPeers(packageManager))
|
|
178
|
+
throw error;
|
|
179
|
+
logger.warn('Installation failed, retrying with relaxed peer dependency resolution...');
|
|
180
|
+
await installPackages(packages, cwd, packageManager, isDev, true);
|
|
181
|
+
peerRelaxationEngaged = true;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Drops from the batch the packages the project already declares and resolves.
|
|
186
|
+
*
|
|
187
|
+
* The manager charges a lot per invocation — it revalidates the whole tree even
|
|
188
|
+
* when there is nothing to do — so the win is not in making the install faster
|
|
189
|
+
* but in not calling it. An `add` in an already-initialized project asks for
|
|
190
|
+
* exactly the dependencies `init` put there.
|
|
191
|
+
*
|
|
192
|
+
* The filter is deliberately conservative: when in doubt the package stays in
|
|
193
|
+
* the batch and the manager decides. Comparing only the major is enough because
|
|
194
|
+
* the versions the CLI asks for are always of the form `^N`.
|
|
195
|
+
*/
|
|
196
|
+
export async function filterInstalledPackages(packages, cwd) {
|
|
197
|
+
const declared = await readDeclaredDependencies(cwd);
|
|
198
|
+
if (!declared)
|
|
199
|
+
return packages;
|
|
200
|
+
return packages.filter(spec => {
|
|
201
|
+
const { name, range } = parseSpec(spec);
|
|
202
|
+
const declaredRange = declared[name];
|
|
203
|
+
if (!declaredRange)
|
|
204
|
+
return true;
|
|
205
|
+
if (!isResolvable(name, cwd))
|
|
206
|
+
return true;
|
|
207
|
+
if (range && majorOf(range) !== majorOf(declaredRange))
|
|
208
|
+
return true;
|
|
209
|
+
return false;
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
function parseSpec(spec) {
|
|
213
|
+
// The `@` in `@ng-icons/core` opens the scope, not the version — hence the last one.
|
|
214
|
+
const separator = spec.lastIndexOf('@');
|
|
215
|
+
if (separator <= 0)
|
|
216
|
+
return { name: spec, range: null };
|
|
217
|
+
return { name: spec.slice(0, separator), range: spec.slice(separator + 1) };
|
|
218
|
+
}
|
|
219
|
+
function majorOf(range) {
|
|
220
|
+
return /(\d+)/.exec(range)?.[1] ?? null;
|
|
221
|
+
}
|
|
222
|
+
async function readDeclaredDependencies(cwd) {
|
|
223
|
+
try {
|
|
224
|
+
const manifest = JSON.parse(await readFile(path.join(cwd, 'package.json'), 'utf8'));
|
|
225
|
+
return { ...manifest.dependencies, ...manifest.devDependencies };
|
|
226
|
+
}
|
|
227
|
+
catch {
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
/** node_modules can sit above the project — workspaces hoist everything to the root. */
|
|
232
|
+
function isResolvable(name, cwd) {
|
|
233
|
+
let dir = path.resolve(cwd);
|
|
234
|
+
for (;;) {
|
|
235
|
+
if (existsSync(path.join(dir, 'node_modules', name)))
|
|
236
|
+
return true;
|
|
237
|
+
const parent = path.dirname(dir);
|
|
238
|
+
if (parent === dir)
|
|
239
|
+
return false;
|
|
240
|
+
dir = parent;
|
|
241
|
+
}
|
|
49
242
|
}
|
|
50
243
|
//# sourceMappingURL=package-manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager.js","sourceRoot":"","sources":["../../src/utils/package-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"package-manager.js","sourceRoot":"","sources":["../../src/utils/package-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC,IAAI,oBAAoB,GAA0B,IAAI,CAAC;AAEvD,MAAM,SAAS,GAA8B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAE5E,SAAS,gBAAgB,CAAC,KAAgC;IACxD,kEAAkE;IAClE,MAAM,IAAI,GAAG,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAClC,OAAO,SAAS,CAAC,QAAQ,C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