Updated the files.
This commit is contained in:
parent
1553e6b971
commit
753967d4f5
23418 changed files with 3784666 additions and 0 deletions
24
my-app/node_modules/@schematics/angular/library/files/README.md.template
generated
vendored
Executable file
24
my-app/node_modules/@schematics/angular/library/files/README.md.template
generated
vendored
Executable file
|
@ -0,0 +1,24 @@
|
|||
# <%= classify(name) %>
|
||||
|
||||
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version <%= angularLatestVersion %>.
|
||||
|
||||
## Code scaffolding
|
||||
|
||||
Run `ng generate component component-name --project <%= name %>` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project <%= name %>`.
|
||||
> Note: Don't forget to add `--project <%= name %>` or else it will be added to the default project in your `angular.json` file.
|
||||
|
||||
## Build
|
||||
|
||||
Run `ng build <%= name %>` to build the project. The build artifacts will be stored in the `dist/` directory.
|
||||
|
||||
## Publishing
|
||||
|
||||
After building your library with `ng build <%= name %>`, go to the dist folder `cd dist/<%= dasherize(name) %>` and run `npm publish`.
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `ng test <%= name %>` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||
|
||||
## Further help
|
||||
|
||||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
7
my-app/node_modules/@schematics/angular/library/files/ng-package.json.template
generated
vendored
Executable file
7
my-app/node_modules/@schematics/angular/library/files/ng-package.json.template
generated
vendored
Executable file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"$schema": "<%= relativePathToWorkspaceRoot %>/node_modules/ng-packagr/ng-package.schema.json",
|
||||
"dest": "<%= relativePathToWorkspaceRoot %>/<%= distRoot %>",
|
||||
"lib": {
|
||||
"entryFile": "src/<%= entryFile %>.ts"
|
||||
}
|
||||
}
|
12
my-app/node_modules/@schematics/angular/library/files/package.json.template
generated
vendored
Executable file
12
my-app/node_modules/@schematics/angular/library/files/package.json.template
generated
vendored
Executable file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"name": "<%= dasherize(packageName) %>",
|
||||
"version": "0.0.1",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^<%= angularLatestVersion %>",
|
||||
"@angular/core": "^<%= angularLatestVersion %>"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^<%= tsLibLatestVersion %>"
|
||||
},
|
||||
"sideEffects": false
|
||||
}
|
7
my-app/node_modules/@schematics/angular/library/files/src/__entryFile__.ts.template
generated
vendored
Executable file
7
my-app/node_modules/@schematics/angular/library/files/src/__entryFile__.ts.template
generated
vendored
Executable file
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Public API Surface of <%= dasherize(name) %>
|
||||
*/
|
||||
|
||||
export * from './lib/<%= dasherize(name) %>.service';
|
||||
export * from './lib/<%= dasherize(name) %>.component';<% if (!standalone) { %>
|
||||
export * from './lib/<%= dasherize(name) %>.module';<% } %>
|
14
my-app/node_modules/@schematics/angular/library/files/tsconfig.lib.json.template
generated
vendored
Executable file
14
my-app/node_modules/@schematics/angular/library/files/tsconfig.lib.json.template
generated
vendored
Executable file
|
@ -0,0 +1,14 @@
|
|||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "<%= relativePathToWorkspaceRoot %>/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/lib",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"inlineSources": true,
|
||||
"types": []
|
||||
},
|
||||
"exclude": [
|
||||
"**/*.spec.ts"
|
||||
]
|
||||
}
|
10
my-app/node_modules/@schematics/angular/library/files/tsconfig.lib.prod.json.template
generated
vendored
Executable file
10
my-app/node_modules/@schematics/angular/library/files/tsconfig.lib.prod.json.template
generated
vendored
Executable file
|
@ -0,0 +1,10 @@
|
|||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"compilerOptions": {
|
||||
"declarationMap": false
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"compilationMode": "partial"
|
||||
}
|
||||
}
|
14
my-app/node_modules/@schematics/angular/library/files/tsconfig.spec.json.template
generated
vendored
Executable file
14
my-app/node_modules/@schematics/angular/library/files/tsconfig.spec.json.template
generated
vendored
Executable file
|
@ -0,0 +1,14 @@
|
|||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "<%= relativePathToWorkspaceRoot %>/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/spec",
|
||||
"types": [
|
||||
"jasmine"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
10
my-app/node_modules/@schematics/angular/library/index.d.ts
generated
vendored
Executable file
10
my-app/node_modules/@schematics/angular/library/index.d.ts
generated
vendored
Executable file
|
@ -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.io/license
|
||||
*/
|
||||
import { Rule } from '@angular-devkit/schematics';
|
||||
import { Schema as LibraryOptions } from './schema';
|
||||
export default function (options: LibraryOptions): Rule;
|
171
my-app/node_modules/@schematics/angular/library/index.js
generated
vendored
Executable file
171
my-app/node_modules/@schematics/angular/library/index.js
generated
vendored
Executable file
|
@ -0,0 +1,171 @@
|
|||
"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.io/license
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const core_1 = require("@angular-devkit/core");
|
||||
const schematics_1 = require("@angular-devkit/schematics");
|
||||
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
||||
const dependencies_1 = require("../utility/dependencies");
|
||||
const json_file_1 = require("../utility/json-file");
|
||||
const latest_versions_1 = require("../utility/latest-versions");
|
||||
const paths_1 = require("../utility/paths");
|
||||
const workspace_1 = require("../utility/workspace");
|
||||
const workspace_models_1 = require("../utility/workspace-models");
|
||||
function updateTsConfig(packageName, ...paths) {
|
||||
return (host) => {
|
||||
if (!host.exists('tsconfig.json')) {
|
||||
return host;
|
||||
}
|
||||
const file = new json_file_1.JSONFile(host, 'tsconfig.json');
|
||||
const jsonPath = ['compilerOptions', 'paths', packageName];
|
||||
const value = file.get(jsonPath);
|
||||
file.modify(jsonPath, Array.isArray(value) ? [...value, ...paths] : paths);
|
||||
};
|
||||
}
|
||||
function addDependenciesToPackageJson() {
|
||||
return (host) => {
|
||||
[
|
||||
{
|
||||
type: dependencies_1.NodeDependencyType.Dev,
|
||||
name: '@angular/compiler-cli',
|
||||
version: latest_versions_1.latestVersions.Angular,
|
||||
},
|
||||
{
|
||||
type: dependencies_1.NodeDependencyType.Dev,
|
||||
name: '@angular-devkit/build-angular',
|
||||
version: latest_versions_1.latestVersions.DevkitBuildAngular,
|
||||
},
|
||||
{
|
||||
type: dependencies_1.NodeDependencyType.Dev,
|
||||
name: 'ng-packagr',
|
||||
version: latest_versions_1.latestVersions['ng-packagr'],
|
||||
},
|
||||
{
|
||||
type: dependencies_1.NodeDependencyType.Default,
|
||||
name: 'tslib',
|
||||
version: latest_versions_1.latestVersions['tslib'],
|
||||
},
|
||||
{
|
||||
type: dependencies_1.NodeDependencyType.Dev,
|
||||
name: 'typescript',
|
||||
version: latest_versions_1.latestVersions['typescript'],
|
||||
},
|
||||
].forEach((dependency) => (0, dependencies_1.addPackageJsonDependency)(host, dependency));
|
||||
return host;
|
||||
};
|
||||
}
|
||||
function addLibToWorkspaceFile(options, projectRoot, projectName) {
|
||||
return (0, workspace_1.updateWorkspace)((workspace) => {
|
||||
workspace.projects.add({
|
||||
name: projectName,
|
||||
root: projectRoot,
|
||||
sourceRoot: `${projectRoot}/src`,
|
||||
projectType: workspace_models_1.ProjectType.Library,
|
||||
prefix: options.prefix,
|
||||
targets: {
|
||||
build: {
|
||||
builder: workspace_models_1.Builders.NgPackagr,
|
||||
defaultConfiguration: 'production',
|
||||
options: {
|
||||
project: `${projectRoot}/ng-package.json`,
|
||||
},
|
||||
configurations: {
|
||||
production: {
|
||||
tsConfig: `${projectRoot}/tsconfig.lib.prod.json`,
|
||||
},
|
||||
development: {
|
||||
tsConfig: `${projectRoot}/tsconfig.lib.json`,
|
||||
},
|
||||
},
|
||||
},
|
||||
test: {
|
||||
builder: workspace_models_1.Builders.Karma,
|
||||
options: {
|
||||
tsConfig: `${projectRoot}/tsconfig.spec.json`,
|
||||
polyfills: ['zone.js', 'zone.js/testing'],
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
function default_1(options) {
|
||||
return async (host) => {
|
||||
const prefix = options.prefix;
|
||||
// If scoped project (i.e. "@foo/bar"), convert projectDir to "foo/bar".
|
||||
const packageName = options.name;
|
||||
if (/^@.*\/.*/.test(options.name)) {
|
||||
const [, name] = options.name.split('/');
|
||||
options.name = name;
|
||||
}
|
||||
const workspace = await (0, workspace_1.getWorkspace)(host);
|
||||
const newProjectRoot = workspace.extensions.newProjectRoot || '';
|
||||
let folderName = packageName.startsWith('@') ? packageName.slice(1) : packageName;
|
||||
if (/[A-Z]/.test(folderName)) {
|
||||
folderName = schematics_1.strings.dasherize(folderName);
|
||||
}
|
||||
const libDir = options.projectRoot !== undefined
|
||||
? (0, core_1.normalize)(options.projectRoot)
|
||||
: (0, core_1.join)((0, core_1.normalize)(newProjectRoot), folderName);
|
||||
const distRoot = `dist/${folderName}`;
|
||||
const sourceDir = `${libDir}/src/lib`;
|
||||
const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
|
||||
(0, schematics_1.applyTemplates)({
|
||||
...schematics_1.strings,
|
||||
...options,
|
||||
packageName,
|
||||
libDir,
|
||||
distRoot,
|
||||
relativePathToWorkspaceRoot: (0, paths_1.relativePathToWorkspaceRoot)(libDir),
|
||||
prefix,
|
||||
angularLatestVersion: latest_versions_1.latestVersions.Angular.replace(/~|\^/, ''),
|
||||
tsLibLatestVersion: latest_versions_1.latestVersions['tslib'].replace(/~|\^/, ''),
|
||||
folderName,
|
||||
}),
|
||||
(0, schematics_1.move)(libDir),
|
||||
]);
|
||||
return (0, schematics_1.chain)([
|
||||
(0, schematics_1.mergeWith)(templateSource),
|
||||
addLibToWorkspaceFile(options, libDir, packageName),
|
||||
options.skipPackageJson ? (0, schematics_1.noop)() : addDependenciesToPackageJson(),
|
||||
options.skipTsConfig ? (0, schematics_1.noop)() : updateTsConfig(packageName, './' + distRoot),
|
||||
options.standalone
|
||||
? (0, schematics_1.noop)()
|
||||
: (0, schematics_1.schematic)('module', {
|
||||
name: options.name,
|
||||
commonModule: false,
|
||||
flat: true,
|
||||
path: sourceDir,
|
||||
project: packageName,
|
||||
}),
|
||||
(0, schematics_1.schematic)('component', {
|
||||
name: options.name,
|
||||
selector: `${prefix}-${options.name}`,
|
||||
inlineStyle: true,
|
||||
inlineTemplate: true,
|
||||
flat: true,
|
||||
path: sourceDir,
|
||||
export: true,
|
||||
standalone: options.standalone,
|
||||
project: packageName,
|
||||
}),
|
||||
(0, schematics_1.schematic)('service', {
|
||||
name: options.name,
|
||||
flat: true,
|
||||
path: sourceDir,
|
||||
project: packageName,
|
||||
}),
|
||||
(_tree, context) => {
|
||||
if (!options.skipPackageJson && !options.skipInstall) {
|
||||
context.addTask(new tasks_1.NodePackageInstallTask());
|
||||
}
|
||||
},
|
||||
]);
|
||||
};
|
||||
}
|
||||
exports.default = default_1;
|
38
my-app/node_modules/@schematics/angular/library/schema.d.ts
generated
vendored
Executable file
38
my-app/node_modules/@schematics/angular/library/schema.d.ts
generated
vendored
Executable file
|
@ -0,0 +1,38 @@
|
|||
/**
|
||||
* Creates a new, generic library project in the current workspace.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* The path at which to create the library's public API file, relative to the workspace root.
|
||||
*/
|
||||
entryFile?: string;
|
||||
/**
|
||||
* The name of the library.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* A prefix to apply to generated selectors.
|
||||
*/
|
||||
prefix?: string;
|
||||
/**
|
||||
* The root directory of the new library.
|
||||
*/
|
||||
projectRoot?: string;
|
||||
/**
|
||||
* Do not install dependency packages.
|
||||
*/
|
||||
skipInstall?: boolean;
|
||||
/**
|
||||
* Do not add dependencies to the "package.json" file.
|
||||
*/
|
||||
skipPackageJson?: boolean;
|
||||
/**
|
||||
* Do not update "tsconfig.json" to add a path mapping for the new library. The path mapping
|
||||
* is needed to use the library in an app, but can be disabled here to simplify development.
|
||||
*/
|
||||
skipTsConfig?: boolean;
|
||||
/**
|
||||
* Creates a library based upon the standalone API, without NgModules.
|
||||
*/
|
||||
standalone?: boolean;
|
||||
}
|
4
my-app/node_modules/@schematics/angular/library/schema.js
generated
vendored
Executable file
4
my-app/node_modules/@schematics/angular/library/schema.js
generated
vendored
Executable file
|
@ -0,0 +1,4 @@
|
|||
"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 });
|
59
my-app/node_modules/@schematics/angular/library/schema.json
generated
vendored
Executable file
59
my-app/node_modules/@schematics/angular/library/schema.json
generated
vendored
Executable file
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "SchematicsLibrary",
|
||||
"title": "Library Options Schema",
|
||||
"type": "object",
|
||||
"description": "Creates a new, generic library project in the current workspace.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the library.",
|
||||
"pattern": "^(?:@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*/)?[a-zA-Z0-9-~][a-zA-Z0-9-._~]*$",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 0
|
||||
},
|
||||
"x-prompt": "What name would you like to use for the library?"
|
||||
},
|
||||
"entryFile": {
|
||||
"type": "string",
|
||||
"format": "path",
|
||||
"description": "The path at which to create the library's public API file, relative to the workspace root.",
|
||||
"default": "public-api"
|
||||
},
|
||||
"prefix": {
|
||||
"type": "string",
|
||||
"format": "html-selector",
|
||||
"description": "A prefix to apply to generated selectors.",
|
||||
"default": "lib",
|
||||
"alias": "p"
|
||||
},
|
||||
"skipPackageJson": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Do not add dependencies to the \"package.json\" file. "
|
||||
},
|
||||
"skipInstall": {
|
||||
"description": "Do not install dependency packages.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"skipTsConfig": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Do not update \"tsconfig.json\" to add a path mapping for the new library. The path mapping is needed to use the library in an app, but can be disabled here to simplify development."
|
||||
},
|
||||
"projectRoot": {
|
||||
"type": "string",
|
||||
"description": "The root directory of the new library."
|
||||
},
|
||||
"standalone": {
|
||||
"description": "Creates a library based upon the standalone API, without NgModules.",
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"x-user-analytics": "ep.ng_standalone"
|
||||
}
|
||||
},
|
||||
"required": ["name"]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue