Primeiro commit do projeto Angular
This commit is contained in:
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export interface <%= prefix %><%= classify(name) %> {
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
import { Rule } from '@angular-devkit/schematics';
|
||||
import { Schema as InterfaceOptions } from './schema';
|
||||
export default function (options: InterfaceOptions): Rule;
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = default_1;
|
||||
const generate_from_files_1 = require("../utility/generate-from-files");
|
||||
function default_1(options) {
|
||||
return (0, generate_from_files_1.generateFromFiles)(options);
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAMH,4BAEC;AALD,wEAAmE;AAGnE,mBAAyB,OAAyB;IAChD,OAAO,IAAA,uCAAiB,EAAC,OAAO,CAAC,CAAC;AACpC,CAAC"}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Creates a new interface in your project. Interfaces define the structure of objects in
|
||||
* TypeScript, ensuring type safety and code clarity. This schematic generates a new
|
||||
* interface with the specified name and type.
|
||||
*/
|
||||
export type Schema = {
|
||||
/**
|
||||
* The name for the new interface. This will be used to create the interface file (e.g.,
|
||||
* `my-interface.interface.ts`).
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The path where the interface file should be created, relative to the workspace root. If
|
||||
* not provided, the interface will be created in the current directory.
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* A prefix to be added to the interface name. This is typically not used for interfaces, as
|
||||
* they don't have selectors like components or directives.
|
||||
*/
|
||||
prefix?: string;
|
||||
/**
|
||||
* The name of the project where the interface should be created. If not specified, the CLI
|
||||
* will determine the project from the current directory.
|
||||
*/
|
||||
project: string;
|
||||
/**
|
||||
* Adds a custom type to the filename, allowing you to create more descriptive interface
|
||||
* names. For example, if you set the type to `data`, the filename will be
|
||||
* `my-interface.data.ts`.
|
||||
*/
|
||||
type?: string;
|
||||
};
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
||||
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=schema.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";AACA,mFAAmF;AACnF,oFAAoF"}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "SchematicsAngularInterface",
|
||||
"title": "Angular Interface Options Schema",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Creates a new interface in your project. Interfaces define the structure of objects in TypeScript, ensuring type safety and code clarity. This schematic generates a new interface with the specified name and type.",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name for the new interface. This will be used to create the interface file (e.g., `my-interface.interface.ts`).",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 0
|
||||
},
|
||||
"x-prompt": "What name would you like to use for the interface?"
|
||||
},
|
||||
"path": {
|
||||
"type": "string",
|
||||
"format": "path",
|
||||
"$default": {
|
||||
"$source": "workingDirectory"
|
||||
},
|
||||
"description": "The path where the interface file should be created, relative to the workspace root. If not provided, the interface will be created in the current directory.",
|
||||
"visible": false
|
||||
},
|
||||
"project": {
|
||||
"type": "string",
|
||||
"description": "The name of the project where the interface should be created. If not specified, the CLI will determine the project from the current directory.",
|
||||
"$default": {
|
||||
"$source": "projectName"
|
||||
}
|
||||
},
|
||||
"prefix": {
|
||||
"type": "string",
|
||||
"description": "A prefix to be added to the interface name. This is typically not used for interfaces, as they don't have selectors like components or directives."
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Adds a custom type to the filename, allowing you to create more descriptive interface names. For example, if you set the type to `data`, the filename will be `my-interface.data.ts`.",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["name", "project"]
|
||||
}
|
||||
Reference in New Issue
Block a user