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
package/README.md
CHANGED
|
@@ -1,60 +1,122 @@
|
|
|
1
|
-
#
|
|
1
|
+
# zard-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The command line for [zard/ui](https://www.zardui.com): add beautiful, accessible Angular components to your project with a single command. The source lands in your codebase, so every component is yours to read and change.
|
|
4
4
|
|
|
5
|
-
<a alt="
|
|
6
|
-
<img align="center" width=100% src="https://www.zardui.com/images/github_banner.png"/>
|
|
5
|
+
<a alt="zard/ui" href="https://www.zardui.com/docs/cli" target="_blank" rel="noreferrer">
|
|
6
|
+
<img align="center" width="100%" src="https://www.zardui.com/images/github_banner.png" alt="zard/ui"/>
|
|
7
7
|
</a>
|
|
8
8
|
|
|
9
|
-
<p align="center">Made with ❤️ from 🇧🇷</p>
|
|
10
9
|
<p align="center">
|
|
11
|
-
<img src="https://img.shields.io/
|
|
10
|
+
<a href="https://www.npmjs.com/package/zard-cli"><img src="https://img.shields.io/npm/v/zard-cli?label=zard-cli" alt="npm version"/></a>
|
|
11
|
+
<a href="https://github.com/zard-ui/zardui"><img src="https://img.shields.io/github/stars/zard-ui/zardui" alt="GitHub stars"/></a>
|
|
12
|
+
<a href="https://github.com/zard-ui/zardui/blob/master/LICENSE.md"><img src="https://img.shields.io/npm/l/zard-cli" alt="license"/></a>
|
|
12
13
|
</p>
|
|
13
14
|
|
|
14
|
-
##
|
|
15
|
+
## Quick start
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
```bash
|
|
18
|
+
# 1. Set up zard/ui in your project
|
|
19
|
+
npx zard-cli@latest init
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
# 2. Add components; whatever they depend on comes along
|
|
22
|
+
npx zard-cli@latest add button card dialog
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { Component } from '@angular/core';
|
|
21
27
|
|
|
22
|
-
|
|
28
|
+
import { ZardButtonComponent } from '@/shared/components/button';
|
|
23
29
|
|
|
24
|
-
|
|
30
|
+
@Component({
|
|
31
|
+
selector: 'app-root',
|
|
32
|
+
imports: [ZardButtonComponent],
|
|
33
|
+
template: `
|
|
34
|
+
<z-button>Click me</z-button>
|
|
35
|
+
`,
|
|
36
|
+
})
|
|
37
|
+
export class AppComponent {}
|
|
38
|
+
```
|
|
25
39
|
|
|
26
|
-
|
|
40
|
+
Requires Node 20 or newer and an Angular project with Tailwind CSS v4 (`init` installs and wires Tailwind for you).
|
|
27
41
|
|
|
28
|
-
|
|
42
|
+
## Commands
|
|
29
43
|
|
|
30
|
-
|
|
31
|
-
2. Create your feature branch: `git checkout -b feat/#123-your-feature`
|
|
32
|
-
3. Develop with as many commits as you want
|
|
33
|
-
4. Open a PR to `master`
|
|
34
|
-
5. After review + merge = automatic release!
|
|
44
|
+
### `init`
|
|
35
45
|
|
|
36
|
-
|
|
46
|
+
Sets up your project: installs the dependencies, writes the theme tokens, maps the `@/` import alias, registers `provideZard()` and wires Tailwind into the build. The first question is the kind of project, and everything after it follows from that answer.
|
|
37
47
|
|
|
38
48
|
```bash
|
|
39
|
-
|
|
40
|
-
npm test # Run all tests
|
|
41
|
-
npm run build # Build production
|
|
42
|
-
npm run release # Automated release
|
|
49
|
+
npx zard-cli init
|
|
43
50
|
```
|
|
44
51
|
|
|
45
|
-
|
|
52
|
+
| Option | Description |
|
|
53
|
+
| ---------------------- | -------------------------------------------------------------------------- |
|
|
54
|
+
| `-y, --yes` | Skip the confirmation prompt |
|
|
55
|
+
| `-c, --cwd <cwd>` | Working directory, defaults to the current one |
|
|
56
|
+
| `-t, --type <type>` | Project type: `angular`, `angular-library`, `nx`, `nx-library` or `analog` |
|
|
57
|
+
| `-p, --project <name>` | Which workspace project to configure, when more than one is compatible |
|
|
58
|
+
| `--css <path>` | The global stylesheet that receives the theme |
|
|
59
|
+
| `--app-config <path>` | The app.config.ts that receives `provideZard()` (ignored for libraries) |
|
|
60
|
+
| `--base-color <color>` | Theme base color: `neutral`, `stone`, `zinc`, `gray` or `slate` |
|
|
61
|
+
| `--components-alias` | Import alias for components, defaults to `@/shared/components` |
|
|
62
|
+
| `--utils-alias` | Import alias for utils, defaults to `@/shared/utils` |
|
|
46
63
|
|
|
47
|
-
|
|
64
|
+
Every question the wizard asks has a flag. Outside a terminal (CI, pipes) pass `--yes`, and the flags answer the questions:
|
|
48
65
|
|
|
49
|
-
|
|
66
|
+
```bash
|
|
67
|
+
npx zard-cli init --yes --type nx --project web
|
|
68
|
+
```
|
|
50
69
|
|
|
51
|
-
|
|
70
|
+
### `add`
|
|
52
71
|
|
|
53
|
-
|
|
54
|
-
<img src="https://img.shields.io/badge/WhatsApp-25D366?style=for-the-badge&logo=whatsapp&logoColor=white" alt="whatsapp" />
|
|
55
|
-
</a>
|
|
56
|
-
<img src="https://dcbadge.limes.pink/api/server/https://discord.com/invite/yP8Uj9rAX9" alt="discord" />
|
|
72
|
+
Adds components, blocks and utilities, resolving their dependencies.
|
|
57
73
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
74
|
+
```bash
|
|
75
|
+
npx zard-cli add [components...]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
| Option | Description |
|
|
79
|
+
| --------------------- | -------------------------------------------------------------- |
|
|
80
|
+
| `-y, --yes` | Skip the confirmation prompt |
|
|
81
|
+
| `-o, --overwrite` | Overwrite existing files |
|
|
82
|
+
| `-c, --cwd <cwd>` | Working directory, defaults to the current one |
|
|
83
|
+
| `-a, --all` | Add every available component |
|
|
84
|
+
| `-p, --path <path>` | Write the components somewhere other than the configured alias |
|
|
85
|
+
| `--index-html <path>` | The index.html that receives the dark-mode theme script |
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npx zard-cli add dialog # one component
|
|
89
|
+
npx zard-cli add button card input # several at once
|
|
90
|
+
npx zard-cli add sidebar-07 # a block, with the components it needs
|
|
91
|
+
npx zard-cli add --all # everything
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Project types
|
|
95
|
+
|
|
96
|
+
The project type decides where the components live and what `init` configures. The paths below are the usual defaults: `init` derives the real ones from the project you pick, so an app outside the workspace root, or an Angular workspace that keeps its paths in `tsconfig.base.json`, gets those instead. Each path is also shown as an editable suggestion before anything is written.
|
|
97
|
+
|
|
98
|
+
| Type | Tailwind | TypeScript paths | Providers |
|
|
99
|
+
| ----------------- | -------------------------------------- | -------------------- | ---------------------------------- |
|
|
100
|
+
| `angular` | `.postcssrc.json` at the root | `tsconfig.json` | `src/app/app.config.ts` |
|
|
101
|
+
| `angular-library` | none: the consuming app owns the build | `tsconfig.json` | none |
|
|
102
|
+
| `nx` | `.postcssrc.json` inside the app | `tsconfig.base.json` | `apps/<app>/src/app/app.config.ts` |
|
|
103
|
+
| `nx-library` | none: the consuming app owns the build | `tsconfig.base.json` | none |
|
|
104
|
+
| `analog` | plugin in `vite.config.ts` | `tsconfig.json` | `src/app/app.config.ts` |
|
|
105
|
+
|
|
106
|
+
## Custom registry
|
|
107
|
+
|
|
108
|
+
The CLI installs from `https://zardui.com/r`. Point it at your own registry with an environment variable:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
ZARD_REGISTRY_URL=https://registry.acme.dev/r npx zard-cli add button
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Documentation
|
|
115
|
+
|
|
116
|
+
- [CLI guide](https://www.zardui.com/docs/cli): every option, the non-interactive mode and troubleshooting
|
|
117
|
+
- [Components](https://www.zardui.com/docs/components)
|
|
118
|
+
- [MCP server](https://www.zardui.com/docs/mcp): let your AI assistant install components through this CLI
|
|
119
|
+
|
|
120
|
+
## License
|
|
121
|
+
|
|
122
|
+
[MIT](https://github.com/zard-ui/zardui/blob/master/LICENSE.md)
|
|
@@ -2,5 +2,8 @@ import { Config } from '../../utils/config';
|
|
|
2
2
|
export declare function validateTargetPath(targetDir: string, projectRoot: string): void;
|
|
3
3
|
export declare function installComponent(componentName: string, targetDir: string, config: Config & {
|
|
4
4
|
resolvedPaths: any;
|
|
5
|
+
}, options?: {
|
|
6
|
+
customPath?: boolean;
|
|
7
|
+
isBlock?: boolean;
|
|
5
8
|
}): Promise<void>;
|
|
6
9
|
//# sourceMappingURL=component-installer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-installer.d.ts","sourceRoot":"","sources":["../../../src/commands/add/component-installer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"component-installer.d.ts","sourceRoot":"","sources":["../../../src/commands/add/component-installer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAO3C,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAS/E;AAED,wBAAsB,gBAAgB,CACpC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GAAG;IAAE,aAAa,EAAE,GAAG,CAAA;CAAE,EACvC,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GACxD,OAAO,CAAC,IAAI,CAAC,CA6Bf"}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
|
+
import { isPublishableLibrary } from '../../commands/init/library-peers.js';
|
|
1
2
|
import { CliError, InstallError } from '../../utils/errors.js';
|
|
2
3
|
import { logger } from '../../utils/logger.js';
|
|
3
|
-
import { fetchComponent } from '../../utils/registry.js';
|
|
4
|
+
import { fetchComponent, relativizeImports } from '../../utils/registry.js';
|
|
4
5
|
import { promises as fs } from 'node:fs';
|
|
5
6
|
import * as path from 'node:path';
|
|
6
7
|
export function validateTargetPath(targetDir, projectRoot) {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
// Comparing string prefixes let a sibling directory through: `/proj-evil`
|
|
9
|
+
// starts with `/proj` without being inside it. The relative path answers the
|
|
10
|
+
// right question — is it contained? — and normalizes any `..` along the way.
|
|
11
|
+
const relative = path.relative(path.resolve(projectRoot), path.resolve(targetDir));
|
|
12
|
+
if (relative.startsWith('..') || path.isAbsolute(relative)) {
|
|
9
13
|
throw new CliError('Target path must be within the project directory', 'INVALID_PATH');
|
|
10
14
|
}
|
|
11
15
|
}
|
|
12
|
-
export async function installComponent(componentName, targetDir, config) {
|
|
13
|
-
const component = await fetchComponent(componentName, config
|
|
16
|
+
export async function installComponent(componentName, targetDir, config, options = {}) {
|
|
17
|
+
const component = await fetchComponent(componentName, config, undefined, {
|
|
18
|
+
siblingComponents: options.customPath,
|
|
19
|
+
isBlock: options.isBlock,
|
|
20
|
+
});
|
|
14
21
|
await fs.mkdir(targetDir, { recursive: true });
|
|
15
22
|
const writtenFiles = [];
|
|
16
23
|
try {
|
|
17
24
|
for (const file of component.files) {
|
|
18
|
-
const filePath = await installComponentFile(file, targetDir);
|
|
25
|
+
const filePath = await installComponentFile(file, targetDir, libraryTargets(config));
|
|
19
26
|
writtenFiles.push(filePath);
|
|
20
27
|
}
|
|
21
28
|
}
|
|
@@ -30,11 +37,27 @@ export async function installComponent(componentName, targetDir, config) {
|
|
|
30
37
|
throw new InstallError(`Failed to install component "${componentName}": ${error instanceof Error ? error.message : error}`, componentName);
|
|
31
38
|
}
|
|
32
39
|
}
|
|
33
|
-
|
|
40
|
+
/**
|
|
41
|
+
* In a publishable library, the directory each alias stands for — `null` anywhere else.
|
|
42
|
+
*
|
|
43
|
+
* Applications keep the aliases, which their own build resolves. A library is
|
|
44
|
+
* bundled by ng-packagr, which leaves aliased imports external: see
|
|
45
|
+
* `relativizeImports`.
|
|
46
|
+
*/
|
|
47
|
+
function libraryTargets(config) {
|
|
48
|
+
if (!isPublishableLibrary(config, config.resolvedPaths['baseUrl']))
|
|
49
|
+
return null;
|
|
50
|
+
return Object.fromEntries(['components', 'utils', 'core', 'services', 'blocks'].map(key => [
|
|
51
|
+
config.aliases[key],
|
|
52
|
+
config.resolvedPaths[key],
|
|
53
|
+
]));
|
|
54
|
+
}
|
|
55
|
+
async function installComponentFile(file, targetDir, targets) {
|
|
34
56
|
const filePath = path.join(targetDir, file.name);
|
|
35
57
|
const fileDir = path.dirname(filePath);
|
|
58
|
+
const content = targets ? relativizeImports(file.content, filePath, targets) : file.content;
|
|
36
59
|
await fs.mkdir(fileDir, { recursive: true });
|
|
37
|
-
await fs.writeFile(filePath,
|
|
60
|
+
await fs.writeFile(filePath, content, 'utf8');
|
|
38
61
|
return filePath;
|
|
39
62
|
}
|
|
40
63
|
//# sourceMappingURL=component-installer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-installer.js","sourceRoot":"","sources":["../../../src/commands/add/component-installer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"component-installer.js","sourceRoot":"","sources":["../../../src/commands/add/component-installer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OA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IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IAE5F,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAE9C,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Works out which components the command should install, from its arguments.
|
|
3
|
+
*
|
|
4
|
+
* Returns an empty list when nothing was given: the wizard picks in that case
|
|
5
|
+
* (or, with no interactive terminal, the command fails asking for the names).
|
|
6
|
+
*/
|
|
1
7
|
export declare function selectComponents(components: string[], allFlag: boolean): Promise<string[]>;
|
|
2
8
|
//# sourceMappingURL=component-selector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-selector.d.ts","sourceRoot":"","sources":["../../../src/commands/add/component-selector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"component-selector.d.ts","sourceRoot":"","sources":["../../../src/commands/add/component-selector.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAGhG"}
|
|
@@ -1,31 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { getAllComponentNames } from '../../commands/add/dependency-resolver.js';
|
|
2
|
+
/**
|
|
3
|
+
* Works out which components the command should install, from its arguments.
|
|
4
|
+
*
|
|
5
|
+
* Returns an empty list when nothing was given: the wizard picks in that case
|
|
6
|
+
* (or, with no interactive terminal, the command fails asking for the names).
|
|
7
|
+
*/
|
|
4
8
|
export async function selectComponents(components, allFlag) {
|
|
5
|
-
if (allFlag)
|
|
9
|
+
if (allFlag)
|
|
6
10
|
return getAllComponentNames();
|
|
7
|
-
|
|
8
|
-
if (!components?.length) {
|
|
9
|
-
return await promptForComponents();
|
|
10
|
-
}
|
|
11
|
-
return components;
|
|
12
|
-
}
|
|
13
|
-
async function promptForComponents() {
|
|
14
|
-
const allNames = await getAllComponentNames();
|
|
15
|
-
const { components: selected } = await prompts({
|
|
16
|
-
type: 'multiselect',
|
|
17
|
-
name: 'components',
|
|
18
|
-
message: 'Which components would you like to add?',
|
|
19
|
-
hint: 'Space to select. A to toggle all. Enter to submit.',
|
|
20
|
-
choices: allNames.map(name => ({
|
|
21
|
-
title: name,
|
|
22
|
-
value: name,
|
|
23
|
-
})),
|
|
24
|
-
});
|
|
25
|
-
if (!selected?.length) {
|
|
26
|
-
logger.warn('No components selected. Exiting.');
|
|
27
|
-
process.exit(0);
|
|
28
|
-
}
|
|
29
|
-
return selected;
|
|
11
|
+
return components ?? [];
|
|
30
12
|
}
|
|
31
13
|
//# sourceMappingURL=component-selector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-selector.js","sourceRoot":"","sources":["../../../src/commands/add/component-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"component-selector.js","sourceRoot":"","sources":["../../../src/commands/add/component-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,UAAoB,EAAE,OAAgB;IAC3E,IAAI,OAAO;QAAE,OAAO,oBAAoB,EAAE,CAAC;IAC3C,OAAO,UAAU,IAAI,EAAE,CAAC;AAC1B,CAAC"}
|
|
@@ -3,7 +3,9 @@ export declare function updateProvideZardWithDarkMode(cwd: string, resolvedConfi
|
|
|
3
3
|
resolvedPaths: {
|
|
4
4
|
core: string;
|
|
5
5
|
services: string;
|
|
6
|
+
baseUrl: string;
|
|
6
7
|
};
|
|
7
8
|
aliases?: Config['aliases'];
|
|
9
|
+
projectType?: Config['projectType'];
|
|
8
10
|
}): Promise<void>;
|
|
9
11
|
//# sourceMappingURL=dark-mode-setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dark-mode-setup.d.ts","sourceRoot":"","sources":["../../../src/commands/add/dark-mode-setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dark-mode-setup.d.ts","sourceRoot":"","sources":["../../../src/commands/add/dark-mode-setup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAmCnD,wBAAsB,6BAA6B,CACjD,GAAG,EAAE,MAAM,EACX,cAAc,EAAE;IACd,aAAa,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;CACrC,GACA,OAAO,CAAC,IAAI,CAAC,CAwCf"}
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
import { isPublishableLibrary } from '../../commands/init/library-peers.js';
|
|
1
2
|
import { logger } from '../../utils/logger.js';
|
|
3
|
+
import { withImport } from '../../utils/source-file.js';
|
|
2
4
|
import { existsSync } from 'fs';
|
|
3
5
|
import * as fsPromises from 'fs/promises';
|
|
4
6
|
import * as path from 'path';
|
|
5
7
|
function getDarkModeImport(servicesAlias) {
|
|
6
8
|
return `import { ZardDarkMode } from '${servicesAlias ?? '@/shared/services'}/dark-mode';`;
|
|
7
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* How providezard.ts reaches the services folder.
|
|
12
|
+
*
|
|
13
|
+
* An application keeps the alias. A library imports it relatively: ng-packagr
|
|
14
|
+
* leaves aliased imports external, and the published package would point at a
|
|
15
|
+
* path only the library's workspace maps — see `relativizeImports`.
|
|
16
|
+
*/
|
|
17
|
+
function servicesSpecifier(provideZardPath, resolvedConfig) {
|
|
18
|
+
if (!isPublishableLibrary(resolvedConfig, resolvedConfig.resolvedPaths.baseUrl)) {
|
|
19
|
+
return resolvedConfig.aliases?.services;
|
|
20
|
+
}
|
|
21
|
+
return path.relative(path.dirname(provideZardPath), resolvedConfig.resolvedPaths.services).split(path.sep).join('/');
|
|
22
|
+
}
|
|
8
23
|
const DARK_MODE_INITIALIZER = 'provideAppInitializer(() => inject(ZardDarkMode).init())';
|
|
9
24
|
export async function updateProvideZardWithDarkMode(cwd, resolvedConfig) {
|
|
10
25
|
const provideZardPath = path.join(resolvedConfig.resolvedPaths.core, 'provider/providezard.ts');
|
|
@@ -23,17 +38,7 @@ export async function updateProvideZardWithDarkMode(cwd, resolvedConfig) {
|
|
|
23
38
|
if (!content.includes('provideAppInitializer')) {
|
|
24
39
|
content = content.replace(/import \{ (.*) \} from '@angular\/core';/, "import { $1, provideAppInitializer } from '@angular/core';");
|
|
25
40
|
}
|
|
26
|
-
|
|
27
|
-
let lastImportMatch = null;
|
|
28
|
-
let match;
|
|
29
|
-
while ((match = importRegex.exec(content)) !== null) {
|
|
30
|
-
lastImportMatch = match;
|
|
31
|
-
}
|
|
32
|
-
if (lastImportMatch) {
|
|
33
|
-
const insertionIndex = lastImportMatch.index + lastImportMatch[0].length;
|
|
34
|
-
const darkModeImport = getDarkModeImport(resolvedConfig.aliases?.services);
|
|
35
|
-
content = content.slice(0, insertionIndex) + darkModeImport + '\n' + content.slice(insertionIndex);
|
|
36
|
-
}
|
|
41
|
+
content = withImport(content, getDarkModeImport(servicesSpecifier(provideZardPath, resolvedConfig)));
|
|
37
42
|
content = content.replace(/return makeEnvironmentProviders\(\[(.*?)\]\);/s, (match, providers) => {
|
|
38
43
|
const trimmedProviders = providers.trim();
|
|
39
44
|
if (trimmedProviders) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dark-mode-setup.js","sourceRoot":"","sources":["../../../src/commands/add/dark-mode-setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dark-mode-setup.js","sourceRoot":"","sources":["../../../src/commands/add/dark-mode-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,SAAS,iBAAiB,CAAC,aAAsB;IAC/C,OAAO,iCAAiC,aAAa,IAAI,mBAAmB,cAAc,CAAC;AAC7F,CAAC;AAED;;;;;;GAMG;AACH,SAAS,iBAAiB,CACxB,eAAuB,EACvB,cAIC;IAED,IAAI,CAAC,oBAAoB,CAAC,cAAc,EAAE,cAAc,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QAChF,OAAO,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC;IAC1C,CAAC;IAED,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvH,CAAC;AAED,MAAM,qBAAqB,GAAG,0DAA0D,CAAC;AAEzF,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,GAAW,EACX,cAI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S,CAAC,eAAe,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { Config } from '../../utils/config.js';
|
|
2
|
-
import { type RegistryIndex } from '../../utils/registry.js';
|
|
2
|
+
import { type RegistryIcons, type RegistryIndex } from '../../utils/registry.js';
|
|
3
|
+
export declare function isItemInstalled(dir: string, files: readonly string[]): boolean;
|
|
3
4
|
export declare function getTargetDir(component: ComponentMeta, resolvedConfig: Config & {
|
|
4
5
|
resolvedPaths: any;
|
|
5
6
|
}, cwd: string, customPath?: string): string;
|
|
6
7
|
export interface ComponentMeta {
|
|
7
8
|
name: string;
|
|
8
9
|
basePath?: string;
|
|
10
|
+
/** Blocks are fetched from `/blocks/` and written one directory per block. */
|
|
11
|
+
isBlock?: boolean;
|
|
12
|
+
files?: string[];
|
|
9
13
|
dependencies?: string[];
|
|
10
14
|
devDependencies?: string[];
|
|
11
15
|
registryDependencies?: string[];
|
|
16
|
+
icons?: RegistryIcons;
|
|
12
17
|
}
|
|
13
18
|
export interface ResolvedDependencies {
|
|
14
19
|
componentsToInstall: ComponentMeta[];
|
|
@@ -17,6 +22,8 @@ export interface ResolvedDependencies {
|
|
|
17
22
|
export declare function getRegistryIndex(forceRefresh?: boolean): Promise<RegistryIndex>;
|
|
18
23
|
export declare function getComponentMeta(name: string): Promise<ComponentMeta | undefined>;
|
|
19
24
|
export declare function getAllComponentNames(): Promise<string[]>;
|
|
25
|
+
/** Everything `add` accepts by name: components first, then blocks. */
|
|
26
|
+
export declare function getAllInstallableNames(): Promise<string[]>;
|
|
20
27
|
export declare function resolveDependencies(selectedComponents: string[], resolvedConfig: Config & {
|
|
21
28
|
resolvedPaths: any;
|
|
22
29
|
}, cwd: string, options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-resolver.d.ts","sourceRoot":"","sources":["../../../src/commands/add/dependency-resolver.ts"],"names":[],"mappings":"
|
|
1
|
+
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wBAAsB,sBAAsB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAGhE;AAED,wBAAsB,mBAAmB,CACvC,kBAAkB,EAAE,MAAM,EAAE,EAC5B,cAAc,EAAE,MAAM,GAAG;IAAE,aAAa,EAAE,GAAG,CAAA;CAAE,EAC/C,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7D,OAAO,CAAC,oBAAoB,CAAC,CA4C/B"}
|
|
@@ -1,20 +1,50 @@
|
|
|
1
|
-
import { existsSync
|
|
1
|
+
import { existsSync } from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
|
+
import { iconPackagesFor } from '../../core/icons/index.js';
|
|
4
|
+
import { iconCatalog } from '../../utils/icon-catalog.js';
|
|
3
5
|
import { logger } from '../../utils/logger.js';
|
|
4
|
-
import { fetchRegistryIndex, invalidateRegistryCache } from '../../utils/registry.js';
|
|
5
|
-
|
|
6
|
+
import { fetchBlocksIndex, fetchRegistryIndex, getAvailableBlocks, invalidateRegistryCache, } from '../../utils/registry.js';
|
|
7
|
+
/*
|
|
8
|
+
* An item is installed when every file it declares already exists.
|
|
9
|
+
*
|
|
10
|
+
* The old question was "does the directory hold any file?", which only works
|
|
11
|
+
* for an item that lives alone. Typeset is written next to the project's
|
|
12
|
+
* global stylesheet, a directory that is never empty — it would be skipped
|
|
13
|
+
* every time. On the way, a half-installed item is now completed, not skipped.
|
|
14
|
+
*/
|
|
15
|
+
export function isItemInstalled(dir, files) {
|
|
6
16
|
if (!existsSync(dir))
|
|
7
17
|
return false;
|
|
8
|
-
|
|
9
|
-
const files = readdirSync(dir);
|
|
10
|
-
return files.length > 0;
|
|
11
|
-
}
|
|
12
|
-
catch {
|
|
18
|
+
if (!files.length)
|
|
13
19
|
return false;
|
|
14
|
-
|
|
20
|
+
return files.every(file => existsSync(path.join(dir, file)));
|
|
15
21
|
}
|
|
16
22
|
export function getTargetDir(component, resolvedConfig, cwd, customPath) {
|
|
17
23
|
const basePath = component.basePath ?? component.name;
|
|
24
|
+
/*
|
|
25
|
+
* A stylesheet goes next to the global CSS declared in components.json, not
|
|
26
|
+
* inside components/. That is what lets the `@import './typeset.css'` the
|
|
27
|
+
* setup injects resolve without a brittle relative path.
|
|
28
|
+
*
|
|
29
|
+
* It comes before `customPath` on purpose: --path moves components, and a
|
|
30
|
+
* stylesheet that moved with them would be imported from a directory it does
|
|
31
|
+
* not sit in — the install would report success and style nothing.
|
|
32
|
+
*/
|
|
33
|
+
if (basePath === 'styles') {
|
|
34
|
+
return path.dirname(resolvedConfig.resolvedPaths.tailwindCss);
|
|
35
|
+
}
|
|
36
|
+
/*
|
|
37
|
+
* A block is a folder, not a file: it brings up to 22 sources that only make
|
|
38
|
+
* sense together, so each one gets a directory of its own under the blocks
|
|
39
|
+
* alias — or under `--path`, for the same reason components honour it.
|
|
40
|
+
*
|
|
41
|
+
* Before the generic `--path` branch: that one appends the basePath, which
|
|
42
|
+
* would drop every block into a shared `<path>/blocks` and mix their files.
|
|
43
|
+
*/
|
|
44
|
+
if (basePath === 'blocks') {
|
|
45
|
+
const root = customPath ? path.resolve(cwd, customPath) : resolvedConfig.resolvedPaths.blocks;
|
|
46
|
+
return path.join(root, component.name);
|
|
47
|
+
}
|
|
18
48
|
if (customPath) {
|
|
19
49
|
return path.resolve(cwd, customPath, basePath);
|
|
20
50
|
}
|
|
@@ -38,20 +68,46 @@ export async function getRegistryIndex(forceRefresh = false) {
|
|
|
38
68
|
export async function getComponentMeta(name) {
|
|
39
69
|
const index = await getRegistryIndex();
|
|
40
70
|
const item = index.items.find(i => i.name === name);
|
|
71
|
+
// Blocks live in a separate index, and a block id never collides with a
|
|
72
|
+
// component name — so the component registry answers first and blocks fill in.
|
|
41
73
|
if (!item)
|
|
42
|
-
return
|
|
74
|
+
return getBlockMeta(name);
|
|
43
75
|
return {
|
|
44
76
|
name: item.name,
|
|
45
77
|
basePath: item.basePath,
|
|
78
|
+
files: item.files,
|
|
46
79
|
dependencies: item.dependencies,
|
|
47
80
|
devDependencies: item.devDependencies,
|
|
48
81
|
registryDependencies: item.registryDependencies,
|
|
82
|
+
icons: item.icons,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** The block behind an id, as a `ComponentMeta` the installer can carry. */
|
|
86
|
+
async function getBlockMeta(name) {
|
|
87
|
+
const blocks = await fetchBlocksIndex();
|
|
88
|
+
const block = blocks.blocks.find(entry => entry.id === name);
|
|
89
|
+
if (!block)
|
|
90
|
+
return undefined;
|
|
91
|
+
return {
|
|
92
|
+
name: block.id,
|
|
93
|
+
basePath: 'blocks',
|
|
94
|
+
isBlock: true,
|
|
95
|
+
// The index does not list a block's files, so `isItemInstalled` cannot tell
|
|
96
|
+
// whether it is already there. Re-adding a block rewrites it, which is the
|
|
97
|
+
// safe end of that trade.
|
|
98
|
+
dependencies: block.dependencies,
|
|
99
|
+
registryDependencies: block.registryDependencies,
|
|
49
100
|
};
|
|
50
101
|
}
|
|
51
102
|
export async function getAllComponentNames() {
|
|
52
103
|
const index = await getRegistryIndex();
|
|
53
104
|
return index.items.map(item => item.name);
|
|
54
105
|
}
|
|
106
|
+
/** Everything `add` accepts by name: components first, then blocks. */
|
|
107
|
+
export async function getAllInstallableNames() {
|
|
108
|
+
const [components, blocks] = await Promise.all([getAllComponentNames(), getAvailableBlocks()]);
|
|
109
|
+
return [...components, ...blocks];
|
|
110
|
+
}
|
|
55
111
|
export async function resolveDependencies(selectedComponents, resolvedConfig, cwd, options) {
|
|
56
112
|
const componentMetas = [];
|
|
57
113
|
for (const name of selectedComponents) {
|
|
@@ -68,11 +124,11 @@ export async function resolveDependencies(selectedComponents, resolvedConfig, cw
|
|
|
68
124
|
const componentsToInstall = [];
|
|
69
125
|
for (const component of componentMetas) {
|
|
70
126
|
const targetDir = getTargetDir(component, resolvedConfig, cwd, options.path);
|
|
71
|
-
if (
|
|
127
|
+
if (isItemInstalled(targetDir, component.files ?? []) && !options.overwrite) {
|
|
72
128
|
continue;
|
|
73
129
|
}
|
|
74
130
|
componentsToInstall.push(component);
|
|
75
|
-
addComponentDependencies(component, dependenciesToInstall);
|
|
131
|
+
addComponentDependencies(component, dependenciesToInstall, resolvedConfig.icons);
|
|
76
132
|
if (component.registryDependencies && !options.all) {
|
|
77
133
|
await resolveRegistryDependencies(component, componentsToInstall, dependenciesToInstall, resolvedConfig, cwd, options);
|
|
78
134
|
}
|
|
@@ -82,22 +138,37 @@ export async function resolveDependencies(selectedComponents, resolvedConfig, cw
|
|
|
82
138
|
dependenciesToInstall,
|
|
83
139
|
};
|
|
84
140
|
}
|
|
85
|
-
|
|
141
|
+
/**
|
|
142
|
+
* The npm dependencies the component requires.
|
|
143
|
+
*
|
|
144
|
+
* Beyond the declared ones, anything that draws icons needs ng-icons and the
|
|
145
|
+
* package of the configured family. That does not come from the registry: the
|
|
146
|
+
* registry publishes WHICH icons a component uses, and which family they come
|
|
147
|
+
* from is the installing project's decision. Installing inside `add` also
|
|
148
|
+
* covers anyone who switched family after init.
|
|
149
|
+
*/
|
|
150
|
+
function addComponentDependencies(component, dependenciesToInstall, iconFamily) {
|
|
86
151
|
component.dependencies?.forEach(dep => dependenciesToInstall.add(dep));
|
|
152
|
+
if (component.icons?.symbols?.length) {
|
|
153
|
+
iconPackagesFor(iconFamily, iconCatalog()).forEach(pkg => dependenciesToInstall.add(pkg));
|
|
154
|
+
}
|
|
87
155
|
}
|
|
88
156
|
async function resolveRegistryDependencies(component, componentsToInstall, dependenciesToInstall, resolvedConfig, cwd, options) {
|
|
89
157
|
if (!component.registryDependencies)
|
|
90
158
|
return;
|
|
91
159
|
for (const dep of component.registryDependencies) {
|
|
92
160
|
const depComponent = await getComponentMeta(dep);
|
|
93
|
-
if (!depComponent)
|
|
161
|
+
if (!depComponent) {
|
|
162
|
+
logger.warn(`"${component.name}" depends on "${dep}", which the registry does not publish. ` +
|
|
163
|
+
'The component may not compile — please report it.');
|
|
94
164
|
continue;
|
|
165
|
+
}
|
|
95
166
|
if (componentsToInstall.find(c => c.name === dep))
|
|
96
167
|
continue;
|
|
97
168
|
const depTargetDir = getTargetDir(depComponent, resolvedConfig, cwd, options.path);
|
|
98
|
-
if (!
|
|
169
|
+
if (!isItemInstalled(depTargetDir, depComponent.files ?? []) || options.overwrite) {
|
|
99
170
|
componentsToInstall.push(depComponent);
|
|
100
|
-
addComponentDependencies(depComponent, dependenciesToInstall);
|
|
171
|
+
addComponentDependencies(depComponent, dependenciesToInstall, resolvedConfig.icons);
|
|
101
172
|
if (depComponent.registryDependencies) {
|
|
102
173
|
await resolveRegistryDependencies(depComponent, componentsToInstall, dependenciesToInstall, resolvedConfig, cwd, options);
|
|
103
174
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-resolver.js","sourceRoot":"","sources":["../../../src/commands/add/dependency-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"dependency-resolver.js","sourceRoot":"","sources":["../../../src/commands/add/dependency-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,GAGxB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,KAAwB;IACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACnC,IAAI,CAAC,KAA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