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.
Files changed (258) hide show
  1. package/README.md +98 -36
  2. package/commands/add/component-installer.d.ts +3 -0
  3. package/commands/add/component-installer.d.ts.map +1 -1
  4. package/commands/add/component-installer.js +31 -8
  5. package/commands/add/component-installer.js.map +1 -1
  6. package/commands/add/component-selector.d.ts +6 -0
  7. package/commands/add/component-selector.d.ts.map +1 -1
  8. package/commands/add/component-selector.js +9 -27
  9. package/commands/add/component-selector.js.map +1 -1
  10. package/commands/add/dark-mode-setup.d.ts +2 -0
  11. package/commands/add/dark-mode-setup.d.ts.map +1 -1
  12. package/commands/add/dark-mode-setup.js +16 -11
  13. package/commands/add/dark-mode-setup.js.map +1 -1
  14. package/commands/add/dependency-resolver.d.ts +8 -1
  15. package/commands/add/dependency-resolver.d.ts.map +1 -1
  16. package/commands/add/dependency-resolver.js +87 -16
  17. package/commands/add/dependency-resolver.js.map +1 -1
  18. package/commands/add/index.d.ts.map +1 -1
  19. package/commands/add/index.js +142 -96
  20. package/commands/add/index.js.map +1 -1
  21. package/commands/add/stylesheet-setup.d.ts +3 -0
  22. package/commands/add/stylesheet-setup.d.ts.map +1 -0
  23. package/commands/add/stylesheet-setup.js +92 -0
  24. package/commands/add/stylesheet-setup.js.map +1 -0
  25. package/commands/add/wizard.d.ts +35 -0
  26. package/commands/add/wizard.d.ts.map +1 -0
  27. package/commands/add/wizard.js +299 -0
  28. package/commands/add/wizard.js.map +1 -0
  29. package/commands/init/config-prompter.d.ts +65 -3
  30. package/commands/init/config-prompter.d.ts.map +1 -1
  31. package/commands/init/config-prompter.js +93 -74
  32. package/commands/init/config-prompter.js.map +1 -1
  33. package/commands/init/dependencies.d.ts +1 -8
  34. package/commands/init/dependencies.d.ts.map +1 -1
  35. package/commands/init/dependencies.js +54 -24
  36. package/commands/init/dependencies.js.map +1 -1
  37. package/commands/init/index.d.ts.map +1 -1
  38. package/commands/init/index.js +175 -81
  39. package/commands/init/index.js.map +1 -1
  40. package/commands/init/library-peers.d.ts +28 -0
  41. package/commands/init/library-peers.d.ts.map +1 -0
  42. package/commands/init/library-peers.js +61 -0
  43. package/commands/init/library-peers.js.map +1 -0
  44. package/commands/init/project-kind.d.ts +82 -0
  45. package/commands/init/project-kind.d.ts.map +1 -0
  46. package/commands/init/project-kind.js +166 -0
  47. package/commands/init/project-kind.js.map +1 -0
  48. package/commands/init/steps.d.ts +15 -0
  49. package/commands/init/steps.d.ts.map +1 -0
  50. package/commands/init/steps.js +188 -0
  51. package/commands/init/steps.js.map +1 -0
  52. package/commands/init/tailwind-setup.d.ts +9 -2
  53. package/commands/init/tailwind-setup.d.ts.map +1 -1
  54. package/commands/init/tailwind-setup.js +47 -12
  55. package/commands/init/tailwind-setup.js.map +1 -1
  56. package/commands/init/tsconfig-updater.d.ts +8 -1
  57. package/commands/init/tsconfig-updater.d.ts.map +1 -1
  58. package/commands/init/tsconfig-updater.js +30 -11
  59. package/commands/init/tsconfig-updater.js.map +1 -1
  60. package/commands/init/update-angular-config.d.ts.map +1 -1
  61. package/commands/init/update-angular-config.js +28 -50
  62. package/commands/init/update-angular-config.js.map +1 -1
  63. package/commands/init/vite-setup.d.ts +11 -0
  64. package/commands/init/vite-setup.d.ts.map +1 -0
  65. package/commands/init/vite-setup.js +61 -0
  66. package/commands/init/vite-setup.js.map +1 -0
  67. package/commands/init/wizard.d.ts +33 -0
  68. package/commands/init/wizard.d.ts.map +1 -0
  69. package/commands/init/wizard.js +561 -0
  70. package/commands/init/wizard.js.map +1 -0
  71. package/constants/app.constants.d.ts +17 -0
  72. package/constants/app.constants.d.ts.map +1 -1
  73. package/constants/app.constants.js +39 -16
  74. package/constants/app.constants.js.map +1 -1
  75. package/core/icons/families.d.ts +38 -0
  76. package/core/icons/families.d.ts.map +1 -0
  77. package/core/icons/families.js +26 -0
  78. package/core/icons/families.js.map +1 -0
  79. package/core/icons/icon-map.d.ts +24 -0
  80. package/core/icons/icon-map.d.ts.map +1 -0
  81. package/core/icons/icon-map.js +141 -0
  82. package/core/icons/icon-map.js.map +1 -0
  83. package/core/icons/index.d.ts +107 -0
  84. package/core/icons/index.d.ts.map +1 -0
  85. package/core/icons/index.js +183 -0
  86. package/core/icons/index.js.map +1 -0
  87. package/core/registry/registry-data.d.ts.map +1 -1
  88. package/core/registry/registry-data.js +498 -36
  89. package/core/registry/registry-data.js.map +1 -1
  90. package/core/themes/theme-definitions.d.ts.map +1 -1
  91. package/core/themes/theme-definitions.js +61 -72
  92. package/core/themes/theme-definitions.js.map +1 -1
  93. package/index.js +6 -3
  94. package/index.js.map +1 -1
  95. package/package.json +6 -11
  96. package/ui/blocks.d.ts +71 -0
  97. package/ui/blocks.d.ts.map +1 -0
  98. package/ui/blocks.js +116 -0
  99. package/ui/blocks.js.map +1 -0
  100. package/ui/brand.d.ts +14 -0
  101. package/ui/brand.d.ts.map +1 -0
  102. package/ui/brand.js +35 -0
  103. package/ui/brand.js.map +1 -0
  104. package/ui/engine/animation/index.d.ts +38 -0
  105. package/ui/engine/animation/index.d.ts.map +1 -0
  106. package/ui/engine/animation/index.js +102 -0
  107. package/ui/engine/animation/index.js.map +1 -0
  108. package/ui/engine/ansi/index.d.ts +51 -0
  109. package/ui/engine/ansi/index.d.ts.map +1 -0
  110. package/ui/engine/ansi/index.js +116 -0
  111. package/ui/engine/ansi/index.js.map +1 -0
  112. package/ui/engine/components/index.d.ts +211 -0
  113. package/ui/engine/components/index.d.ts.map +1 -0
  114. package/ui/engine/components/index.js +109 -0
  115. package/ui/engine/components/index.js.map +1 -0
  116. package/ui/engine/cursor/index.d.ts +16 -0
  117. package/ui/engine/cursor/index.d.ts.map +1 -0
  118. package/ui/engine/cursor/index.js +40 -0
  119. package/ui/engine/cursor/index.js.map +1 -0
  120. package/ui/engine/diff/index.d.ts +26 -0
  121. package/ui/engine/diff/index.d.ts.map +1 -0
  122. package/ui/engine/diff/index.js +56 -0
  123. package/ui/engine/diff/index.js.map +1 -0
  124. package/ui/engine/events/index.d.ts +24 -0
  125. package/ui/engine/events/index.d.ts.map +1 -0
  126. package/ui/engine/events/index.js +60 -0
  127. package/ui/engine/events/index.js.map +1 -0
  128. package/ui/engine/focus/index.d.ts +25 -0
  129. package/ui/engine/focus/index.d.ts.map +1 -0
  130. package/ui/engine/focus/index.js +77 -0
  131. package/ui/engine/focus/index.js.map +1 -0
  132. package/ui/engine/frame/index.d.ts +48 -0
  133. package/ui/engine/frame/index.d.ts.map +1 -0
  134. package/ui/engine/frame/index.js +0 -0
  135. package/ui/engine/frame/index.js.map +1 -0
  136. package/ui/engine/index.d.ts +28 -0
  137. package/ui/engine/index.d.ts.map +1 -0
  138. package/ui/engine/index.js +28 -0
  139. package/ui/engine/index.js.map +1 -0
  140. package/ui/engine/input/index.d.ts +36 -0
  141. package/ui/engine/input/index.d.ts.map +1 -0
  142. package/ui/engine/input/index.js +224 -0
  143. package/ui/engine/input/index.js.map +1 -0
  144. package/ui/engine/layout/index.d.ts +42 -0
  145. package/ui/engine/layout/index.d.ts.map +1 -0
  146. package/ui/engine/layout/index.js +241 -0
  147. package/ui/engine/layout/index.js.map +1 -0
  148. package/ui/engine/renderer/index.d.ts +43 -0
  149. package/ui/engine/renderer/index.d.ts.map +1 -0
  150. package/ui/engine/renderer/index.js +619 -0
  151. package/ui/engine/renderer/index.js.map +1 -0
  152. package/ui/engine/scheduler/index.d.ts +22 -0
  153. package/ui/engine/scheduler/index.d.ts.map +1 -0
  154. package/ui/engine/scheduler/index.js +77 -0
  155. package/ui/engine/scheduler/index.js.map +1 -0
  156. package/ui/engine/screen/index.d.ts +39 -0
  157. package/ui/engine/screen/index.d.ts.map +1 -0
  158. package/ui/engine/screen/index.js +255 -0
  159. package/ui/engine/screen/index.js.map +1 -0
  160. package/ui/engine/terminal/index.d.ts +84 -0
  161. package/ui/engine/terminal/index.d.ts.map +1 -0
  162. package/ui/engine/terminal/index.js +235 -0
  163. package/ui/engine/terminal/index.js.map +1 -0
  164. package/ui/engine/testing/index.d.ts +27 -0
  165. package/ui/engine/testing/index.d.ts.map +1 -0
  166. package/ui/engine/testing/index.js +63 -0
  167. package/ui/engine/testing/index.js.map +1 -0
  168. package/ui/engine/theme/index.d.ts +26 -0
  169. package/ui/engine/theme/index.d.ts.map +1 -0
  170. package/ui/engine/theme/index.js +128 -0
  171. package/ui/engine/theme/index.js.map +1 -0
  172. package/ui/engine/utils/index.d.ts +12 -0
  173. package/ui/engine/utils/index.d.ts.map +1 -0
  174. package/ui/engine/utils/index.js +143 -0
  175. package/ui/engine/utils/index.js.map +1 -0
  176. package/ui/gate.d.ts +19 -0
  177. package/ui/gate.d.ts.map +1 -0
  178. package/ui/gate.js +36 -0
  179. package/ui/gate.js.map +1 -0
  180. package/ui/index.d.ts +18 -0
  181. package/ui/index.d.ts.map +1 -0
  182. package/ui/index.js +18 -0
  183. package/ui/index.js.map +1 -0
  184. package/ui/log-sink.d.ts +24 -0
  185. package/ui/log-sink.d.ts.map +1 -0
  186. package/ui/log-sink.js +35 -0
  187. package/ui/log-sink.js.map +1 -0
  188. package/ui/output.d.ts +14 -0
  189. package/ui/output.d.ts.map +1 -0
  190. package/ui/output.js +28 -0
  191. package/ui/output.js.map +1 -0
  192. package/ui/report.d.ts +30 -0
  193. package/ui/report.d.ts.map +1 -0
  194. package/ui/report.js +45 -0
  195. package/ui/report.js.map +1 -0
  196. package/ui/runner.d.ts +66 -0
  197. package/ui/runner.d.ts.map +1 -0
  198. package/ui/runner.js +135 -0
  199. package/ui/runner.js.map +1 -0
  200. package/ui/style.d.ts +24 -0
  201. package/ui/style.d.ts.map +1 -0
  202. package/ui/style.js +44 -0
  203. package/ui/style.js.map +1 -0
  204. package/ui/testing/fake-tty.d.ts +26 -0
  205. package/ui/testing/fake-tty.d.ts.map +1 -0
  206. package/ui/testing/fake-tty.js +61 -0
  207. package/ui/testing/fake-tty.js.map +1 -0
  208. package/ui/text-input.d.ts +31 -0
  209. package/ui/text-input.d.ts.map +1 -0
  210. package/ui/text-input.js +89 -0
  211. package/ui/text-input.js.map +1 -0
  212. package/ui/theme.d.ts +10 -0
  213. package/ui/theme.d.ts.map +1 -0
  214. package/ui/theme.js +20 -0
  215. package/ui/theme.js.map +1 -0
  216. package/utils/angular-compat.d.ts +21 -0
  217. package/utils/angular-compat.d.ts.map +1 -0
  218. package/utils/angular-compat.js +52 -0
  219. package/utils/angular-compat.js.map +1 -0
  220. package/utils/config.d.ts +29 -0
  221. package/utils/config.d.ts.map +1 -1
  222. package/utils/config.js +50 -4
  223. package/utils/config.js.map +1 -1
  224. package/utils/errors.d.ts +11 -0
  225. package/utils/errors.d.ts.map +1 -1
  226. package/utils/errors.js +14 -0
  227. package/utils/errors.js.map +1 -1
  228. package/utils/get-project-info.d.ts +29 -0
  229. package/utils/get-project-info.d.ts.map +1 -1
  230. package/utils/get-project-info.js +246 -1
  231. package/utils/get-project-info.js.map +1 -1
  232. package/utils/http-client.d.ts.map +1 -1
  233. package/utils/http-client.js +18 -3
  234. package/utils/http-client.js.map +1 -1
  235. package/utils/icon-catalog.d.ts +34 -0
  236. package/utils/icon-catalog.d.ts.map +1 -0
  237. package/utils/icon-catalog.js +63 -0
  238. package/utils/icon-catalog.js.map +1 -0
  239. package/utils/logger.d.ts +13 -1
  240. package/utils/logger.d.ts.map +1 -1
  241. package/utils/logger.js +95 -15
  242. package/utils/logger.js.map +1 -1
  243. package/utils/package-manager.d.ts +42 -1
  244. package/utils/package-manager.d.ts.map +1 -1
  245. package/utils/package-manager.js +204 -11
  246. package/utils/package-manager.js.map +1 -1
  247. package/utils/registry.d.ts +106 -2
  248. package/utils/registry.d.ts.map +1 -1
  249. package/utils/registry.js +155 -21
  250. package/utils/registry.js.map +1 -1
  251. package/utils/schema-version.d.ts +21 -0
  252. package/utils/schema-version.d.ts.map +1 -0
  253. package/utils/schema-version.js +28 -0
  254. package/utils/schema-version.js.map +1 -0
  255. package/utils/source-file.d.ts +40 -0
  256. package/utils/source-file.d.ts.map +1 -0
  257. package/utils/source-file.js +104 -0
  258. package/utils/source-file.js.map +1 -0
@@ -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,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGpF,MAAM,MAAM,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;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAOvE"}
@@ -0,0 +1,166 @@
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 * as path from 'node:path';
16
+ /**
17
+ * The colour of each ecosystem in the menu.
18
+ *
19
+ * Angular stays the base white — it is the default case, and giving it a colour
20
+ * would suggest it is a special option among the others.
21
+ */
22
+ const ANGULAR = '#fafafa';
23
+ const NX = '#6aa9ff';
24
+ const ANALOG = '#fb7185';
25
+ /**
26
+ * Menu order: each ecosystem with the application before the library, from the
27
+ * most common to the rarest. Angular opens the list because it is the default.
28
+ */
29
+ export const PROJECT_KINDS = [
30
+ {
31
+ value: 'angular',
32
+ label: 'Angular',
33
+ detail: 'Application — providers in app.config.ts, tokens in the global CSS.',
34
+ color: ANGULAR,
35
+ },
36
+ {
37
+ value: 'angular-library',
38
+ label: 'Angular Library',
39
+ detail: 'Publishable library — components ship with it, no app providers.',
40
+ color: ANGULAR,
41
+ },
42
+ {
43
+ value: 'nx',
44
+ label: 'Nx',
45
+ detail: 'Application inside an Nx workspace — paths go to tsconfig.base.json.',
46
+ color: NX,
47
+ },
48
+ {
49
+ value: 'nx-library',
50
+ label: 'Nx Library',
51
+ detail: 'Library inside an Nx workspace — lives in libs/, no app providers.',
52
+ color: NX,
53
+ },
54
+ {
55
+ value: 'analog',
56
+ label: 'Analog.js',
57
+ detail: 'Vite-powered Angular app — Tailwind is a Vite plugin, not PostCSS.',
58
+ color: ANALOG,
59
+ },
60
+ ];
61
+ const TRAITS = {
62
+ angular: { isLibrary: false, workspace: 'angular', bundler: 'angular', fallbackRoot: '' },
63
+ analog: { isLibrary: false, workspace: 'angular', bundler: 'vite', fallbackRoot: '' },
64
+ nx: { isLibrary: false, workspace: 'nx', bundler: 'angular', fallbackRoot: 'apps/app' },
65
+ 'angular-library': { isLibrary: true, workspace: 'angular', bundler: 'angular', fallbackRoot: 'projects/ui' },
66
+ 'nx-library': { isLibrary: true, workspace: 'nx', bundler: 'angular', fallbackRoot: 'libs/ui' },
67
+ };
68
+ export function isLibraryKind(kind) {
69
+ return TRAITS[kind]?.isLibrary ?? false;
70
+ }
71
+ /** Where the TypeScript paths have to be written for the project to see them. */
72
+ export function tsconfigFileFor(kind, projectInfo) {
73
+ // Nx extends a tsconfig.base.json at the root; writing into the tsconfig.json
74
+ // there would reach no project at all. Outside Nx the tsconfig.json itself is
75
+ // the target, unless the workspace already keeps a base — then that one wins.
76
+ if (TRAITS[kind].workspace === 'nx')
77
+ return 'tsconfig.base.json';
78
+ return projectInfo.tsconfigFile;
79
+ }
80
+ /** Se o Tailwind entra pelo PostCSS do Angular ou pelo plugin do Vite. */
81
+ export function bundlerFor(kind) {
82
+ return TRAITS[kind].bundler;
83
+ }
84
+ /**
85
+ * The workspace projects that can receive the install.
86
+ *
87
+ * Once the type is chosen, only what matches it makes sense to offer: asking
88
+ * someone who chose "library" to install into an application would offer a
89
+ * target the following steps do not know how to configure.
90
+ */
91
+ export function candidateProjects(kind, projectInfo) {
92
+ const wanted = TRAITS[kind].isLibrary ? 'library' : 'application';
93
+ return projectInfo.projects.filter(project => project.projectType === wanted);
94
+ }
95
+ /** Default root when the workspace declares no compatible project. */
96
+ export function fallbackRootFor(kind) {
97
+ return TRAITS[kind].fallbackRoot;
98
+ }
99
+ /**
100
+ * The type the headless path assumes.
101
+ *
102
+ * With no interactive terminal nobody answers the first question, so here — and
103
+ * only here — the workspace decides: the manager gives the world (Nx or
104
+ * Angular), Analog announces itself through its own dependencies, and the
105
+ * absence of any application is what suggests the target is a library.
106
+ */
107
+ export function detectProjectKind(projectInfo) {
108
+ const hasApplication = projectInfo.projects.some(project => project.projectType === 'application');
109
+ const hasLibrary = projectInfo.projects.some(project => project.projectType === 'library');
110
+ const isLibraryWorkspace = !hasApplication && hasLibrary;
111
+ if (projectInfo.hasNx)
112
+ return isLibraryWorkspace ? 'nx-library' : 'nx';
113
+ if (isLibraryWorkspace)
114
+ return 'angular-library';
115
+ return projectInfo.hasAnalog ? 'analog' : 'angular';
116
+ }
117
+ /**
118
+ * Where a library's code lives.
119
+ *
120
+ * `src/lib` is the convention for both `ng generate library` and
121
+ * `nx g @nx/angular:library`: `src/` holds the public entry point, and
122
+ * everything it exports sits in `src/lib`.
123
+ */
124
+ export function libraryBaseUrl(libraryRoot) {
125
+ return `${trimSlashes(libraryRoot)}/src/lib`;
126
+ }
127
+ /** The theme CSS the library starts exposing to whoever consumes it. */
128
+ export function libraryStylesPath(libraryRoot) {
129
+ return `${trimSlashes(libraryRoot)}/src/styles.css`;
130
+ }
131
+ /**
132
+ * The project root, derived from `baseUrl`.
133
+ *
134
+ * Both layouts end two levels below the root — `<root>/src/app` in an
135
+ * application, `<root>/src/lib` in a library — so going up two levels gives the
136
+ * directory holding that project's `project.json`, `ng-package.json` and
137
+ * `.postcssrc.json`. A single app at the root gives `.`.
138
+ */
139
+ export function projectRootOf(baseUrl) {
140
+ return path.posix.normalize(path.posix.join(toPosix(baseUrl), '..', '..'));
141
+ }
142
+ /** The project's source directory — where `index.html` and `main.ts` sit. */
143
+ export function sourceRootOf(baseUrl) {
144
+ return path.posix.dirname(toPosix(baseUrl));
145
+ }
146
+ /**
147
+ * Where to look for the project's `index.html`.
148
+ *
149
+ * In Analog it is Vite's entry page and sits at the project root, not in `src/`
150
+ * as in the Angular build — suggesting the wrong path made `add dark-mode` fail
151
+ * right after asking.
152
+ */
153
+ export function indexHtmlFor(kind, baseUrl) {
154
+ if (kind === 'analog') {
155
+ const root = projectRootOf(baseUrl);
156
+ return root === '.' ? 'index.html' : `${root}/index.html`;
157
+ }
158
+ return `${sourceRootOf(baseUrl)}/index.html`;
159
+ }
160
+ function toPosix(value) {
161
+ return value.replace(/\\/g, '/');
162
+ }
163
+ function trimSlashes(value) {
164
+ return value.replace(/\/+$/, '');
165
+ }
166
+ //# sourceMappingURL=project-kind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-kind.js","sourceRoot":"","sources":["../../../src/commands/init/project-kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAYlC;;;;;GAKG;AACH,MAAM,OAAO,GAAG,SAAS,CAAC;AAC1B,MAAM,EAAE,GAAG,SAAS,CAAC;AACrB,MAAM,MAAM,GAAG,SAAS,CAAC;AAEzB;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAiC;IACzD;QACE,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,qEAAqE;QAC7E,KAAK,EAAE,OAAO;KACf;IACD;QACE,KAAK,EAAE,iBAAiB;QACxB,KAAK,EAAE,iBAAiB;QACxB,MAAM,EAAE,kEAAkE;QAC1E,KAAK,EAAE,OAAO;KACf;IACD;QACE,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,sEAAsE;QAC9E,KAAK,EAAE,EAAE;KACV;IACD;QACE,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,YAAY;QACnB,MAAM,EAAE,oEAAoE;QAC5E,KAAK,EAAE,EAAE;KACV;IACD;QACE,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE,oEAAoE;QAC5E,KAAK,EAAE,MAAM;KACd;CACF,CAAC;AAaF,MAAM,MAAM,GAAoC;IAC9C,OAAO,EAAE,EAAE,SAAS,EAAE,KA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CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,IAAiB,EAAE,OAAe;IAC7D,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;QACpC,OAAO,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,aAAa,CAAC;IAC5D,CAAC;IAED,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC;AAC/C,CAAC;AAED,SAAS,OAAO,CAAC,KAAa;IAC5B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { type Config } from '../../utils/config.js';
2
+ import { type ProjectInfo } from '../../utils/get-project-info.js';
3
+ /**
4
+ * One step of initialization: the label the UI shows and the work it does.
5
+ *
6
+ * The list is built once and consumed by both the wizard and the headless path,
7
+ * so the two run exactly the same sequence — the UI only decides how to present it.
8
+ */
9
+ export interface InitStep {
10
+ readonly label: string;
11
+ readonly note: string;
12
+ run(): Promise<void>;
13
+ }
14
+ export declare function buildInitSteps(cwd: string, config: Config, projectInfo: ProjectInfo, isReInitializing: boolean): InitStep[];
15
+ //# sourceMappingURL=steps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../../src/commands/init/steps.ts"],"names":[],"mappings":"AAQA,OAAO,EAAsB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAOlE;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACtB;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,OAAO,GACxB,QAAQ,EAAE,CA6DZ"}
@@ -0,0 +1,188 @@
1
+ import { installComponent } from '../../commands/add/component-installer.js';
2
+ import { installDependencies } from '../../commands/init/dependencies.js';
3
+ import { bundlerFor, isLibraryKind, projectRootOf, tsconfigFileFor } from '../../commands/init/project-kind.js';
4
+ import { applyThemeToStyles, createPostCssConfig } from '../../commands/init/tailwind-setup.js';
5
+ import { updateTsConfig } from '../../commands/init/tsconfig-updater.js';
6
+ import { updateAngularConfig } from '../../commands/init/update-angular-config.js';
7
+ import { setupVitePlugin } from '../../commands/init/vite-setup.js';
8
+ import { iconFamily } from '../../core/icons/index.js';
9
+ import { resolveConfigPaths } from '../../utils/config.js';
10
+ import { iconCatalog } from '../../utils/icon-catalog.js';
11
+ import { logger } from '../../utils/logger.js';
12
+ import { existsSync } from 'node:fs';
13
+ import { mkdir, readFile, writeFile } from 'node:fs/promises';
14
+ import * as path from 'node:path';
15
+ export function buildInitSteps(cwd, config, projectInfo, isReInitializing) {
16
+ const kind = config.projectType;
17
+ const isLibrary = isLibraryKind(kind);
18
+ const projectRoot = projectRootOf(config.baseUrl);
19
+ const tsconfigFile = tsconfigFileFor(kind, projectInfo);
20
+ const steps = [
21
+ {
22
+ label: 'components.json',
23
+ note: 'component & utils aliases',
24
+ run: async () => {
25
+ await writeFile(path.resolve(cwd, 'components.json'), JSON.stringify(config, null, 2), 'utf8');
26
+ },
27
+ },
28
+ {
29
+ label: 'dependencies',
30
+ note: `CDK, CVA, tailwind-merge, ng-icons (${iconFamily(config.icons, iconCatalog())?.label ?? config.icons})`,
31
+ run: () => installDependencies(cwd, config, projectInfo),
32
+ },
33
+ ];
34
+ // Application providers do not belong to the library: the app consuming it
35
+ // registers them, and a library has no app.config.ts to write into.
36
+ if (!isLibrary) {
37
+ steps.push({
38
+ label: config.appConfigFile,
39
+ note: 'zard/ui providers',
40
+ run: () => updateAngularConfig(cwd, config),
41
+ });
42
+ steps.push(tailwindPipelineStep(cwd, projectRoot, kind, projectInfo, isReInitializing));
43
+ }
44
+ steps.push({
45
+ label: config.tailwind.css,
46
+ note: `theme tokens (${config.tailwind.baseColor})`,
47
+ run: () => applyThemeToStyles(cwd, config),
48
+ });
49
+ if (isLibrary) {
50
+ steps.push({
51
+ label: 'ng-package.json',
52
+ note: 'ship the theme with the library',
53
+ run: () => registerStylesAsset(cwd, config),
54
+ });
55
+ }
56
+ steps.push({
57
+ label: tsconfigFile,
58
+ note: 'import path aliases',
59
+ run: () => updateTsConfig(cwd, config, tsconfigFile),
60
+ }, {
61
+ label: 'core & utils',
62
+ note: 'shared helpers used by every component',
63
+ run: () => installCoreDependencies(cwd, config),
64
+ });
65
+ return steps;
66
+ }
67
+ /**
68
+ * How Tailwind enters the application build.
69
+ *
70
+ * In Analog it is Vite that compiles, and Tailwind is one of its plugins — a
71
+ * `.postcssrc.json` there would be read by nobody. Everywhere else the Angular
72
+ * build loads PostCSS, and the file goes to the project root: in a workspace
73
+ * with several apps, writing it at the repository root would configure all of
74
+ * them at once.
75
+ */
76
+ function tailwindPipelineStep(cwd, projectRoot, kind, projectInfo, isReInitializing) {
77
+ if (bundlerFor(kind) === 'vite') {
78
+ return {
79
+ label: 'vite.config.ts',
80
+ note: 'Tailwind Vite plugin',
81
+ run: () => setupVitePlugin(cwd),
82
+ };
83
+ }
84
+ const relative = projectRoot === '.' ? '.postcssrc.json' : `${projectRoot}/.postcssrc.json`;
85
+ return {
86
+ label: relative,
87
+ note: 'Tailwind PostCSS plugin',
88
+ // Re-initializing rewrites the file on purpose: it is the chance to correct a
89
+ // `.postcssrc.json` left over from an earlier setup.
90
+ run: () => !projectInfo.hasTailwind || isReInitializing || !existsSync(path.resolve(cwd, relative))
91
+ ? createPostCssConfig(cwd, projectRoot)
92
+ : Promise.resolve(),
93
+ };
94
+ }
95
+ /**
96
+ * Declares the theme CSS as a library asset.
97
+ *
98
+ * ng-packagr only publishes what the entry point reaches; a loose `.css` in
99
+ * `src/` stays out of the package. Without this entry, the file the previous
100
+ * step wrote would exist only in the repository and never reach whoever
101
+ * installs the library.
102
+ *
103
+ * The asset is declared with `output: '/'` so it lands at the package root.
104
+ * Listing it as a plain path preserves the source folder, and the consumer would
105
+ * end up importing `<lib>/src/styles.css` — a `src/` that is a detail of the
106
+ * library's repository, not something whoever installs it should know.
107
+ */
108
+ async function registerStylesAsset(cwd, config) {
109
+ const libraryRoot = path.resolve(cwd, projectRootOf(config.baseUrl));
110
+ const ngPackagePath = path.join(libraryRoot, 'ng-package.json');
111
+ if (!existsSync(ngPackagePath)) {
112
+ // An Nx library only gets an ng-package.json when it is publishable; in the
113
+ // others there is no package to assemble and the CSS is consumed straight
114
+ // from the source.
115
+ logger.warn(`ng-package.json not found in ${path.relative(cwd, libraryRoot)}; skipping the theme asset.`);
116
+ return;
117
+ }
118
+ const relative = path.relative(libraryRoot, path.resolve(cwd, config.tailwind.css)).split(path.sep).join('/');
119
+ const input = path.posix.dirname(relative);
120
+ // Every stylesheet under the theme's folder, not just the theme: it imports
121
+ // the core's `zard.css` from `lib/shared/core/css`, and `add` writes
122
+ // `typeset.css` and `utilities.css` beside it. Shipping the theme alone left
123
+ // the published package with imports pointing at files it did not contain.
124
+ const entry = { glob: '**/*.css', input, output: '/' };
125
+ const ngPackage = JSON.parse(await readFile(ngPackagePath, 'utf8'));
126
+ const assets = Array.isArray(ngPackage.assets) ? ngPackage.assets : [];
127
+ // Old entries pointing at the same files are replaced, not accumulated: a
128
+ // repeated init would otherwise publish the CSS twice, in two places. That
129
+ // includes the entry earlier versions wrote for the theme file alone.
130
+ const legacy = { glob: path.posix.basename(relative), input };
131
+ const others = assets.filter(asset => !describesSameFile(asset, relative, entry) && !describesSameFile(asset, relative, legacy));
132
+ const alreadyCorrect = assets.length === others.length + 1 && hasEntry(assets, entry);
133
+ if (!alreadyCorrect) {
134
+ ngPackage.assets = [...others, entry];
135
+ await writeFile(ngPackagePath, `${JSON.stringify(ngPackage, null, 2)}\n`, 'utf8');
136
+ }
137
+ await exportStylesheet(libraryRoot, path.posix.basename(relative));
138
+ }
139
+ /**
140
+ * Lets the consumer import the theme by the package name (`@import 'ui/styles.css'`).
141
+ *
142
+ * ng-packagr writes an `exports` map, and a package with one allows no subpath
143
+ * it does not list — the shipped file existed, but the consumer's build refused
144
+ * to resolve it. Entries declared in the library's `package.json` are merged
145
+ * into that map.
146
+ */
147
+ async function exportStylesheet(libraryRoot, fileName) {
148
+ const packageJsonPath = path.join(libraryRoot, 'package.json');
149
+ if (!existsSync(packageJsonPath))
150
+ return;
151
+ const packageJson = JSON.parse(await readFile(packageJsonPath, 'utf8'));
152
+ const key = `./${fileName}`;
153
+ // `"exports": "./index.js"` (or an array of fallbacks) is shorthand for the
154
+ // package root; spreading it would turn the string into one key per character.
155
+ const current = packageJson.exports;
156
+ // The same goes for a map of conditions (`{ import, require }`): Node rejects
157
+ // one that mixes condition keys with subpaths, so they move under `.` too.
158
+ const isRootShorthand = typeof current === 'string' ||
159
+ Array.isArray(current) ||
160
+ (current && typeof current === 'object' && Object.keys(current).some(name => !name.startsWith('.')));
161
+ const exportsMap = isRootShorthand ? { '.': current } : { ...(current ?? {}) };
162
+ if (exportsMap[key])
163
+ return;
164
+ packageJson.exports = { ...exportsMap, [key]: { style: key, default: key } };
165
+ await writeFile(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`, 'utf8');
166
+ }
167
+ /** Whether an already-declared asset publishes exactly the same file. */
168
+ function describesSameFile(asset, relative, entry) {
169
+ if (typeof asset === 'string')
170
+ return asset.replace(/^\.\//, '') === relative;
171
+ const declared = asset;
172
+ return declared?.glob === entry.glob && declared?.input === entry.input;
173
+ }
174
+ function hasEntry(assets, entry) {
175
+ return assets.some(asset => typeof asset === 'object' &&
176
+ asset !== null &&
177
+ asset.glob === entry.glob &&
178
+ asset.input === entry.input &&
179
+ asset.output === entry.output);
180
+ }
181
+ async function installCoreDependencies(cwd, config) {
182
+ const resolvedConfig = await resolveConfigPaths(cwd, config);
183
+ await mkdir(resolvedConfig.resolvedPaths.core, { recursive: true });
184
+ await mkdir(resolvedConfig.resolvedPaths.utils, { recursive: true });
185
+ await installComponent('core', resolvedConfig.resolvedPaths.core, resolvedConfig);
186
+ await installComponent('utils', resolvedConfig.resolvedPaths.utils, resolvedConfig);
187
+ }
188
+ //# sourceMappingURL=steps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steps.js","sourceRoot":"","sources":["../../../src/commands/init/steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC/G,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,kBAAkB,E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AC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAErE,MAAM,gBAAgB,CAAC,MAAM,EAAE,cAAc,CAAC,aAAa,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAClF,MAAM,gBAAgB,CAAC,OAAO,EAAE,cAAc,CAAC,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;AACtF,CAAC"}
@@ -1,5 +1,12 @@
1
1
  import { type Config } from '../../utils/config.js';
2
- export declare function setupTailwind(cwd: string, config: Config): Promise<void>;
3
- export declare function createPostCssConfig(cwd: string): Promise<void>;
2
+ /**
3
+ * Writes `.postcssrc.json` at the root of the project that will use it.
4
+ *
5
+ * The Angular build looks for the file starting from the CSS it is processing
6
+ * and walks up to the workspace root, so the project is the most specific place
7
+ * that works — and in a monorepo with several apps it is the only one that does
8
+ * not configure all of them at once. `projectRoot` is `.` for a single app.
9
+ */
10
+ export declare function createPostCssConfig(cwd: string, projectRoot?: string): Promise<void>;
4
11
  export declare function applyThemeToStyles(cwd: string, config: Config): Promise<void>;
5
12
  //# sourceMappingURL=tailwind-setup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind-setup.d.ts","sourceRoot":"","sources":["../../../src/commands/init/tailwind-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAYnD,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG9E;AAED,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGpE;AAED,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CASnF"}
1
+ {"version":3,"file":"tailwind-setup.d.ts","sourceRoot":"","sources":["../../../src/commands/init/tailwind-setup.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAYvE;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,SAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKvF;AAkCD,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CASnF"}
@@ -1,5 +1,7 @@
1
+ import { isLibraryKind } from '../../commands/init/project-kind.js';
2
+ import { resolveAliasToPath } from '../../utils/config.js';
1
3
  import { getThemeContent } from '../../utils/theme-selector.js';
2
- import { writeFile } from 'node:fs/promises';
4
+ import { mkdir, writeFile } from 'node:fs/promises';
3
5
  import * as path from 'path';
4
6
  const POSTCSS_CONFIG = `{
5
7
  "plugins": {
@@ -7,21 +9,54 @@ const POSTCSS_CONFIG = `{
7
9
  }
8
10
  }
9
11
  `;
10
- export async function setupTailwind(cwd, config) {
11
- await createPostCssConfig(cwd);
12
- await applyThemeToStyles(cwd, config);
12
+ /**
13
+ * Writes `.postcssrc.json` at the root of the project that will use it.
14
+ *
15
+ * The Angular build looks for the file starting from the CSS it is processing
16
+ * and walks up to the workspace root, so the project is the most specific place
17
+ * that works — and in a monorepo with several apps it is the only one that does
18
+ * not configure all of them at once. `projectRoot` is `.` for a single app.
19
+ */
20
+ export async function createPostCssConfig(cwd, projectRoot = '.') {
21
+ const targetDir = path.resolve(cwd, projectRoot);
22
+ await mkdir(targetDir, { recursive: true });
23
+ await writeFile(path.join(targetDir, '.postcssrc.json'), POSTCSS_CONFIG, 'utf8');
13
24
  }
14
- export async function createPostCssConfig(cwd) {
15
- const postcssConfigPath = path.join(cwd, '.postcssrc.json');
16
- await writeFile(postcssConfigPath, POSTCSS_CONFIG, 'utf8');
25
+ /**
26
+ * The CSS `@import` is resolved by the bundler relative to the file containing
27
+ * it, so it has to be a real relative path — it cannot be assembled by slicing
28
+ * the alias.
29
+ *
30
+ * The previous version took the second segment of baseUrl and pasted the alias
31
+ * without its first character. It only worked for the `src/app` + `@/...`
32
+ * layout: with baseUrl `projects/admin/src/app` it aimed at `./admin/...`, and
33
+ * with an `@app/core` alias it produced `./appapp/core`.
34
+ */
35
+ function coreImportPath(cwd, config) {
36
+ const cssDir = path.dirname(path.resolve(cwd, config.tailwind.css));
37
+ const coreDir = path.resolve(cwd, resolveAliasToPath(config.aliases.core, config.baseUrl));
38
+ const relative = path.relative(cssDir, coreDir).split(path.sep).join('/');
39
+ return relative.startsWith('.') ? relative : `./${relative}`;
40
+ }
41
+ /**
42
+ * Where the consumer's Tailwind finds the classes a library's components use.
43
+ *
44
+ * Tailwind skips `node_modules` when it detects sources, so an app installing
45
+ * the published library generated none of the utilities its components need.
46
+ * `./` is relative to this stylesheet: in the package that is its root, beside
47
+ * the bundled JavaScript; in the workspace, the library's own `src`. It goes
48
+ * after the `@plugin` line so the `@import`s `add` appends stay first.
49
+ */
50
+ function withLibrarySource(themeContent) {
51
+ return themeContent.replace(/^(@plugin [^\n]*;)$/m, `$1\n@source './';`);
17
52
  }
18
53
  export async function applyThemeToStyles(cwd, config) {
19
54
  const stylesPath = path.join(cwd, config.tailwind.css);
20
- const selectedTheme = config.tailwind.baseColor;
21
- const parts = config.baseUrl.split('/');
22
- const base = parts.length > 1 ? parts[1] : parts[0];
23
- const corePath = './' + base + config.aliases.core.substring(1);
24
- const themeContent = getThemeContent(selectedTheme, corePath);
55
+ const baseTheme = getThemeContent(config.tailwind.baseColor, coreImportPath(cwd, config));
56
+ const themeContent = isLibraryKind(config.projectType) ? withLibrarySource(baseTheme) : baseTheme;
57
+ // In a library that file usually does not exist — init creates it, so the
58
+ // library can expose the tokens to whoever consumes it.
59
+ await mkdir(path.dirname(stylesPath), { recursive: true });
25
60
  await writeFile(stylesPath, themeContent, 'utf8');
26
61
  }
27
62
  //# sourceMappingURL=tailwind-setup.js.map
@@ -1 +1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CAAC,CAAC,CAAC;IAE3F,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE1E,OAAO,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;AAC/D,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,iBAAiB,CAAC,YAAoB;IAC7C,OAAO,YAAY,CAAC,OAAO,CAAC,sBAAsB,EAAE,mBAAmB,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,GAAW,EAAE,MAAc;IAClE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1F,MAAM,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAElG,0EAA0E;IAC1E,wDAAwD;IACxD,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,MAAM,SAAS,CAAC,UAAU,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC"}
@@ -1,3 +1,10 @@
1
1
  import { type Config } from '../../utils/config.js';
2
- export declare function updateTsConfig(cwd: string, config: Config): Promise<void>;
2
+ /**
3
+ * Writes the alias into the tsconfig the projects actually extend.
4
+ *
5
+ * In an Nx workspace that is `tsconfig.base.json`: the root `tsconfig.json` is
6
+ * inherited by no project, and a mapping written there would never reach the
7
+ * compiler — the alias resolved in the editor and broke in the build.
8
+ */
9
+ export declare function updateTsConfig(cwd: string, config: Config, tsconfigFile?: string): Promise<void>;
3
10
  //# sourceMappingURL=tsconfig-updater.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tsconfig-updater.d.ts","sourceRoot":"","sources":["../../../src/commands/init/tsconfig-updater.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAOnD,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB/E"}
1
+ {"version":3,"file":"tsconfig-updater.d.ts","sourceRoot":"","sources":["../../../src/commands/init/tsconfig-updater.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAOjE;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,SAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB/G"}