workspace-schema.d.ts 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953
  1. export type Schema = {
  2. $schema?: string;
  3. cli?: CliOptions;
  4. /**
  5. * Path where new projects will be created.
  6. */
  7. newProjectRoot?: string;
  8. projects?: Projects;
  9. schematics?: SchematicOptions;
  10. version: number;
  11. };
  12. export type CliOptions = {
  13. /**
  14. * Share pseudonymous usage data with the Angular Team at Google.
  15. */
  16. analytics?: Analytics;
  17. /**
  18. * Control disk cache.
  19. */
  20. cache?: Cache;
  21. /**
  22. * Specify which package manager tool to use.
  23. */
  24. packageManager?: PackageManager;
  25. /**
  26. * The list of schematic collections to use.
  27. */
  28. schematicCollections?: string[];
  29. /**
  30. * Control CLI specific console warnings
  31. */
  32. warnings?: Warnings;
  33. };
  34. /**
  35. * Share pseudonymous usage data with the Angular Team at Google.
  36. */
  37. export type Analytics = boolean | string;
  38. /**
  39. * Control disk cache.
  40. */
  41. export type Cache = {
  42. /**
  43. * Configure whether disk caching is enabled.
  44. */
  45. enabled?: boolean;
  46. /**
  47. * Configure in which environment disk cache is enabled.
  48. */
  49. environment?: Environment;
  50. /**
  51. * Cache base path.
  52. */
  53. path?: string;
  54. };
  55. /**
  56. * Configure in which environment disk cache is enabled.
  57. */
  58. export declare enum Environment {
  59. All = "all",
  60. Ci = "ci",
  61. Local = "local"
  62. }
  63. /**
  64. * Specify which package manager tool to use.
  65. *
  66. * The package manager used to install dependencies.
  67. */
  68. export declare enum PackageManager {
  69. Bun = "bun",
  70. Cnpm = "cnpm",
  71. Npm = "npm",
  72. Pnpm = "pnpm",
  73. Yarn = "yarn"
  74. }
  75. /**
  76. * Control CLI specific console warnings
  77. */
  78. export type Warnings = {
  79. /**
  80. * Show a warning when the global version is newer than the local one.
  81. */
  82. versionMismatch?: boolean;
  83. };
  84. export type Projects = {};
  85. export type SchematicOptions = {
  86. "@schematics/angular:application"?: AngularApplicationOptionsSchema;
  87. "@schematics/angular:class"?: AngularClassOptionsSchema;
  88. "@schematics/angular:component"?: AngularComponentOptionsSchema;
  89. "@schematics/angular:directive"?: AngularDirectiveOptionsSchema;
  90. "@schematics/angular:enum"?: AngularEnumOptionsSchema;
  91. "@schematics/angular:guard"?: AngularGuardOptionsSchema;
  92. "@schematics/angular:interceptor"?: AngularInterceptorOptionsSchema;
  93. "@schematics/angular:interface"?: AngularInterfaceOptionsSchema;
  94. "@schematics/angular:library"?: LibraryOptionsSchema;
  95. "@schematics/angular:ng-new"?: AngularNgNewOptionsSchema;
  96. "@schematics/angular:pipe"?: AngularPipeOptionsSchema;
  97. "@schematics/angular:resolver"?: AngularResolverOptionsSchema;
  98. "@schematics/angular:service"?: AngularServiceOptionsSchema;
  99. "@schematics/angular:web-worker"?: AngularWebWorkerOptionsSchema;
  100. [property: string]: any;
  101. };
  102. /**
  103. * Generates a new Angular application within your workspace. This schematic sets up the
  104. * foundational structure of your project, including the root component, module, and
  105. * configuration files. You can customize various aspects of the application, such as
  106. * routing, styling, and testing.
  107. */
  108. export type AngularApplicationOptionsSchema = {
  109. /**
  110. * Include the styles for the root component directly within the `app.component.ts` file.
  111. * Only CSS styles can be included inline. By default, a separate stylesheet file (e.g.,
  112. * `app.component.css`) is created.
  113. */
  114. inlineStyle?: boolean;
  115. /**
  116. * Include the HTML template for the root component directly within the `app.component.ts`
  117. * file. By default, a separate template file (e.g., `app.component.html`) is created.
  118. */
  119. inlineTemplate?: boolean;
  120. /**
  121. * Generate a minimal project without any testing frameworks. This is intended for learning
  122. * purposes and simple experimentation, not for production applications.
  123. */
  124. minimal?: boolean;
  125. /**
  126. * The name for the new application. This name will be used for the project directory and
  127. * various identifiers throughout the application's code.
  128. */
  129. name: string;
  130. /**
  131. * A prefix to be added to the selectors of components generated within this application.
  132. * For example, if the prefix is `my-app` and you generate a component named `my-component`,
  133. * the selector will be `my-app-my-component`.
  134. */
  135. prefix?: string;
  136. /**
  137. * The directory where the new application's files will be created, relative to the
  138. * workspace root. If not specified, the application will be created in a subfolder within
  139. * the `projects` directory, using the application's name.
  140. */
  141. projectRoot?: string;
  142. /**
  143. * Generate an application with routing already configured. This sets up the necessary files
  144. * and modules for managing navigation between different views in your application.
  145. */
  146. routing?: boolean;
  147. /**
  148. * Skip the automatic installation of packages. You will need to manually install the
  149. * dependencies later.
  150. */
  151. skipInstall?: boolean;
  152. /**
  153. * Do not add dependencies to the `package.json` file.
  154. */
  155. skipPackageJson?: boolean;
  156. /**
  157. * Skip the generation of a unit test files `spec.ts`.
  158. */
  159. skipTests?: boolean;
  160. /**
  161. * Configure the application for Server-Side Rendering (SSR) and Static Site Generation
  162. * (SSG/Prerendering).
  163. */
  164. ssr?: boolean;
  165. /**
  166. * Create an application that utilizes the standalone API, eliminating the need for
  167. * NgModules. This can simplify the structure of your application.
  168. */
  169. standalone?: boolean;
  170. /**
  171. * Enable stricter bundle budget settings for the application. This helps to keep your
  172. * application's bundle size small and improve performance. For more information, see
  173. * https://angular.dev/tools/cli/template-typecheck#strict-mode
  174. */
  175. strict?: boolean;
  176. /**
  177. * The type of stylesheet files to be created for components in the application.
  178. */
  179. style?: SchematicsAngularApplicationStyle;
  180. /**
  181. * Sets the view encapsulation mode for the application's components. This determines how
  182. * component styles are scoped and applied.
  183. */
  184. viewEncapsulation?: ViewEncapsulation;
  185. /**
  186. * Generate an application that does not use `zone.js`.
  187. */
  188. zoneless?: boolean;
  189. };
  190. /**
  191. * The type of stylesheet files to be created for components in the application.
  192. *
  193. * The type of stylesheet files to be created for components in the initial project.
  194. */
  195. export declare enum SchematicsAngularApplicationStyle {
  196. Css = "css",
  197. Less = "less",
  198. Sass = "sass",
  199. Scss = "scss"
  200. }
  201. /**
  202. * Sets the view encapsulation mode for the application's components. This determines how
  203. * component styles are scoped and applied.
  204. *
  205. * Sets the view encapsulation mode for the component. This determines how the component's
  206. * styles are scoped and applied.
  207. *
  208. * Sets the view encapsulation mode for components in the initial project. This determines
  209. * how component styles are scoped and applied. Options include: `Emulated` (default, styles
  210. * are scoped to the component), `None` (styles are global), and `ShadowDom` (styles are
  211. * encapsulated using Shadow DOM).
  212. */
  213. export declare enum ViewEncapsulation {
  214. Emulated = "Emulated",
  215. None = "None",
  216. ShadowDom = "ShadowDom"
  217. }
  218. /**
  219. * Creates a new class in your project. Classes are the fundamental building blocks for
  220. * object-oriented programming in TypeScript. They provide a blueprint for creating objects
  221. * with properties and methods. This schematic helps you generate a new class with the basic
  222. * structure and optional test files.
  223. */
  224. export type AngularClassOptionsSchema = {
  225. /**
  226. * The name for the new class. This will be used to create the class file (e.g.,
  227. * `my-class.ts`) and, if enabled, the corresponding test file `my-class.spec.ts`.
  228. */
  229. name: string;
  230. /**
  231. * The path where the class file should be created, relative to the workspace root. If not
  232. * specified, the class will be created in the current directory.
  233. */
  234. path?: string;
  235. /**
  236. * The name of the project where the class should be added. If not specified, the CLI will
  237. * determine the project from the current directory.
  238. */
  239. project: string;
  240. /**
  241. * Skip the generation of a unit test file `spec.ts` for the new class.
  242. */
  243. skipTests?: boolean;
  244. /**
  245. * Adds a custom type to the filename, allowing you to create more descriptive class names.
  246. * For example, if you set the type to `helper`, the filename will be `my-class.helper.ts`.
  247. */
  248. type?: string;
  249. };
  250. /**
  251. * Creates a new Angular component. Components are the basic building blocks of Angular
  252. * applications. Each component consists of a TypeScript class, an HTML template, and an
  253. * optional CSS stylesheet. Use this schematic to generate a new component in your project.
  254. */
  255. export type AngularComponentOptionsSchema = {
  256. /**
  257. * Configures the change detection strategy for the component.
  258. */
  259. changeDetection?: ChangeDetection;
  260. /**
  261. * Adds `:host { display: block; }` to the component's stylesheet, ensuring the component
  262. * renders as a block-level element. This is useful for layout purposes.
  263. */
  264. displayBlock?: boolean;
  265. /**
  266. * Automatically export the component from the specified NgModule, making it accessible to
  267. * other modules in the application.
  268. */
  269. export?: boolean;
  270. /**
  271. * Use a default export for the component in its TypeScript file instead of a named export.
  272. */
  273. exportDefault?: boolean;
  274. /**
  275. * Create the component files directly in the project's `src/app` directory instead of
  276. * creating a new folder for them.
  277. */
  278. flat?: boolean;
  279. /**
  280. * Include the component's styles directly in the `component.ts` file. By default, a
  281. * separate stylesheet file (e.g., `my-component.component.css`) is created.
  282. */
  283. inlineStyle?: boolean;
  284. /**
  285. * Include the component's HTML template directly in the `component.ts` file. By default, a
  286. * separate template file (e.g., `my-component.component.html`) is created.
  287. */
  288. inlineTemplate?: boolean;
  289. /**
  290. * Specify the NgModule where the component should be declared. If not provided, the CLI
  291. * will attempt to find the closest NgModule in the component's path.
  292. */
  293. module?: string;
  294. /**
  295. * The name for the new component. This will be used to create the component's class,
  296. * template, and stylesheet files. For example, if you provide `my-component`, the files
  297. * will be named `my-component.component.ts`, `my-component.component.html`, and
  298. * `my-component.component.css`.
  299. */
  300. name: string;
  301. /**
  302. * Generate component template files with an '.ng.html' file extension instead of '.html'.
  303. */
  304. ngHtml?: boolean;
  305. /**
  306. * The path where the component files should be created, relative to the current workspace.
  307. * If not provided, a folder with the same name as the component will be created in the
  308. * project's `src/app` directory.
  309. */
  310. path?: string;
  311. /**
  312. * A prefix to be added to the component's selector. For example, if the prefix is `app` and
  313. * the component name is `my-component`, the selector will be `app-my-component`.
  314. */
  315. prefix?: string;
  316. /**
  317. * The name of the project where the component should be added. If not specified, the CLI
  318. * will determine the project from the current directory.
  319. */
  320. project: string;
  321. /**
  322. * The HTML selector to use for this component. If not provided, a selector will be
  323. * generated based on the component name (e.g., `app-my-component`).
  324. */
  325. selector?: string;
  326. /**
  327. * Do not automatically import the new component into its closest NgModule.
  328. */
  329. skipImport?: boolean;
  330. /**
  331. * Skip the generation of an HTML selector for the component.
  332. */
  333. skipSelector?: boolean;
  334. /**
  335. * Skip the generation of unit test files `spec.ts`.
  336. */
  337. skipTests?: boolean;
  338. /**
  339. * Generate a standalone component. Standalone components are self-contained and don't need
  340. * to be declared in an NgModule. They can be used independently or imported directly into
  341. * other standalone components.
  342. */
  343. standalone?: boolean;
  344. /**
  345. * Specify the type of stylesheet to be created for the component, or `none` to skip
  346. * creating a stylesheet.
  347. */
  348. style?: SchematicsAngularComponentStyle;
  349. /**
  350. * Append a custom type to the component's filename. For example, if you set the type to
  351. * `container`, the file will be named `my-component.container.ts`.
  352. */
  353. type?: string;
  354. /**
  355. * Sets the view encapsulation mode for the component. This determines how the component's
  356. * styles are scoped and applied.
  357. */
  358. viewEncapsulation?: ViewEncapsulation;
  359. };
  360. /**
  361. * Configures the change detection strategy for the component.
  362. */
  363. export declare enum ChangeDetection {
  364. Default = "Default",
  365. OnPush = "OnPush"
  366. }
  367. /**
  368. * Specify the type of stylesheet to be created for the component, or `none` to skip
  369. * creating a stylesheet.
  370. */
  371. export declare enum SchematicsAngularComponentStyle {
  372. Css = "css",
  373. Less = "less",
  374. None = "none",
  375. Sass = "sass",
  376. Scss = "scss"
  377. }
  378. /**
  379. * Creates a new directive in your project. Directives are used to extend the behavior or
  380. * appearance of HTML elements and components. They allow you to manipulate the DOM, add
  381. * custom attributes, and respond to events. This schematic generates the necessary files
  382. * and boilerplate code for a new directive.
  383. */
  384. export type AngularDirectiveOptionsSchema = {
  385. /**
  386. * Automatically export the directive from the specified NgModule, making it accessible to
  387. * other modules in the application.
  388. */
  389. export?: boolean;
  390. /**
  391. * Creates the new directive files at the top level of the current project. If set to false,
  392. * a new folder with the directive's name will be created to contain the files.
  393. */
  394. flat?: boolean;
  395. /**
  396. * Specify the NgModule where the directive should be declared. If not provided, the CLI
  397. * will attempt to find the closest NgModule in the directive's path.
  398. */
  399. module?: string;
  400. /**
  401. * The name for the new directive. This will be used to create the directive's class and
  402. * spec files (e.g., `my-directive.directive.ts` and `my-directive.directive.spec.ts`).
  403. */
  404. name: string;
  405. /**
  406. * The path where the directive files should be created, relative to the workspace root. If
  407. * not provided, the directive will be created in the current directory.
  408. */
  409. path?: string;
  410. /**
  411. * A prefix to be added to the directive's selector. For example, if the prefix is `app` and
  412. * the directive name is `highlight`, the selector will be `appHighlight`.
  413. */
  414. prefix?: string;
  415. /**
  416. * The name of the project where the directive should be added. If not specified, the CLI
  417. * will determine the project from the current directory.
  418. */
  419. project: string;
  420. /**
  421. * The HTML selector to use for this directive. If not provided, a selector will be
  422. * generated based on the directive's name (e.g., `appHighlight`).
  423. */
  424. selector?: string;
  425. /**
  426. * Do not automatically import the new directive into its closest NgModule.
  427. */
  428. skipImport?: boolean;
  429. /**
  430. * Skip the generation of a unit test file `spec.ts` for the new directive.
  431. */
  432. skipTests?: boolean;
  433. /**
  434. * Generate a standalone directive. Standalone directives are self-contained and don't need
  435. * to be declared in an NgModule. They can be used independently or imported directly into
  436. * other standalone components or directives.
  437. */
  438. standalone?: boolean;
  439. /**
  440. * Append a custom type to the directive's filename. For example, if you set the type to
  441. * `directive`, the file will be named `example.directive.ts`.
  442. */
  443. type?: string;
  444. };
  445. /**
  446. * Creates a new enum in your project. Enums (enumerations) are a way to define a set of
  447. * named constants, making your code more readable and maintainable. This schematic
  448. * generates a new enum with the specified name and type.
  449. */
  450. export type AngularEnumOptionsSchema = {
  451. /**
  452. * The name for the new enum. This will be used to create the enum file (e.g.,
  453. * `my-enum.enum.ts`).
  454. */
  455. name: string;
  456. /**
  457. * The path where the enum file should be created, relative to the current workspace. If not
  458. * specified, the enum will be created in the current directory.
  459. */
  460. path?: string;
  461. /**
  462. * The name of the project where the enum should be created. If not specified, the CLI will
  463. * determine the project from the current directory.
  464. */
  465. project: string;
  466. /**
  467. * Adds a custom type to the filename, allowing you to create more descriptive enum names.
  468. * For example, if you set the type to `status`, the filename will be `my-enum.status.ts`.
  469. */
  470. type?: string;
  471. };
  472. /**
  473. * Creates a new route guard in your project. Route guards are used to control access to
  474. * parts of your application by checking certain conditions before a route is activated.
  475. * This schematic generates a new guard with the specified name, type, and options.
  476. */
  477. export type AngularGuardOptionsSchema = {
  478. /**
  479. * Creates the new guard files at the top level of the current project. If set to false, a
  480. * new folder with the guard's name will be created to contain the files.
  481. */
  482. flat?: boolean;
  483. /**
  484. * Generate the guard as a function instead of a class. Functional guards can be simpler for
  485. * basic scenarios.
  486. */
  487. functional?: boolean;
  488. /**
  489. * Specifies the type(s) of guard to create. You can choose one or more of the following:
  490. * `CanActivate` (controls access to a route), `CanActivateChild` (controls access to child
  491. * routes), `CanDeactivate` (asks for confirmation before leaving a route), `CanMatch`
  492. * (determines if a route can be matched).
  493. */
  494. implements?: Implement[];
  495. /**
  496. * The name for the new route guard. This will be used to create the guard's class and spec
  497. * files (e.g., `my-guard.guard.ts` and `my-guard.guard.spec.ts`).
  498. */
  499. name: string;
  500. /**
  501. * The path where the guard files should be created, relative to the current workspace. If
  502. * not provided, the guard will be created in the current directory.
  503. */
  504. path?: string;
  505. /**
  506. * The name of the project where the guard should be created. If not specified, the CLI will
  507. * determine the project from the current directory.
  508. */
  509. project: string;
  510. /**
  511. * Skip the generation of a unit test file `spec.ts` for the new guard.
  512. */
  513. skipTests?: boolean;
  514. /**
  515. * The separator character to use before the type within the generated file's name. For
  516. * example, if you set the option to `.`, the file will be named `example.guard.ts`.
  517. */
  518. typeSeparator?: TypeSeparator;
  519. };
  520. export declare enum Implement {
  521. CanActivate = "CanActivate",
  522. CanActivateChild = "CanActivateChild",
  523. CanDeactivate = "CanDeactivate",
  524. CanMatch = "CanMatch"
  525. }
  526. /**
  527. * The separator character to use before the type within the generated file's name. For
  528. * example, if you set the option to `.`, the file will be named `example.guard.ts`.
  529. *
  530. * The separator character to use before the type within the generated file's name. For
  531. * example, if you set the option to `.`, the file will be named `example.interceptor.ts`.
  532. *
  533. * The separator character to use before the type within the generated file's name. For
  534. * example, if you set the option to `.`, the file will be named `example.pipe.ts`.
  535. *
  536. * The separator character to use before the type within the generated file's name. For
  537. * example, if you set the option to `.`, the file will be named `example.resolver.ts`.
  538. */
  539. export declare enum TypeSeparator {
  540. Empty = "-",
  541. TypeSeparator = "."
  542. }
  543. /**
  544. * Creates a new interceptor in your project. Interceptors are used to intercept and modify
  545. * HTTP requests and responses before they reach their destination. This allows you to
  546. * perform tasks like adding authentication headers, handling errors, or logging requests.
  547. * This schematic generates the necessary files and boilerplate code for a new interceptor.
  548. */
  549. export type AngularInterceptorOptionsSchema = {
  550. /**
  551. * Creates the new interceptor files at the top level of the current project. If set to
  552. * false, a new folder with the interceptor's name will be created to contain the files.
  553. */
  554. flat?: boolean;
  555. /**
  556. * Creates the interceptor as a function `HttpInterceptorFn` instead of a class. Functional
  557. * interceptors can be simpler for basic scenarios.
  558. */
  559. functional?: boolean;
  560. /**
  561. * The name for the new interceptor. This will be used to create the interceptor's class and
  562. * spec files (e.g., `my-interceptor.interceptor.ts` and
  563. * `my-interceptor.interceptor.spec.ts`).
  564. */
  565. name: string;
  566. /**
  567. * The path where the interceptor files should be created, relative to the workspace root.
  568. * If not provided, the interceptor will be created in the current directory.
  569. */
  570. path?: string;
  571. /**
  572. * The name of the project where the interceptor should be created. If not specified, the
  573. * CLI will determine the project from the current directory.
  574. */
  575. project: string;
  576. /**
  577. * Skip the generation of a unit test file `spec.ts` for the new interceptor.
  578. */
  579. skipTests?: boolean;
  580. /**
  581. * The separator character to use before the type within the generated file's name. For
  582. * example, if you set the option to `.`, the file will be named `example.interceptor.ts`.
  583. */
  584. typeSeparator?: TypeSeparator;
  585. };
  586. /**
  587. * Creates a new interface in your project. Interfaces define the structure of objects in
  588. * TypeScript, ensuring type safety and code clarity. This schematic generates a new
  589. * interface with the specified name and type.
  590. */
  591. export type AngularInterfaceOptionsSchema = {
  592. /**
  593. * The name for the new interface. This will be used to create the interface file (e.g.,
  594. * `my-interface.interface.ts`).
  595. */
  596. name: string;
  597. /**
  598. * The path where the interface file should be created, relative to the workspace root. If
  599. * not provided, the interface will be created in the current directory.
  600. */
  601. path?: string;
  602. /**
  603. * A prefix to be added to the interface name. This is typically not used for interfaces, as
  604. * they don't have selectors like components or directives.
  605. */
  606. prefix?: string;
  607. /**
  608. * The name of the project where the interface should be created. If not specified, the CLI
  609. * will determine the project from the current directory.
  610. */
  611. project: string;
  612. /**
  613. * Adds a custom type to the filename, allowing you to create more descriptive interface
  614. * names. For example, if you set the type to `data`, the filename will be
  615. * `my-interface.data.ts`.
  616. */
  617. type?: string;
  618. };
  619. /**
  620. * Creates a new library project in your Angular workspace. Libraries are reusable
  621. * collections of components, services, and other Angular artifacts that can be shared
  622. * across multiple applications. This schematic simplifies the process of generating a new
  623. * library with the necessary files and configurations.
  624. */
  625. export type LibraryOptionsSchema = {
  626. /**
  627. * The path to the library's public API file, relative to the workspace root. This file
  628. * defines what parts of the library are accessible to applications that import it.
  629. */
  630. entryFile?: string;
  631. /**
  632. * The name for the new library. This name will be used for the project directory and
  633. * various identifiers within the library's code.
  634. */
  635. name: string;
  636. /**
  637. * A prefix to be added to the selectors of components generated within this library. For
  638. * example, if the prefix is `my-lib` and you generate a component named `my-component`, the
  639. * selector will be `my-lib-my-component`.
  640. */
  641. prefix?: string;
  642. /**
  643. * The root directory for the new library, relative to the workspace root. If not specified,
  644. * the library will be created in a subfolder within the `projects` directory, using the
  645. * library's name.
  646. */
  647. projectRoot?: string;
  648. /**
  649. * Skip the automatic installation of packages. You will need to manually install the
  650. * dependencies later.
  651. */
  652. skipInstall?: boolean;
  653. /**
  654. * Do not automatically add dependencies to the `package.json` file.
  655. */
  656. skipPackageJson?: boolean;
  657. /**
  658. * Do not update the workspace `tsconfig.json` file to add a path mapping for the new
  659. * library. The path mapping is needed to use the library in an application, but can be
  660. * disabled here to simplify development.
  661. */
  662. skipTsConfig?: boolean;
  663. /**
  664. * Create a library that utilizes the standalone API, eliminating the need for NgModules.
  665. * This can simplify the structure of your library and its usage in applications.
  666. */
  667. standalone?: boolean;
  668. };
  669. /**
  670. * Creates a new Angular workspace and an initial project. This schematic sets up the
  671. * foundation for your Angular development, generating the workspace configuration files and
  672. * an optional starter application. You can customize various aspects of the workspace and
  673. * the initial project, such as routing, styling, and testing.
  674. */
  675. export type AngularNgNewOptionsSchema = {
  676. /**
  677. * Configure the initial Git commit for the new repository.
  678. */
  679. commit?: CommitUnion;
  680. /**
  681. * Create a new initial application project in the new workspace. When false, creates an
  682. * empty workspace with no initial application. You can then use the `ng generate
  683. * application` command to create applications in the `projects` directory.
  684. */
  685. createApplication?: boolean;
  686. /**
  687. * The directory where the new workspace and project should be created. If not specified,
  688. * the workspace will be created in the current directory.
  689. */
  690. directory?: string;
  691. /**
  692. * Include the styles for the initial application's root component directly within the
  693. * `app.component.ts` file. By default, a separate stylesheet file (e.g.,
  694. * `app.component.css`) is created.
  695. */
  696. inlineStyle?: boolean;
  697. /**
  698. * Include the HTML template for the initial application's root component directly within
  699. * the `app.component.ts` file. By default, a separate template file (e.g.,
  700. * `app.component.html`) is created.
  701. */
  702. inlineTemplate?: boolean;
  703. /**
  704. * Generate a minimal Angular workspace without any testing frameworks. This is intended for
  705. * learning purposes and simple experimentation, not for production applications.
  706. */
  707. minimal?: boolean;
  708. /**
  709. * The name for the new workspace and the initial project. This name will be used for the
  710. * root directory and various identifiers throughout the project.
  711. */
  712. name: string;
  713. /**
  714. * The path where new projects will be created within the workspace, relative to the
  715. * workspace root. By default, new projects are created in the `projects` directory.
  716. */
  717. newProjectRoot?: string;
  718. /**
  719. * The package manager used to install dependencies.
  720. */
  721. packageManager?: PackageManager;
  722. /**
  723. * The prefix to apply to generated selectors for the initial project. For example, if the
  724. * prefix is `my-app` and you generate a component named `my-component`, the selector will
  725. * be `my-app-my-component`.
  726. */
  727. prefix?: string;
  728. /**
  729. * Enable routing in the initial application project. This sets up the necessary files and
  730. * modules for managing navigation between different views in your application.
  731. */
  732. routing?: boolean;
  733. /**
  734. * Do not initialize a Git repository in the new workspace. By default, a Git repository is
  735. * initialized to help you track changes to your project.
  736. */
  737. skipGit?: boolean;
  738. /**
  739. * Skip the automatic installation of packages. You will need to manually install the
  740. * dependencies later.
  741. */
  742. skipInstall?: boolean;
  743. /**
  744. * Skip the generation of unit test files `spec.ts`.
  745. */
  746. skipTests?: boolean;
  747. /**
  748. * Configure the initial application for Server-Side Rendering (SSR) and Static Site
  749. * Generation (SSG/Prerendering).
  750. */
  751. ssr?: boolean;
  752. /**
  753. * Creates an application based upon the standalone API, without NgModules.
  754. */
  755. standalone?: boolean;
  756. /**
  757. * Enable stricter type checking and stricter bundle budgets settings. This setting helps
  758. * improve maintainability and catch bugs ahead of time. For more information, see
  759. * https://angular.dev/tools/cli/template-typecheck#strict-mode
  760. */
  761. strict?: boolean;
  762. /**
  763. * The type of stylesheet files to be created for components in the initial project.
  764. */
  765. style?: SchematicsAngularApplicationStyle;
  766. /**
  767. * The version of the Angular CLI to use.
  768. */
  769. version: string;
  770. /**
  771. * Sets the view encapsulation mode for components in the initial project. This determines
  772. * how component styles are scoped and applied. Options include: `Emulated` (default, styles
  773. * are scoped to the component), `None` (styles are global), and `ShadowDom` (styles are
  774. * encapsulated using Shadow DOM).
  775. */
  776. viewEncapsulation?: ViewEncapsulation;
  777. /**
  778. * Create an initial application that does not utilize `zone.js`.
  779. */
  780. zoneless?: boolean;
  781. };
  782. /**
  783. * Configure the initial Git commit for the new repository.
  784. */
  785. export type CommitUnion = boolean | CommitObject;
  786. export type CommitObject = {
  787. email: string;
  788. message?: string;
  789. name: string;
  790. [property: string]: any;
  791. };
  792. /**
  793. * Creates a new pipe in your project. Pipes are used to transform data for display in
  794. * templates. They take input values and apply a specific transformation, such as formatting
  795. * dates, currency, or filtering arrays. This schematic generates the necessary files and
  796. * boilerplate code for a new pipe.
  797. */
  798. export type AngularPipeOptionsSchema = {
  799. /**
  800. * Automatically export the pipe from the specified NgModule, making it accessible to other
  801. * modules in the application.
  802. */
  803. export?: boolean;
  804. /**
  805. * Creates the new pipe files at the top level of the current project. If set to false, a
  806. * new folder with the pipe's name will be created to contain the files.
  807. */
  808. flat?: boolean;
  809. /**
  810. * Specify the NgModule where the pipe should be declared. If not provided, the CLI will
  811. * attempt to find the closest NgModule in the pipe's path.
  812. */
  813. module?: string;
  814. /**
  815. * The name for the new pipe. This will be used to create the pipe's class and spec files
  816. * (e.g., `my-pipe.pipe.ts` and `my-pipe.pipe.spec.ts`).
  817. */
  818. name: string;
  819. /**
  820. * The path where the pipe files should be created, relative to the workspace root. If not
  821. * provided, the pipe will be created in the current directory.
  822. */
  823. path?: string;
  824. /**
  825. * The name of the project where the pipe should be created. If not specified, the CLI will
  826. * determine the project from the current directory.
  827. */
  828. project: string;
  829. /**
  830. * Do not automatically import the new pipe into its closest NgModule.
  831. */
  832. skipImport?: boolean;
  833. /**
  834. * Prevent the generation of a unit test file `spec.ts` for the new pipe.
  835. */
  836. skipTests?: boolean;
  837. /**
  838. * Generate a standalone pipe. Standalone pipes are self-contained and don't need to be
  839. * declared in an NgModule. They can be used independently or imported directly into other
  840. * standalone components, directives, or pipes.
  841. */
  842. standalone?: boolean;
  843. /**
  844. * The separator character to use before the type within the generated file's name. For
  845. * example, if you set the option to `.`, the file will be named `example.pipe.ts`.
  846. */
  847. typeSeparator?: TypeSeparator;
  848. };
  849. /**
  850. * Creates a new resolver in your project. Resolvers are used to pre-fetch data before a
  851. * route is activated, ensuring that the necessary data is available before the component is
  852. * displayed. This can improve the user experience by preventing delays and loading states.
  853. * This schematic generates a new resolver with the specified name and options.
  854. */
  855. export type AngularResolverOptionsSchema = {
  856. /**
  857. * Creates the new resolver files at the top level of the current project. If set to false,
  858. * a new folder with the resolver's name will be created to contain the files.
  859. */
  860. flat?: boolean;
  861. /**
  862. * Creates the resolver as a function `ResolveFn` instead of a class. Functional resolvers
  863. * can be simpler for basic scenarios.
  864. */
  865. functional?: boolean;
  866. /**
  867. * The name for the new resolver. This will be used to create the resolver's class and spec
  868. * files (e.g., `my-resolver.resolver.ts` and `my-resolver.resolver.spec.ts`).
  869. */
  870. name: string;
  871. /**
  872. * The path where the resolver files should be created, relative to the current workspace.
  873. * If not provided, the resolver will be created in the current directory.
  874. */
  875. path?: string;
  876. /**
  877. * The name of the project where the resolver should be created. If not specified, the CLI
  878. * will determine the project from the current directory.
  879. */
  880. project: string;
  881. /**
  882. * Skip the generation of a unit test file `spec.ts` for the new resolver.
  883. */
  884. skipTests?: boolean;
  885. /**
  886. * The separator character to use before the type within the generated file's name. For
  887. * example, if you set the option to `.`, the file will be named `example.resolver.ts`.
  888. */
  889. typeSeparator?: TypeSeparator;
  890. };
  891. /**
  892. * Creates a new service in your project. Services are used to encapsulate reusable logic,
  893. * such as data access, API calls, or utility functions. This schematic simplifies the
  894. * process of generating a new service with the necessary files and boilerplate code.
  895. */
  896. export type AngularServiceOptionsSchema = {
  897. /**
  898. * Creates files at the top level of the project or the given path. If set to false, a new
  899. * folder with the service's name will be created to contain the files.
  900. */
  901. flat?: boolean;
  902. /**
  903. * The name for the new service. This will be used to create the service's class and spec
  904. * files (e.g., `my-service.service.ts` and `my-service.service.spec.ts`).
  905. */
  906. name: string;
  907. /**
  908. * The path where the service files should be created, relative to the workspace root. If
  909. * not provided, the service will be created in the project's `src/app` directory.
  910. */
  911. path?: string;
  912. /**
  913. * The name of the project where the service should be added. If not specified, the CLI will
  914. * determine the project from the current directory.
  915. */
  916. project: string;
  917. /**
  918. * Skip the generation of a unit test file `spec.ts` for the service.
  919. */
  920. skipTests?: boolean;
  921. /**
  922. * Append a custom type to the service's filename. For example, if you set the type to
  923. * `service`, the file will be named `my-service.service.ts`.
  924. */
  925. type?: string;
  926. };
  927. /**
  928. * Creates a new web worker in your project. Web workers allow you to run JavaScript code in
  929. * the background, improving the performance and responsiveness of your application by
  930. * offloading computationally intensive tasks. This schematic generates the necessary files
  931. * for a new web worker and provides an optional code snippet to demonstrate its usage.
  932. */
  933. export type AngularWebWorkerOptionsSchema = {
  934. /**
  935. * The name for the new web worker. This will be used to create the worker file (e.g.,
  936. * `my-worker.worker.ts`).
  937. */
  938. name: string;
  939. /**
  940. * The path where the web worker file should be created, relative to the current workspace.
  941. * If not specified, the worker will be created in the current directory.
  942. */
  943. path?: string;
  944. /**
  945. * The name of the project where the web worker should be created. If not specified, the CLI
  946. * will determine the project from the current directory.
  947. */
  948. project: string;
  949. /**
  950. * Generate a code snippet that demonstrates how to create and use the new web worker.
  951. */
  952. snippet?: boolean;
  953. };