workspace-schema.d.ts 34 KB

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