Skip to content

Commit

Permalink
92c7674 build: migrate @angular-devkit/schematics-cli to npm_package
Browse files Browse the repository at this point in the history
  • Loading branch information
Angular Builds committed Jan 15, 2025
1 parent ece7fbd commit a61140c
Show file tree
Hide file tree
Showing 50 changed files with 560 additions and 383 deletions.
7 changes: 4 additions & 3 deletions app-shell/schema.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/**
* Generates an application shell for running a server-side version of an app.
* Configures your project to generate an app-shell during build time.
*/
export interface Schema {
/**
* The name of the related client app.
* The name of the project where the app-shell should be generated.
*/
project: string;
/**
* Creates a server application using the Server Routing API (Developer Preview).
* Set up a server application using the Server Routing and App Engine APIs (Developer
* Preview).
*/
serverRouting?: boolean;
}
6 changes: 3 additions & 3 deletions app-shell/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"$id": "SchematicsAngularAppShell",
"title": "Angular AppShell Options Schema",
"type": "object",
"description": "Generates an application shell for running a server-side version of an app.",
"description": "Configures your project to generate an app-shell during build time.",
"additionalProperties": false,
"properties": {
"project": {
"type": "string",
"description": "The name of the related client app.",
"description": "The name of the project where the app-shell should be generated.",
"$default": {
"$source": "projectName"
}
},
"serverRouting": {
"description": "Creates a server application using the Server Routing API (Developer Preview).",
"description": "Set up a server application using the Server Routing and App Engine APIs (Developer Preview).",
"type": "boolean",
"default": false
}
Expand Down
65 changes: 40 additions & 25 deletions application/schema.d.ts
Original file line number Diff line number Diff line change
@@ -1,84 +1,98 @@
/**
* Generates a new basic application definition in the "projects" subfolder of the workspace.
* Generates a new Angular application within your workspace. This schematic sets up the
* foundational structure of your project, including the root component, module, and
* configuration files. You can customize various aspects of the application, such as
* routing, styling, and testing.
*/
export interface Schema {
/**
* Create an application that does not utilize zone.js.
* Generate an application that does not use `zone.js`.
*/
experimentalZoneless?: boolean;
/**
* Include styles inline in the root component.ts file. Only CSS styles can be included
* inline. Default is false, meaning that an external styles file is created and referenced
* in the root component.ts file.
* Include the styles for the root component directly within the `app.component.ts` file.
* Only CSS styles can be included inline. By default, a separate stylesheet file (e.g.,
* `app.component.css`) is created.
*/
inlineStyle?: boolean;
/**
* Include template inline in the root component.ts file. Default is false, meaning that an
* external template file is created and referenced in the root component.ts file.
* Include the HTML template for the root component directly within the `app.component.ts`
* file. By default, a separate template file (e.g., `app.component.html`) is created.
*/
inlineTemplate?: boolean;
/**
* Create a bare-bones project without any testing frameworks. (Use for learning purposes
* only.)
* Generate a minimal project without any testing frameworks. This is intended for learning
* purposes and simple experimentation, not for production applications.
*/
minimal?: boolean;
/**
* The name of the new application.
* The name for the new application. This name will be used for the project directory and
* various identifiers throughout the application's code.
*/
name: string;
/**
* A prefix to apply to generated selectors.
* A prefix to be added to the selectors of components generated within this application.
* For example, if the prefix is `my-app` and you generate a component named `my-component`,
* the selector will be `my-app-my-component`.
*/
prefix?: string;
/**
* The root directory of the new application.
* The directory where the new application's files will be created, relative to the
* workspace root. If not specified, the application will be created in a subfolder within
* the `projects` directory, using the application's name.
*/
projectRoot?: string;
/**
* Creates an application with routing enabled.
* Generate an application with routing already configured. This sets up the necessary files
* and modules for managing navigation between different views in your application.
*/
routing?: boolean;
/**
* Creates a server application using the Server Routing and App Engine APIs (Developer
* Set up a server application using the Server Routing and App Engine APIs (Developer
* Preview).
*/
serverRouting?: boolean;
/**
* Skip installing dependency packages.
* Skip the automatic installation of packages. You will need to manually install the
* dependencies later.
*/
skipInstall?: boolean;
/**
* Do not add dependencies to the "package.json" file.
* Do not add dependencies to the `package.json` file.
*/
skipPackageJson?: boolean;
/**
* Do not create "spec.ts" test files for the application.
* Skip the generation of a unit test files `spec.ts`.
*/
skipTests?: boolean;
/**
* Creates an application with Server-Side Rendering (SSR) and Static Site Generation
* (SSG/Prerendering) enabled.
* Configure the application for Server-Side Rendering (SSR) and Static Site Generation
* (SSG/Prerendering).
*/
ssr?: boolean;
/**
* Creates an application based upon the standalone API, without NgModules.
* Create an application that utilizes the standalone API, eliminating the need for
* NgModules. This can simplify the structure of your application.
*/
standalone?: boolean;
/**
* Creates an application with stricter bundle budgets settings.
* Enable stricter bundle budget settings for the application. This helps to keep your
* application's bundle size small and improve performance. For more information, see
* https://angular.dev/tools/cli/template-typecheck#strict-mode
*/
strict?: boolean;
/**
* The file extension or preprocessor to use for style files.
* The type of stylesheet files to be created for components in the application.
*/
style?: Style;
/**
* The view encapsulation strategy to use in the new application.
* Sets the view encapsulation mode for the application's components. This determines how
* component styles are scoped and applied.
*/
viewEncapsulation?: ViewEncapsulation;
}
/**
* The file extension or preprocessor to use for style files.
* The type of stylesheet files to be created for components in the application.
*/
export declare enum Style {
Css = "css",
Expand All @@ -87,7 +101,8 @@ export declare enum Style {
Scss = "scss"
}
/**
* The view encapsulation strategy to use in the new application.
* Sets the view encapsulation mode for the application's components. This determines how
* component styles are scoped and applied.
*/
export declare enum ViewEncapsulation {
Emulated = "Emulated",
Expand Down
5 changes: 3 additions & 2 deletions application/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.ViewEncapsulation = exports.Style = void 0;
/**
* The file extension or preprocessor to use for style files.
* The type of stylesheet files to be created for components in the application.
*/
var Style;
(function (Style) {
Expand All @@ -14,7 +14,8 @@ var Style;
Style["Scss"] = "scss";
})(Style || (exports.Style = Style = {}));
/**
* The view encapsulation strategy to use in the new application.
* Sets the view encapsulation mode for the application's components. This determines how
* component styles are scoped and applied.
*/
var ViewEncapsulation;
(function (ViewEncapsulation) {
Expand Down
36 changes: 18 additions & 18 deletions application/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"$id": "SchematicsAngularApp",
"title": "Angular Application Options Schema",
"type": "object",
"description": "Generates a new basic application definition in the \"projects\" subfolder of the workspace.",
"description": "Generates a new Angular application within your workspace. This schematic sets up the foundational structure of your project, including the root component, module, and configuration files. You can customize various aspects of the application, such as routing, styling, and testing.",
"additionalProperties": false,
"properties": {
"projectRoot": {
"description": "The root directory of the new application.",
"description": "The directory where the new application's files will be created, relative to the workspace root. If not specified, the application will be created in a subfolder within the `projects` directory, using the application's name.",
"type": "string"
},
"name": {
"description": "The name of the new application.",
"description": "The name for the new application. This name will be used for the project directory and various identifiers throughout the application's code.",
"type": "string",
"pattern": "^(?:@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*/)?[a-zA-Z0-9-~][a-zA-Z0-9-._~]*$",
"$default": {
Expand All @@ -21,37 +21,37 @@
"x-prompt": "What name would you like to use for the application?"
},
"inlineStyle": {
"description": "Include styles inline in the root component.ts file. Only CSS styles can be included inline. Default is false, meaning that an external styles file is created and referenced in the root component.ts file.",
"description": "Include the styles for the root component directly within the `app.component.ts` file. Only CSS styles can be included inline. By default, a separate stylesheet file (e.g., `app.component.css`) is created.",
"type": "boolean",
"alias": "s",
"x-user-analytics": "ep.ng_inline_style"
},
"inlineTemplate": {
"description": "Include template inline in the root component.ts file. Default is false, meaning that an external template file is created and referenced in the root component.ts file. ",
"description": "Include the HTML template for the root component directly within the `app.component.ts` file. By default, a separate template file (e.g., `app.component.html`) is created.",
"type": "boolean",
"alias": "t",
"x-user-analytics": "ep.ng_inline_template"
},
"viewEncapsulation": {
"description": "The view encapsulation strategy to use in the new application.",
"description": "Sets the view encapsulation mode for the application's components. This determines how component styles are scoped and applied.",
"enum": ["Emulated", "None", "ShadowDom"],
"type": "string"
},
"routing": {
"type": "boolean",
"description": "Creates an application with routing enabled.",
"description": "Generate an application with routing already configured. This sets up the necessary files and modules for managing navigation between different views in your application.",
"default": true,
"x-user-analytics": "ep.ng_routing"
},
"prefix": {
"type": "string",
"format": "html-selector",
"description": "A prefix to apply to generated selectors.",
"description": "A prefix to be added to the selectors of components generated within this application. For example, if the prefix is `my-app` and you generate a component named `my-component`, the selector will be `my-app-my-component`.",
"default": "app",
"alias": "p"
},
"style": {
"description": "The file extension or preprocessor to use for style files.",
"description": "The type of stylesheet files to be created for components in the application.",
"type": "string",
"default": "css",
"enum": ["css", "scss", "sass", "less"],
Expand Down Expand Up @@ -80,50 +80,50 @@
"x-user-analytics": "ep.ng_style"
},
"skipTests": {
"description": "Do not create \"spec.ts\" test files for the application.",
"description": "Skip the generation of a unit test files `spec.ts`.",
"type": "boolean",
"default": false,
"alias": "S"
},
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not add dependencies to the \"package.json\" file."
"description": "Do not add dependencies to the `package.json` file."
},
"minimal": {
"description": "Create a bare-bones project without any testing frameworks. (Use for learning purposes only.)",
"description": "Generate a minimal project without any testing frameworks. This is intended for learning purposes and simple experimentation, not for production applications.",
"type": "boolean",
"default": false
},
"skipInstall": {
"description": "Skip installing dependency packages.",
"description": "Skip the automatic installation of packages. You will need to manually install the dependencies later.",
"type": "boolean",
"default": false
},
"strict": {
"description": "Creates an application with stricter bundle budgets settings.",
"description": "Enable stricter bundle budget settings for the application. This helps to keep your application's bundle size small and improve performance. For more information, see https://angular.dev/tools/cli/template-typecheck#strict-mode",
"type": "boolean",
"default": true
},
"standalone": {
"description": "Creates an application based upon the standalone API, without NgModules.",
"description": "Create an application that utilizes the standalone API, eliminating the need for NgModules. This can simplify the structure of your application.",
"type": "boolean",
"default": true,
"x-user-analytics": "ep.ng_standalone"
},
"ssr": {
"description": "Creates an application with Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) enabled.",
"description": "Configure the application for Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering).",
"x-prompt": "Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)?",
"type": "boolean",
"default": false,
"x-user-analytics": "ep.ng_ssr"
},
"serverRouting": {
"description": "Creates a server application using the Server Routing and App Engine APIs (Developer Preview).",
"description": "Set up a server application using the Server Routing and App Engine APIs (Developer Preview).",
"type": "boolean"
},
"experimentalZoneless": {
"description": "Create an application that does not utilize zone.js.",
"description": "Generate an application that does not use `zone.js`.",
"type": "boolean",
"default": false
}
Expand Down
19 changes: 13 additions & 6 deletions class/schema.d.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
/**
* Creates a new, generic class definition in the given project.
* Creates a new class in your project. Classes are the fundamental building blocks for
* object-oriented programming in TypeScript. They provide a blueprint for creating objects
* with properties and methods. This schematic helps you generate a new class with the basic
* structure and optional test files.
*/
export interface Schema {
/**
* The name of the new class.
* The name for the new class. This will be used to create the class file (e.g.,
* `my-class.ts`) and, if enabled, the corresponding test file `my-class.spec.ts`.
*/
name: string;
/**
* The path at which to create the class, relative to the workspace root.
* The path where the class file should be created, relative to the workspace root. If not
* specified, the class will be created in the current directory.
*/
path?: string;
/**
* The name of the project.
* The name of the project where the class should be added. If not specified, the CLI will
* determine the project from the current directory.
*/
project: string;
/**
* Do not create "spec.ts" test files for the new class.
* Skip the generation of a unit test file `spec.ts` for the new class.
*/
skipTests?: boolean;
/**
* Adds a developer-defined type to the filename, in the format "name.type.ts".
* Adds a custom type to the filename, allowing you to create more descriptive class names.
* For example, if you set the type to `helper`, the filename will be `my-class.helper.ts`.
*/
type?: string;
}
12 changes: 6 additions & 6 deletions class/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"$id": "SchematicsAngularClass",
"title": "Angular Class Options Schema",
"type": "object",
"description": "Creates a new, generic class definition in the given project.",
"description": "Creates a new class in your project. Classes are the fundamental building blocks for object-oriented programming in TypeScript. They provide a blueprint for creating objects with properties and methods. This schematic helps you generate a new class with the basic structure and optional test files.",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "The name of the new class.",
"description": "The name for the new class. This will be used to create the class file (e.g., `my-class.ts`) and, if enabled, the corresponding test file `my-class.spec.ts`.",
"$default": {
"$source": "argv",
"index": 0
Expand All @@ -21,24 +21,24 @@
"$default": {
"$source": "workingDirectory"
},
"description": "The path at which to create the class, relative to the workspace root.",
"description": "The path where the class file should be created, relative to the workspace root. If not specified, the class will be created in the current directory.",
"visible": false
},
"project": {
"type": "string",
"description": "The name of the project.",
"description": "The name of the project where the class should be added. If not specified, the CLI will determine the project from the current directory.",
"$default": {
"$source": "projectName"
}
},
"skipTests": {
"type": "boolean",
"description": "Do not create \"spec.ts\" test files for the new class.",
"description": "Skip the generation of a unit test file `spec.ts` for the new class.",
"default": false
},
"type": {
"type": "string",
"description": "Adds a developer-defined type to the filename, in the format \"name.type.ts\"."
"description": "Adds a custom type to the filename, allowing you to create more descriptive class names. For example, if you set the type to `helper`, the filename will be `my-class.helper.ts`."
}
},
"required": ["name", "project"]
Expand Down
Loading

0 comments on commit a61140c

Please sign in to comment.