zard-cli 1.0.0-beta.12 → 1.0.0-beta.120
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 +39 -167
- package/commands/add/component-installer.d.ts +4 -1
- package/commands/add/component-installer.d.ts.map +1 -1
- package/commands/add/component-installer.js +33 -5
- 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 +5 -11
- package/commands/add/dark-mode-setup.js.map +1 -1
- package/commands/add/dependency-resolver.d.ts +5 -2
- package/commands/add/dependency-resolver.d.ts.map +1 -1
- package/commands/add/dependency-resolver.js +54 -20
- package/commands/add/dependency-resolver.js.map +1 -1
- package/commands/add/index.d.ts.map +1 -1
- package/commands/add/index.js +135 -86
- package/commands/add/index.js.map +1 -1
- package/commands/add/typeset-setup.d.ts +12 -0
- package/commands/add/typeset-setup.d.ts.map +1 -0
- package/commands/add/typeset-setup.js +68 -0
- package/commands/add/typeset-setup.js.map +1 -0
- package/commands/add/wizard.d.ts +34 -0
- package/commands/add/wizard.d.ts.map +1 -0
- package/commands/add/wizard.js +295 -0
- package/commands/add/wizard.js.map +1 -0
- package/commands/init/config-prompter.d.ts +66 -56
- package/commands/init/config-prompter.d.ts.map +1 -1
- package/commands/init/config-prompter.js +90 -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 +51 -23
- package/commands/init/dependencies.js.map +1 -1
- package/commands/init/index.d.ts.map +1 -1
- package/commands/init/index.js +150 -86
- package/commands/init/index.js.map +1 -1
- 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 +154 -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 +33 -9
- package/commands/init/tailwind-setup.js.map +1 -1
- package/commands/init/theme-loader.d.ts.map +1 -1
- package/commands/init/theme-loader.js +1 -3
- package/commands/init/theme-loader.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 -47
- 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 +30 -0
- package/commands/init/wizard.d.ts.map +1 -0
- package/commands/init/wizard.js +560 -0
- package/commands/init/wizard.js.map +1 -0
- 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 +135 -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 +752 -126
- package/core/registry/registry-data.js.map +1 -1
- package/core/themes/theme-definitions.d.ts +5 -5
- package/core/themes/theme-definitions.d.ts.map +1 -1
- package/core/themes/theme-definitions.js +75 -61
- package/core/themes/theme-definitions.js.map +1 -1
- package/index.js +41 -4
- package/index.js.map +1 -1
- package/package.json +9 -14
- 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 +52 -69
- package/utils/config.d.ts.map +1 -1
- package/utils/config.js +60 -9
- package/utils/config.js.map +1 -1
- package/utils/errors.d.ts +27 -0
- package/utils/errors.d.ts.map +1 -0
- package/utils/errors.js +45 -0
- package/utils/errors.js.map +1 -0
- package/utils/get-package-info.js +4 -4
- package/utils/get-package-info.js.map +1 -1
- package/utils/get-project-info.d.ts +30 -0
- package/utils/get-project-info.d.ts.map +1 -1
- package/utils/get-project-info.js +195 -6
- package/utils/get-project-info.js.map +1 -1
- package/utils/http-client.d.ts +8 -0
- package/utils/http-client.d.ts.map +1 -0
- package/utils/http-client.js +83 -0
- package/utils/http-client.js.map +1 -0
- 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 +16 -1
- package/utils/logger.d.ts.map +1 -1
- package/utils/logger.js +104 -12
- package/utils/logger.js.map +1 -1
- package/utils/package-manager.d.ts +44 -1
- package/utils/package-manager.d.ts.map +1 -1
- package/utils/package-manager.js +210 -14
- package/utils/package-manager.js.map +1 -1
- package/utils/registry.d.ts +44 -2
- package/utils/registry.d.ts.map +1 -1
- package/utils/registry.js +89 -30
- 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
- package/utils/theme-selector.d.ts +1 -1
- package/utils/theme-selector.d.ts.map +1 -1
- package/utils/theme-selector.js +6 -6
- package/utils/theme-selector.js.map +1 -1
- package/utils/fetch-component.d.ts +0 -3
- package/utils/fetch-component.d.ts.map +0 -1
- package/utils/fetch-component.js +0 -75
- package/utils/fetch-component.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-prompter.js","sourceRoot":"","sources":["../../../src/commands/init/config-prompter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config-prompter.js","sourceRoot":"","sources":["../../../src/commands/init/config-prompter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,cAAc,EACd,iBAAiB,GAElB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,EAAE,UAA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,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAE7C,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IAE3C,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChD,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC;AAC7D,CAAC"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { type Config } from '../../utils/config.js';
|
|
2
|
-
type ProjectInfo
|
|
3
|
-
framework: string;
|
|
4
|
-
hasTypeScript: boolean;
|
|
5
|
-
hasTailwind: boolean;
|
|
6
|
-
hasNx: boolean;
|
|
7
|
-
angularVersion: string | null;
|
|
8
|
-
};
|
|
2
|
+
import { type ProjectInfo } from '../../utils/get-project-info.js';
|
|
9
3
|
export declare function installDependencies(cwd: string, config: Config, projectInfo?: ProjectInfo): Promise<void>;
|
|
10
|
-
export {};
|
|
11
4
|
//# sourceMappingURL=dependencies.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../../src/commands/init/dependencies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../../src/commands/init/dependencies.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAKlF,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAwC/G"}
|
|
@@ -1,33 +1,61 @@
|
|
|
1
|
+
import { bundlerFor, isLibraryKind } from '../../commands/init/project-kind.js';
|
|
2
|
+
import { iconPackagesFor } from '../../core/icons/index.js';
|
|
3
|
+
import { pinAllForAngular } from '../../utils/angular-compat.js';
|
|
1
4
|
import { getProjectInfo } from '../../utils/get-project-info.js';
|
|
5
|
+
import { iconCatalog } from '../../utils/icon-catalog.js';
|
|
2
6
|
import { logger } from '../../utils/logger.js';
|
|
3
|
-
import {
|
|
7
|
+
import { filterInstalledPackages, installPackagesWithRetry } from '../../utils/package-manager.js';
|
|
4
8
|
export async function installDependencies(cwd, config, projectInfo) {
|
|
5
9
|
const info = projectInfo || (await getProjectInfo(cwd));
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
// The icon package comes from the family chosen in `components.json`, not from
|
|
11
|
+
// a fixed list: that is what makes `"icons"` mean something the day there is
|
|
12
|
+
// more than one family.
|
|
13
|
+
//
|
|
14
|
+
// Pinned against the project's Angular: the CDK and ng-icons both ship one
|
|
15
|
+
// release per Angular major and peer on `>=` it, so `latest` is the wrong
|
|
16
|
+
// answer for anyone not already on the newest Angular.
|
|
17
|
+
const deps = pinAllForAngular([
|
|
18
|
+
'@angular/cdk',
|
|
19
|
+
'class-variance-authority',
|
|
20
|
+
'clsx',
|
|
21
|
+
'tailwind-merge',
|
|
22
|
+
...iconPackagesFor(config.icons, iconCatalog()),
|
|
23
|
+
], info.angularVersion);
|
|
24
|
+
const devDeps = tailwindPackages(config.projectType);
|
|
9
25
|
if (info.hasTailwind) {
|
|
10
|
-
logger.info('Tailwind CSS is already installed.
|
|
26
|
+
logger.info('Tailwind CSS is already installed. Only the missing pieces will be added.');
|
|
11
27
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
28
|
+
// Every batch that comes back empty is a whole manager invocation saved — and
|
|
29
|
+
// that is exactly the common case for a repeated `init`: nothing to install.
|
|
30
|
+
const [missingDeps, missingDevDeps] = await Promise.all([
|
|
31
|
+
filterInstalledPackages(deps, cwd),
|
|
32
|
+
filterInstalledPackages(devDeps, cwd),
|
|
33
|
+
]);
|
|
34
|
+
if (!missingDeps.length && !missingDevDeps.length) {
|
|
35
|
+
logger.info('All dependencies are already installed.');
|
|
36
|
+
return;
|
|
15
37
|
}
|
|
38
|
+
await installPackagesWithRetry(missingDeps, cwd, config.packageManager, false);
|
|
39
|
+
await installPackagesWithRetry(missingDevDeps, cwd, config.packageManager, true);
|
|
16
40
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
41
|
+
/**
|
|
42
|
+
* What Tailwind needs to run in that kind of project.
|
|
43
|
+
*
|
|
44
|
+
* The list is always the complete one and the installed-filter decides what is
|
|
45
|
+
* left: checking only for `tailwindcss` missed the case of someone who had it
|
|
46
|
+
* installed but not the bundler adapter, and then the build emitted no
|
|
47
|
+
* utilities at all.
|
|
48
|
+
*
|
|
49
|
+
* A library has no bundler to configure — the consuming application compiles
|
|
50
|
+
* the CSS — but the packages stay because the theme init writes there declares
|
|
51
|
+
* them.
|
|
52
|
+
*/
|
|
53
|
+
function tailwindPackages(kind) {
|
|
54
|
+
const shared = ['tailwindcss', 'tailwindcss-animate'];
|
|
55
|
+
if (isLibraryKind(kind))
|
|
56
|
+
return shared;
|
|
57
|
+
return bundlerFor(kind) === 'vite'
|
|
58
|
+
? [...shared, '@tailwindcss/vite']
|
|
59
|
+
: [...shared, '@tailwindcss/postcss', 'postcss'];
|
|
32
60
|
}
|
|
33
61
|
//# sourceMappingURL=dependencies.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../src/commands/init/dependencies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../src/commands/init/dependencies.ts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CAAC;KACtC,CAAC,CAAC;IAEH,IAAI,CAAC,WAAW,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;QAClD,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;QACvD,OAAO;IACT,CAAC;IAED,MAAM,wBAAwB,CAAC,WAAW,EAAE,GAAG,EAAE,MAAM,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IAC/E,MAAM,wBAAwB,CAAC,cAAc,EAAE,GAAG,EAAE,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;AACnF,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,gBAAgB,CAAC,IAA2B;IACnD,MAAM,MAAM,GAAG,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;IAEtD,IAAI,aAAa,CAAC,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC;IAEvC,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,MAAM;QAChC,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,mBAAmB,CAAC;QAClC,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,sBAAsB,EAAE,SAAS,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,IAAI,SAkEb,CAAC"}
|
package/commands/init/index.js
CHANGED
|
@@ -1,121 +1,185 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { buildConfig, defaultAnswers, inspectCssFile } from '../../commands/init/config-prompter.js';
|
|
2
|
+
import { candidateProjects, detectProjectKind, isLibraryKind, PROJECT_KINDS, } from '../../commands/init/project-kind.js';
|
|
3
|
+
import { buildInitSteps } from '../../commands/init/steps.js';
|
|
4
|
+
import { runInitWizard } from '../../commands/init/wizard.js';
|
|
5
|
+
import { isInteractive, printReport, WizardCancelledError } from '../../ui/index.js';
|
|
6
|
+
import { CliError } from '../../utils/errors.js';
|
|
7
7
|
import { getProjectInfo } from '../../utils/get-project-info.js';
|
|
8
|
+
import { loadIconCatalog } from '../../utils/icon-catalog.js';
|
|
8
9
|
import { logger, spinner } from '../../utils/logger.js';
|
|
9
|
-
import { detectPackageManager } from '../../utils/package-manager.js';
|
|
10
|
-
import
|
|
10
|
+
import { detectPackageManager, suggestedRunner } from '../../utils/package-manager.js';
|
|
11
|
+
import { getRegistryUrl } from '../../utils/registry.js';
|
|
11
12
|
import { Command } from 'commander';
|
|
12
13
|
import { existsSync } from 'node:fs';
|
|
13
|
-
import { mkdir, writeFile } from 'node:fs/promises';
|
|
14
14
|
import * as path from 'node:path';
|
|
15
|
-
import prompts from 'prompts';
|
|
16
|
-
import { updateAngularConfig } from './update-angular-config.js';
|
|
17
15
|
export const init = new Command()
|
|
18
16
|
.name('init')
|
|
19
17
|
.description('initialize your project and install dependencies')
|
|
20
18
|
.option('-y, --yes', 'skip confirmation prompt.', false)
|
|
21
19
|
.option('-c, --cwd <cwd>', 'the working directory. defaults to the current directory.', process.cwd())
|
|
20
|
+
.option('-t, --type <type>', `the project type: ${PROJECT_KINDS.map(kind => kind.value).join(', ')}.`)
|
|
21
|
+
.option('-p, --project <name>', 'the workspace project to configure. defaults to the first compatible one.')
|
|
22
22
|
.action(async (options) => {
|
|
23
23
|
const cwd = path.resolve(options.cwd);
|
|
24
24
|
validateWorkingDirectory(cwd);
|
|
25
25
|
const projectInfo = await getProjectInfo(cwd);
|
|
26
26
|
validateAngularProject(projectInfo);
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
const kind = resolveKind(options.type);
|
|
28
|
+
const projectRoot = resolveProjectRoot(options.project, kind ?? detectProjectKind(projectInfo), projectInfo);
|
|
29
|
+
const isReInitializing = existsSync(path.resolve(cwd, 'components.json'));
|
|
30
|
+
const packageManager = await detectPackageManager(cwd);
|
|
31
|
+
// Before any step: the catalog is what says which icon package to install,
|
|
32
|
+
// and it comes from the registry so it does not depend on the CLI version.
|
|
33
|
+
await loadIconCatalog(getRegistryUrl());
|
|
34
|
+
const buildSteps = (config) => buildInitSteps(cwd, config, projectInfo, isReInitializing);
|
|
35
|
+
if (!isInteractive()) {
|
|
36
|
+
logHeadlessReason();
|
|
37
|
+
await runHeadless({
|
|
38
|
+
cwd,
|
|
39
|
+
projectInfo,
|
|
40
|
+
packageManager,
|
|
41
|
+
isReInitializing,
|
|
42
|
+
buildSteps,
|
|
43
|
+
yes: options.yes,
|
|
44
|
+
kind,
|
|
45
|
+
projectRoot,
|
|
46
|
+
});
|
|
47
|
+
return;
|
|
35
48
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
try {
|
|
50
|
+
const { config, logs } = await runInitWizard({
|
|
51
|
+
cwd,
|
|
52
|
+
projectInfo,
|
|
53
|
+
packageManager,
|
|
54
|
+
isReInitializing,
|
|
55
|
+
skipConfirmation: options.yes,
|
|
56
|
+
buildSteps,
|
|
57
|
+
presetKind: kind,
|
|
58
|
+
presetProjectRoot: projectRoot,
|
|
59
|
+
});
|
|
60
|
+
reportSuccess(config, buildSteps(config), logs);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
if (error instanceof WizardCancelledError) {
|
|
64
|
+
printReport({
|
|
65
|
+
status: 'cancelled',
|
|
66
|
+
headline: error.message,
|
|
67
|
+
notes: ['Nothing was changed in your project.'],
|
|
68
|
+
});
|
|
44
69
|
process.exit(0);
|
|
45
70
|
}
|
|
71
|
+
throw error;
|
|
46
72
|
}
|
|
47
|
-
await runInitializationSteps(cwd, config, projectInfo, isReInitializing);
|
|
48
|
-
displaySuccessMessage(config);
|
|
49
73
|
});
|
|
74
|
+
/**
|
|
75
|
+
* Why the full screen was not mounted.
|
|
76
|
+
*
|
|
77
|
+
* The CLI falling back to text mode is, to whoever is watching, indistinguishable
|
|
78
|
+
* from the interface not existing — which is how the degradation on macOS and
|
|
79
|
+
* Linux went unnoticed until it turned into "it never showed up" reports. With
|
|
80
|
+
* `--debug`, the command answers for itself.
|
|
81
|
+
*/
|
|
82
|
+
function logHeadlessReason() {
|
|
83
|
+
logger.debug(`No terminal to draw on (stdin TTY: ${Boolean(process.stdin.isTTY)}, ` +
|
|
84
|
+
`stdout TTY: ${Boolean(process.stdout.isTTY)}, controlling terminal: unreachable) — running headless.`);
|
|
85
|
+
}
|
|
50
86
|
function validateWorkingDirectory(cwd) {
|
|
51
87
|
if (!existsSync(cwd)) {
|
|
52
|
-
|
|
53
|
-
process.exit(1);
|
|
88
|
+
throw new CliError(`The path ${cwd} does not exist. Please try again.`, 'INVALID_CWD');
|
|
54
89
|
}
|
|
55
90
|
}
|
|
56
91
|
function validateAngularProject(projectInfo) {
|
|
57
92
|
if (projectInfo.framework !== 'angular') {
|
|
58
|
-
|
|
59
|
-
logger.error('Please run this command in an Angular project.');
|
|
60
|
-
process.exit(1);
|
|
93
|
+
throw new CliError('This project does not appear to be an Angular project.', 'NOT_ANGULAR');
|
|
61
94
|
}
|
|
62
95
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
96
|
+
/**
|
|
97
|
+
* The type asked for with `--type`, when there is one.
|
|
98
|
+
*
|
|
99
|
+
* It is the answer to the wizard's first question given up front — which is what
|
|
100
|
+
* makes init usable in CI, where nobody can pick from a menu.
|
|
101
|
+
*/
|
|
102
|
+
function resolveKind(value) {
|
|
103
|
+
if (!value)
|
|
104
|
+
return undefined;
|
|
105
|
+
const kind = PROJECT_KINDS.find(option => option.value === value);
|
|
106
|
+
if (!kind) {
|
|
107
|
+
throw new CliError(`Unknown project type "${value}". Expected one of: ${PROJECT_KINDS.map(option => option.value).join(', ')}.`, 'UNKNOWN_PROJECT_TYPE');
|
|
108
|
+
}
|
|
109
|
+
return kind.value;
|
|
72
110
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
111
|
+
/** The root of the project asked for with `--project`, looked up among the compatible ones. */
|
|
112
|
+
function resolveProjectRoot(name, kind, projectInfo) {
|
|
113
|
+
if (!name)
|
|
114
|
+
return undefined;
|
|
115
|
+
const candidates = candidateProjects(kind, projectInfo);
|
|
116
|
+
const project = candidates.find(candidate => candidate.name === name);
|
|
117
|
+
if (!project) {
|
|
118
|
+
const available = candidates.map(candidate => candidate.name).join(', ') || 'none';
|
|
119
|
+
throw new CliError(`Project "${name}" is not a ${kind} project in this workspace. Available: ${available}.`, 'UNKNOWN_PROJECT');
|
|
120
|
+
}
|
|
121
|
+
return project.root;
|
|
81
122
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (!
|
|
90
|
-
|
|
91
|
-
|
|
123
|
+
/**
|
|
124
|
+
* The path without a UI — CI, pipes and non-interactive terminals.
|
|
125
|
+
*
|
|
126
|
+
* Nobody can answer anything here, so the defaults apply and `--yes` is
|
|
127
|
+
* required: without it the CLI refuses to overwrite the project's global CSS.
|
|
128
|
+
*/
|
|
129
|
+
async function runHeadless(options) {
|
|
130
|
+
if (!options.yes) {
|
|
131
|
+
throw new CliError('Running without an interactive terminal requires --yes, since init overwrites your global CSS.', 'NOT_INTERACTIVE');
|
|
132
|
+
}
|
|
133
|
+
const kind = options.kind ?? detectProjectKind(options.projectInfo);
|
|
134
|
+
const answers = defaultAnswers(options.projectInfo, kind, options.projectRoot);
|
|
135
|
+
const cssState = await inspectCssFile(options.cwd, answers.globalCss);
|
|
136
|
+
// In a library the theme CSS is created by init, so its absence is expected;
|
|
137
|
+
// in an application the file has to be there and wired into the build.
|
|
138
|
+
if (cssState === 'missing' && !isLibraryKind(answers.kind)) {
|
|
139
|
+
throw new CliError(`CSS file not found at: ${answers.globalCss}. Run init in an interactive terminal to choose another path.`, 'CSS_NOT_FOUND');
|
|
140
|
+
}
|
|
141
|
+
const config = buildConfig(answers, options.packageManager);
|
|
142
|
+
const steps = options.buildSteps(config);
|
|
143
|
+
logger.info(options.isReInitializing ? 'Re-initializing zard/ui...' : 'Initializing zard/ui...');
|
|
144
|
+
for (const step of steps) {
|
|
145
|
+
const stepSpinner = spinner(`${step.label} — ${step.note}`).start();
|
|
146
|
+
try {
|
|
147
|
+
await step.run();
|
|
148
|
+
stepSpinner.succeed(step.label);
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
stepSpinner.fail(`${step.label}: ${error instanceof Error ? error.message : String(error)}`);
|
|
152
|
+
throw error;
|
|
153
|
+
}
|
|
92
154
|
}
|
|
93
|
-
|
|
94
|
-
await applyThemeToStyles(cwd, config);
|
|
95
|
-
initSpinner.text = 'Updating TypeScript config...';
|
|
96
|
-
await updateTsConfig(cwd, config);
|
|
97
|
-
initSpinner.text = 'Installing core dependencies...';
|
|
98
|
-
await installCoreDependencies(cwd, config);
|
|
99
|
-
initSpinner.succeed('Project initialized');
|
|
155
|
+
reportSuccess(config, steps, []);
|
|
100
156
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
157
|
+
function reportSuccess(config, steps, logs) {
|
|
158
|
+
printReport({
|
|
159
|
+
status: 'success',
|
|
160
|
+
headline: 'zard/ui has been initialized successfully!',
|
|
161
|
+
items: steps.map(step => `${step.label} — ${step.note}`),
|
|
162
|
+
notes: nextStepsFor(config),
|
|
163
|
+
commands: [{ command: `${suggestedRunner(config.packageManager)} zard-cli add`, argument: '[component]' }],
|
|
164
|
+
logs,
|
|
165
|
+
});
|
|
107
166
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
167
|
+
/**
|
|
168
|
+
* What is still left to do by hand.
|
|
169
|
+
*
|
|
170
|
+
* In a library init has nowhere to register `provideZard()` and no way to import
|
|
171
|
+
* the tokens — both belong to the app consuming the library, and without this
|
|
172
|
+
* notice the user only finds out when the components do not render.
|
|
173
|
+
*/
|
|
174
|
+
function nextStepsFor(config) {
|
|
175
|
+
if (!isLibraryKind(config.projectType)) {
|
|
176
|
+
return ['You can now add components using:'];
|
|
177
|
+
}
|
|
178
|
+
return [
|
|
179
|
+
'The consuming app still needs to register provideZard() in its app.config.ts',
|
|
180
|
+
`and import the theme tokens from this library's ${path.basename(config.tailwind.css)}.`,
|
|
181
|
+
'',
|
|
182
|
+
'You can now add components using:',
|
|
183
|
+
];
|
|
120
184
|
}
|
|
121
185
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACpG,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,aAAa,GAEd,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAiB,MAAM,6BAA6B,C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A0B,EAAE,IAA0B;IAC3F,WAAW,CAAC;QACV,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,4CAA4C;QACtD,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QACxD,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC;QAC3B,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC,MAAM,CAAC,cAAc,CAAC,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;QAC1G,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,SAAS,YAAY,CAAC,MAAc;IAClC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QACvC,OAAO,CAAC,mCAAmC,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO;QACL,8EAA8E;QAC9E,mDAAmD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG;QACxF,EAAE;QACF,mCAAmC;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which kind of project `init` is configuring.
|
|
3
|
+
*
|
|
4
|
+
* The user answers, in the wizard's first question — the CLI does not decide for
|
|
5
|
+
* them. What the workspace reveals comes afterwards, to fill in the suggested
|
|
6
|
+
* paths for the chosen type; detection only becomes a decision on the headless
|
|
7
|
+
* path, where there is nobody to ask.
|
|
8
|
+
*
|
|
9
|
+
* The differences between the types are not cosmetic: a library has no
|
|
10
|
+
* `app.config.ts` to register providers in and no pre-existing global CSS, Nx
|
|
11
|
+
* keeps the TypeScript paths in a different file, and Analog swaps Angular's
|
|
12
|
+
* build for Vite — and with it the way Tailwind is configured. Concentrating
|
|
13
|
+
* those differences here keeps every step from rediscovering them.
|
|
14
|
+
*/
|
|
15
|
+
import type { ProjectInfo, WorkspaceProject } from '../../utils/get-project-info.js';
|
|
16
|
+
export type ProjectKind = 'angular' | 'angular-library' | 'nx' | 'nx-library' | 'analog';
|
|
17
|
+
export interface ProjectKindOption {
|
|
18
|
+
readonly value: ProjectKind;
|
|
19
|
+
readonly label: string;
|
|
20
|
+
readonly detail: string;
|
|
21
|
+
/** The ecosystem's colour, so the menu says at a glance which world the type belongs to. */
|
|
22
|
+
readonly color: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Menu order: each ecosystem with the application before the library, from the
|
|
26
|
+
* most common to the rarest. Angular opens the list because it is the default.
|
|
27
|
+
*/
|
|
28
|
+
export declare const PROJECT_KINDS: readonly ProjectKindOption[];
|
|
29
|
+
export declare function isLibraryKind(kind: ProjectKind): boolean;
|
|
30
|
+
/** Where the TypeScript paths have to be written for the project to see them. */
|
|
31
|
+
export declare function tsconfigFileFor(kind: ProjectKind, projectInfo: ProjectInfo): string;
|
|
32
|
+
/** Se o Tailwind entra pelo PostCSS do Angular ou pelo plugin do Vite. */
|
|
33
|
+
export declare function bundlerFor(kind: ProjectKind): 'angular' | 'vite';
|
|
34
|
+
/**
|
|
35
|
+
* The workspace projects that can receive the install.
|
|
36
|
+
*
|
|
37
|
+
* Once the type is chosen, only what matches it makes sense to offer: asking
|
|
38
|
+
* someone who chose "library" to install into an application would offer a
|
|
39
|
+
* target the following steps do not know how to configure.
|
|
40
|
+
*/
|
|
41
|
+
export declare function candidateProjects(kind: ProjectKind, projectInfo: ProjectInfo): WorkspaceProject[];
|
|
42
|
+
/** Default root when the workspace declares no compatible project. */
|
|
43
|
+
export declare function fallbackRootFor(kind: ProjectKind): string;
|
|
44
|
+
/**
|
|
45
|
+
* The type the headless path assumes.
|
|
46
|
+
*
|
|
47
|
+
* With no interactive terminal nobody answers the first question, so here — and
|
|
48
|
+
* only here — the workspace decides: the manager gives the world (Nx or
|
|
49
|
+
* Angular), Analog announces itself through its own dependencies, and the
|
|
50
|
+
* absence of any application is what suggests the target is a library.
|
|
51
|
+
*/
|
|
52
|
+
export declare function detectProjectKind(projectInfo: ProjectInfo): ProjectKind;
|
|
53
|
+
/**
|
|
54
|
+
* Where a library's code lives.
|
|
55
|
+
*
|
|
56
|
+
* `src/lib` is the convention for both `ng generate library` and
|
|
57
|
+
* `nx g @nx/angular:library`: `src/` holds the public entry point, and
|
|
58
|
+
* everything it exports sits in `src/lib`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function libraryBaseUrl(libraryRoot: string): string;
|
|
61
|
+
/** The theme CSS the library starts exposing to whoever consumes it. */
|
|
62
|
+
export declare function libraryStylesPath(libraryRoot: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* The project root, derived from `baseUrl`.
|
|
65
|
+
*
|
|
66
|
+
* Both layouts end two levels below the root — `<root>/src/app` in an
|
|
67
|
+
* application, `<root>/src/lib` in a library — so going up two levels gives the
|
|
68
|
+
* directory holding that project's `project.json`, `ng-package.json` and
|
|
69
|
+
* `.postcssrc.json`. A single app at the root gives `.`.
|
|
70
|
+
*/
|
|
71
|
+
export declare function projectRootOf(baseUrl: string): string;
|
|
72
|
+
/** The project's source directory — where `index.html` and `main.ts` sit. */
|
|
73
|
+
export declare function sourceRootOf(baseUrl: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* Where to look for the project's `index.html`.
|
|
76
|
+
*
|
|
77
|
+
* In Analog it is Vite's entry page and sits at the project root, not in `src/`
|
|
78
|
+
* as in the Angular build — suggesting the wrong path made `add dark-mode` fail
|
|
79
|
+
* right after asking.
|
|
80
|
+
*/
|
|
81
|
+
export declare function indexHtmlFor(kind: ProjectKind, baseUrl: string): string;
|
|
82
|
+
//# sourceMappingURL=project-kind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-kind.d.ts","sourceRoot":"","sources":["../../../src/commands/init/project-kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK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