Conexio amb la api
This commit is contained in:
parent
207c0ba819
commit
b12369cb47
48513 changed files with 7391639 additions and 7 deletions
21
node_modules/@angular/cli/LICENSE
generated
vendored
Executable file
21
node_modules/@angular/cli/LICENSE
generated
vendored
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License
|
||||
|
||||
Copyright (c) 2017 Google, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
273
node_modules/@angular/cli/README.md
generated
vendored
Executable file
273
node_modules/@angular/cli/README.md
generated
vendored
Executable file
|
|
@ -0,0 +1,273 @@
|
|||
## Angular CLI
|
||||
|
||||
<!-- Badges section here. -->
|
||||
|
||||
[![Dependency Status][david-badge]][david-badge-url]
|
||||
[![devDependency Status][david-dev-badge]][david-dev-badge-url]
|
||||
|
||||
[][npm-badge-url]
|
||||
[][npm-badge-url]
|
||||
[][license-url]
|
||||
[][npm-badge-url]
|
||||
|
||||
[](https://gitter.im/angular/angular-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
[](https://github.com/angular/angular-cli/fork)
|
||||
[](https://github.com/angular/angular-cli)
|
||||
|
||||
## Note
|
||||
|
||||
If you are updating from a beta or RC version, check out our [1.0 Update Guide](https://github.com/angular/angular-cli/wiki/stories-1.0-update).
|
||||
|
||||
If you wish to collaborate, check out [our issue list](https://github.com/angular/angular-cli/issues).
|
||||
|
||||
Before submitting new issues, have a look at [issues marked with the `type: faq` label](https://github.com/angular/angular-cli/issues?utf8=%E2%9C%93&q=is%3Aissue%20label%3A%22type%3A%20faq%22%20).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Both the CLI and generated project have dependencies that require Node 8.9 or higher, together
|
||||
with NPM 5.5.1 or higher.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Installation](#installation)
|
||||
- [Usage](#usage)
|
||||
- [Generating a New Project](#generating-and-serving-an-angular-project-via-a-development-server)
|
||||
- [Generating Components, Directives, Pipes and Services](#generating-components-directives-pipes-and-services)
|
||||
- [Updating Angular CLI](#updating-angular-cli)
|
||||
- [Development Hints for working on Angular CLI](#development-hints-for-working-on-angular-cli)
|
||||
- [Documentation](#documentation)
|
||||
- [License](#license)
|
||||
|
||||
## Installation
|
||||
|
||||
**BEFORE YOU INSTALL:** please read the [prerequisites](#prerequisites)
|
||||
|
||||
### Install Globally
|
||||
|
||||
```bash
|
||||
npm install -g @angular/cli
|
||||
```
|
||||
|
||||
### Install Locally
|
||||
|
||||
```bash
|
||||
npm install @angular/cli
|
||||
```
|
||||
|
||||
To run a locally installed version of the angular-cli, you can call `ng` commands directly by adding the `.bin` folder within your local `node_modules` folder to your PATH. The `node_modules` and `.bin` folders are created in the directory where `npm install @angular/cli` was run upon completion of the install command.
|
||||
|
||||
Alternatively, you can install [npx](https://www.npmjs.com/package/npx) and run `npx ng <command>` within the local directory where `npm install @angular/cli` was run, which will use the locally installed angular-cli.
|
||||
|
||||
### Install Specific Version (Example: 6.1.1)
|
||||
|
||||
```bash
|
||||
npm install -g @angular/cli@6.1.1
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
ng help
|
||||
```
|
||||
|
||||
### Generating and serving an Angular project via a development server
|
||||
|
||||
```bash
|
||||
ng new PROJECT-NAME
|
||||
cd PROJECT-NAME
|
||||
ng serve
|
||||
```
|
||||
|
||||
Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
|
||||
|
||||
You can configure the default HTTP host and port used by the development server with two command-line options :
|
||||
|
||||
```bash
|
||||
ng serve --host 0.0.0.0 --port 4201
|
||||
```
|
||||
|
||||
### Generating Components, Directives, Pipes and Services
|
||||
|
||||
You can use the `ng generate` (or just `ng g`) command to generate Angular components:
|
||||
|
||||
```bash
|
||||
ng generate component my-new-component
|
||||
ng g component my-new-component # using the alias
|
||||
|
||||
# components support relative path generation
|
||||
# if in the directory src/app/feature/ and you run
|
||||
ng g component new-cmp
|
||||
# your component will be generated in src/app/feature/new-cmp
|
||||
# but if you were to run
|
||||
ng g component ./newer-cmp
|
||||
# your component will be generated in src/app/newer-cmp
|
||||
# if in the directory src/app you can also run
|
||||
ng g component feature/new-cmp
|
||||
# and your component will be generated in src/app/feature/new-cmp
|
||||
```
|
||||
|
||||
You can find all possible blueprints in the table below:
|
||||
|
||||
| Scaffold | Usage |
|
||||
| ------------------------------------------------------ | --------------------------------- |
|
||||
| [Component](https://angular.io/cli/generate#component) | `ng g component my-new-component` |
|
||||
| [Directive](https://angular.io/cli/generate#directive) | `ng g directive my-new-directive` |
|
||||
| [Pipe](https://angular.io/cli/generate#pipe) | `ng g pipe my-new-pipe` |
|
||||
| [Service](https://angular.io/cli/generate#service) | `ng g service my-new-service` |
|
||||
| [Class](https://angular.io/cli/generate#class) | `ng g class my-new-class` |
|
||||
| [Guard](https://angular.io/cli/generate#guard) | `ng g guard my-new-guard` |
|
||||
| [Interface](https://angular.io/cli/generate#interface) | `ng g interface my-new-interface` |
|
||||
| [Enum](https://angular.io/cli/generate#enum) | `ng g enum my-new-enum` |
|
||||
| [Module](https://angular.io/cli/generate#module) | `ng g module my-module` |
|
||||
|
||||
angular-cli will add reference to `components`, `directives` and `pipes` automatically in the `app.module.ts`. If you need to add this references to another custom module, follow these steps:
|
||||
|
||||
1. `ng g module new-module` to create a new module
|
||||
2. call `ng g component new-module/new-component`
|
||||
|
||||
This should add the new `component`, `directive` or `pipe` reference to the `new-module` you've created.
|
||||
|
||||
### Updating Angular CLI
|
||||
|
||||
If you're using Angular CLI `1.0.0-beta.28` or less, you need to uninstall `angular-cli` package. It should be done due to changing of package's name and scope from `angular-cli` to `@angular/cli`:
|
||||
|
||||
```bash
|
||||
npm uninstall -g angular-cli
|
||||
npm uninstall --save-dev angular-cli
|
||||
```
|
||||
|
||||
To update Angular CLI to a new version, you must update both the global package and your project's local package.
|
||||
|
||||
Global package:
|
||||
|
||||
```bash
|
||||
npm uninstall -g @angular/cli
|
||||
npm cache verify
|
||||
# if npm version is < 5 then use `npm cache clean`
|
||||
npm install -g @angular/cli@latest
|
||||
```
|
||||
|
||||
Local project package:
|
||||
|
||||
```bash
|
||||
rm -rf node_modules dist # use rmdir /S/Q node_modules dist in Windows Command Prompt; use rm -r -fo node_modules,dist in Windows PowerShell
|
||||
npm install --save-dev @angular/cli@latest
|
||||
npm install
|
||||
```
|
||||
|
||||
If you are updating to 1.0 from a beta or RC version, check out our [1.0 Update Guide](https://github.com/angular/angular-cli/wiki/stories-1.0-update).
|
||||
|
||||
You can find more details about changes between versions in [the Releases tab on GitHub](https://github.com/angular/angular-cli/releases).
|
||||
|
||||
## Development Hints for working on Angular CLI
|
||||
|
||||
### Working with master
|
||||
|
||||
```bash
|
||||
git clone https://github.com/angular/angular-cli.git
|
||||
yarn
|
||||
npm run build
|
||||
cd dist/@angular/cli
|
||||
npm link
|
||||
```
|
||||
|
||||
`npm link` is very similar to `npm install -g` except that instead of downloading the package
|
||||
from the repo, the just built `dist/@angular/cli/` folder becomes the global package.
|
||||
Additionally, this repository publishes several packages and we use special logic to load all of them
|
||||
on development setups.
|
||||
|
||||
Any changes to the files in the `angular-cli/` folder will immediately affect the global `@angular/cli` package,
|
||||
meaning that, in order to quickly test any changes you make to the cli project, you should simply just run `npm run build`
|
||||
again.
|
||||
|
||||
Now you can use `@angular/cli` via the command line:
|
||||
|
||||
```bash
|
||||
ng new foo
|
||||
cd foo
|
||||
npm link @angular/cli
|
||||
ng serve
|
||||
```
|
||||
|
||||
`npm link @angular/cli` is needed because by default the globally installed `@angular/cli` just loads
|
||||
the local `@angular/cli` from the project which was fetched remotely from npm.
|
||||
`npm link @angular/cli` symlinks the global `@angular/cli` package to the local `@angular/cli` package.
|
||||
Now the `angular-cli` you cloned before is in three places:
|
||||
The folder you cloned it into, npm's folder where it stores global packages and the Angular CLI project you just created.
|
||||
|
||||
You can also use `ng new foo --link-cli` to automatically link the `@angular/cli` package.
|
||||
|
||||
Please read the official [npm-link documentation](https://docs.npmjs.com/cli/link)
|
||||
and the [npm-link cheatsheet](http://browsenpm.org/help#linkinganynpmpackagelocally) for more information.
|
||||
|
||||
To run the Angular CLI E2E test suite, use the `node ./tests/legacy-cli/run_e2e` command.
|
||||
It can also receive a filename to only run that test (e.g. `node ./tests/legacy-cli/run_e2e tests/legacy-cli/e2e/tests/build/dev-build.ts`).
|
||||
|
||||
As part of the test procedure, all packages will be built and linked.
|
||||
You will need to re-run `npm link` to re-link the development Angular CLI environment after tests finish.
|
||||
|
||||
### Debugging with VS Code
|
||||
|
||||
In order to debug some Angular CLI behaviour using Visual Studio Code, you can run `npm run build`, and then use a launch configuration like the following:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "ng serve",
|
||||
"cwd": "<path to an Angular project generated with Angular-CLI>",
|
||||
"program": "${workspaceFolder}/dist/@angular/cli/bin/ng",
|
||||
"args": [
|
||||
"<ng command>",
|
||||
...other arguments
|
||||
],
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
```
|
||||
|
||||
Then you can add breakpoints in `dist/@angular` files.
|
||||
|
||||
For more informations about Node.js debugging in VS Code, see the related [VS Code Documentation](https://code.visualstudio.com/docs/nodejs/nodejs-debugging).
|
||||
|
||||
### CPU Profiling
|
||||
|
||||
In order to investigate performance issues, CPU profiling is often useful.
|
||||
|
||||
To capture a CPU profiling, you can:
|
||||
|
||||
1. install the v8-profiler-node8 dependency: `npm install v8-profiler-node8 --no-save`
|
||||
1. set the NG_CLI_PROFILING Environment variable to the file name you want:
|
||||
- on Unix systems (Linux & Mac OS X): ̀`export NG_CLI_PROFILING=my-profile`
|
||||
- on Windows: ̀̀`setx NG_CLI_PROFILING my-profile`
|
||||
|
||||
Then, just run the ng command on which you want to capture a CPU profile.
|
||||
You will then obtain a `my-profile.cpuprofile` file in the folder from which you ran the ng command.
|
||||
|
||||
You can use the Chrome Devtools to process it. To do so:
|
||||
|
||||
1. open `chrome://inspect/#devices` in Chrome
|
||||
1. click on "Open dedicated DevTools for Node"
|
||||
1. go to the "profiler" tab
|
||||
1. click on the "Load" button and select the generated .cpuprofile file
|
||||
1. on the left panel, select the associated file
|
||||
|
||||
In addition to this one, another, more elaborated way to capture a CPU profile using the Chrome Devtools is detailed in https://github.com/angular/angular-cli/issues/8259#issue-269908550.
|
||||
|
||||
## Documentation
|
||||
|
||||
The documentation for the Angular CLI is located on our [documentation website](https://angular.io/cli).
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/angular/angular-cli/blob/master/LICENSE)
|
||||
|
||||
[travis-badge]: https://travis-ci.org/angular/angular-cli.svg?branch=master
|
||||
[travis-badge-url]: https://travis-ci.org/angular/angular-cli
|
||||
[david-badge]: https://david-dm.org/angular/angular-cli.svg
|
||||
[david-badge-url]: https://david-dm.org/angular/angular-cli
|
||||
[david-dev-badge]: https://david-dm.org/angular/angular-cli/dev-status.svg
|
||||
[david-dev-badge-url]: https://david-dm.org/angular/angular-cli?type=dev
|
||||
[npm-badge]: https://img.shields.io/npm/v/@angular/cli.svg
|
||||
[npm-badge-url]: https://www.npmjs.com/package/@angular/cli
|
||||
[license-url]: https://github.com/angular/angular-cli/blob/master/LICENSE
|
||||
47
node_modules/@angular/cli/bin/ng
generated
vendored
Executable file
47
node_modules/@angular/cli/bin/ng
generated
vendored
Executable file
|
|
@ -0,0 +1,47 @@
|
|||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
// Provide a title to the process in `ps`.
|
||||
// Due to an obscure Mac bug, do not start this title with any symbol.
|
||||
try {
|
||||
process.title = 'ng ' + Array.from(process.argv).slice(2).join(' ');
|
||||
} catch (_) {
|
||||
// If an error happened above, use the most basic title.
|
||||
process.title = 'ng';
|
||||
}
|
||||
|
||||
// This node version check ensures that extremely old versions of node are not used.
|
||||
// These may not support ES2015 features such as const/let/async/await/etc.
|
||||
// These would then crash with a hard to diagnose error message.
|
||||
// tslint:disable-next-line: no-var-keyword
|
||||
var version = process.versions.node.split('.').map((part) => Number(part));
|
||||
if (version[0] % 2 === 1 && version[0] > 14) {
|
||||
// Allow new odd numbered releases with a warning (currently v15+)
|
||||
console.warn(
|
||||
'Node.js version ' +
|
||||
process.version +
|
||||
' detected.\n' +
|
||||
'Odd numbered Node.js versions will not enter LTS status and should not be used for production.' +
|
||||
' For more information, please see https://nodejs.org/en/about/releases/.',
|
||||
);
|
||||
|
||||
require('../lib/init');
|
||||
} else if (
|
||||
version[0] < 12 ||
|
||||
version[0] === 13 ||
|
||||
(version[0] === 12 && version[1] < 14) ||
|
||||
(version[0] === 14 && version[1] < 15)
|
||||
) {
|
||||
// Error and exit if less than 12.14 or 13.x or less than 14.15
|
||||
console.error(
|
||||
'Node.js version ' +
|
||||
process.version +
|
||||
' detected.\n' +
|
||||
'The Angular CLI requires a minimum Node.js version of either v12.14 or v14.15.\n\n' +
|
||||
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
|
||||
);
|
||||
|
||||
process.exitCode = 3;
|
||||
} else {
|
||||
require('../lib/init');
|
||||
}
|
||||
19
node_modules/@angular/cli/bin/postinstall/analytics-prompt.js
generated
vendored
Executable file
19
node_modules/@angular/cli/bin/postinstall/analytics-prompt.js
generated
vendored
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
'use strict';
|
||||
// This file is ES6 because it needs to be executed as is.
|
||||
|
||||
if ('NG_CLI_ANALYTICS' in process.env) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
var analytics = require('../../models/analytics');
|
||||
|
||||
analytics
|
||||
.hasGlobalAnalyticsConfiguration()
|
||||
.then((hasGlobalConfig) => {
|
||||
if (!hasGlobalConfig) {
|
||||
return analytics.promptGlobalAnalytics();
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
} catch (_) {}
|
||||
7
node_modules/@angular/cli/bin/postinstall/script.js
generated
vendored
Executable file
7
node_modules/@angular/cli/bin/postinstall/script.js
generated
vendored
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
// These should not fail but if they do they should not block installation of the package
|
||||
try {
|
||||
require('./analytics-prompt');
|
||||
} catch (_) {}
|
||||
20
node_modules/@angular/cli/commands.json
generated
vendored
Executable file
20
node_modules/@angular/cli/commands.json
generated
vendored
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"add": "./commands/add.json",
|
||||
"analytics": "./commands/analytics.json",
|
||||
"build": "./commands/build.json",
|
||||
"config": "./commands/config.json",
|
||||
"deploy": "./commands/deploy.json",
|
||||
"doc": "./commands/doc.json",
|
||||
"e2e": "./commands/e2e.json",
|
||||
"extract-i18n": "./commands/extract-i18n.json",
|
||||
"make-this-awesome": "./commands/easter-egg.json",
|
||||
"generate": "./commands/generate.json",
|
||||
"help": "./commands/help.json",
|
||||
"lint": "./commands/lint.json",
|
||||
"new": "./commands/new.json",
|
||||
"run": "./commands/run.json",
|
||||
"serve": "./commands/serve.json",
|
||||
"test": "./commands/test.json",
|
||||
"update": "./commands/update.json",
|
||||
"version": "./commands/version.json"
|
||||
}
|
||||
20
node_modules/@angular/cli/commands/add-impl.d.ts
generated
vendored
Executable file
20
node_modules/@angular/cli/commands/add-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* @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 { Arguments } from '../models/interface';
|
||||
import { SchematicCommand } from '../models/schematic-command';
|
||||
import { Schema as AddCommandSchema } from './add';
|
||||
export declare class AddCommand extends SchematicCommand<AddCommandSchema> {
|
||||
readonly allowPrivateSchematics = true;
|
||||
initialize(options: AddCommandSchema & Arguments): Promise<void>;
|
||||
run(options: AddCommandSchema & Arguments): Promise<number | void>;
|
||||
reportAnalytics(paths: string[], options: AddCommandSchema & Arguments, dimensions?: (boolean | number | string)[], metrics?: (boolean | number | string)[]): Promise<void>;
|
||||
private isPackageInstalled;
|
||||
private executeSchematic;
|
||||
private findProjectVersion;
|
||||
private hasMismatchedPeer;
|
||||
}
|
||||
301
node_modules/@angular/cli/commands/add-impl.js
generated
vendored
Executable file
301
node_modules/@angular/cli/commands/add-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,301 @@
|
|||
"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 });
|
||||
exports.AddCommand = void 0;
|
||||
const core_1 = require("@angular-devkit/core");
|
||||
const tools_1 = require("@angular-devkit/schematics/tools");
|
||||
const path_1 = require("path");
|
||||
const semver_1 = require("semver");
|
||||
const workspace_schema_1 = require("../lib/config/workspace-schema");
|
||||
const analytics_1 = require("../models/analytics");
|
||||
const schematic_command_1 = require("../models/schematic-command");
|
||||
const color_1 = require("../utilities/color");
|
||||
const install_package_1 = require("../utilities/install-package");
|
||||
const package_manager_1 = require("../utilities/package-manager");
|
||||
const package_metadata_1 = require("../utilities/package-metadata");
|
||||
const prompt_1 = require("../utilities/prompt");
|
||||
const spinner_1 = require("../utilities/spinner");
|
||||
const tty_1 = require("../utilities/tty");
|
||||
const npa = require('npm-package-arg');
|
||||
class AddCommand extends schematic_command_1.SchematicCommand {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.allowPrivateSchematics = true;
|
||||
}
|
||||
async initialize(options) {
|
||||
if (options.registry) {
|
||||
return super.initialize({ ...options, packageRegistry: options.registry });
|
||||
}
|
||||
else {
|
||||
return super.initialize(options);
|
||||
}
|
||||
}
|
||||
async run(options) {
|
||||
var _a;
|
||||
await package_manager_1.ensureCompatibleNpm(this.context.root);
|
||||
if (!options.collection) {
|
||||
this.logger.fatal(`The "ng add" command requires a name argument to be specified eg. ` +
|
||||
`${color_1.colors.yellow('ng add [name] ')}. For more details, use "ng help".`);
|
||||
return 1;
|
||||
}
|
||||
let packageIdentifier;
|
||||
try {
|
||||
packageIdentifier = npa(options.collection);
|
||||
}
|
||||
catch (e) {
|
||||
this.logger.error(e.message);
|
||||
return 1;
|
||||
}
|
||||
if (packageIdentifier.registry && this.isPackageInstalled(packageIdentifier.name)) {
|
||||
let validVersion = false;
|
||||
const installedVersion = await this.findProjectVersion(packageIdentifier.name);
|
||||
if (installedVersion) {
|
||||
if (packageIdentifier.type === 'range') {
|
||||
validVersion = semver_1.satisfies(installedVersion, packageIdentifier.fetchSpec);
|
||||
}
|
||||
else if (packageIdentifier.type === 'version') {
|
||||
const v1 = semver_1.valid(packageIdentifier.fetchSpec);
|
||||
const v2 = semver_1.valid(installedVersion);
|
||||
validVersion = v1 !== null && v1 === v2;
|
||||
}
|
||||
else if (!packageIdentifier.rawSpec) {
|
||||
validVersion = true;
|
||||
}
|
||||
}
|
||||
if (validVersion) {
|
||||
// Already installed so just run schematic
|
||||
this.logger.info('Skipping installation: Package already installed');
|
||||
return this.executeSchematic(packageIdentifier.name, options['--']);
|
||||
}
|
||||
}
|
||||
const spinner = new spinner_1.Spinner();
|
||||
spinner.start('Determining package manager...');
|
||||
const packageManager = await package_manager_1.getPackageManager(this.context.root);
|
||||
const usingYarn = packageManager === workspace_schema_1.PackageManager.Yarn;
|
||||
spinner.info(`Using package manager: ${color_1.colors.grey(packageManager)}`);
|
||||
if (packageIdentifier.type === 'tag' && !packageIdentifier.rawSpec) {
|
||||
// only package name provided; search for viable version
|
||||
// plus special cases for packages that did not have peer deps setup
|
||||
spinner.start('Searching for compatible package version...');
|
||||
let packageMetadata;
|
||||
try {
|
||||
packageMetadata = await package_metadata_1.fetchPackageMetadata(packageIdentifier.name, this.logger, {
|
||||
registry: options.registry,
|
||||
usingYarn,
|
||||
verbose: options.verbose,
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
spinner.fail('Unable to load package information from registry: ' + e.message);
|
||||
return 1;
|
||||
}
|
||||
const latestManifest = packageMetadata.tags['latest'];
|
||||
if (latestManifest && Object.keys(latestManifest.peerDependencies).length === 0) {
|
||||
if (latestManifest.name === '@angular/pwa') {
|
||||
const version = await this.findProjectVersion('@angular/cli');
|
||||
const semverOptions = { includePrerelease: true };
|
||||
if (version &&
|
||||
((semver_1.validRange(version) && semver_1.intersects(version, '7', semverOptions)) ||
|
||||
(semver_1.valid(version) && semver_1.satisfies(version, '7', semverOptions)))) {
|
||||
packageIdentifier = npa.resolve('@angular/pwa', '0.12');
|
||||
}
|
||||
}
|
||||
else {
|
||||
packageIdentifier = npa.resolve(latestManifest.name, latestManifest.version);
|
||||
}
|
||||
spinner.succeed(`Found compatible package version: ${color_1.colors.grey(packageIdentifier)}.`);
|
||||
}
|
||||
else if (!latestManifest || (await this.hasMismatchedPeer(latestManifest))) {
|
||||
// 'latest' is invalid so search for most recent matching package
|
||||
const versionManifests = Object.values(packageMetadata.versions).filter((value) => !semver_1.prerelease(value.version) && !value.deprecated);
|
||||
versionManifests.sort((a, b) => semver_1.rcompare(a.version, b.version, true));
|
||||
let newIdentifier;
|
||||
for (const versionManifest of versionManifests) {
|
||||
if (!(await this.hasMismatchedPeer(versionManifest))) {
|
||||
newIdentifier = npa.resolve(packageIdentifier.name, versionManifest.version);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!newIdentifier) {
|
||||
spinner.warn("Unable to find compatible package. Using 'latest'.");
|
||||
}
|
||||
else {
|
||||
packageIdentifier = newIdentifier;
|
||||
spinner.succeed(`Found compatible package version: ${color_1.colors.grey(packageIdentifier)}.`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
packageIdentifier = npa.resolve(latestManifest.name, latestManifest.version);
|
||||
spinner.succeed(`Found compatible package version: ${color_1.colors.grey(packageIdentifier)}.`);
|
||||
}
|
||||
}
|
||||
let collectionName = packageIdentifier.name;
|
||||
let savePackage;
|
||||
try {
|
||||
spinner.start('Loading package information from registry...');
|
||||
const manifest = await package_metadata_1.fetchPackageManifest(packageIdentifier, this.logger, {
|
||||
registry: options.registry,
|
||||
verbose: options.verbose,
|
||||
usingYarn,
|
||||
});
|
||||
savePackage = (_a = manifest['ng-add']) === null || _a === void 0 ? void 0 : _a.save;
|
||||
collectionName = manifest.name;
|
||||
if (await this.hasMismatchedPeer(manifest)) {
|
||||
spinner.warn('Package has unmet peer dependencies. Adding the package may not succeed.');
|
||||
}
|
||||
else {
|
||||
spinner.succeed(`Package information loaded.`);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
spinner.fail(`Unable to fetch package information for '${packageIdentifier}': ${e.message}`);
|
||||
return 1;
|
||||
}
|
||||
if (!options.skipConfirmation) {
|
||||
const confirmationResponse = await prompt_1.askConfirmation(`\nThe package ${color_1.colors.blue(packageIdentifier.raw)} will be installed and executed.\n` +
|
||||
'Would you like to proceed?', true, false);
|
||||
if (!confirmationResponse) {
|
||||
if (!tty_1.isTTY) {
|
||||
this.logger.error('No terminal detected. ' +
|
||||
`'--skip-confirmation' can be used to bypass installation confirmation. ` +
|
||||
`Ensure package name is correct prior to '--skip-confirmation' option usage.`);
|
||||
}
|
||||
this.logger.error('Command aborted.');
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (savePackage === false) {
|
||||
// Temporary packages are located in a different directory
|
||||
// Hence we need to resolve them using the temp path
|
||||
const { status, tempNodeModules } = await install_package_1.installTempPackage(packageIdentifier.raw, packageManager, options.registry ? [`--registry="${options.registry}"`] : undefined);
|
||||
const resolvedCollectionPath = require.resolve(path_1.join(collectionName, 'package.json'), {
|
||||
paths: [tempNodeModules],
|
||||
});
|
||||
if (status !== 0) {
|
||||
return status;
|
||||
}
|
||||
collectionName = path_1.dirname(resolvedCollectionPath);
|
||||
}
|
||||
else {
|
||||
const status = await install_package_1.installPackage(packageIdentifier.raw, packageManager, savePackage, options.registry ? [`--registry="${options.registry}"`] : undefined);
|
||||
if (status !== 0) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return this.executeSchematic(collectionName, options['--']);
|
||||
}
|
||||
async reportAnalytics(paths, options, dimensions = [], metrics = []) {
|
||||
const collection = options.collection;
|
||||
// Add the collection if it's safe listed.
|
||||
if (collection && analytics_1.isPackageNameSafeForAnalytics(collection)) {
|
||||
dimensions[core_1.analytics.NgCliAnalyticsDimensions.NgAddCollection] = collection;
|
||||
}
|
||||
else {
|
||||
delete dimensions[core_1.analytics.NgCliAnalyticsDimensions.NgAddCollection];
|
||||
}
|
||||
return super.reportAnalytics(paths, options, dimensions, metrics);
|
||||
}
|
||||
isPackageInstalled(name) {
|
||||
try {
|
||||
require.resolve(path_1.join(name, 'package.json'), { paths: [this.context.root] });
|
||||
return true;
|
||||
}
|
||||
catch (e) {
|
||||
if (e.code !== 'MODULE_NOT_FOUND') {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
async executeSchematic(collectionName, options = []) {
|
||||
const runOptions = {
|
||||
schematicOptions: options,
|
||||
collectionName,
|
||||
schematicName: 'ng-add',
|
||||
dryRun: false,
|
||||
force: false,
|
||||
};
|
||||
try {
|
||||
return await this.runSchematic(runOptions);
|
||||
}
|
||||
catch (e) {
|
||||
if (e instanceof tools_1.NodePackageDoesNotSupportSchematics) {
|
||||
this.logger.error(core_1.tags.oneLine `
|
||||
The package that you are trying to add does not support schematics. You can try using
|
||||
a different version of the package or contact the package author to add ng-add support.
|
||||
`);
|
||||
return 1;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
async findProjectVersion(name) {
|
||||
let installedPackage;
|
||||
try {
|
||||
installedPackage = require.resolve(path_1.join(name, 'package.json'), {
|
||||
paths: [this.context.root],
|
||||
});
|
||||
}
|
||||
catch { }
|
||||
if (installedPackage) {
|
||||
try {
|
||||
const installed = await package_metadata_1.fetchPackageManifest(path_1.dirname(installedPackage), this.logger);
|
||||
return installed.version;
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
let projectManifest;
|
||||
try {
|
||||
projectManifest = await package_metadata_1.fetchPackageManifest(this.context.root, this.logger);
|
||||
}
|
||||
catch { }
|
||||
if (projectManifest) {
|
||||
const version = projectManifest.dependencies[name] || projectManifest.devDependencies[name];
|
||||
if (version) {
|
||||
return version;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
async hasMismatchedPeer(manifest) {
|
||||
for (const peer in manifest.peerDependencies) {
|
||||
let peerIdentifier;
|
||||
try {
|
||||
peerIdentifier = npa.resolve(peer, manifest.peerDependencies[peer]);
|
||||
}
|
||||
catch {
|
||||
this.logger.warn(`Invalid peer dependency ${peer} found in package.`);
|
||||
continue;
|
||||
}
|
||||
if (peerIdentifier.type === 'version' || peerIdentifier.type === 'range') {
|
||||
try {
|
||||
const version = await this.findProjectVersion(peer);
|
||||
if (!version) {
|
||||
continue;
|
||||
}
|
||||
const options = { includePrerelease: true };
|
||||
if (!semver_1.intersects(version, peerIdentifier.rawSpec, options) &&
|
||||
!semver_1.satisfies(version, peerIdentifier.rawSpec, options)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch {
|
||||
// Not found or invalid so ignore
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// type === 'tag' | 'file' | 'directory' | 'remote' | 'git'
|
||||
// Cannot accurately compare these as the tag/location may have changed since install
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
exports.AddCommand = AddCommand;
|
||||
42
node_modules/@angular/cli/commands/add.d.ts
generated
vendored
Executable file
42
node_modules/@angular/cli/commands/add.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
* Adds support for an external library to your project.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* The package to be added.
|
||||
*/
|
||||
collection?: string;
|
||||
/**
|
||||
* Disable interactive input prompts for options with a default.
|
||||
*/
|
||||
defaults?: boolean;
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
/**
|
||||
* Enable interactive input prompts.
|
||||
*/
|
||||
interactive?: boolean;
|
||||
/**
|
||||
* The NPM registry to use.
|
||||
*/
|
||||
registry?: string;
|
||||
/**
|
||||
* Skip asking a confirmation prompt before installing and executing the package. Ensure
|
||||
* package name is correct prior to using this option.
|
||||
*/
|
||||
skipConfirmation?: boolean;
|
||||
/**
|
||||
* Display additional details about internal operations during execution.
|
||||
*/
|
||||
verbose?: boolean;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
10
node_modules/@angular/cli/commands/add.js
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/add.js
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
"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 });
|
||||
exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
54
node_modules/@angular/cli/commands/add.json
generated
vendored
Executable file
54
node_modules/@angular/cli/commands/add.json
generated
vendored
Executable file
|
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/add.json",
|
||||
"description": "Adds support for an external library to your project.",
|
||||
"$longDescription": "./add.md",
|
||||
|
||||
"$scope": "in",
|
||||
"$impl": "./add-impl#AddCommand",
|
||||
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"properties": {
|
||||
"collection": {
|
||||
"type": "string",
|
||||
"description": "The package to be added.",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 0
|
||||
}
|
||||
},
|
||||
"registry": {
|
||||
"description": "The NPM registry to use.",
|
||||
"type": "string",
|
||||
"oneOf": [
|
||||
{
|
||||
"format": "uri"
|
||||
},
|
||||
{
|
||||
"format": "hostname"
|
||||
}
|
||||
]
|
||||
},
|
||||
"verbose": {
|
||||
"description": "Display additional details about internal operations during execution.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"skipConfirmation": {
|
||||
"description": "Skip asking a confirmation prompt before installing and executing the package. Ensure package name is correct prior to using this option.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
},
|
||||
{
|
||||
"$ref": "./definitions.json#/definitions/interactive"
|
||||
},
|
||||
{
|
||||
"$ref": "./definitions.json#/definitions/base"
|
||||
}
|
||||
]
|
||||
}
|
||||
10
node_modules/@angular/cli/commands/add.md
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/add.md
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
Adds the npm package for a published library to your workspace, and configures
|
||||
the project in the current working directory (or the default project if you are
|
||||
not in a project directory) to use that library, as specified by the library's schematic.
|
||||
For example, adding `@angular/pwa` configures your project for PWA support:
|
||||
|
||||
```bash
|
||||
ng add @angular/pwa
|
||||
```
|
||||
|
||||
The default project is the value of `defaultProject` in `angular.json`.
|
||||
13
node_modules/@angular/cli/commands/analytics-impl.d.ts
generated
vendored
Executable file
13
node_modules/@angular/cli/commands/analytics-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
* @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 { Command } from '../models/command';
|
||||
import { Arguments } from '../models/interface';
|
||||
import { Schema as AnalyticsCommandSchema } from './analytics';
|
||||
export declare class AnalyticsCommand extends Command<AnalyticsCommandSchema> {
|
||||
run(options: AnalyticsCommandSchema & Arguments): Promise<0 | 1 | 2 | 3 | 4>;
|
||||
}
|
||||
80
node_modules/@angular/cli/commands/analytics-impl.js
generated
vendored
Executable file
80
node_modules/@angular/cli/commands/analytics-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,80 @@
|
|||
"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 });
|
||||
exports.AnalyticsCommand = void 0;
|
||||
const analytics_1 = require("../models/analytics");
|
||||
const command_1 = require("../models/command");
|
||||
const analytics_2 = require("./analytics");
|
||||
class AnalyticsCommand extends command_1.Command {
|
||||
async run(options) {
|
||||
// Our parser does not support positional enums (won't report invalid parameters). Do the
|
||||
// validation manually.
|
||||
// TODO(hansl): fix parser to better support positionals. This would be a breaking change.
|
||||
if (options.settingOrProject === undefined) {
|
||||
if (options['--']) {
|
||||
// The user passed positional arguments but they didn't validate.
|
||||
this.logger.error(`Argument ${JSON.stringify(options['--'][0])} is invalid.`);
|
||||
this.logger.error(`Please provide one of the following value: on, off, ci or project.`);
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
// No argument were passed.
|
||||
await this.printHelp();
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
else if (options.settingOrProject == analytics_2.SettingOrProject.Project &&
|
||||
options.projectSetting === undefined) {
|
||||
this.logger.error(`Argument ${JSON.stringify(options.settingOrProject)} requires a second ` +
|
||||
`argument of one of the following value: on, off.`);
|
||||
return 2;
|
||||
}
|
||||
try {
|
||||
switch (options.settingOrProject) {
|
||||
case analytics_2.SettingOrProject.Off:
|
||||
analytics_1.setAnalyticsConfig('global', false);
|
||||
break;
|
||||
case analytics_2.SettingOrProject.On:
|
||||
analytics_1.setAnalyticsConfig('global', true);
|
||||
break;
|
||||
case analytics_2.SettingOrProject.Ci:
|
||||
analytics_1.setAnalyticsConfig('global', 'ci');
|
||||
break;
|
||||
case analytics_2.SettingOrProject.Project:
|
||||
switch (options.projectSetting) {
|
||||
case analytics_2.ProjectSetting.Off:
|
||||
analytics_1.setAnalyticsConfig('local', false);
|
||||
break;
|
||||
case analytics_2.ProjectSetting.On:
|
||||
analytics_1.setAnalyticsConfig('local', true);
|
||||
break;
|
||||
case analytics_2.ProjectSetting.Prompt:
|
||||
await analytics_1.promptProjectAnalytics(true);
|
||||
break;
|
||||
default:
|
||||
await this.printHelp();
|
||||
return 3;
|
||||
}
|
||||
break;
|
||||
case analytics_2.SettingOrProject.Prompt:
|
||||
await analytics_1.promptGlobalAnalytics(true);
|
||||
break;
|
||||
default:
|
||||
await this.printHelp();
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
this.logger.fatal(err.message);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
exports.AnalyticsCommand = AnalyticsCommand;
|
||||
8
node_modules/@angular/cli/commands/analytics-long.md
generated
vendored
Executable file
8
node_modules/@angular/cli/commands/analytics-long.md
generated
vendored
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
The value of _settingOrProject_ is one of the following.
|
||||
|
||||
- "on" : Enables analytics gathering and reporting for the user.
|
||||
- "off" : Disables analytics gathering and reporting for the user.
|
||||
- "ci" : Enables analytics and configures reporting for use with Continuous Integration,
|
||||
which uses a common CI user.
|
||||
- "prompt" : Prompts the user to set the status interactively.
|
||||
- "project" : Sets the default status for the project to the _projectSetting_ value, which can be any of the other values. The _projectSetting_ argument is ignored for all other values of _settingOrProject_.
|
||||
46
node_modules/@angular/cli/commands/analytics.d.ts
generated
vendored
Executable file
46
node_modules/@angular/cli/commands/analytics.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
/**
|
||||
* Configures the gathering of Angular CLI usage metrics. See
|
||||
* https://angular.io/cli/usage-analytics-gathering.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
/**
|
||||
* Sets the default analytics enablement status for the project.
|
||||
*/
|
||||
projectSetting?: ProjectSetting;
|
||||
/**
|
||||
* Directly enables or disables all usage analytics for the user, or prompts the user to set
|
||||
* the status interactively, or sets the default status for the project.
|
||||
*/
|
||||
settingOrProject: SettingOrProject;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
/**
|
||||
* Sets the default analytics enablement status for the project.
|
||||
*/
|
||||
export declare enum ProjectSetting {
|
||||
Off = "off",
|
||||
On = "on",
|
||||
Prompt = "prompt"
|
||||
}
|
||||
/**
|
||||
* Directly enables or disables all usage analytics for the user, or prompts the user to set
|
||||
* the status interactively, or sets the default status for the project.
|
||||
*/
|
||||
export declare enum SettingOrProject {
|
||||
Ci = "ci",
|
||||
Off = "off",
|
||||
On = "on",
|
||||
Project = "project",
|
||||
Prompt = "prompt"
|
||||
}
|
||||
31
node_modules/@angular/cli/commands/analytics.js
generated
vendored
Executable file
31
node_modules/@angular/cli/commands/analytics.js
generated
vendored
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
"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 });
|
||||
exports.SettingOrProject = exports.ProjectSetting = exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
/**
|
||||
* Sets the default analytics enablement status for the project.
|
||||
*/
|
||||
var ProjectSetting;
|
||||
(function (ProjectSetting) {
|
||||
ProjectSetting["Off"] = "off";
|
||||
ProjectSetting["On"] = "on";
|
||||
ProjectSetting["Prompt"] = "prompt";
|
||||
})(ProjectSetting = exports.ProjectSetting || (exports.ProjectSetting = {}));
|
||||
/**
|
||||
* Directly enables or disables all usage analytics for the user, or prompts the user to set
|
||||
* the status interactively, or sets the default status for the project.
|
||||
*/
|
||||
var SettingOrProject;
|
||||
(function (SettingOrProject) {
|
||||
SettingOrProject["Ci"] = "ci";
|
||||
SettingOrProject["Off"] = "off";
|
||||
SettingOrProject["On"] = "on";
|
||||
SettingOrProject["Project"] = "project";
|
||||
SettingOrProject["Prompt"] = "prompt";
|
||||
})(SettingOrProject = exports.SettingOrProject || (exports.SettingOrProject = {}));
|
||||
37
node_modules/@angular/cli/commands/analytics.json
generated
vendored
Executable file
37
node_modules/@angular/cli/commands/analytics.json
generated
vendored
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/analytics.json",
|
||||
"description": "Configures the gathering of Angular CLI usage metrics. See https://angular.io/cli/usage-analytics-gathering.",
|
||||
"$longDescription": "./analytics-long.md",
|
||||
|
||||
"$aliases": [],
|
||||
"$scope": "all",
|
||||
"$type": "native",
|
||||
"$impl": "./analytics-impl#AnalyticsCommand",
|
||||
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"properties": {
|
||||
"settingOrProject": {
|
||||
"enum": ["on", "off", "ci", "project", "prompt"],
|
||||
"description": "Directly enables or disables all usage analytics for the user, or prompts the user to set the status interactively, or sets the default status for the project.",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 0
|
||||
}
|
||||
},
|
||||
"projectSetting": {
|
||||
"enum": ["on", "off", "prompt"],
|
||||
"description": "Sets the default analytics enablement status for the project.",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["settingOrProject"]
|
||||
},
|
||||
{ "$ref": "./definitions.json#/definitions/base" }
|
||||
]
|
||||
}
|
||||
14
node_modules/@angular/cli/commands/build-impl.d.ts
generated
vendored
Executable file
14
node_modules/@angular/cli/commands/build-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* @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 { ArchitectCommand, ArchitectCommandOptions } from '../models/architect-command';
|
||||
import { Arguments } from '../models/interface';
|
||||
import { Schema as BuildCommandSchema } from './build';
|
||||
export declare class BuildCommand extends ArchitectCommand<BuildCommandSchema> {
|
||||
readonly target = "build";
|
||||
run(options: ArchitectCommandOptions & Arguments): Promise<number>;
|
||||
}
|
||||
21
node_modules/@angular/cli/commands/build-impl.js
generated
vendored
Executable file
21
node_modules/@angular/cli/commands/build-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
"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 });
|
||||
exports.BuildCommand = void 0;
|
||||
const architect_command_1 = require("../models/architect-command");
|
||||
class BuildCommand extends architect_command_1.ArchitectCommand {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.target = 'build';
|
||||
}
|
||||
async run(options) {
|
||||
return this.runArchitectTarget(options);
|
||||
}
|
||||
}
|
||||
exports.BuildCommand = BuildCommand;
|
||||
18
node_modules/@angular/cli/commands/build-long.md
generated
vendored
Executable file
18
node_modules/@angular/cli/commands/build-long.md
generated
vendored
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
The command can be used to build a project of type "application" or "library".
|
||||
When used to build a library, a different builder is invoked, and only the `ts-config`, `configuration`, and `watch` options are applied.
|
||||
All other options apply only to building applications.
|
||||
|
||||
The application builder uses the [webpack](https://webpack.js.org/) build tool, with default configuration options specified in the workspace configuration file (`angular.json`) or with a named alternative configuration.
|
||||
A "development" configuration is created by default when you use the CLI to create the project, and you can use that configuration by specifying the `--configuration development`.
|
||||
|
||||
The configuration options generally correspond to the command options.
|
||||
You can override individual configuration defaults by specifying the corresponding options on the command line.
|
||||
The command can accept option names given in either dash-case or camelCase.
|
||||
Note that in the configuration file, you must specify names in camelCase.
|
||||
|
||||
Some additional options can only be set through the configuration file,
|
||||
either by direct editing or with the `ng config` command.
|
||||
These include `assets`, `styles`, and `scripts` objects that provide runtime-global resources to include in the project.
|
||||
Resources in CSS, such as images and fonts, are automatically written and fingerprinted at the root of the output folder.
|
||||
|
||||
For further details, see [Workspace Configuration](guide/workspace-config).
|
||||
38
node_modules/@angular/cli/commands/build.d.ts
generated
vendored
Executable file
38
node_modules/@angular/cli/commands/build.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
/**
|
||||
* Compiles an Angular app into an output directory named dist/ at the given output path.
|
||||
* Must be executed from within a workspace directory.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* One or more named builder configurations as a comma-separated list as specified in the
|
||||
* "configurations" section of angular.json.
|
||||
* The builder uses the named configurations to run the given target.
|
||||
* For more information, see
|
||||
* https://angular.io/guide/workspace-config#alternate-build-configurations.
|
||||
* Setting this explicitly overrides the "--prod" flag.
|
||||
*/
|
||||
configuration?: string;
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
/**
|
||||
* Shorthand for "--configuration=production".
|
||||
* Set the build configuration to the production target.
|
||||
* By default, the production target is set up in the workspace configuration such that all
|
||||
* builds make use of bundling, limited tree-shaking, and also limited dead code elimination.
|
||||
*/
|
||||
prod?: boolean;
|
||||
/**
|
||||
* The name of the project to build. Can be an application or a library.
|
||||
*/
|
||||
project?: string;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
10
node_modules/@angular/cli/commands/build.js
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/build.js
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
"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 });
|
||||
exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
16
node_modules/@angular/cli/commands/build.json
generated
vendored
Executable file
16
node_modules/@angular/cli/commands/build.json
generated
vendored
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/build.json",
|
||||
"description": "Compiles an Angular app into an output directory named dist/ at the given output path. Must be executed from within a workspace directory.",
|
||||
"$longDescription": "./build-long.md",
|
||||
|
||||
"$aliases": ["b"],
|
||||
"$scope": "in",
|
||||
"$type": "architect",
|
||||
"$impl": "./build-impl#BuildCommand",
|
||||
|
||||
"allOf": [
|
||||
{ "$ref": "./definitions.json#/definitions/architect" },
|
||||
{ "$ref": "./definitions.json#/definitions/base" }
|
||||
]
|
||||
}
|
||||
15
node_modules/@angular/cli/commands/config-impl.d.ts
generated
vendored
Executable file
15
node_modules/@angular/cli/commands/config-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* @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 { Command } from '../models/command';
|
||||
import { Arguments } from '../models/interface';
|
||||
import { Schema as ConfigCommandSchema } from './config';
|
||||
export declare class ConfigCommand extends Command<ConfigCommandSchema> {
|
||||
run(options: ConfigCommandSchema & Arguments): Promise<0 | 1>;
|
||||
private get;
|
||||
private set;
|
||||
}
|
||||
156
node_modules/@angular/cli/commands/config-impl.js
generated
vendored
Executable file
156
node_modules/@angular/cli/commands/config-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,156 @@
|
|||
"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 });
|
||||
exports.ConfigCommand = void 0;
|
||||
const core_1 = require("@angular-devkit/core");
|
||||
const uuid_1 = require("uuid");
|
||||
const command_1 = require("../models/command");
|
||||
const interface_1 = require("../models/interface");
|
||||
const config_1 = require("../utilities/config");
|
||||
const json_file_1 = require("../utilities/json-file");
|
||||
const validCliPaths = new Map([
|
||||
['cli.warnings.versionMismatch', undefined],
|
||||
['cli.defaultCollection', undefined],
|
||||
['cli.packageManager', undefined],
|
||||
['cli.analytics', undefined],
|
||||
['cli.analyticsSharing.tracking', undefined],
|
||||
['cli.analyticsSharing.uuid', (v) => (v ? `${v}` : uuid_1.v4())],
|
||||
]);
|
||||
/**
|
||||
* Splits a JSON path string into fragments. Fragments can be used to get the value referenced
|
||||
* by the path. For example, a path of "a[3].foo.bar[2]" would give you a fragment array of
|
||||
* ["a", 3, "foo", "bar", 2].
|
||||
* @param path The JSON string to parse.
|
||||
* @returns {(string|number)[]} The fragments for the string.
|
||||
* @private
|
||||
*/
|
||||
function parseJsonPath(path) {
|
||||
const fragments = (path || '').split(/\./g);
|
||||
const result = [];
|
||||
while (fragments.length > 0) {
|
||||
const fragment = fragments.shift();
|
||||
if (fragment == undefined) {
|
||||
break;
|
||||
}
|
||||
const match = fragment.match(/([^\[]+)((\[.*\])*)/);
|
||||
if (!match) {
|
||||
throw new Error('Invalid JSON path.');
|
||||
}
|
||||
result.push(match[1]);
|
||||
if (match[2]) {
|
||||
const indices = match[2]
|
||||
.slice(1, -1)
|
||||
.split('][')
|
||||
.map((x) => (/^\d$/.test(x) ? +x : x.replace(/\"|\'/g, '')));
|
||||
result.push(...indices);
|
||||
}
|
||||
}
|
||||
return result.filter((fragment) => fragment != null);
|
||||
}
|
||||
function normalizeValue(value) {
|
||||
var _a, _b;
|
||||
const valueString = `${value}`.trim();
|
||||
switch (valueString) {
|
||||
case 'true':
|
||||
return true;
|
||||
case 'false':
|
||||
return false;
|
||||
case 'null':
|
||||
return null;
|
||||
case 'undefined':
|
||||
return undefined;
|
||||
}
|
||||
if (isFinite(+valueString)) {
|
||||
return +valueString;
|
||||
}
|
||||
return (_b = (_a = json_file_1.parseJson(valueString)) !== null && _a !== void 0 ? _a : value) !== null && _b !== void 0 ? _b : undefined;
|
||||
}
|
||||
class ConfigCommand extends command_1.Command {
|
||||
async run(options) {
|
||||
const level = options.global ? 'global' : 'local';
|
||||
if (!options.global) {
|
||||
await this.validateScope(interface_1.CommandScope.InProject);
|
||||
}
|
||||
let [config] = config_1.getWorkspaceRaw(level);
|
||||
if (options.global && !config) {
|
||||
try {
|
||||
if (config_1.migrateLegacyGlobalConfig()) {
|
||||
config = config_1.getWorkspaceRaw(level)[0];
|
||||
this.logger.info(core_1.tags.oneLine `
|
||||
We found a global configuration that was used in Angular CLI 1.
|
||||
It has been automatically migrated.`);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
if (options.value == undefined) {
|
||||
if (!config) {
|
||||
this.logger.error('No config found.');
|
||||
return 1;
|
||||
}
|
||||
return this.get(config, options);
|
||||
}
|
||||
else {
|
||||
return this.set(options);
|
||||
}
|
||||
}
|
||||
get(jsonFile, options) {
|
||||
let value;
|
||||
if (options.jsonPath) {
|
||||
value = jsonFile.get(parseJsonPath(options.jsonPath));
|
||||
}
|
||||
else {
|
||||
value = jsonFile.content;
|
||||
}
|
||||
if (value === undefined) {
|
||||
this.logger.error('Value cannot be found.');
|
||||
return 1;
|
||||
}
|
||||
else if (typeof value === 'string') {
|
||||
this.logger.info(value);
|
||||
}
|
||||
else {
|
||||
this.logger.info(JSON.stringify(value, null, 2));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
async set(options) {
|
||||
var _a, _b, _c;
|
||||
if (!((_a = options.jsonPath) === null || _a === void 0 ? void 0 : _a.trim())) {
|
||||
throw new Error('Invalid Path.');
|
||||
}
|
||||
if (options.global &&
|
||||
!options.jsonPath.startsWith('schematics.') &&
|
||||
!validCliPaths.has(options.jsonPath)) {
|
||||
throw new Error('Invalid Path.');
|
||||
}
|
||||
const [config, configPath] = config_1.getWorkspaceRaw(options.global ? 'global' : 'local');
|
||||
if (!config || !configPath) {
|
||||
this.logger.error('Confguration file cannot be found.');
|
||||
return 1;
|
||||
}
|
||||
const jsonPath = parseJsonPath(options.jsonPath);
|
||||
const value = (_c = (_b = validCliPaths.get(options.jsonPath)) === null || _b === void 0 ? void 0 : _b(options.value)) !== null && _c !== void 0 ? _c : options.value;
|
||||
const modified = config.modify(jsonPath, normalizeValue(value));
|
||||
if (!modified) {
|
||||
this.logger.error('Value cannot be found.');
|
||||
return 1;
|
||||
}
|
||||
try {
|
||||
await config_1.validateWorkspace(json_file_1.parseJson(config.content));
|
||||
}
|
||||
catch (error) {
|
||||
this.logger.fatal(error.message);
|
||||
return 1;
|
||||
}
|
||||
config.save();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
exports.ConfigCommand = ConfigCommand;
|
||||
13
node_modules/@angular/cli/commands/config-long.md
generated
vendored
Executable file
13
node_modules/@angular/cli/commands/config-long.md
generated
vendored
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
A workspace has a single CLI configuration file, `angular.json`, at the top level.
|
||||
The `projects` object contains a configuration object for each project in the workspace.
|
||||
|
||||
You can edit the configuration directly in a code editor,
|
||||
or indirectly on the command line using this command.
|
||||
|
||||
The configurable property names match command option names,
|
||||
except that in the configuration file, all names must use camelCase,
|
||||
while on the command line options can be given in either camelCase or dash-case.
|
||||
|
||||
For further details, see [Workspace Configuration](guide/workspace-config).
|
||||
|
||||
For configuration of CLI usage analytics, see [Gathering an Viewing CLI Usage Analytics](./usage-analytics-gathering).
|
||||
34
node_modules/@angular/cli/commands/config.d.ts
generated
vendored
Executable file
34
node_modules/@angular/cli/commands/config.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
/**
|
||||
* Retrieves or sets Angular configuration values in the angular.json file for the workspace.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* Access the global configuration in the caller's home directory.
|
||||
*/
|
||||
global?: boolean;
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
/**
|
||||
* The configuration key to set or query, in JSON path format. For example:
|
||||
* "a[3].foo.bar[2]". If no new value is provided, returns the current value of this key.
|
||||
*/
|
||||
jsonPath?: string;
|
||||
/**
|
||||
* If provided, a new value for the given configuration key.
|
||||
*/
|
||||
value?: Value;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
/**
|
||||
* If provided, a new value for the given configuration key.
|
||||
*/
|
||||
export declare type Value = boolean | number | string;
|
||||
10
node_modules/@angular/cli/commands/config.js
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/config.js
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
"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 });
|
||||
exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
43
node_modules/@angular/cli/commands/config.json
generated
vendored
Executable file
43
node_modules/@angular/cli/commands/config.json
generated
vendored
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/config.json",
|
||||
"description": "Retrieves or sets Angular configuration values in the angular.json file for the workspace.",
|
||||
"$longDescription": "",
|
||||
|
||||
"$aliases": [],
|
||||
"$scope": "all",
|
||||
"$type": "native",
|
||||
"$impl": "./config-impl#ConfigCommand",
|
||||
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"properties": {
|
||||
"jsonPath": {
|
||||
"type": "string",
|
||||
"description": "The configuration key to set or query, in JSON path format. For example: \"a[3].foo.bar[2]\". If no new value is provided, returns the current value of this key.",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 0
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"type": ["string", "number", "boolean"],
|
||||
"description": "If provided, a new value for the given configuration key.",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 1
|
||||
}
|
||||
},
|
||||
"global": {
|
||||
"type": "boolean",
|
||||
"description": "Access the global configuration in the caller's home directory.",
|
||||
"default": false,
|
||||
"aliases": ["g"]
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
},
|
||||
{ "$ref": "./definitions.json#/definitions/base" }
|
||||
]
|
||||
}
|
||||
71
node_modules/@angular/cli/commands/definitions.json
generated
vendored
Executable file
71
node_modules/@angular/cli/commands/definitions.json
generated
vendored
Executable file
|
|
@ -0,0 +1,71 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/definitions.json",
|
||||
|
||||
"definitions": {
|
||||
"architect": {
|
||||
"properties": {
|
||||
"project": {
|
||||
"type": "string",
|
||||
"description": "The name of the project to build. Can be an application or a library.",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 0
|
||||
}
|
||||
},
|
||||
"configuration": {
|
||||
"description": "One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section of angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.io/guide/workspace-config#alternate-build-configurations.\nSetting this explicitly overrides the \"--prod\" flag.",
|
||||
"type": "string",
|
||||
"aliases": ["c"]
|
||||
},
|
||||
"prod": {
|
||||
"description": "Shorthand for \"--configuration=production\".\nSet the build configuration to the production target.\nBy default, the production target is set up in the workspace configuration such that all builds make use of bundling, limited tree-shaking, and also limited dead code elimination.",
|
||||
"type": "boolean",
|
||||
"x-deprecated": "Use `--configuration production` instead."
|
||||
}
|
||||
}
|
||||
},
|
||||
"base": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"help": {
|
||||
"enum": [true, false, "json", "JSON"],
|
||||
"description": "Shows a help message for this command in the console.",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"schematic": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"dryRun": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"aliases": ["d"],
|
||||
"description": "Run through and reports activity without writing out results."
|
||||
},
|
||||
"force": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"aliases": ["f"],
|
||||
"description": "Force overwriting of existing files."
|
||||
}
|
||||
}
|
||||
},
|
||||
"interactive": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"interactive": {
|
||||
"type": "boolean",
|
||||
"default": "true",
|
||||
"description": "Enable interactive input prompts."
|
||||
},
|
||||
"defaults": {
|
||||
"type": "boolean",
|
||||
"default": "false",
|
||||
"description": "Disable interactive input prompts for options with a default."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
15
node_modules/@angular/cli/commands/deploy-impl.d.ts
generated
vendored
Executable file
15
node_modules/@angular/cli/commands/deploy-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* @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 { ArchitectCommand } from '../models/architect-command';
|
||||
import { Arguments } from '../models/interface';
|
||||
import { Schema as DeployCommandSchema } from './deploy';
|
||||
export declare class DeployCommand extends ArchitectCommand<DeployCommandSchema> {
|
||||
readonly target = "deploy";
|
||||
readonly missingTargetError = "\nCannot find \"deploy\" target for the specified project.\n\nYou should add a package that implements deployment capabilities for your\nfavorite platform.\n\nFor example:\n ng add @angular/fire\n ng add @azure/ng-deploy\n ng add @zeit/ng-deploy\n\nFind more packages on npm https://www.npmjs.com/search?q=ng%20deploy\n";
|
||||
initialize(options: DeployCommandSchema & Arguments): Promise<number | void>;
|
||||
}
|
||||
37
node_modules/@angular/cli/commands/deploy-impl.js
generated
vendored
Executable file
37
node_modules/@angular/cli/commands/deploy-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
"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 });
|
||||
exports.DeployCommand = void 0;
|
||||
const architect_command_1 = require("../models/architect-command");
|
||||
const BuilderMissing = `
|
||||
Cannot find "deploy" target for the specified project.
|
||||
|
||||
You should add a package that implements deployment capabilities for your
|
||||
favorite platform.
|
||||
|
||||
For example:
|
||||
ng add @angular/fire
|
||||
ng add @azure/ng-deploy
|
||||
ng add @zeit/ng-deploy
|
||||
|
||||
Find more packages on npm https://www.npmjs.com/search?q=ng%20deploy
|
||||
`;
|
||||
class DeployCommand extends architect_command_1.ArchitectCommand {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.target = 'deploy';
|
||||
this.missingTargetError = BuilderMissing;
|
||||
}
|
||||
async initialize(options) {
|
||||
if (!options.help) {
|
||||
return super.initialize(options);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.DeployCommand = DeployCommand;
|
||||
22
node_modules/@angular/cli/commands/deploy-long.md
generated
vendored
Executable file
22
node_modules/@angular/cli/commands/deploy-long.md
generated
vendored
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
The command takes an optional project name, as specified in the `projects` section of the `angular.json` workspace configuration file.
|
||||
When a project name is not supplied, executes the `deploy` builder for the default project.
|
||||
|
||||
To use the `ng deploy` command, use `ng add` to add a package that implements deployment capabilities to your favorite platform.
|
||||
Adding the package automatically updates your workspace configuration, adding a deployment
|
||||
[CLI builder](guide/cli-builder).
|
||||
For example:
|
||||
|
||||
```json
|
||||
"projects": {
|
||||
"my-project": {
|
||||
...
|
||||
"architect": {
|
||||
...
|
||||
"deploy": {
|
||||
"builder": "@angular/fire:deploy",
|
||||
"options": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
30
node_modules/@angular/cli/commands/deploy.d.ts
generated
vendored
Executable file
30
node_modules/@angular/cli/commands/deploy.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
/**
|
||||
* Invokes the deploy builder for a specified project or for the default project in the
|
||||
* workspace.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* One or more named builder configurations as a comma-separated list as specified in the
|
||||
* "configurations" section of angular.json.
|
||||
* The builder uses the named configurations to run the given target.
|
||||
* For more information, see
|
||||
* https://angular.io/guide/workspace-config#alternate-build-configurations.
|
||||
*/
|
||||
configuration?: string;
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
/**
|
||||
* The name of the project to deploy.
|
||||
*/
|
||||
project?: string;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
10
node_modules/@angular/cli/commands/deploy.js
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/deploy.js
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
"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 });
|
||||
exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
34
node_modules/@angular/cli/commands/deploy.json
generated
vendored
Executable file
34
node_modules/@angular/cli/commands/deploy.json
generated
vendored
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/deploy.json",
|
||||
"description": "Invokes the deploy builder for a specified project or for the default project in the workspace.",
|
||||
"$longDescription": "./deploy-long.md",
|
||||
|
||||
"$scope": "in",
|
||||
"$type": "architect",
|
||||
"$impl": "./deploy-impl#DeployCommand",
|
||||
|
||||
"allOf": [
|
||||
{
|
||||
"properties": {
|
||||
"project": {
|
||||
"type": "string",
|
||||
"description": "The name of the project to deploy.",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 0
|
||||
}
|
||||
},
|
||||
"configuration": {
|
||||
"description": "One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section of angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.io/guide/workspace-config#alternate-build-configurations.",
|
||||
"type": "string",
|
||||
"aliases": ["c"]
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
},
|
||||
{
|
||||
"$ref": "./definitions.json#/definitions/base"
|
||||
}
|
||||
]
|
||||
}
|
||||
13
node_modules/@angular/cli/commands/doc-impl.d.ts
generated
vendored
Executable file
13
node_modules/@angular/cli/commands/doc-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
* @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 { Command } from '../models/command';
|
||||
import { Arguments } from '../models/interface';
|
||||
import { Schema as DocCommandSchema } from './doc';
|
||||
export declare class DocCommand extends Command<DocCommandSchema> {
|
||||
run(options: DocCommandSchema & Arguments): Promise<0 | undefined>;
|
||||
}
|
||||
75
node_modules/@angular/cli/commands/doc-impl.js
generated
vendored
Executable file
75
node_modules/@angular/cli/commands/doc-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,75 @@
|
|||
"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
|
||||
*/
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DocCommand = void 0;
|
||||
const open_1 = __importDefault(require("open"));
|
||||
const command_1 = require("../models/command");
|
||||
class DocCommand extends command_1.Command {
|
||||
async run(options) {
|
||||
if (!options.keyword) {
|
||||
this.logger.error('You should specify a keyword, for instance, `ng doc ActivatedRoute`.');
|
||||
return 0;
|
||||
}
|
||||
let domain = 'angular.io';
|
||||
if (options.version) {
|
||||
// version can either be a string containing "next"
|
||||
if (options.version == 'next') {
|
||||
domain = 'next.angular.io';
|
||||
// or a number where version must be a valid Angular version (i.e. not 0, 1 or 3)
|
||||
}
|
||||
else if (!isNaN(+options.version) && ![0, 1, 3].includes(+options.version)) {
|
||||
domain = `v${options.version}.angular.io`;
|
||||
}
|
||||
else {
|
||||
this.logger.error('Version should either be a number (2, 4, 5, 6...) or "next"');
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// we try to get the current Angular version of the project
|
||||
// and use it if we can find it
|
||||
try {
|
||||
/* eslint-disable-next-line import/no-extraneous-dependencies */
|
||||
const currentNgVersion = (await Promise.resolve().then(() => __importStar(require('@angular/core')))).VERSION.major;
|
||||
domain = `v${currentNgVersion}.angular.io`;
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
let searchUrl = `https://${domain}/api?query=${options.keyword}`;
|
||||
if (options.search) {
|
||||
searchUrl = `https://${domain}/docs?search=${options.keyword}`;
|
||||
}
|
||||
await open_1.default(searchUrl, {
|
||||
wait: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.DocCommand = DocCommand;
|
||||
39
node_modules/@angular/cli/commands/doc.d.ts
generated
vendored
Executable file
39
node_modules/@angular/cli/commands/doc.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
/**
|
||||
* Opens the official Angular documentation (angular.io) in a browser, and searches for a
|
||||
* given keyword.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
/**
|
||||
* The keyword to search for, as provided in the search bar in angular.io.
|
||||
*/
|
||||
keyword?: string;
|
||||
/**
|
||||
* Search all of angular.io. Otherwise, searches only API reference documentation.
|
||||
*/
|
||||
search?: boolean;
|
||||
/**
|
||||
* Contains the version of Angular to use for the documentation. If not provided, the
|
||||
* command uses your current Angular core version.
|
||||
*/
|
||||
version?: VersionUnion;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
/**
|
||||
* Contains the version of Angular to use for the documentation. If not provided, the
|
||||
* command uses your current Angular core version.
|
||||
*/
|
||||
export declare type VersionUnion = number | VersionEnum;
|
||||
export declare enum VersionEnum {
|
||||
Next = "next"
|
||||
}
|
||||
14
node_modules/@angular/cli/commands/doc.js
generated
vendored
Executable file
14
node_modules/@angular/cli/commands/doc.js
generated
vendored
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
"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 });
|
||||
exports.VersionEnum = exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
var VersionEnum;
|
||||
(function (VersionEnum) {
|
||||
VersionEnum["Next"] = "next";
|
||||
})(VersionEnum = exports.VersionEnum || (exports.VersionEnum = {}));
|
||||
46
node_modules/@angular/cli/commands/doc.json
generated
vendored
Executable file
46
node_modules/@angular/cli/commands/doc.json
generated
vendored
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/doc.json",
|
||||
"description": "Opens the official Angular documentation (angular.io) in a browser, and searches for a given keyword.",
|
||||
"$longDescription": "",
|
||||
|
||||
"$aliases": ["d"],
|
||||
"$type": "native",
|
||||
"$impl": "./doc-impl#DocCommand",
|
||||
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"properties": {
|
||||
"keyword": {
|
||||
"type": "string",
|
||||
"description": "The keyword to search for, as provided in the search bar in angular.io.",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 0
|
||||
}
|
||||
},
|
||||
"search": {
|
||||
"aliases": ["s"],
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Search all of angular.io. Otherwise, searches only API reference documentation."
|
||||
},
|
||||
"version": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number",
|
||||
"minimum": 4
|
||||
},
|
||||
{
|
||||
"enum": [2, "next"]
|
||||
}
|
||||
],
|
||||
"description": "Contains the version of Angular to use for the documentation. If not provided, the command uses your current Angular core version."
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
},
|
||||
{ "$ref": "./definitions.json#/definitions/base" }
|
||||
]
|
||||
}
|
||||
16
node_modules/@angular/cli/commands/e2e-impl.d.ts
generated
vendored
Executable file
16
node_modules/@angular/cli/commands/e2e-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
/**
|
||||
* @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 { ArchitectCommand } from '../models/architect-command';
|
||||
import { Arguments } from '../models/interface';
|
||||
import { Schema as E2eCommandSchema } from './e2e';
|
||||
export declare class E2eCommand extends ArchitectCommand<E2eCommandSchema> {
|
||||
readonly target = "e2e";
|
||||
readonly multiTarget = true;
|
||||
readonly missingTargetError = "\nCannot find \"e2e\" target for the specified project.\n\nYou should add a package that implements end-to-end testing capabilities.\n\nFor example:\n Cypress: ng add @cypress/schematic\n Nightwatch: ng add @nightwatch/schematics\n WebdriverIO: ng add @wdio/schematics\n\nMore options will be added to the list as they become available.\n";
|
||||
initialize(options: E2eCommandSchema & Arguments): Promise<number | void>;
|
||||
}
|
||||
36
node_modules/@angular/cli/commands/e2e-impl.js
generated
vendored
Executable file
36
node_modules/@angular/cli/commands/e2e-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
"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 });
|
||||
exports.E2eCommand = void 0;
|
||||
const architect_command_1 = require("../models/architect-command");
|
||||
class E2eCommand extends architect_command_1.ArchitectCommand {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.target = 'e2e';
|
||||
this.multiTarget = true;
|
||||
this.missingTargetError = `
|
||||
Cannot find "e2e" target for the specified project.
|
||||
|
||||
You should add a package that implements end-to-end testing capabilities.
|
||||
|
||||
For example:
|
||||
Cypress: ng add @cypress/schematic
|
||||
Nightwatch: ng add @nightwatch/schematics
|
||||
WebdriverIO: ng add @wdio/schematics
|
||||
|
||||
More options will be added to the list as they become available.
|
||||
`;
|
||||
}
|
||||
async initialize(options) {
|
||||
if (!options.help) {
|
||||
return super.initialize(options);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.E2eCommand = E2eCommand;
|
||||
2
node_modules/@angular/cli/commands/e2e-long.md
generated
vendored
Executable file
2
node_modules/@angular/cli/commands/e2e-long.md
generated
vendored
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
Must be executed from within a workspace directory.
|
||||
When a project name is not supplied, it will execute for all projects.
|
||||
37
node_modules/@angular/cli/commands/e2e.d.ts
generated
vendored
Executable file
37
node_modules/@angular/cli/commands/e2e.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
/**
|
||||
* Builds and serves an Angular app, then runs end-to-end tests.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* One or more named builder configurations as a comma-separated list as specified in the
|
||||
* "configurations" section of angular.json.
|
||||
* The builder uses the named configurations to run the given target.
|
||||
* For more information, see
|
||||
* https://angular.io/guide/workspace-config#alternate-build-configurations.
|
||||
* Setting this explicitly overrides the "--prod" flag.
|
||||
*/
|
||||
configuration?: string;
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
/**
|
||||
* Shorthand for "--configuration=production".
|
||||
* Set the build configuration to the production target.
|
||||
* By default, the production target is set up in the workspace configuration such that all
|
||||
* builds make use of bundling, limited tree-shaking, and also limited dead code elimination.
|
||||
*/
|
||||
prod?: boolean;
|
||||
/**
|
||||
* The name of the project to build. Can be an application or a library.
|
||||
*/
|
||||
project?: string;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
10
node_modules/@angular/cli/commands/e2e.js
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/e2e.js
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
"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 });
|
||||
exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
17
node_modules/@angular/cli/commands/e2e.json
generated
vendored
Executable file
17
node_modules/@angular/cli/commands/e2e.json
generated
vendored
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/e2e.json",
|
||||
"description": "Builds and serves an Angular app, then runs end-to-end tests.",
|
||||
"$longDescription": "./e2e-long.md",
|
||||
|
||||
"$aliases": ["e"],
|
||||
"$scope": "in",
|
||||
"$type": "architect",
|
||||
"$impl": "./e2e-impl#E2eCommand",
|
||||
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{ "$ref": "./definitions.json#/definitions/architect" },
|
||||
{ "$ref": "./definitions.json#/definitions/base" }
|
||||
]
|
||||
}
|
||||
12
node_modules/@angular/cli/commands/easter-egg-impl.d.ts
generated
vendored
Executable file
12
node_modules/@angular/cli/commands/easter-egg-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* @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 { Command } from '../models/command';
|
||||
import { Schema as AwesomeCommandSchema } from './easter-egg';
|
||||
export declare class AwesomeCommand extends Command<AwesomeCommandSchema> {
|
||||
run(): Promise<void>;
|
||||
}
|
||||
31
node_modules/@angular/cli/commands/easter-egg-impl.js
generated
vendored
Executable file
31
node_modules/@angular/cli/commands/easter-egg-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
"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 });
|
||||
exports.AwesomeCommand = void 0;
|
||||
const command_1 = require("../models/command");
|
||||
const color_1 = require("../utilities/color");
|
||||
function pickOne(of) {
|
||||
return of[Math.floor(Math.random() * of.length)];
|
||||
}
|
||||
class AwesomeCommand extends command_1.Command {
|
||||
async run() {
|
||||
const phrase = pickOne([
|
||||
`You're on it, there's nothing for me to do!`,
|
||||
`Let's take a look... nope, it's all good!`,
|
||||
`You're doing fine.`,
|
||||
`You're already doing great.`,
|
||||
`Nothing to do; already awesome. Exiting.`,
|
||||
`Error 418: As Awesome As Can Get.`,
|
||||
`I spy with my little eye a great developer!`,
|
||||
`Noop... already awesome.`,
|
||||
]);
|
||||
this.logger.info(color_1.colors.green(phrase));
|
||||
}
|
||||
}
|
||||
exports.AwesomeCommand = AwesomeCommand;
|
||||
14
node_modules/@angular/cli/commands/easter-egg.d.ts
generated
vendored
Executable file
14
node_modules/@angular/cli/commands/easter-egg.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
export interface Schema {
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
10
node_modules/@angular/cli/commands/easter-egg.js
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/easter-egg.js
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
"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 });
|
||||
exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
12
node_modules/@angular/cli/commands/easter-egg.json
generated
vendored
Executable file
12
node_modules/@angular/cli/commands/easter-egg.json
generated
vendored
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/easter-egg.json",
|
||||
"description": "",
|
||||
"$longDescription": "",
|
||||
"$hidden": true,
|
||||
|
||||
"$impl": "./easter-egg-impl#AwesomeCommand",
|
||||
|
||||
"type": "object",
|
||||
"allOf": [{ "$ref": "./definitions.json#/definitions/base" }]
|
||||
}
|
||||
14
node_modules/@angular/cli/commands/extract-i18n-impl.d.ts
generated
vendored
Executable file
14
node_modules/@angular/cli/commands/extract-i18n-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* @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 { ArchitectCommand } from '../models/architect-command';
|
||||
import { Arguments } from '../models/interface';
|
||||
import { Schema as ExtractI18nCommandSchema } from './extract-i18n';
|
||||
export declare class ExtractI18nCommand extends ArchitectCommand<ExtractI18nCommandSchema> {
|
||||
readonly target = "extract-i18n";
|
||||
run(options: ExtractI18nCommandSchema & Arguments): Promise<number>;
|
||||
}
|
||||
32
node_modules/@angular/cli/commands/extract-i18n-impl.js
generated
vendored
Executable file
32
node_modules/@angular/cli/commands/extract-i18n-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
"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 });
|
||||
exports.ExtractI18nCommand = void 0;
|
||||
const architect_command_1 = require("../models/architect-command");
|
||||
class ExtractI18nCommand extends architect_command_1.ArchitectCommand {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.target = 'extract-i18n';
|
||||
}
|
||||
async run(options) {
|
||||
const version = process.version.substr(1).split('.');
|
||||
if (Number(version[0]) === 12 && Number(version[1]) === 0) {
|
||||
this.logger.error('Due to a defect in Node.js 12.0, the command is not supported on this Node.js version. ' +
|
||||
'Please upgrade to Node.js 12.1 or later.');
|
||||
return 1;
|
||||
}
|
||||
const commandName = process.argv[2];
|
||||
if (['xi18n', 'i18n-extract'].includes(commandName)) {
|
||||
this.logger.warn(`Warning: "ng ${commandName}" has been deprecated and will be removed in a future major version. ` +
|
||||
'Please use "ng extract-i18n" instead.');
|
||||
}
|
||||
return this.runArchitectTarget(options);
|
||||
}
|
||||
}
|
||||
exports.ExtractI18nCommand = ExtractI18nCommand;
|
||||
37
node_modules/@angular/cli/commands/extract-i18n.d.ts
generated
vendored
Executable file
37
node_modules/@angular/cli/commands/extract-i18n.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
/**
|
||||
* Extracts i18n messages from source code.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* One or more named builder configurations as a comma-separated list as specified in the
|
||||
* "configurations" section of angular.json.
|
||||
* The builder uses the named configurations to run the given target.
|
||||
* For more information, see
|
||||
* https://angular.io/guide/workspace-config#alternate-build-configurations.
|
||||
* Setting this explicitly overrides the "--prod" flag.
|
||||
*/
|
||||
configuration?: string;
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
/**
|
||||
* Shorthand for "--configuration=production".
|
||||
* Set the build configuration to the production target.
|
||||
* By default, the production target is set up in the workspace configuration such that all
|
||||
* builds make use of bundling, limited tree-shaking, and also limited dead code elimination.
|
||||
*/
|
||||
prod?: boolean;
|
||||
/**
|
||||
* The name of the project to build. Can be an application or a library.
|
||||
*/
|
||||
project?: string;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
10
node_modules/@angular/cli/commands/extract-i18n.js
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/extract-i18n.js
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
"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 });
|
||||
exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
17
node_modules/@angular/cli/commands/extract-i18n.json
generated
vendored
Executable file
17
node_modules/@angular/cli/commands/extract-i18n.json
generated
vendored
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/extract-i18n.json",
|
||||
"description": "Extracts i18n messages from source code.",
|
||||
"$longDescription": "",
|
||||
|
||||
"$aliases": ["i18n-extract", "xi18n"],
|
||||
"$scope": "in",
|
||||
"$type": "architect",
|
||||
"$impl": "./extract-i18n-impl#ExtractI18nCommand",
|
||||
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{ "$ref": "./definitions.json#/definitions/architect" },
|
||||
{ "$ref": "./definitions.json#/definitions/base" }
|
||||
]
|
||||
}
|
||||
18
node_modules/@angular/cli/commands/generate-impl.d.ts
generated
vendored
Executable file
18
node_modules/@angular/cli/commands/generate-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
* @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 { Arguments } from '../models/interface';
|
||||
import { SchematicCommand } from '../models/schematic-command';
|
||||
import { Schema as GenerateCommandSchema } from './generate';
|
||||
export declare class GenerateCommand extends SchematicCommand<GenerateCommandSchema> {
|
||||
longSchematicName: string | undefined;
|
||||
initialize(options: GenerateCommandSchema & Arguments): Promise<void>;
|
||||
run(options: GenerateCommandSchema & Arguments): Promise<number | void>;
|
||||
reportAnalytics(paths: string[], options: GenerateCommandSchema & Arguments): Promise<void>;
|
||||
private parseSchematicInfo;
|
||||
printHelp(): Promise<number>;
|
||||
}
|
||||
89
node_modules/@angular/cli/commands/generate-impl.js
generated
vendored
Executable file
89
node_modules/@angular/cli/commands/generate-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,89 @@
|
|||
"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 });
|
||||
exports.GenerateCommand = void 0;
|
||||
const schematic_command_1 = require("../models/schematic-command");
|
||||
const color_1 = require("../utilities/color");
|
||||
const json_schema_1 = require("../utilities/json-schema");
|
||||
class GenerateCommand extends schematic_command_1.SchematicCommand {
|
||||
async initialize(options) {
|
||||
// Fill up the schematics property of the command description.
|
||||
const [collectionName, schematicName] = await this.parseSchematicInfo(options);
|
||||
this.collectionName = collectionName;
|
||||
this.schematicName = schematicName;
|
||||
await super.initialize(options);
|
||||
const collection = this.getCollection(collectionName);
|
||||
const subcommands = {};
|
||||
const schematicNames = schematicName ? [schematicName] : collection.listSchematicNames();
|
||||
// Sort as a courtesy for the user.
|
||||
schematicNames.sort();
|
||||
for (const name of schematicNames) {
|
||||
const schematic = this.getSchematic(collection, name, true);
|
||||
this.longSchematicName = schematic.description.name;
|
||||
let subcommand;
|
||||
if (schematic.description.schemaJson) {
|
||||
subcommand = await json_schema_1.parseJsonSchemaToSubCommandDescription(name, schematic.description.path, this._workflow.registry, schematic.description.schemaJson);
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
if ((await this.getDefaultSchematicCollection()) == collectionName) {
|
||||
subcommands[name] = subcommand;
|
||||
}
|
||||
else {
|
||||
subcommands[`${collectionName}:${name}`] = subcommand;
|
||||
}
|
||||
}
|
||||
this.description.options.forEach((option) => {
|
||||
if (option.name == 'schematic') {
|
||||
option.subcommands = subcommands;
|
||||
}
|
||||
});
|
||||
}
|
||||
async run(options) {
|
||||
if (!this.schematicName || !this.collectionName) {
|
||||
return this.printHelp();
|
||||
}
|
||||
return this.runSchematic({
|
||||
collectionName: this.collectionName,
|
||||
schematicName: this.schematicName,
|
||||
schematicOptions: options['--'] || [],
|
||||
debug: !!options.debug || false,
|
||||
dryRun: !!options.dryRun || false,
|
||||
force: !!options.force || false,
|
||||
});
|
||||
}
|
||||
async reportAnalytics(paths, options) {
|
||||
if (!this.collectionName || !this.schematicName) {
|
||||
return;
|
||||
}
|
||||
const escapedSchematicName = (this.longSchematicName || this.schematicName).replace(/\//g, '_');
|
||||
return super.reportAnalytics(['generate', this.collectionName.replace(/\//g, '_'), escapedSchematicName], options);
|
||||
}
|
||||
async parseSchematicInfo(options) {
|
||||
let collectionName = await this.getDefaultSchematicCollection();
|
||||
let schematicName = options.schematic;
|
||||
if (schematicName && schematicName.includes(':')) {
|
||||
[collectionName, schematicName] = schematicName.split(':', 2);
|
||||
}
|
||||
return [collectionName, schematicName];
|
||||
}
|
||||
async printHelp() {
|
||||
await super.printHelp();
|
||||
this.logger.info('');
|
||||
// Find the generate subcommand.
|
||||
const subcommand = this.description.options.filter((x) => x.subcommands)[0];
|
||||
if (Object.keys((subcommand && subcommand.subcommands) || {}).length == 1) {
|
||||
this.logger.info(`\nTo see help for a schematic run:`);
|
||||
this.logger.info(color_1.colors.cyan(` ng generate <schematic> --help`));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
exports.GenerateCommand = GenerateCommand;
|
||||
37
node_modules/@angular/cli/commands/generate.d.ts
generated
vendored
Executable file
37
node_modules/@angular/cli/commands/generate.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
/**
|
||||
* Generates and/or modifies files based on a schematic.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* Disable interactive input prompts for options with a default.
|
||||
*/
|
||||
defaults?: boolean;
|
||||
/**
|
||||
* Run through and reports activity without writing out results.
|
||||
*/
|
||||
dryRun?: boolean;
|
||||
/**
|
||||
* Force overwriting of existing files.
|
||||
*/
|
||||
force?: boolean;
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
/**
|
||||
* Enable interactive input prompts.
|
||||
*/
|
||||
interactive?: boolean;
|
||||
/**
|
||||
* The schematic or collection:schematic to generate.
|
||||
*/
|
||||
schematic?: string;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
10
node_modules/@angular/cli/commands/generate.js
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/generate.js
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
"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 });
|
||||
exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
31
node_modules/@angular/cli/commands/generate.json
generated
vendored
Executable file
31
node_modules/@angular/cli/commands/generate.json
generated
vendored
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/generate.json",
|
||||
"description": "Generates and/or modifies files based on a schematic.",
|
||||
"$longDescription": "",
|
||||
|
||||
"$aliases": ["g"],
|
||||
"$scope": "in",
|
||||
"$type": "schematics",
|
||||
"$impl": "./generate-impl#GenerateCommand",
|
||||
|
||||
"allOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"schematic": {
|
||||
"type": "string",
|
||||
"description": "The schematic or collection:schematic to generate.",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
},
|
||||
{ "$ref": "./definitions.json#/definitions/base" },
|
||||
{ "$ref": "./definitions.json#/definitions/schematic" },
|
||||
{ "$ref": "./definitions.json#/definitions/interactive" }
|
||||
]
|
||||
}
|
||||
12
node_modules/@angular/cli/commands/help-impl.d.ts
generated
vendored
Executable file
12
node_modules/@angular/cli/commands/help-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* @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 { Command } from '../models/command';
|
||||
import { Schema as HelpCommandSchema } from './help';
|
||||
export declare class HelpCommand extends Command<HelpCommandSchema> {
|
||||
run(): Promise<void>;
|
||||
}
|
||||
26
node_modules/@angular/cli/commands/help-impl.js
generated
vendored
Executable file
26
node_modules/@angular/cli/commands/help-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
"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 });
|
||||
exports.HelpCommand = void 0;
|
||||
const command_1 = require("../models/command");
|
||||
const color_1 = require("../utilities/color");
|
||||
class HelpCommand extends command_1.Command {
|
||||
async run() {
|
||||
this.logger.info(`Available Commands:`);
|
||||
for (const cmd of Object.values(await command_1.Command.commandMap())) {
|
||||
if (cmd.hidden) {
|
||||
continue;
|
||||
}
|
||||
const aliasInfo = cmd.aliases.length > 0 ? ` (${cmd.aliases.join(', ')})` : '';
|
||||
this.logger.info(` ${color_1.colors.cyan(cmd.name)}${aliasInfo} ${cmd.description}`);
|
||||
}
|
||||
this.logger.info(`\nFor more detailed help run "ng [command name] --help"`);
|
||||
}
|
||||
}
|
||||
exports.HelpCommand = HelpCommand;
|
||||
7
node_modules/@angular/cli/commands/help-long.md
generated
vendored
Executable file
7
node_modules/@angular/cli/commands/help-long.md
generated
vendored
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
For help with individual commands, use the `--help` or `-h` option with the command.
|
||||
|
||||
For example,
|
||||
|
||||
```sh
|
||||
ng help serve
|
||||
```
|
||||
17
node_modules/@angular/cli/commands/help.d.ts
generated
vendored
Executable file
17
node_modules/@angular/cli/commands/help.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* Lists available commands and their short descriptions.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
10
node_modules/@angular/cli/commands/help.js
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/help.js
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
"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 });
|
||||
exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
13
node_modules/@angular/cli/commands/help.json
generated
vendored
Executable file
13
node_modules/@angular/cli/commands/help.json
generated
vendored
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/help.json",
|
||||
"description": "Lists available commands and their short descriptions.",
|
||||
"$longDescription": "./help-long.md",
|
||||
|
||||
"$scope": "all",
|
||||
"$aliases": [],
|
||||
"$impl": "./help-impl#HelpCommand",
|
||||
|
||||
"type": "object",
|
||||
"allOf": [{ "$ref": "./definitions.json#/definitions/base" }]
|
||||
}
|
||||
16
node_modules/@angular/cli/commands/lint-impl.d.ts
generated
vendored
Executable file
16
node_modules/@angular/cli/commands/lint-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
/**
|
||||
* @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 { ArchitectCommand } from '../models/architect-command';
|
||||
import { Arguments } from '../models/interface';
|
||||
import { Schema as LintCommandSchema } from './lint';
|
||||
export declare class LintCommand extends ArchitectCommand<LintCommandSchema> {
|
||||
readonly target = "lint";
|
||||
readonly multiTarget = true;
|
||||
readonly missingTargetError = "\nCannot find \"lint\" target for the specified project.\n\nYou should add a package that implements linting capabilities.\n\nFor example:\n ng add @angular-eslint/schematics\n";
|
||||
initialize(options: LintCommandSchema & Arguments): Promise<number | void>;
|
||||
}
|
||||
33
node_modules/@angular/cli/commands/lint-impl.js
generated
vendored
Executable file
33
node_modules/@angular/cli/commands/lint-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
"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 });
|
||||
exports.LintCommand = void 0;
|
||||
const architect_command_1 = require("../models/architect-command");
|
||||
const MissingBuilder = `
|
||||
Cannot find "lint" target for the specified project.
|
||||
|
||||
You should add a package that implements linting capabilities.
|
||||
|
||||
For example:
|
||||
ng add @angular-eslint/schematics
|
||||
`;
|
||||
class LintCommand extends architect_command_1.ArchitectCommand {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.target = 'lint';
|
||||
this.multiTarget = true;
|
||||
this.missingTargetError = MissingBuilder;
|
||||
}
|
||||
async initialize(options) {
|
||||
if (!options.help) {
|
||||
return super.initialize(options);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.LintCommand = LintCommand;
|
||||
20
node_modules/@angular/cli/commands/lint-long.md
generated
vendored
Executable file
20
node_modules/@angular/cli/commands/lint-long.md
generated
vendored
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
The command takes an optional project name, as specified in the `projects` section of the `angular.json` workspace configuration file.
|
||||
When a project name is not supplied, executes the `lint` builder for the default project.
|
||||
|
||||
To use the `ng lint` command, use `ng add` to add a package that implements linting capabilities. Adding the package automatically updates your workspace configuration, adding a lint [CLI builder](guide/cli-builder).
|
||||
For example:
|
||||
|
||||
```json
|
||||
"projects": {
|
||||
"my-project": {
|
||||
...
|
||||
"architect": {
|
||||
...
|
||||
"lint": {
|
||||
"builder": "@angular-eslint/builder:lint",
|
||||
"options": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
29
node_modules/@angular/cli/commands/lint.d.ts
generated
vendored
Executable file
29
node_modules/@angular/cli/commands/lint.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
/**
|
||||
* Runs linting tools on Angular app code in a given project folder.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* One or more named builder configurations as a comma-separated list as specified in the
|
||||
* "configurations" section of angular.json.
|
||||
* The builder uses the named configurations to run the given target.
|
||||
* For more information, see
|
||||
* https://angular.io/guide/workspace-config#alternate-build-configurations.
|
||||
*/
|
||||
configuration?: string;
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
/**
|
||||
* The name of the project to lint.
|
||||
*/
|
||||
project?: string;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
10
node_modules/@angular/cli/commands/lint.js
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/lint.js
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
"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 });
|
||||
exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
36
node_modules/@angular/cli/commands/lint.json
generated
vendored
Executable file
36
node_modules/@angular/cli/commands/lint.json
generated
vendored
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/lint.json",
|
||||
"description": "Runs linting tools on Angular app code in a given project folder.",
|
||||
"$longDescription": "./lint-long.md",
|
||||
|
||||
"$aliases": ["l"],
|
||||
"$scope": "in",
|
||||
"$type": "architect",
|
||||
"$impl": "./lint-impl#LintCommand",
|
||||
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"properties": {
|
||||
"project": {
|
||||
"type": "string",
|
||||
"description": "The name of the project to lint.",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 0
|
||||
}
|
||||
},
|
||||
"configuration": {
|
||||
"description": "One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section of angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.io/guide/workspace-config#alternate-build-configurations.",
|
||||
"type": "string",
|
||||
"aliases": ["c"]
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
},
|
||||
{
|
||||
"$ref": "./definitions.json#/definitions/base"
|
||||
}
|
||||
]
|
||||
}
|
||||
16
node_modules/@angular/cli/commands/new-impl.d.ts
generated
vendored
Executable file
16
node_modules/@angular/cli/commands/new-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
/**
|
||||
* @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 { Arguments } from '../models/interface';
|
||||
import { SchematicCommand } from '../models/schematic-command';
|
||||
import { Schema as NewCommandSchema } from './new';
|
||||
export declare class NewCommand extends SchematicCommand<NewCommandSchema> {
|
||||
readonly allowMissingWorkspace = true;
|
||||
schematicName: string;
|
||||
initialize(options: NewCommandSchema & Arguments): Promise<void>;
|
||||
run(options: NewCommandSchema & Arguments): Promise<number | void>;
|
||||
}
|
||||
37
node_modules/@angular/cli/commands/new-impl.js
generated
vendored
Executable file
37
node_modules/@angular/cli/commands/new-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
"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 });
|
||||
exports.NewCommand = void 0;
|
||||
const schematic_command_1 = require("../models/schematic-command");
|
||||
const version_1 = require("../models/version");
|
||||
class NewCommand extends schematic_command_1.SchematicCommand {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.allowMissingWorkspace = true;
|
||||
this.schematicName = 'ng-new';
|
||||
}
|
||||
async initialize(options) {
|
||||
this.collectionName = options.collection || (await this.getDefaultSchematicCollection());
|
||||
return super.initialize(options);
|
||||
}
|
||||
async run(options) {
|
||||
// Register the version of the CLI in the registry.
|
||||
const version = version_1.VERSION.full;
|
||||
this._workflow.registry.addSmartDefaultProvider('ng-cli-version', () => version);
|
||||
return this.runSchematic({
|
||||
collectionName: this.collectionName,
|
||||
schematicName: this.schematicName,
|
||||
schematicOptions: options['--'] || [],
|
||||
debug: !!options.debug,
|
||||
dryRun: !!options.dryRun,
|
||||
force: !!options.force,
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.NewCommand = NewCommand;
|
||||
41
node_modules/@angular/cli/commands/new.d.ts
generated
vendored
Executable file
41
node_modules/@angular/cli/commands/new.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
* Creates a new workspace and an initial Angular application.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* A collection of schematics to use in generating the initial application.
|
||||
*/
|
||||
collection?: string;
|
||||
/**
|
||||
* Disable interactive input prompts for options with a default.
|
||||
*/
|
||||
defaults?: boolean;
|
||||
/**
|
||||
* Run through and reports activity without writing out results.
|
||||
*/
|
||||
dryRun?: boolean;
|
||||
/**
|
||||
* Force overwriting of existing files.
|
||||
*/
|
||||
force?: boolean;
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
/**
|
||||
* Enable interactive input prompts.
|
||||
*/
|
||||
interactive?: boolean;
|
||||
/**
|
||||
* Add more details to output logging.
|
||||
*/
|
||||
verbose?: boolean;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
10
node_modules/@angular/cli/commands/new.js
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/new.js
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
"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 });
|
||||
exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
34
node_modules/@angular/cli/commands/new.json
generated
vendored
Executable file
34
node_modules/@angular/cli/commands/new.json
generated
vendored
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/new.json",
|
||||
"description": "Creates a new workspace and an initial Angular application.",
|
||||
"$longDescription": "./new.md",
|
||||
|
||||
"$aliases": ["n"],
|
||||
"$scope": "out",
|
||||
"$type": "schematic",
|
||||
"$impl": "./new-impl#NewCommand",
|
||||
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"properties": {
|
||||
"collection": {
|
||||
"type": "string",
|
||||
"aliases": ["c"],
|
||||
"description": "A collection of schematics to use in generating the initial application."
|
||||
},
|
||||
"verbose": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"aliases": ["v"],
|
||||
"description": "Add more details to output logging."
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
},
|
||||
{ "$ref": "./definitions.json#/definitions/base" },
|
||||
{ "$ref": "./definitions.json#/definitions/schematic" },
|
||||
{ "$ref": "./definitions.json#/definitions/interactive" }
|
||||
]
|
||||
}
|
||||
16
node_modules/@angular/cli/commands/new.md
generated
vendored
Executable file
16
node_modules/@angular/cli/commands/new.md
generated
vendored
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
Creates and initializes a new Angular application that is the default project for a new workspace.
|
||||
|
||||
Provides interactive prompts for optional configuration, such as adding routing support.
|
||||
All prompts can safely be allowed to default.
|
||||
|
||||
- The new workspace folder is given the specified project name, and contains configuration files at the top level.
|
||||
|
||||
- By default, the files for a new initial application (with the same name as the workspace) are placed in the `src/` subfolder. Corresponding end-to-end tests are placed in the `e2e/` subfolder.
|
||||
|
||||
- The new application's configuration appears in the `projects` section of the `angular.json` workspace configuration file, under its project name.
|
||||
|
||||
- Subsequent applications that you generate in the workspace reside in the `projects/` subfolder.
|
||||
|
||||
If you plan to have multiple applications in the workspace, you can create an empty workspace by setting the `--createApplication` option to false.
|
||||
You can then use `ng generate application` to create an initial application.
|
||||
This allows a workspace name different from the initial app name, and ensures that all applications reside in the `/projects` subfolder, matching the structure of the configuration file.
|
||||
13
node_modules/@angular/cli/commands/run-impl.d.ts
generated
vendored
Executable file
13
node_modules/@angular/cli/commands/run-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
* @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 { ArchitectCommand, ArchitectCommandOptions } from '../models/architect-command';
|
||||
import { Arguments } from '../models/interface';
|
||||
import { Schema as RunCommandSchema } from './run';
|
||||
export declare class RunCommand extends ArchitectCommand<RunCommandSchema> {
|
||||
run(options: ArchitectCommandOptions & Arguments): Promise<number>;
|
||||
}
|
||||
22
node_modules/@angular/cli/commands/run-impl.js
generated
vendored
Executable file
22
node_modules/@angular/cli/commands/run-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
"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 });
|
||||
exports.RunCommand = void 0;
|
||||
const architect_command_1 = require("../models/architect-command");
|
||||
class RunCommand extends architect_command_1.ArchitectCommand {
|
||||
async run(options) {
|
||||
if (options.target) {
|
||||
return this.runArchitectTarget(options);
|
||||
}
|
||||
else {
|
||||
throw new Error('Invalid architect target.');
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.RunCommand = RunCommand;
|
||||
16
node_modules/@angular/cli/commands/run-long.md
generated
vendored
Executable file
16
node_modules/@angular/cli/commands/run-long.md
generated
vendored
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
Architect is the tool that the CLI uses to perform complex tasks such as compilation, according to provided configurations.
|
||||
The CLI commands run Architect targets such as `build`, `serve`, `test`, and `lint`.
|
||||
Each named target has a default configuration, specified by an "options" object,
|
||||
and an optional set of named alternate configurations in the "configurations" object.
|
||||
|
||||
For example, the "serve" target for a newly generated app has a predefined
|
||||
alternate configuration named "production".
|
||||
|
||||
You can define new targets and their configuration options in the "architect" section
|
||||
of the `angular.json` file.
|
||||
If you do so, you can run them from the command line using the `ng run` command.
|
||||
Execute the command using the following format.
|
||||
|
||||
```
|
||||
ng run project:target[:configuration]
|
||||
```
|
||||
30
node_modules/@angular/cli/commands/run.d.ts
generated
vendored
Executable file
30
node_modules/@angular/cli/commands/run.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
/**
|
||||
* Runs an Architect target with an optional custom builder configuration defined in your
|
||||
* project.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* One or more named builder configurations as a comma-separated list as specified in the
|
||||
* "configurations" section of angular.json.
|
||||
* The builder uses the named configurations to run the given target.
|
||||
* For more information, see
|
||||
* https://angular.io/guide/workspace-config#alternate-build-configurations.
|
||||
*/
|
||||
configuration?: string;
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
/**
|
||||
* The Architect target to run.
|
||||
*/
|
||||
target?: string;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
10
node_modules/@angular/cli/commands/run.js
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/run.js
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
"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 });
|
||||
exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
36
node_modules/@angular/cli/commands/run.json
generated
vendored
Executable file
36
node_modules/@angular/cli/commands/run.json
generated
vendored
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/run.json",
|
||||
"description": "Runs an Architect target with an optional custom builder configuration defined in your project.",
|
||||
"$longDescription": "./run-long.md",
|
||||
|
||||
"$aliases": [],
|
||||
"$scope": "in",
|
||||
"$type": "architect",
|
||||
"$impl": "./run-impl#RunCommand",
|
||||
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"properties": {
|
||||
"target": {
|
||||
"type": "string",
|
||||
"description": "The Architect target to run.",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 0
|
||||
}
|
||||
},
|
||||
"configuration": {
|
||||
"description": "One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section of angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.io/guide/workspace-config#alternate-build-configurations.",
|
||||
"type": "string",
|
||||
"aliases": ["c"]
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
},
|
||||
{
|
||||
"$ref": "./definitions.json#/definitions/base"
|
||||
}
|
||||
]
|
||||
}
|
||||
15
node_modules/@angular/cli/commands/serve-impl.d.ts
generated
vendored
Executable file
15
node_modules/@angular/cli/commands/serve-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* @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 { ArchitectCommand, ArchitectCommandOptions } from '../models/architect-command';
|
||||
import { Arguments } from '../models/interface';
|
||||
import { Schema as ServeCommandSchema } from './serve';
|
||||
export declare class ServeCommand extends ArchitectCommand<ServeCommandSchema> {
|
||||
readonly target = "serve";
|
||||
validate(): boolean;
|
||||
run(options: ArchitectCommandOptions & Arguments): Promise<number>;
|
||||
}
|
||||
24
node_modules/@angular/cli/commands/serve-impl.js
generated
vendored
Executable file
24
node_modules/@angular/cli/commands/serve-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
"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 });
|
||||
exports.ServeCommand = void 0;
|
||||
const architect_command_1 = require("../models/architect-command");
|
||||
class ServeCommand extends architect_command_1.ArchitectCommand {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.target = 'serve';
|
||||
}
|
||||
validate() {
|
||||
return true;
|
||||
}
|
||||
async run(options) {
|
||||
return this.runArchitectTarget(options);
|
||||
}
|
||||
}
|
||||
exports.ServeCommand = ServeCommand;
|
||||
37
node_modules/@angular/cli/commands/serve.d.ts
generated
vendored
Executable file
37
node_modules/@angular/cli/commands/serve.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
/**
|
||||
* Builds and serves your app, rebuilding on file changes.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* One or more named builder configurations as a comma-separated list as specified in the
|
||||
* "configurations" section of angular.json.
|
||||
* The builder uses the named configurations to run the given target.
|
||||
* For more information, see
|
||||
* https://angular.io/guide/workspace-config#alternate-build-configurations.
|
||||
* Setting this explicitly overrides the "--prod" flag.
|
||||
*/
|
||||
configuration?: string;
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
/**
|
||||
* Shorthand for "--configuration=production".
|
||||
* Set the build configuration to the production target.
|
||||
* By default, the production target is set up in the workspace configuration such that all
|
||||
* builds make use of bundling, limited tree-shaking, and also limited dead code elimination.
|
||||
*/
|
||||
prod?: boolean;
|
||||
/**
|
||||
* The name of the project to build. Can be an application or a library.
|
||||
*/
|
||||
project?: string;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
10
node_modules/@angular/cli/commands/serve.js
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/serve.js
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
"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 });
|
||||
exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
17
node_modules/@angular/cli/commands/serve.json
generated
vendored
Executable file
17
node_modules/@angular/cli/commands/serve.json
generated
vendored
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/serve.json",
|
||||
"description": "Builds and serves your app, rebuilding on file changes.",
|
||||
"$longDescription": "",
|
||||
|
||||
"$aliases": ["s"],
|
||||
"$scope": "in",
|
||||
"$type": "architect",
|
||||
"$impl": "./serve-impl#ServeCommand",
|
||||
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{ "$ref": "./definitions.json#/definitions/architect" },
|
||||
{ "$ref": "./definitions.json#/definitions/base" }
|
||||
]
|
||||
}
|
||||
15
node_modules/@angular/cli/commands/test-impl.d.ts
generated
vendored
Executable file
15
node_modules/@angular/cli/commands/test-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* @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 { ArchitectCommand, ArchitectCommandOptions } from '../models/architect-command';
|
||||
import { Arguments } from '../models/interface';
|
||||
import { Schema as TestCommandSchema } from './test';
|
||||
export declare class TestCommand extends ArchitectCommand<TestCommandSchema> {
|
||||
readonly target = "test";
|
||||
readonly multiTarget = true;
|
||||
run(options: ArchitectCommandOptions & Arguments): Promise<number>;
|
||||
}
|
||||
22
node_modules/@angular/cli/commands/test-impl.js
generated
vendored
Executable file
22
node_modules/@angular/cli/commands/test-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
"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 });
|
||||
exports.TestCommand = void 0;
|
||||
const architect_command_1 = require("../models/architect-command");
|
||||
class TestCommand extends architect_command_1.ArchitectCommand {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.target = 'test';
|
||||
this.multiTarget = true;
|
||||
}
|
||||
async run(options) {
|
||||
return this.runArchitectTarget(options);
|
||||
}
|
||||
}
|
||||
exports.TestCommand = TestCommand;
|
||||
2
node_modules/@angular/cli/commands/test-long.md
generated
vendored
Executable file
2
node_modules/@angular/cli/commands/test-long.md
generated
vendored
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
Takes the name of the project, as specified in the `projects` section of the `angular.json` workspace configuration file.
|
||||
When a project name is not supplied, it will execute for all projects.
|
||||
37
node_modules/@angular/cli/commands/test.d.ts
generated
vendored
Executable file
37
node_modules/@angular/cli/commands/test.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
/**
|
||||
* Runs unit tests in a project.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* One or more named builder configurations as a comma-separated list as specified in the
|
||||
* "configurations" section of angular.json.
|
||||
* The builder uses the named configurations to run the given target.
|
||||
* For more information, see
|
||||
* https://angular.io/guide/workspace-config#alternate-build-configurations.
|
||||
* Setting this explicitly overrides the "--prod" flag.
|
||||
*/
|
||||
configuration?: string;
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
help?: HelpUnion;
|
||||
/**
|
||||
* Shorthand for "--configuration=production".
|
||||
* Set the build configuration to the production target.
|
||||
* By default, the production target is set up in the workspace configuration such that all
|
||||
* builds make use of bundling, limited tree-shaking, and also limited dead code elimination.
|
||||
*/
|
||||
prod?: boolean;
|
||||
/**
|
||||
* The name of the project to build. Can be an application or a library.
|
||||
*/
|
||||
project?: string;
|
||||
}
|
||||
/**
|
||||
* Shows a help message for this command in the console.
|
||||
*/
|
||||
export declare type HelpUnion = boolean | HelpEnum;
|
||||
export declare enum HelpEnum {
|
||||
HelpJson = "JSON",
|
||||
Json = "json"
|
||||
}
|
||||
10
node_modules/@angular/cli/commands/test.js
generated
vendored
Executable file
10
node_modules/@angular/cli/commands/test.js
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
"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 });
|
||||
exports.HelpEnum = void 0;
|
||||
var HelpEnum;
|
||||
(function (HelpEnum) {
|
||||
HelpEnum["HelpJson"] = "JSON";
|
||||
HelpEnum["Json"] = "json";
|
||||
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
||||
17
node_modules/@angular/cli/commands/test.json
generated
vendored
Executable file
17
node_modules/@angular/cli/commands/test.json
generated
vendored
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "ng-cli://commands/test.json",
|
||||
"description": "Runs unit tests in a project.",
|
||||
"$longDescription": "./test-long.md",
|
||||
|
||||
"$aliases": ["t"],
|
||||
"$scope": "in",
|
||||
"$type": "architect",
|
||||
"$impl": "./test-impl#TestCommand",
|
||||
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{ "$ref": "./definitions.json#/definitions/architect" },
|
||||
{ "$ref": "./definitions.json#/definitions/base" }
|
||||
]
|
||||
}
|
||||
37
node_modules/@angular/cli/commands/update-impl.d.ts
generated
vendored
Executable file
37
node_modules/@angular/cli/commands/update-impl.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
/**
|
||||
* @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 { Command } from '../models/command';
|
||||
import { Arguments } from '../models/interface';
|
||||
import { Schema as UpdateCommandSchema } from './update';
|
||||
export declare class UpdateCommand extends Command<UpdateCommandSchema> {
|
||||
readonly allowMissingWorkspace = true;
|
||||
private workflow;
|
||||
private packageManager;
|
||||
initialize(options: UpdateCommandSchema & Arguments): Promise<void>;
|
||||
private executeSchematic;
|
||||
/**
|
||||
* @return Whether or not the migration was performed successfully.
|
||||
*/
|
||||
private executeMigration;
|
||||
/**
|
||||
* @return Whether or not the migrations were performed successfully.
|
||||
*/
|
||||
private executeMigrations;
|
||||
private executePackageMigrations;
|
||||
run(options: UpdateCommandSchema & Arguments): Promise<number>;
|
||||
/**
|
||||
* @return Whether or not the commit was successful.
|
||||
*/
|
||||
private commit;
|
||||
private checkCleanGit;
|
||||
/**
|
||||
* Checks if the current installed CLI version is older than the latest version.
|
||||
* @returns `true` when the installed version is older.
|
||||
*/
|
||||
private checkCLILatestVersion;
|
||||
}
|
||||
721
node_modules/@angular/cli/commands/update-impl.js
generated
vendored
Executable file
721
node_modules/@angular/cli/commands/update-impl.js
generated
vendored
Executable file
|
|
@ -0,0 +1,721 @@
|
|||
"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
|
||||
*/
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.UpdateCommand = void 0;
|
||||
const schematics_1 = require("@angular-devkit/schematics");
|
||||
const tools_1 = require("@angular-devkit/schematics/tools");
|
||||
const child_process_1 = require("child_process");
|
||||
const fs = __importStar(require("fs"));
|
||||
const path = __importStar(require("path"));
|
||||
const semver = __importStar(require("semver"));
|
||||
const workspace_schema_1 = require("../lib/config/workspace-schema");
|
||||
const command_1 = require("../models/command");
|
||||
const schematic_engine_host_1 = require("../models/schematic-engine-host");
|
||||
const version_1 = require("../models/version");
|
||||
const color_1 = require("../utilities/color");
|
||||
const install_package_1 = require("../utilities/install-package");
|
||||
const log_file_1 = require("../utilities/log-file");
|
||||
const package_manager_1 = require("../utilities/package-manager");
|
||||
const package_metadata_1 = require("../utilities/package-metadata");
|
||||
const package_tree_1 = require("../utilities/package-tree");
|
||||
const npa = require('npm-package-arg');
|
||||
const pickManifest = require('npm-pick-manifest');
|
||||
const NG_VERSION_9_POST_MSG = color_1.colors.cyan('\nYour project has been updated to Angular version 9!\n' +
|
||||
'For more info, please see: https://v9.angular.io/guide/updating-to-version-9');
|
||||
const UPDATE_SCHEMATIC_COLLECTION = path.join(__dirname, '../src/commands/update/schematic/collection.json');
|
||||
/**
|
||||
* Disable CLI version mismatch checks and forces usage of the invoked CLI
|
||||
* instead of invoking the local installed version.
|
||||
*/
|
||||
const disableVersionCheckEnv = process.env['NG_DISABLE_VERSION_CHECK'];
|
||||
const disableVersionCheck = disableVersionCheckEnv !== undefined &&
|
||||
disableVersionCheckEnv !== '0' &&
|
||||
disableVersionCheckEnv.toLowerCase() !== 'false';
|
||||
class UpdateCommand extends command_1.Command {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.allowMissingWorkspace = true;
|
||||
this.packageManager = workspace_schema_1.PackageManager.Npm;
|
||||
}
|
||||
async initialize(options) {
|
||||
this.packageManager = await package_manager_1.getPackageManager(this.context.root);
|
||||
this.workflow = new tools_1.NodeWorkflow(this.context.root, {
|
||||
packageManager: this.packageManager,
|
||||
packageManagerForce: options.force,
|
||||
// __dirname -> favor @schematics/update from this package
|
||||
// Otherwise, use packages from the active workspace (migrations)
|
||||
resolvePaths: [__dirname, this.context.root],
|
||||
schemaValidation: true,
|
||||
engineHostCreator: (options) => new schematic_engine_host_1.SchematicEngineHost(options.resolvePaths),
|
||||
});
|
||||
}
|
||||
async executeSchematic(collection, schematic, options = {}) {
|
||||
let error = false;
|
||||
let logs = [];
|
||||
const files = new Set();
|
||||
const reporterSubscription = this.workflow.reporter.subscribe((event) => {
|
||||
// Strip leading slash to prevent confusion.
|
||||
const eventPath = event.path.startsWith('/') ? event.path.substr(1) : event.path;
|
||||
switch (event.kind) {
|
||||
case 'error':
|
||||
error = true;
|
||||
const desc = event.description == 'alreadyExist' ? 'already exists' : 'does not exist.';
|
||||
this.logger.error(`ERROR! ${eventPath} ${desc}.`);
|
||||
break;
|
||||
case 'update':
|
||||
logs.push(`${color_1.colors.cyan('UPDATE')} ${eventPath} (${event.content.length} bytes)`);
|
||||
files.add(eventPath);
|
||||
break;
|
||||
case 'create':
|
||||
logs.push(`${color_1.colors.green('CREATE')} ${eventPath} (${event.content.length} bytes)`);
|
||||
files.add(eventPath);
|
||||
break;
|
||||
case 'delete':
|
||||
logs.push(`${color_1.colors.yellow('DELETE')} ${eventPath}`);
|
||||
files.add(eventPath);
|
||||
break;
|
||||
case 'rename':
|
||||
const eventToPath = event.to.startsWith('/') ? event.to.substr(1) : event.to;
|
||||
logs.push(`${color_1.colors.blue('RENAME')} ${eventPath} => ${eventToPath}`);
|
||||
files.add(eventPath);
|
||||
break;
|
||||
}
|
||||
});
|
||||
const lifecycleSubscription = this.workflow.lifeCycle.subscribe((event) => {
|
||||
if (event.kind == 'end' || event.kind == 'post-tasks-start') {
|
||||
if (!error) {
|
||||
// Output the logging queue, no error happened.
|
||||
logs.forEach((log) => this.logger.info(` ${log}`));
|
||||
logs = [];
|
||||
}
|
||||
}
|
||||
});
|
||||
// TODO: Allow passing a schematic instance directly
|
||||
try {
|
||||
await this.workflow
|
||||
.execute({
|
||||
collection,
|
||||
schematic,
|
||||
options,
|
||||
logger: this.logger,
|
||||
})
|
||||
.toPromise();
|
||||
reporterSubscription.unsubscribe();
|
||||
lifecycleSubscription.unsubscribe();
|
||||
return { success: !error, files };
|
||||
}
|
||||
catch (e) {
|
||||
if (e instanceof schematics_1.UnsuccessfulWorkflowExecution) {
|
||||
this.logger.error(`${color_1.colors.symbols.cross} Migration failed. See above for further details.\n`);
|
||||
}
|
||||
else {
|
||||
const logPath = log_file_1.writeErrorToLogFile(e);
|
||||
this.logger.fatal(`${color_1.colors.symbols.cross} Migration failed: ${e.message}\n` +
|
||||
` See "${logPath}" for further details.\n`);
|
||||
}
|
||||
return { success: false, files };
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @return Whether or not the migration was performed successfully.
|
||||
*/
|
||||
async executeMigration(packageName, collectionPath, migrationName, commit) {
|
||||
const collection = this.workflow.engine.createCollection(collectionPath);
|
||||
const name = collection.listSchematicNames().find((name) => name === migrationName);
|
||||
if (!name) {
|
||||
this.logger.error(`Cannot find migration '${migrationName}' in '${packageName}'.`);
|
||||
return false;
|
||||
}
|
||||
const schematic = this.workflow.engine.createSchematic(name, collection);
|
||||
this.logger.info(color_1.colors.cyan(`** Executing '${migrationName}' of package '${packageName}' **\n`));
|
||||
return this.executePackageMigrations([schematic.description], packageName, commit);
|
||||
}
|
||||
/**
|
||||
* @return Whether or not the migrations were performed successfully.
|
||||
*/
|
||||
async executeMigrations(packageName, collectionPath, from, to, commit) {
|
||||
const collection = this.workflow.engine.createCollection(collectionPath);
|
||||
const migrationRange = new semver.Range('>' + (semver.prerelease(from) ? from.split('-')[0] + '-0' : from) + ' <=' + to);
|
||||
const migrations = [];
|
||||
for (const name of collection.listSchematicNames()) {
|
||||
const schematic = this.workflow.engine.createSchematic(name, collection);
|
||||
const description = schematic.description;
|
||||
description.version = coerceVersionNumber(description.version) || undefined;
|
||||
if (!description.version) {
|
||||
continue;
|
||||
}
|
||||
if (semver.satisfies(description.version, migrationRange, { includePrerelease: true })) {
|
||||
migrations.push(description);
|
||||
}
|
||||
}
|
||||
migrations.sort((a, b) => semver.compare(a.version, b.version) || a.name.localeCompare(b.name));
|
||||
if (migrations.length === 0) {
|
||||
return true;
|
||||
}
|
||||
this.logger.info(color_1.colors.cyan(`** Executing migrations of package '${packageName}' **\n`));
|
||||
return this.executePackageMigrations(migrations, packageName, commit);
|
||||
}
|
||||
async executePackageMigrations(migrations, packageName, commit = false) {
|
||||
for (const migration of migrations) {
|
||||
const [title, ...description] = migration.description.split('. ');
|
||||
this.logger.info(color_1.colors.cyan(color_1.colors.symbols.pointer) +
|
||||
' ' +
|
||||
color_1.colors.bold(title.endsWith('.') ? title : title + '.'));
|
||||
if (description.length) {
|
||||
this.logger.info(' ' + description.join('.\n '));
|
||||
}
|
||||
const result = await this.executeSchematic(migration.collection.name, migration.name);
|
||||
if (!result.success) {
|
||||
return false;
|
||||
}
|
||||
this.logger.info(' Migration completed.');
|
||||
// Commit migration
|
||||
if (commit) {
|
||||
const commitPrefix = `${packageName} migration - ${migration.name}`;
|
||||
const commitMessage = migration.description
|
||||
? `${commitPrefix}\n\n${migration.description}`
|
||||
: commitPrefix;
|
||||
const committed = this.commit(commitMessage);
|
||||
if (!committed) {
|
||||
// Failed to commit, something went wrong. Abort the update.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
this.logger.info(''); // Extra trailing newline.
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// eslint-disable-next-line max-lines-per-function
|
||||
async run(options) {
|
||||
var _a, _b;
|
||||
await package_manager_1.ensureCompatibleNpm(this.context.root);
|
||||
// Check if the current installed CLI version is older than the latest version.
|
||||
if (!disableVersionCheck && (await this.checkCLILatestVersion(options.verbose, options.next))) {
|
||||
this.logger.warn(`The installed local Angular CLI version is older than the latest ${options.next ? 'pre-release' : 'stable'} version.\n` + 'Installing a temporary version to perform the update.');
|
||||
return install_package_1.runTempPackageBin(`@angular/cli@${options.next ? 'next' : 'latest'}`, this.packageManager, process.argv.slice(2));
|
||||
}
|
||||
const logVerbose = (message) => {
|
||||
if (options.verbose) {
|
||||
this.logger.info(message);
|
||||
}
|
||||
};
|
||||
if (options.all) {
|
||||
const updateCmd = this.packageManager === workspace_schema_1.PackageManager.Yarn
|
||||
? `'yarn upgrade-interactive' or 'yarn upgrade'`
|
||||
: `'${this.packageManager} update'`;
|
||||
this.logger.warn(`
|
||||
'--all' functionality has been removed as updating multiple packages at once is not recommended.
|
||||
To update packages which don’t provide 'ng update' capabilities in your workspace 'package.json' use ${updateCmd} instead.
|
||||
Run the package manager update command after updating packages which provide 'ng update' capabilities.
|
||||
`);
|
||||
return 0;
|
||||
}
|
||||
const packages = [];
|
||||
for (const request of options['--'] || []) {
|
||||
try {
|
||||
const packageIdentifier = npa(request);
|
||||
// only registry identifiers are supported
|
||||
if (!packageIdentifier.registry) {
|
||||
this.logger.error(`Package '${request}' is not a registry package identifer.`);
|
||||
return 1;
|
||||
}
|
||||
if (packages.some((v) => v.name === packageIdentifier.name)) {
|
||||
this.logger.error(`Duplicate package '${packageIdentifier.name}' specified.`);
|
||||
return 1;
|
||||
}
|
||||
if (options.migrateOnly && packageIdentifier.rawSpec) {
|
||||
this.logger.warn('Package specifier has no effect when using "migrate-only" option.');
|
||||
}
|
||||
// If next option is used and no specifier supplied, use next tag
|
||||
if (options.next && !packageIdentifier.rawSpec) {
|
||||
packageIdentifier.fetchSpec = 'next';
|
||||
}
|
||||
packages.push(packageIdentifier);
|
||||
}
|
||||
catch (e) {
|
||||
this.logger.error(e.message);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (!options.migrateOnly && (options.from || options.to)) {
|
||||
this.logger.error('Can only use "from" or "to" options with "migrate-only" option.');
|
||||
return 1;
|
||||
}
|
||||
// If not asking for status then check for a clean git repository.
|
||||
// This allows the user to easily reset any changes from the update.
|
||||
if (packages.length && !this.checkCleanGit()) {
|
||||
if (options.allowDirty) {
|
||||
this.logger.warn('Repository is not clean. Update changes will be mixed with pre-existing changes.');
|
||||
}
|
||||
else {
|
||||
this.logger.error('Repository is not clean. Please commit or stash any changes before updating.');
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
this.logger.info(`Using package manager: '${this.packageManager}'`);
|
||||
this.logger.info('Collecting installed dependencies...');
|
||||
const rootDependencies = await package_tree_1.getProjectDependencies(this.context.root);
|
||||
this.logger.info(`Found ${rootDependencies.size} dependencies.`);
|
||||
if (packages.length === 0) {
|
||||
// Show status
|
||||
const { success } = await this.executeSchematic(UPDATE_SCHEMATIC_COLLECTION, 'update', {
|
||||
force: options.force || false,
|
||||
next: options.next || false,
|
||||
verbose: options.verbose || false,
|
||||
packageManager: this.packageManager,
|
||||
packages: [],
|
||||
});
|
||||
return success ? 0 : 1;
|
||||
}
|
||||
if (options.migrateOnly) {
|
||||
if (!options.from && typeof options.migrateOnly !== 'string') {
|
||||
this.logger.error('"from" option is required when using the "migrate-only" option without a migration name.');
|
||||
return 1;
|
||||
}
|
||||
else if (packages.length !== 1) {
|
||||
this.logger.error('A single package must be specified when using the "migrate-only" option.');
|
||||
return 1;
|
||||
}
|
||||
if (options.next) {
|
||||
this.logger.warn('"next" option has no effect when using "migrate-only" option.');
|
||||
}
|
||||
const packageName = packages[0].name;
|
||||
const packageDependency = rootDependencies.get(packageName);
|
||||
let packagePath = packageDependency === null || packageDependency === void 0 ? void 0 : packageDependency.path;
|
||||
let packageNode = packageDependency === null || packageDependency === void 0 ? void 0 : packageDependency.package;
|
||||
if (packageDependency && !packageNode) {
|
||||
this.logger.error('Package found in package.json but is not installed.');
|
||||
return 1;
|
||||
}
|
||||
else if (!packageDependency) {
|
||||
// Allow running migrations on transitively installed dependencies
|
||||
// There can technically be nested multiple versions
|
||||
// TODO: If multiple, this should find all versions and ask which one to use
|
||||
const packageJson = package_tree_1.findPackageJson(this.context.root, packageName);
|
||||
if (packageJson) {
|
||||
packagePath = path.dirname(packageJson);
|
||||
packageNode = await package_tree_1.readPackageJson(packageJson);
|
||||
}
|
||||
}
|
||||
if (!packageNode || !packagePath) {
|
||||
this.logger.error('Package is not installed.');
|
||||
return 1;
|
||||
}
|
||||
const updateMetadata = packageNode['ng-update'];
|
||||
let migrations = updateMetadata === null || updateMetadata === void 0 ? void 0 : updateMetadata.migrations;
|
||||
if (migrations === undefined) {
|
||||
this.logger.error('Package does not provide migrations.');
|
||||
return 1;
|
||||
}
|
||||
else if (typeof migrations !== 'string') {
|
||||
this.logger.error('Package contains a malformed migrations field.');
|
||||
return 1;
|
||||
}
|
||||
else if (path.posix.isAbsolute(migrations) || path.win32.isAbsolute(migrations)) {
|
||||
this.logger.error('Package contains an invalid migrations field. Absolute paths are not permitted.');
|
||||
return 1;
|
||||
}
|
||||
// Normalize slashes
|
||||
migrations = migrations.replace(/\\/g, '/');
|
||||
if (migrations.startsWith('../')) {
|
||||
this.logger.error('Package contains an invalid migrations field. ' +
|
||||
'Paths outside the package root are not permitted.');
|
||||
return 1;
|
||||
}
|
||||
// Check if it is a package-local location
|
||||
const localMigrations = path.join(packagePath, migrations);
|
||||
if (fs.existsSync(localMigrations)) {
|
||||
migrations = localMigrations;
|
||||
}
|
||||
else {
|
||||
// Try to resolve from package location.
|
||||
// This avoids issues with package hoisting.
|
||||
try {
|
||||
migrations = require.resolve(migrations, { paths: [packagePath] });
|
||||
}
|
||||
catch (e) {
|
||||
if (e.code === 'MODULE_NOT_FOUND') {
|
||||
this.logger.error('Migrations for package were not found.');
|
||||
}
|
||||
else {
|
||||
this.logger.error(`Unable to resolve migrations for package. [${e.message}]`);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
let success = false;
|
||||
if (typeof options.migrateOnly == 'string') {
|
||||
success = await this.executeMigration(packageName, migrations, options.migrateOnly, options.createCommits);
|
||||
}
|
||||
else {
|
||||
const from = coerceVersionNumber(options.from);
|
||||
if (!from) {
|
||||
this.logger.error(`"from" value [${options.from}] is not a valid version.`);
|
||||
return 1;
|
||||
}
|
||||
success = await this.executeMigrations(packageName, migrations, from, options.to || packageNode.version, options.createCommits);
|
||||
}
|
||||
if (success) {
|
||||
if (packageName === '@angular/core' &&
|
||||
options.from &&
|
||||
+options.from.split('.')[0] < 9 &&
|
||||
(options.to || packageNode.version).split('.')[0] === '9') {
|
||||
this.logger.info(NG_VERSION_9_POST_MSG);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
const requests = [];
|
||||
// Validate packages actually are part of the workspace
|
||||
for (const pkg of packages) {
|
||||
const node = rootDependencies.get(pkg.name);
|
||||
if (!(node === null || node === void 0 ? void 0 : node.package)) {
|
||||
this.logger.error(`Package '${pkg.name}' is not a dependency.`);
|
||||
return 1;
|
||||
}
|
||||
// If a specific version is requested and matches the installed version, skip.
|
||||
if (pkg.type === 'version' && node.package.version === pkg.fetchSpec) {
|
||||
this.logger.info(`Package '${pkg.name}' is already at '${pkg.fetchSpec}'.`);
|
||||
continue;
|
||||
}
|
||||
requests.push({ identifier: pkg, node });
|
||||
}
|
||||
if (requests.length === 0) {
|
||||
return 0;
|
||||
}
|
||||
const packagesToUpdate = [];
|
||||
this.logger.info('Fetching dependency metadata from registry...');
|
||||
for (const { identifier: requestIdentifier, node } of requests) {
|
||||
const packageName = requestIdentifier.name;
|
||||
let metadata;
|
||||
try {
|
||||
// Metadata requests are internally cached; multiple requests for same name
|
||||
// does not result in additional network traffic
|
||||
metadata = await package_metadata_1.fetchPackageMetadata(packageName, this.logger, {
|
||||
verbose: options.verbose,
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
this.logger.error(`Error fetching metadata for '${packageName}': ` + e.message);
|
||||
return 1;
|
||||
}
|
||||
// Try to find a package version based on the user requested package specifier
|
||||
// registry specifier types are either version, range, or tag
|
||||
let manifest;
|
||||
if (requestIdentifier.type === 'version' ||
|
||||
requestIdentifier.type === 'range' ||
|
||||
requestIdentifier.type === 'tag') {
|
||||
try {
|
||||
manifest = pickManifest(metadata, requestIdentifier.fetchSpec);
|
||||
}
|
||||
catch (e) {
|
||||
if (e.code === 'ETARGET') {
|
||||
// If not found and next was used and user did not provide a specifier, try latest.
|
||||
// Package may not have a next tag.
|
||||
if (requestIdentifier.type === 'tag' &&
|
||||
requestIdentifier.fetchSpec === 'next' &&
|
||||
!requestIdentifier.rawSpec) {
|
||||
try {
|
||||
manifest = pickManifest(metadata, 'latest');
|
||||
}
|
||||
catch (e) {
|
||||
if (e.code !== 'ETARGET' && e.code !== 'ENOVERSIONS') {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e.code !== 'ENOVERSIONS') {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!manifest) {
|
||||
this.logger.error(`Package specified by '${requestIdentifier.raw}' does not exist within the registry.`);
|
||||
return 1;
|
||||
}
|
||||
if (((_a = node.package) === null || _a === void 0 ? void 0 : _a.name) === '@angular/cli') {
|
||||
// Migrations for non LTS versions of Angular CLI are no longer included in @schematics/angular v12.
|
||||
const toBeInstalledMajorVersion = +manifest.version.split('.')[0];
|
||||
const currentMajorVersion = +node.package.version.split('.')[0];
|
||||
if (currentMajorVersion < 9 && toBeInstalledMajorVersion >= 12) {
|
||||
const updateVersions = {
|
||||
1: 6,
|
||||
6: 7,
|
||||
7: 8,
|
||||
8: 9,
|
||||
};
|
||||
const updateTo = updateVersions[currentMajorVersion];
|
||||
this.logger.error('Updating multiple major versions at once is not recommended. ' +
|
||||
`Run 'ng update @angular/cli@${updateTo}' in your workspace directory ` +
|
||||
`to update to latest '${updateTo}.x' version of '@angular/cli'.\n\n` +
|
||||
'For more information about the update process, see https://update.angular.io/.');
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (manifest.version === ((_b = node.package) === null || _b === void 0 ? void 0 : _b.version)) {
|
||||
this.logger.info(`Package '${packageName}' is already up to date.`);
|
||||
continue;
|
||||
}
|
||||
packagesToUpdate.push(requestIdentifier.toString());
|
||||
}
|
||||
if (packagesToUpdate.length === 0) {
|
||||
return 0;
|
||||
}
|
||||
const { success } = await this.executeSchematic(UPDATE_SCHEMATIC_COLLECTION, 'update', {
|
||||
verbose: options.verbose || false,
|
||||
force: options.force || false,
|
||||
next: !!options.next,
|
||||
packageManager: this.packageManager,
|
||||
packages: packagesToUpdate,
|
||||
});
|
||||
if (success) {
|
||||
try {
|
||||
// Remove existing node modules directory to provide a stronger guarantee that packages
|
||||
// will be hoisted into the correct locations.
|
||||
await fs.promises.rmdir(path.join(this.context.root, 'node_modules'), {
|
||||
recursive: true,
|
||||
maxRetries: 3,
|
||||
});
|
||||
}
|
||||
catch { }
|
||||
const result = await install_package_1.installAllPackages(this.packageManager, options.force ? ['--force'] : [], this.context.root);
|
||||
if (result !== 0) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (success && options.createCommits) {
|
||||
const committed = this.commit(`Angular CLI update for packages - ${packagesToUpdate.join(', ')}`);
|
||||
if (!committed) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
// This is a temporary workaround to allow data to be passed back from the update schematic
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const migrations = global.externalMigrations;
|
||||
if (success && migrations) {
|
||||
for (const migration of migrations) {
|
||||
// Resolve the package from the workspace root, as otherwise it will be resolved from the temp
|
||||
// installed CLI version.
|
||||
let packagePath;
|
||||
logVerbose(`Resolving migration package '${migration.package}' from '${this.context.root}'...`);
|
||||
try {
|
||||
try {
|
||||
packagePath = path.dirname(
|
||||
// This may fail if the `package.json` is not exported as an entry point
|
||||
require.resolve(path.join(migration.package, 'package.json'), {
|
||||
paths: [this.context.root],
|
||||
}));
|
||||
}
|
||||
catch (e) {
|
||||
if (e.code === 'MODULE_NOT_FOUND') {
|
||||
// Fallback to trying to resolve the package's main entry point
|
||||
packagePath = require.resolve(migration.package, { paths: [this.context.root] });
|
||||
}
|
||||
else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
if (e.code === 'MODULE_NOT_FOUND') {
|
||||
logVerbose(e.toString());
|
||||
this.logger.error(`Migrations for package (${migration.package}) were not found.` +
|
||||
' The package could not be found in the workspace.');
|
||||
}
|
||||
else {
|
||||
this.logger.error(`Unable to resolve migrations for package (${migration.package}). [${e.message}]`);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
let migrations;
|
||||
// Check if it is a package-local location
|
||||
const localMigrations = path.join(packagePath, migration.collection);
|
||||
if (fs.existsSync(localMigrations)) {
|
||||
migrations = localMigrations;
|
||||
}
|
||||
else {
|
||||
// Try to resolve from package location.
|
||||
// This avoids issues with package hoisting.
|
||||
try {
|
||||
migrations = require.resolve(migration.collection, { paths: [packagePath] });
|
||||
}
|
||||
catch (e) {
|
||||
if (e.code === 'MODULE_NOT_FOUND') {
|
||||
this.logger.error(`Migrations for package (${migration.package}) were not found.`);
|
||||
}
|
||||
else {
|
||||
this.logger.error(`Unable to resolve migrations for package (${migration.package}). [${e.message}]`);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
const result = await this.executeMigrations(migration.package, migrations, migration.from, migration.to, options.createCommits);
|
||||
if (!result) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (migrations.some((m) => m.package === '@angular/core' &&
|
||||
m.to.split('.')[0] === '9' &&
|
||||
+m.from.split('.')[0] < 9)) {
|
||||
this.logger.info(NG_VERSION_9_POST_MSG);
|
||||
}
|
||||
}
|
||||
return success ? 0 : 1;
|
||||
}
|
||||
/**
|
||||
* @return Whether or not the commit was successful.
|
||||
*/
|
||||
commit(message) {
|
||||
// Check if a commit is needed.
|
||||
let commitNeeded;
|
||||
try {
|
||||
commitNeeded = hasChangesToCommit();
|
||||
}
|
||||
catch (err) {
|
||||
this.logger.error(` Failed to read Git tree:\n${err.stderr}`);
|
||||
return false;
|
||||
}
|
||||
if (!commitNeeded) {
|
||||
this.logger.info(' No changes to commit after migration.');
|
||||
return true;
|
||||
}
|
||||
// Commit changes and abort on error.
|
||||
try {
|
||||
createCommit(message);
|
||||
}
|
||||
catch (err) {
|
||||
this.logger.error(`Failed to commit update (${message}):\n${err.stderr}`);
|
||||
return false;
|
||||
}
|
||||
// Notify user of the commit.
|
||||
const hash = findCurrentGitSha();
|
||||
const shortMessage = message.split('\n')[0];
|
||||
if (hash) {
|
||||
this.logger.info(` Committed migration step (${getShortHash(hash)}): ${shortMessage}.`);
|
||||
}
|
||||
else {
|
||||
// Commit was successful, but reading the hash was not. Something weird happened,
|
||||
// but nothing that would stop the update. Just log the weirdness and continue.
|
||||
this.logger.info(` Committed migration step: ${shortMessage}.`);
|
||||
this.logger.warn(' Failed to look up hash of most recent commit, continuing anyways.');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
checkCleanGit() {
|
||||
try {
|
||||
const topLevel = child_process_1.execSync('git rev-parse --show-toplevel', {
|
||||
encoding: 'utf8',
|
||||
stdio: 'pipe',
|
||||
});
|
||||
const result = child_process_1.execSync('git status --porcelain', { encoding: 'utf8', stdio: 'pipe' });
|
||||
if (result.trim().length === 0) {
|
||||
return true;
|
||||
}
|
||||
// Only files inside the workspace root are relevant
|
||||
for (const entry of result.split('\n')) {
|
||||
const relativeEntry = path.relative(path.resolve(this.context.root), path.resolve(topLevel.trim(), entry.slice(3).trim()));
|
||||
if (!relativeEntry.startsWith('..') && !path.isAbsolute(relativeEntry)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Checks if the current installed CLI version is older than the latest version.
|
||||
* @returns `true` when the installed version is older.
|
||||
*/
|
||||
async checkCLILatestVersion(verbose = false, next = false) {
|
||||
const installedCLIVersion = version_1.VERSION.full;
|
||||
const LatestCLIManifest = await package_metadata_1.fetchPackageManifest(`@angular/cli@${next ? 'next' : 'latest'}`, this.logger, {
|
||||
verbose,
|
||||
usingYarn: this.packageManager === workspace_schema_1.PackageManager.Yarn,
|
||||
});
|
||||
return semver.lt(installedCLIVersion, LatestCLIManifest.version);
|
||||
}
|
||||
}
|
||||
exports.UpdateCommand = UpdateCommand;
|
||||
/**
|
||||
* @return Whether or not the working directory has Git changes to commit.
|
||||
*/
|
||||
function hasChangesToCommit() {
|
||||
// List all modified files not covered by .gitignore.
|
||||
const files = child_process_1.execSync('git ls-files -m -d -o --exclude-standard').toString();
|
||||
// If any files are returned, then there must be something to commit.
|
||||
return files !== '';
|
||||
}
|
||||
/**
|
||||
* Precondition: Must have pending changes to commit, they do not need to be staged.
|
||||
* Postcondition: The Git working tree is committed and the repo is clean.
|
||||
* @param message The commit message to use.
|
||||
*/
|
||||
function createCommit(message) {
|
||||
// Stage entire working tree for commit.
|
||||
child_process_1.execSync('git add -A', { encoding: 'utf8', stdio: 'pipe' });
|
||||
// Commit with the message passed via stdin to avoid bash escaping issues.
|
||||
child_process_1.execSync('git commit --no-verify -F -', { encoding: 'utf8', stdio: 'pipe', input: message });
|
||||
}
|
||||
/**
|
||||
* @return The Git SHA hash of the HEAD commit. Returns null if unable to retrieve the hash.
|
||||
*/
|
||||
function findCurrentGitSha() {
|
||||
try {
|
||||
const hash = child_process_1.execSync('git rev-parse HEAD', { encoding: 'utf8', stdio: 'pipe' });
|
||||
return hash.trim();
|
||||
}
|
||||
catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
function getShortHash(commitHash) {
|
||||
return commitHash.slice(0, 9);
|
||||
}
|
||||
function coerceVersionNumber(version) {
|
||||
if (!version) {
|
||||
return null;
|
||||
}
|
||||
if (!version.match(/^\d{1,30}\.\d{1,30}\.\d{1,30}/)) {
|
||||
const match = version.match(/^\d{1,30}(\.\d{1,30})*/);
|
||||
if (!match) {
|
||||
return null;
|
||||
}
|
||||
if (!match[1]) {
|
||||
version = version.substr(0, match[0].length) + '.0.0' + version.substr(match[0].length);
|
||||
}
|
||||
else if (!match[2]) {
|
||||
version = version.substr(0, match[0].length) + '.0' + version.substr(match[0].length);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return semver.valid(version);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue