zard-cli 1.1.0-alpha.0 → 1.1.0

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 (234) hide show
  1. package/README.md +122 -60
  2. package/commands/add/component-installer.d.ts +2 -1
  3. package/commands/add/component-installer.d.ts.map +1 -1
  4. package/commands/add/component-installer.js +25 -7
  5. package/commands/add/component-installer.js.map +1 -1
  6. package/commands/add/component-selector.d.ts +3 -3
  7. package/commands/add/component-selector.js +4 -4
  8. package/commands/add/dark-mode-setup.d.ts +2 -0
  9. package/commands/add/dark-mode-setup.d.ts.map +1 -1
  10. package/commands/add/dark-mode-setup.js +15 -1
  11. package/commands/add/dark-mode-setup.js.map +1 -1
  12. package/commands/add/dependency-resolver.d.ts +8 -1
  13. package/commands/add/dependency-resolver.d.ts.map +1 -1
  14. package/commands/add/dependency-resolver.js +87 -16
  15. package/commands/add/dependency-resolver.js.map +1 -1
  16. package/commands/add/index.d.ts.map +1 -1
  17. package/commands/add/index.js +55 -29
  18. package/commands/add/index.js.map +1 -1
  19. package/commands/add/stylesheet-setup.d.ts +3 -0
  20. package/commands/add/stylesheet-setup.d.ts.map +1 -0
  21. package/commands/add/stylesheet-setup.js +92 -0
  22. package/commands/add/stylesheet-setup.js.map +1 -0
  23. package/commands/add/wizard.d.ts +12 -8
  24. package/commands/add/wizard.d.ts.map +1 -1
  25. package/commands/add/wizard.js +12 -2
  26. package/commands/add/wizard.js.map +1 -1
  27. package/commands/init/config-prompter.d.ts +36 -16
  28. package/commands/init/config-prompter.d.ts.map +1 -1
  29. package/commands/init/config-prompter.js +37 -17
  30. package/commands/init/config-prompter.js.map +1 -1
  31. package/commands/init/dependencies.d.ts.map +1 -1
  32. package/commands/init/dependencies.js +35 -23
  33. package/commands/init/dependencies.js.map +1 -1
  34. package/commands/init/index.d.ts.map +1 -1
  35. package/commands/init/index.js +74 -23
  36. package/commands/init/index.js.map +1 -1
  37. package/commands/init/library-peers.d.ts +28 -0
  38. package/commands/init/library-peers.d.ts.map +1 -0
  39. package/commands/init/library-peers.js +61 -0
  40. package/commands/init/library-peers.js.map +1 -0
  41. package/commands/init/project-kind.d.ts +39 -39
  42. package/commands/init/project-kind.d.ts.map +1 -1
  43. package/commands/init/project-kind.js +45 -45
  44. package/commands/init/project-kind.js.map +1 -1
  45. package/commands/init/rtl-setup.d.ts +12 -0
  46. package/commands/init/rtl-setup.d.ts.map +1 -0
  47. package/commands/init/rtl-setup.js +42 -0
  48. package/commands/init/rtl-setup.js.map +1 -0
  49. package/commands/init/steps.d.ts +3 -4
  50. package/commands/init/steps.d.ts.map +1 -1
  51. package/commands/init/steps.js +100 -39
  52. package/commands/init/steps.js.map +1 -1
  53. package/commands/init/tailwind-setup.d.ts +5 -5
  54. package/commands/init/tailwind-setup.d.ts.map +1 -1
  55. package/commands/init/tailwind-setup.js +29 -15
  56. package/commands/init/tailwind-setup.js.map +1 -1
  57. package/commands/init/tsconfig-updater.d.ts +4 -4
  58. package/commands/init/tsconfig-updater.js +12 -12
  59. package/commands/init/tsconfig-updater.js.map +1 -1
  60. package/commands/init/update-angular-config.js +4 -4
  61. package/commands/init/vite-setup.d.ts +5 -4
  62. package/commands/init/vite-setup.d.ts.map +1 -1
  63. package/commands/init/vite-setup.js +11 -10
  64. package/commands/init/vite-setup.js.map +1 -1
  65. package/commands/init/wizard.d.ts +10 -7
  66. package/commands/init/wizard.d.ts.map +1 -1
  67. package/commands/init/wizard.js +73 -46
  68. package/commands/init/wizard.js.map +1 -1
  69. package/constants/app.constants.d.ts +17 -0
  70. package/constants/app.constants.d.ts.map +1 -1
  71. package/constants/app.constants.js +39 -16
  72. package/constants/app.constants.js.map +1 -1
  73. package/core/icons/families.d.ts +38 -0
  74. package/core/icons/families.d.ts.map +1 -0
  75. package/core/icons/families.js +26 -0
  76. package/core/icons/families.js.map +1 -0
  77. package/core/icons/icon-map.d.ts +24 -0
  78. package/core/icons/icon-map.d.ts.map +1 -0
  79. package/core/icons/icon-map.js +150 -0
  80. package/core/icons/icon-map.js.map +1 -0
  81. package/core/icons/index.d.ts +107 -0
  82. package/core/icons/index.d.ts.map +1 -0
  83. package/core/icons/index.js +183 -0
  84. package/core/icons/index.js.map +1 -0
  85. package/core/registry/registry-data.d.ts.map +1 -1
  86. package/core/registry/registry-data.js +545 -63
  87. package/core/registry/registry-data.js.map +1 -1
  88. package/core/themes/index.d.ts +1 -1
  89. package/core/themes/index.js +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 +3 -2
  94. package/index.js.map +1 -1
  95. package/package.json +56 -58
  96. package/ui/blocks.d.ts +29 -28
  97. package/ui/blocks.d.ts.map +1 -1
  98. package/ui/blocks.js +27 -27
  99. package/ui/blocks.js.map +1 -1
  100. package/ui/brand.d.ts +5 -5
  101. package/ui/brand.d.ts.map +1 -1
  102. package/ui/brand.js +6 -6
  103. package/ui/brand.js.map +1 -1
  104. package/ui/engine/animation/index.d.ts +2 -3
  105. package/ui/engine/animation/index.d.ts.map +1 -1
  106. package/ui/engine/animation/index.js +2 -3
  107. package/ui/engine/animation/index.js.map +1 -1
  108. package/ui/engine/ansi/index.d.ts +10 -11
  109. package/ui/engine/ansi/index.d.ts.map +1 -1
  110. package/ui/engine/ansi/index.js +6 -7
  111. package/ui/engine/ansi/index.js.map +1 -1
  112. package/ui/engine/components/index.d.ts +3 -3
  113. package/ui/engine/components/index.js +4 -4
  114. package/ui/engine/cursor/index.d.ts +3 -4
  115. package/ui/engine/cursor/index.d.ts.map +1 -1
  116. package/ui/engine/cursor/index.js +2 -3
  117. package/ui/engine/cursor/index.js.map +1 -1
  118. package/ui/engine/diff/index.d.ts +2 -3
  119. package/ui/engine/diff/index.d.ts.map +1 -1
  120. package/ui/engine/diff/index.js +5 -6
  121. package/ui/engine/diff/index.js.map +1 -1
  122. package/ui/engine/events/index.d.ts +2 -2
  123. package/ui/engine/events/index.js +3 -3
  124. package/ui/engine/events/index.js.map +1 -1
  125. package/ui/engine/focus/index.d.ts +2 -2
  126. package/ui/engine/focus/index.js +2 -2
  127. package/ui/engine/frame/index.d.ts +4 -4
  128. package/ui/engine/frame/index.js +0 -0
  129. package/ui/engine/index.d.ts +7 -7
  130. package/ui/engine/index.js +7 -7
  131. package/ui/engine/input/index.d.ts +2 -2
  132. package/ui/engine/input/index.js +11 -11
  133. package/ui/engine/input/index.js.map +1 -1
  134. package/ui/engine/layout/index.d.ts +3 -3
  135. package/ui/engine/layout/index.js +7 -7
  136. package/ui/engine/layout/index.js.map +1 -1
  137. package/ui/engine/renderer/index.d.ts +4 -4
  138. package/ui/engine/renderer/index.d.ts.map +1 -1
  139. package/ui/engine/renderer/index.js +3 -3
  140. package/ui/engine/scheduler/index.d.ts +3 -3
  141. package/ui/engine/scheduler/index.js +5 -5
  142. package/ui/engine/scheduler/index.js.map +1 -1
  143. package/ui/engine/screen/index.d.ts +5 -5
  144. package/ui/engine/screen/index.d.ts.map +1 -1
  145. package/ui/engine/screen/index.js +7 -7
  146. package/ui/engine/screen/index.js.map +1 -1
  147. package/ui/engine/terminal/index.d.ts +49 -3
  148. package/ui/engine/terminal/index.d.ts.map +1 -1
  149. package/ui/engine/terminal/index.js +149 -18
  150. package/ui/engine/terminal/index.js.map +1 -1
  151. package/ui/engine/testing/index.d.ts +4 -4
  152. package/ui/engine/testing/index.d.ts.map +1 -1
  153. package/ui/engine/testing/index.js +2 -2
  154. package/ui/engine/theme/index.d.ts +2 -3
  155. package/ui/engine/theme/index.d.ts.map +1 -1
  156. package/ui/engine/theme/index.js +3 -4
  157. package/ui/engine/theme/index.js.map +1 -1
  158. package/ui/engine/utils/index.d.ts +2 -2
  159. package/ui/engine/utils/index.js +4 -4
  160. package/ui/engine/utils/index.js.map +1 -1
  161. package/ui/gate.d.ts +7 -7
  162. package/ui/gate.d.ts.map +1 -1
  163. package/ui/gate.js +5 -5
  164. package/ui/index.d.ts +3 -3
  165. package/ui/index.js +3 -3
  166. package/ui/log-sink.d.ts +9 -9
  167. package/ui/log-sink.d.ts.map +1 -1
  168. package/ui/log-sink.js +9 -9
  169. package/ui/log-sink.js.map +1 -1
  170. package/ui/output.d.ts +6 -6
  171. package/ui/output.d.ts.map +1 -1
  172. package/ui/output.js +6 -6
  173. package/ui/output.js.map +1 -1
  174. package/ui/report.d.ts +8 -8
  175. package/ui/report.d.ts.map +1 -1
  176. package/ui/report.js +7 -7
  177. package/ui/report.js.map +1 -1
  178. package/ui/runner.d.ts +31 -22
  179. package/ui/runner.d.ts.map +1 -1
  180. package/ui/runner.js +41 -25
  181. package/ui/runner.js.map +1 -1
  182. package/ui/style.d.ts +7 -7
  183. package/ui/style.d.ts.map +1 -1
  184. package/ui/style.js +8 -8
  185. package/ui/style.js.map +1 -1
  186. package/ui/testing/fake-tty.d.ts +4 -4
  187. package/ui/testing/fake-tty.js +4 -4
  188. package/ui/text-input.d.ts +15 -14
  189. package/ui/text-input.d.ts.map +1 -1
  190. package/ui/text-input.js +15 -13
  191. package/ui/text-input.js.map +1 -1
  192. package/ui/theme.d.ts +4 -4
  193. package/ui/theme.js +4 -4
  194. package/utils/angular-compat.d.ts +21 -0
  195. package/utils/angular-compat.d.ts.map +1 -0
  196. package/utils/angular-compat.js +52 -0
  197. package/utils/angular-compat.js.map +1 -0
  198. package/utils/config.d.ts +16 -9
  199. package/utils/config.d.ts.map +1 -1
  200. package/utils/config.js +35 -13
  201. package/utils/config.js.map +1 -1
  202. package/utils/errors.d.ts +11 -0
  203. package/utils/errors.d.ts.map +1 -1
  204. package/utils/errors.js +14 -0
  205. package/utils/errors.js.map +1 -1
  206. package/utils/get-project-info.d.ts +6 -6
  207. package/utils/get-project-info.d.ts.map +1 -1
  208. package/utils/get-project-info.js +106 -36
  209. package/utils/get-project-info.js.map +1 -1
  210. package/utils/http-client.d.ts.map +1 -1
  211. package/utils/http-client.js +20 -5
  212. package/utils/http-client.js.map +1 -1
  213. package/utils/icon-catalog.d.ts +34 -0
  214. package/utils/icon-catalog.d.ts.map +1 -0
  215. package/utils/icon-catalog.js +63 -0
  216. package/utils/icon-catalog.js.map +1 -0
  217. package/utils/logger.d.ts +3 -3
  218. package/utils/logger.js +9 -9
  219. package/utils/logger.js.map +1 -1
  220. package/utils/package-manager.d.ts +25 -25
  221. package/utils/package-manager.js +50 -50
  222. package/utils/package-manager.js.map +1 -1
  223. package/utils/registry.d.ts +100 -6
  224. package/utils/registry.d.ts.map +1 -1
  225. package/utils/registry.js +141 -22
  226. package/utils/registry.js.map +1 -1
  227. package/utils/schema-version.d.ts +21 -0
  228. package/utils/schema-version.d.ts.map +1 -0
  229. package/utils/schema-version.js +28 -0
  230. package/utils/schema-version.js.map +1 -0
  231. package/utils/source-file.d.ts +21 -21
  232. package/utils/source-file.d.ts.map +1 -1
  233. package/utils/source-file.js +24 -24
  234. package/utils/source-file.js.map +1 -1
@@ -1,16 +1,16 @@
1
1
  /**
2
- * Que tipo de projeto o `init` está configurando.
2
+ * Which kind of project `init` is configuring.
3
3
  *
4
- * Quem responde é o usuário, na primeira pergunta do wizard — a CLI não decide
5
- * por ele. O que o workspace revela entra depois, para preencher os caminhos
6
- * sugeridos do tipo escolhido; a detecção só vira decisão no caminho headless,
7
- * onde não há ninguém para perguntar.
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
8
  *
9
- * As diferenças entre os tipos não são cosméticas: uma biblioteca não tem
10
- * `app.config.ts` onde registrar providers nem CSS global pré-existente, o Nx
11
- * guarda os paths do TypeScript noutro arquivo, e o Analog troca o build do
12
- * Angular por Vite — e com ele a forma de configurar o Tailwind. Concentrar
13
- * essas diferenças aqui evita que cada etapa precise redescobri-las.
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
14
  */
15
15
  import type { ProjectInfo, WorkspaceProject } from '../../utils/get-project-info.js';
16
16
  export type ProjectKind = 'angular' | 'angular-library' | 'nx' | 'nx-library' | 'analog';
@@ -18,65 +18,65 @@ export interface ProjectKindOption {
18
18
  readonly value: ProjectKind;
19
19
  readonly label: string;
20
20
  readonly detail: string;
21
- /** A cor do ecossistema, para o menu dizer de relance a que mundo o tipo pertence. */
21
+ /** The ecosystem's colour, so the menu says at a glance which world the type belongs to. */
22
22
  readonly color: string;
23
23
  }
24
24
  /**
25
- * A ordem é a do menu: cada ecossistema com a aplicação antes da biblioteca,
26
- * do mais comum ao mais raro. Angular abre a lista porque é o default.
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
27
  */
28
28
  export declare const PROJECT_KINDS: readonly ProjectKindOption[];
29
29
  export declare function isLibraryKind(kind: ProjectKind): boolean;
30
- /** Onde os paths do TypeScript precisam ser escritos para o projeto enxergá-los. */
30
+ /** Where the TypeScript paths have to be written for the project to see them. */
31
31
  export declare function tsconfigFileFor(kind: ProjectKind, projectInfo: ProjectInfo): string;
32
32
  /** Se o Tailwind entra pelo PostCSS do Angular ou pelo plugin do Vite. */
33
33
  export declare function bundlerFor(kind: ProjectKind): 'angular' | 'vite';
34
34
  /**
35
- * Os projetos do workspace que podem receber a instalação.
35
+ * The workspace projects that can receive the install.
36
36
  *
37
- * Escolhido o tipo, só faz sentido oferecer o que combina com ele: pedir para
38
- * instalar numa aplicação quem escolheu biblioteca seria oferecer um alvo que
39
- * as etapas seguintes não sabem configurar.
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
40
  */
41
41
  export declare function candidateProjects(kind: ProjectKind, projectInfo: ProjectInfo): WorkspaceProject[];
42
- /** Raiz padrão quando o workspace não declara nenhum projeto compatível. */
42
+ /** Default root when the workspace declares no compatible project. */
43
43
  export declare function fallbackRootFor(kind: ProjectKind): string;
44
44
  /**
45
- * O tipo que o caminho headless assume.
45
+ * The type the headless path assumes.
46
46
  *
47
- * Sem terminal interativo ninguém responde à primeira pergunta, então aqui — e
48
- * só aqui — o workspace decide: o gerenciador dá o mundo (Nx ou Angular), o
49
- * Analog se anuncia pelas próprias dependências, e a ausência de qualquer
50
- * aplicação é o que sugere que o alvo é uma biblioteca.
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
51
  */
52
52
  export declare function detectProjectKind(projectInfo: ProjectInfo): ProjectKind;
53
53
  /**
54
- * Onde o código da biblioteca vive.
54
+ * Where a library's code lives.
55
55
  *
56
- * `src/lib` é a convenção tanto do `ng generate library` quanto do
57
- * `nx g @nx/angular:library`: `src/` guarda o ponto de entrada público, e tudo
58
- * que ele exporta fica em `src/lib`.
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
59
  */
60
60
  export declare function libraryBaseUrl(libraryRoot: string): string;
61
- /** O CSS de tema que a biblioteca passa a expor para quem a consome. */
61
+ /** The theme CSS the library starts exposing to whoever consumes it. */
62
62
  export declare function libraryStylesPath(libraryRoot: string): string;
63
63
  /**
64
- * A raiz do projeto, deduzida do `baseUrl`.
64
+ * The project root, derived from `baseUrl`.
65
65
  *
66
- * Os dois layouts terminam dois níveis abaixo da raiz — `<root>/src/app` numa
67
- * aplicação, `<root>/src/lib` numa biblioteca —, então subir dois níveis
68
- * devolve o diretório onde vivem o `project.json`, o `ng-package.json` e o
69
- * `.postcssrc.json` daquele projeto. Um app único na raiz devolve `.`.
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
70
  */
71
71
  export declare function projectRootOf(baseUrl: string): string;
72
- /** O diretório de fontes do projeto — onde `index.html` e `main.ts` ficam. */
72
+ /** The project's source directory — where `index.html` and `main.ts` sit. */
73
73
  export declare function sourceRootOf(baseUrl: string): string;
74
74
  /**
75
- * Onde procurar o `index.html` do projeto.
75
+ * Where to look for the project's `index.html`.
76
76
  *
77
- * No Analog ele é a página de entrada do Vite e fica na raiz, e não em `src/`
78
- * como no build do Angular — sugerir o caminho errado fazia o `add dark-mode`
79
- * falhar logo depois de perguntar.
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
80
  */
81
81
  export declare function indexHtmlFor(kind: ProjectKind, baseUrl: string): string;
82
82
  //# sourceMappingURL=project-kind.d.ts.map
@@ -1 +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,WAAW,GAAG,SAAS,GAAG,iBAAiB,GAAG,IAAI,GAAG,YAAY,GAAG,QAAQ,CAAC;AAEzF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sFAAsF;IACtF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAYD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,iBAAiB,EA+BrD,CAAC;AAqBF,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,G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de projeto o `init` está configurando.
2
+ * Which kind of project `init` is configuring.
3
3
  *
4
- * Quem responde é o usuário, na primeira pergunta do wizard — a CLI não decide
5
- * por ele. O que o workspace revela entra depois, para preencher os caminhos
6
- * sugeridos do tipo escolhido; a detecção só vira decisão no caminho headless,
7
- * onde não há ninguém para perguntar.
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
8
  *
9
- * As diferenças entre os tipos não são cosméticas: uma biblioteca não tem
10
- * `app.config.ts` onde registrar providers nem CSS global pré-existente, o Nx
11
- * guarda os paths do TypeScript noutro arquivo, e o Analog troca o build do
12
- * Angular por Vite — e com ele a forma de configurar o Tailwind. Concentrar
13
- * essas diferenças aqui evita que cada etapa precise redescobri-las.
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
14
  */
15
15
  import * as path from 'node:path';
16
16
  /**
17
- * As cores de cada ecossistema no menu.
17
+ * The colour of each ecosystem in the menu.
18
18
  *
19
- * Angular fica no branco da base — é o caso padrão, e destacá-lo com uma cor
20
- * daria a impressão de que é uma opção especial entre as outras.
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
21
  */
22
22
  const ANGULAR = '#fafafa';
23
23
  const NX = '#6aa9ff';
24
24
  const ANALOG = '#fb7185';
25
25
  /**
26
- * A ordem é a do menu: cada ecossistema com a aplicação antes da biblioteca,
27
- * do mais comum ao mais raro. Angular abre a lista porque é o default.
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
28
  */
29
29
  export const PROJECT_KINDS = [
30
30
  {
@@ -66,13 +66,13 @@ const TRAITS = {
66
66
  'nx-library': { isLibrary: true, workspace: 'nx', bundler: 'angular', fallbackRoot: 'libs/ui' },
67
67
  };
68
68
  export function isLibraryKind(kind) {
69
- return TRAITS[kind].isLibrary;
69
+ return TRAITS[kind]?.isLibrary ?? false;
70
70
  }
71
- /** Onde os paths do TypeScript precisam ser escritos para o projeto enxergá-los. */
71
+ /** Where the TypeScript paths have to be written for the project to see them. */
72
72
  export function tsconfigFileFor(kind, projectInfo) {
73
- // O Nx estende um tsconfig.base.json na raiz; escrever no tsconfig.json de lá
74
- // não chegaria a projeto nenhum. Fora do Nx o próprio tsconfig.json é o alvo,
75
- // a menos que o workspace já mantenha um base — aí ele é quem manda.
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
76
  if (TRAITS[kind].workspace === 'nx')
77
77
  return 'tsconfig.base.json';
78
78
  return projectInfo.tsconfigFile;
@@ -82,27 +82,27 @@ export function bundlerFor(kind) {
82
82
  return TRAITS[kind].bundler;
83
83
  }
84
84
  /**
85
- * Os projetos do workspace que podem receber a instalação.
85
+ * The workspace projects that can receive the install.
86
86
  *
87
- * Escolhido o tipo, só faz sentido oferecer o que combina com ele: pedir para
88
- * instalar numa aplicação quem escolheu biblioteca seria oferecer um alvo que
89
- * as etapas seguintes não sabem configurar.
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
90
  */
91
91
  export function candidateProjects(kind, projectInfo) {
92
92
  const wanted = TRAITS[kind].isLibrary ? 'library' : 'application';
93
93
  return projectInfo.projects.filter(project => project.projectType === wanted);
94
94
  }
95
- /** Raiz padrão quando o workspace não declara nenhum projeto compatível. */
95
+ /** Default root when the workspace declares no compatible project. */
96
96
  export function fallbackRootFor(kind) {
97
97
  return TRAITS[kind].fallbackRoot;
98
98
  }
99
99
  /**
100
- * O tipo que o caminho headless assume.
100
+ * The type the headless path assumes.
101
101
  *
102
- * Sem terminal interativo ninguém responde à primeira pergunta, então aqui — e
103
- * só aqui — o workspace decide: o gerenciador dá o mundo (Nx ou Angular), o
104
- * Analog se anuncia pelas próprias dependências, e a ausência de qualquer
105
- * aplicação é o que sugere que o alvo é uma biblioteca.
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
106
  */
107
107
  export function detectProjectKind(projectInfo) {
108
108
  const hasApplication = projectInfo.projects.some(project => project.projectType === 'application');
@@ -115,40 +115,40 @@ export function detectProjectKind(projectInfo) {
115
115
  return projectInfo.hasAnalog ? 'analog' : 'angular';
116
116
  }
117
117
  /**
118
- * Onde o código da biblioteca vive.
118
+ * Where a library's code lives.
119
119
  *
120
- * `src/lib` é a convenção tanto do `ng generate library` quanto do
121
- * `nx g @nx/angular:library`: `src/` guarda o ponto de entrada público, e tudo
122
- * que ele exporta fica em `src/lib`.
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
123
  */
124
124
  export function libraryBaseUrl(libraryRoot) {
125
125
  return `${trimSlashes(libraryRoot)}/src/lib`;
126
126
  }
127
- /** O CSS de tema que a biblioteca passa a expor para quem a consome. */
127
+ /** The theme CSS the library starts exposing to whoever consumes it. */
128
128
  export function libraryStylesPath(libraryRoot) {
129
129
  return `${trimSlashes(libraryRoot)}/src/styles.css`;
130
130
  }
131
131
  /**
132
- * A raiz do projeto, deduzida do `baseUrl`.
132
+ * The project root, derived from `baseUrl`.
133
133
  *
134
- * Os dois layouts terminam dois níveis abaixo da raiz — `<root>/src/app` numa
135
- * aplicação, `<root>/src/lib` numa biblioteca —, então subir dois níveis
136
- * devolve o diretório onde vivem o `project.json`, o `ng-package.json` e o
137
- * `.postcssrc.json` daquele projeto. Um app único na raiz devolve `.`.
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
138
  */
139
139
  export function projectRootOf(baseUrl) {
140
140
  return path.posix.normalize(path.posix.join(toPosix(baseUrl), '..', '..'));
141
141
  }
142
- /** O diretório de fontes do projeto — onde `index.html` e `main.ts` ficam. */
142
+ /** The project's source directory — where `index.html` and `main.ts` sit. */
143
143
  export function sourceRootOf(baseUrl) {
144
144
  return path.posix.dirname(toPosix(baseUrl));
145
145
  }
146
146
  /**
147
- * Onde procurar o `index.html` do projeto.
147
+ * Where to look for the project's `index.html`.
148
148
  *
149
- * No Analog ele é a página de entrada do Vite e fica na raiz, e não em `src/`
150
- * como no build do Angular — sugerir o caminho errado fazia o `add dark-mode`
151
- * falhar logo depois de perguntar.
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
152
  */
153
153
  export function indexHtmlFor(kind, baseUrl) {
154
154
  if (kind === 'analog') {
@@ -1 +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,iBAAi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AO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"}
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,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE;IACzF,MAAM,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE;IACrF,EAAE,EAAE,EAAE,SAAS,E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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,12 @@
1
+ /** The `<html>` tag with `dir="rtl"`, whatever it had before. */
2
+ export declare function withRtlDirection(content: string): string;
3
+ export type RtlSetupResult = 'updated' | 'unchanged' | 'missing' | 'no-html-tag';
4
+ /**
5
+ * Sets `dir="rtl"` on `<html>` in the app's index.html.
6
+ *
7
+ * The components are direction-agnostic, so this attribute is all a project needs
8
+ * to render right to left. A library has no index.html — it belongs to the app
9
+ * consuming it — so a missing file is a note, not a failure.
10
+ */
11
+ export declare function setupRtlDirection(cwd: string, indexFile: string): Promise<RtlSetupResult>;
12
+ //# sourceMappingURL=rtl-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rtl-setup.d.ts","sourceRoot":"","sources":["../../../src/commands/init/rtl-setup.ts"],"names":[],"mappings":"AAQA,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAUxD;AAED,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,aAAa,CAAC;AAEjF;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAoB/F"}
@@ -0,0 +1,42 @@
1
+ import { logger } from '../../utils/logger.js';
2
+ import { existsSync } from 'node:fs';
3
+ import { readFile, writeFile } from 'node:fs/promises';
4
+ import * as path from 'node:path';
5
+ const HTML_OPEN_TAG = /<html(\s[^>]*)?>/i;
6
+ const DIR_ATTRIBUTE = /\sdir\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i;
7
+ /** The `<html>` tag with `dir="rtl"`, whatever it had before. */
8
+ export function withRtlDirection(content) {
9
+ const match = HTML_OPEN_TAG.exec(content);
10
+ if (!match)
11
+ return content;
12
+ const attributes = match[1] ?? '';
13
+ const next = DIR_ATTRIBUTE.test(attributes)
14
+ ? attributes.replace(DIR_ATTRIBUTE, ' dir="rtl"')
15
+ : `${attributes.replace(/\s+$/, '')} dir="rtl"`;
16
+ return content.slice(0, match.index) + `<html${next}>` + content.slice(match.index + match[0].length);
17
+ }
18
+ /**
19
+ * Sets `dir="rtl"` on `<html>` in the app's index.html.
20
+ *
21
+ * The components are direction-agnostic, so this attribute is all a project needs
22
+ * to render right to left. A library has no index.html — it belongs to the app
23
+ * consuming it — so a missing file is a note, not a failure.
24
+ */
25
+ export async function setupRtlDirection(cwd, indexFile) {
26
+ const indexPath = path.resolve(cwd, indexFile);
27
+ if (!existsSync(indexPath)) {
28
+ logger.warn(`${indexFile} not found: add dir="rtl" to the <html> tag of the app's index.html by hand.`);
29
+ return 'missing';
30
+ }
31
+ const content = await readFile(indexPath, 'utf8');
32
+ if (!HTML_OPEN_TAG.test(content)) {
33
+ logger.warn(`No <html> tag found in ${indexFile}: add dir="rtl" to it by hand.`);
34
+ return 'no-html-tag';
35
+ }
36
+ const updated = withRtlDirection(content);
37
+ if (updated === content)
38
+ return 'unchanged';
39
+ await writeFile(indexPath, updated, 'utf8');
40
+ return 'updated';
41
+ }
42
+ //# sourceMappingURL=rtl-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rtl-setup.js","sourceRoot":"","sources":["../../../src/commands/init/rtl-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAC1C,MAAM,aAAa,GAAG,0CAA0C,CAAC;AAEjE,iEAAiE;AACjE,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK;QAAE,OAAO,OAAO,CAAC;IAE3B,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAClC,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC;QACzC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,aAAa,EAAE,YAAY,CAAC;QACjD,CAAC,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC;IAElD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,QAAQ,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACxG,CAAC;AAID;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,GAAW,EAAE,SAAiB;IACpE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAE/C,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,8EAA8E,CAAC,CAAC;QACxG,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAElD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,0BAA0B,SAAS,gCAAgC,CAAC,CAAC;QACjF,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,OAAO,KAAK,OAAO;QAAE,OAAO,WAAW,CAAC;IAE5C,MAAM,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5C,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,11 +1,10 @@
1
1
  import { type Config } from '../../utils/config.js';
2
2
  import { type ProjectInfo } from '../../utils/get-project-info.js';
3
3
  /**
4
- * Uma etapa da inicialização: o rótulo que a UI mostra e o trabalho que ela faz.
4
+ * One step of initialization: the label the UI shows and the work it does.
5
5
  *
6
- * A lista é montada uma vez e consumida tanto pelo wizard quanto pelo caminho
7
- * headless, para que os dois executem exatamente a mesma sequência — a UI só
8
- * decide como apresentá-la.
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.
9
8
  */
10
9
  export interface InitStep {
11
10
  readonly label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../../src/commands/init/steps.ts"],"names":[],"mappings":"AAOA,OAAO,EAAsB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAMlE;;;;;;GAMG;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"}
1
+ {"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../../src/commands/init/steps.ts"],"names":[],"mappings":"AAeA,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,CA0EZ"}