schema.json 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema",
  3. "$id": "SchematicsAngularNgNew",
  4. "title": "Angular Ng New Options Schema",
  5. "type": "object",
  6. "description": "Creates a new Angular workspace and an initial project. This schematic sets up the foundation for your Angular development, generating the workspace configuration files and an optional starter application. You can customize various aspects of the workspace and the initial project, such as routing, styling, and testing.",
  7. "additionalProperties": false,
  8. "properties": {
  9. "directory": {
  10. "type": "string",
  11. "description": "The directory where the new workspace and project should be created. If not specified, the workspace will be created in the current directory."
  12. },
  13. "name": {
  14. "description": "The name for the new workspace and the initial project. This name will be used for the root directory and various identifiers throughout the project.",
  15. "type": "string",
  16. "$default": {
  17. "$source": "argv",
  18. "index": 0
  19. },
  20. "x-prompt": "What name would you like to use for the new workspace and initial project?"
  21. },
  22. "skipInstall": {
  23. "description": "Skip the automatic installation of packages. You will need to manually install the dependencies later.",
  24. "type": "boolean",
  25. "default": false
  26. },
  27. "skipGit": {
  28. "description": "Do not initialize a Git repository in the new workspace. By default, a Git repository is initialized to help you track changes to your project.",
  29. "type": "boolean",
  30. "default": false,
  31. "alias": "g"
  32. },
  33. "commit": {
  34. "description": "Configure the initial Git commit for the new repository.",
  35. "oneOf": [
  36. { "type": "boolean" },
  37. {
  38. "type": "object",
  39. "properties": {
  40. "name": {
  41. "type": "string"
  42. },
  43. "email": {
  44. "type": "string",
  45. "format": "email"
  46. },
  47. "message": {
  48. "type": "string"
  49. }
  50. },
  51. "required": ["name", "email"]
  52. }
  53. ],
  54. "default": true
  55. },
  56. "newProjectRoot": {
  57. "description": "The path where new projects will be created within the workspace, relative to the workspace root. By default, new projects are created in the `projects` directory.",
  58. "type": "string",
  59. "default": "projects"
  60. },
  61. "inlineStyle": {
  62. "description": "Include the styles for the initial application's root component directly within the `app.component.ts` file. By default, a separate stylesheet file (e.g., `app.component.css`) is created.",
  63. "type": "boolean",
  64. "alias": "s",
  65. "x-user-analytics": "ep.ng_inline_style"
  66. },
  67. "inlineTemplate": {
  68. "description": "Include the HTML template for the initial application's root component directly within the `app.component.ts` file. By default, a separate template file (e.g., `app.component.html`) is created.",
  69. "type": "boolean",
  70. "alias": "t",
  71. "x-user-analytics": "ep.ng_inline_template"
  72. },
  73. "viewEncapsulation": {
  74. "description": "Sets the view encapsulation mode for components in the initial project. This determines how component styles are scoped and applied. Options include: `Emulated` (default, styles are scoped to the component), `None` (styles are global), and `ShadowDom` (styles are encapsulated using Shadow DOM).",
  75. "enum": ["Emulated", "None", "ShadowDom"],
  76. "type": "string"
  77. },
  78. "version": {
  79. "type": "string",
  80. "description": "The version of the Angular CLI to use.",
  81. "visible": false,
  82. "$default": {
  83. "$source": "ng-cli-version"
  84. }
  85. },
  86. "routing": {
  87. "type": "boolean",
  88. "description": "Enable routing in the initial application project. This sets up the necessary files and modules for managing navigation between different views in your application.",
  89. "x-user-analytics": "ep.ng_routing"
  90. },
  91. "prefix": {
  92. "type": "string",
  93. "format": "html-selector",
  94. "description": "The prefix to apply to generated selectors for the initial project. For example, if the prefix is `my-app` and you generate a component named `my-component`, the selector will be `my-app-my-component`.",
  95. "minLength": 1,
  96. "default": "app",
  97. "alias": "p"
  98. },
  99. "style": {
  100. "description": "The type of stylesheet files to be created for components in the initial project.",
  101. "type": "string",
  102. "enum": ["css", "scss", "sass", "less"],
  103. "x-user-analytics": "ep.ng_style"
  104. },
  105. "skipTests": {
  106. "description": "Skip the generation of unit test files `spec.ts`.",
  107. "type": "boolean",
  108. "default": false,
  109. "alias": "S"
  110. },
  111. "createApplication": {
  112. "description": "Create a new initial application project in the new workspace. When false, creates an empty workspace with no initial application. You can then use the `ng generate application` command to create applications in the `projects` directory.",
  113. "type": "boolean",
  114. "default": true
  115. },
  116. "minimal": {
  117. "description": "Generate a minimal Angular workspace without any testing frameworks. This is intended for learning purposes and simple experimentation, not for production applications.",
  118. "type": "boolean",
  119. "default": false
  120. },
  121. "strict": {
  122. "description": "Enable stricter type checking and stricter bundle budgets settings. This setting helps improve maintainability and catch bugs ahead of time. For more information, see https://angular.dev/tools/cli/template-typecheck#strict-mode",
  123. "type": "boolean",
  124. "default": true
  125. },
  126. "packageManager": {
  127. "description": "The package manager used to install dependencies.",
  128. "type": "string",
  129. "enum": ["npm", "yarn", "pnpm", "cnpm", "bun"]
  130. },
  131. "standalone": {
  132. "description": "Creates an application based upon the standalone API, without NgModules.",
  133. "type": "boolean",
  134. "default": true,
  135. "x-user-analytics": "ep.ng_standalone"
  136. },
  137. "ssr": {
  138. "description": "Configure the initial application for Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering).",
  139. "type": "boolean",
  140. "x-user-analytics": "ep.ng_ssr"
  141. },
  142. "serverRouting": {
  143. "description": "Create a server application in the initial project using the Server Routing and App Engine APIs (Developer Preview).",
  144. "type": "boolean"
  145. },
  146. "experimentalZoneless": {
  147. "description": "Create an initial application that does not utilize `zone.js`.",
  148. "type": "boolean",
  149. "default": false
  150. }
  151. },
  152. "required": ["name", "version"]
  153. }