Updated the files.
This commit is contained in:
parent
1553e6b971
commit
753967d4f5
23418 changed files with 3784666 additions and 0 deletions
11
my-app/node_modules/@angular-devkit/schematics/tasks/index.d.ts
generated
vendored
Executable file
11
my-app/node_modules/@angular-devkit/schematics/tasks/index.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @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
|
||||
*/
|
||||
export { NodePackageInstallTask } from './package-manager/install-task';
|
||||
export { NodePackageLinkTask } from './package-manager/link-task';
|
||||
export { RepositoryInitializerTask } from './repo-init/init-task';
|
||||
export { RunSchematicTask } from './run-schematic/task';
|
||||
18
my-app/node_modules/@angular-devkit/schematics/tasks/index.js
generated
vendored
Executable file
18
my-app/node_modules/@angular-devkit/schematics/tasks/index.js
generated
vendored
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
"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.RunSchematicTask = exports.RepositoryInitializerTask = exports.NodePackageLinkTask = exports.NodePackageInstallTask = void 0;
|
||||
var install_task_1 = require("./package-manager/install-task");
|
||||
Object.defineProperty(exports, "NodePackageInstallTask", { enumerable: true, get: function () { return install_task_1.NodePackageInstallTask; } });
|
||||
var link_task_1 = require("./package-manager/link-task");
|
||||
Object.defineProperty(exports, "NodePackageLinkTask", { enumerable: true, get: function () { return link_task_1.NodePackageLinkTask; } });
|
||||
var init_task_1 = require("./repo-init/init-task");
|
||||
Object.defineProperty(exports, "RepositoryInitializerTask", { enumerable: true, get: function () { return init_task_1.RepositoryInitializerTask; } });
|
||||
var task_1 = require("./run-schematic/task");
|
||||
Object.defineProperty(exports, "RunSchematicTask", { enumerable: true, get: function () { return task_1.RunSchematicTask; } });
|
||||
15
my-app/node_modules/@angular-devkit/schematics/tasks/node/index.d.ts
generated
vendored
Executable file
15
my-app/node_modules/@angular-devkit/schematics/tasks/node/index.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 { TaskExecutorFactory } from '../../src';
|
||||
import { NodePackageTaskFactoryOptions } from '../package-manager/options';
|
||||
import { RepositoryInitializerTaskFactoryOptions } from '../repo-init/options';
|
||||
export declare class BuiltinTaskExecutor {
|
||||
static readonly NodePackage: TaskExecutorFactory<NodePackageTaskFactoryOptions>;
|
||||
static readonly RepositoryInitializer: TaskExecutorFactory<RepositoryInitializerTaskFactoryOptions>;
|
||||
static readonly RunSchematic: TaskExecutorFactory<{}>;
|
||||
}
|
||||
51
my-app/node_modules/@angular-devkit/schematics/tasks/node/index.js
generated
vendored
Executable file
51
my-app/node_modules/@angular-devkit/schematics/tasks/node/index.js
generated
vendored
Executable file
|
|
@ -0,0 +1,51 @@
|
|||
"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;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (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.BuiltinTaskExecutor = void 0;
|
||||
const options_1 = require("../package-manager/options");
|
||||
const options_2 = require("../repo-init/options");
|
||||
const options_3 = require("../run-schematic/options");
|
||||
class BuiltinTaskExecutor {
|
||||
static NodePackage = {
|
||||
name: options_1.NodePackageName,
|
||||
create: (options) => Promise.resolve().then(() => __importStar(require('../package-manager/executor'))).then((mod) => mod.default(options)),
|
||||
};
|
||||
static RepositoryInitializer = {
|
||||
name: options_2.RepositoryInitializerName,
|
||||
create: (options) => Promise.resolve().then(() => __importStar(require('../repo-init/executor'))).then((mod) => mod.default(options)),
|
||||
};
|
||||
static RunSchematic = {
|
||||
name: options_3.RunSchematicName,
|
||||
create: () => Promise.resolve().then(() => __importStar(require('../run-schematic/executor'))).then((mod) => mod.default()),
|
||||
};
|
||||
}
|
||||
exports.BuiltinTaskExecutor = BuiltinTaskExecutor;
|
||||
14
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/executor.d.ts
generated
vendored
Executable file
14
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/executor.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 { BaseException } from '@angular-devkit/core';
|
||||
import { TaskExecutor } from '../../src';
|
||||
import { NodePackageTaskFactoryOptions, NodePackageTaskOptions } from './options';
|
||||
export declare class UnknownPackageManagerException extends BaseException {
|
||||
constructor(name: string);
|
||||
}
|
||||
export default function (factoryOptions?: NodePackageTaskFactoryOptions): TaskExecutor<NodePackageTaskOptions>;
|
||||
161
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/executor.js
generated
vendored
Executable file
161
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/executor.js
generated
vendored
Executable file
|
|
@ -0,0 +1,161 @@
|
|||
"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;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (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.UnknownPackageManagerException = void 0;
|
||||
const core_1 = require("@angular-devkit/core");
|
||||
const child_process_1 = require("child_process");
|
||||
const ora_1 = __importDefault(require("ora"));
|
||||
const path = __importStar(require("path"));
|
||||
const rxjs_1 = require("rxjs");
|
||||
const src_1 = require("../../src");
|
||||
const packageManagers = {
|
||||
'npm': {
|
||||
commands: {
|
||||
installAll: 'install',
|
||||
installPackage: 'install',
|
||||
},
|
||||
},
|
||||
'cnpm': {
|
||||
commands: {
|
||||
installAll: 'install',
|
||||
installPackage: 'install',
|
||||
},
|
||||
},
|
||||
'yarn': {
|
||||
commands: {
|
||||
installPackage: 'add',
|
||||
},
|
||||
},
|
||||
'pnpm': {
|
||||
commands: {
|
||||
installAll: 'install',
|
||||
installPackage: 'install',
|
||||
},
|
||||
},
|
||||
};
|
||||
class UnknownPackageManagerException extends core_1.BaseException {
|
||||
constructor(name) {
|
||||
super(`Unknown package manager "${name}".`);
|
||||
}
|
||||
}
|
||||
exports.UnknownPackageManagerException = UnknownPackageManagerException;
|
||||
function default_1(factoryOptions = {}) {
|
||||
const packageManagerName = factoryOptions.packageManager || 'npm';
|
||||
const packageManagerProfile = packageManagers[packageManagerName];
|
||||
if (!packageManagerProfile) {
|
||||
throw new UnknownPackageManagerException(packageManagerName);
|
||||
}
|
||||
const rootDirectory = factoryOptions.rootDirectory || process.cwd();
|
||||
return (options = { command: 'install' }) => {
|
||||
let taskPackageManagerProfile = packageManagerProfile;
|
||||
let taskPackageManagerName = packageManagerName;
|
||||
if (factoryOptions.allowPackageManagerOverride && options.packageManager) {
|
||||
taskPackageManagerProfile = packageManagers[options.packageManager];
|
||||
if (!taskPackageManagerProfile) {
|
||||
throw new UnknownPackageManagerException(options.packageManager);
|
||||
}
|
||||
taskPackageManagerName = options.packageManager;
|
||||
}
|
||||
const bufferedOutput = [];
|
||||
const spawnOptions = {
|
||||
shell: true,
|
||||
cwd: path.join(rootDirectory, options.workingDirectory || ''),
|
||||
};
|
||||
if (options.hideOutput) {
|
||||
spawnOptions.stdio = options.quiet ? ['ignore', 'ignore', 'pipe'] : 'pipe';
|
||||
}
|
||||
else {
|
||||
spawnOptions.stdio = options.quiet ? ['ignore', 'ignore', 'inherit'] : 'inherit';
|
||||
}
|
||||
const args = [];
|
||||
if (options.packageName) {
|
||||
if (options.command === 'install') {
|
||||
args.push(taskPackageManagerProfile.commands.installPackage);
|
||||
}
|
||||
args.push(options.packageName);
|
||||
}
|
||||
else if (options.command === 'install' && taskPackageManagerProfile.commands.installAll) {
|
||||
args.push(taskPackageManagerProfile.commands.installAll);
|
||||
}
|
||||
if (!options.allowScripts) {
|
||||
// Yarn requires special handling since Yarn 2+ no longer has the `--ignore-scripts` flag
|
||||
if (taskPackageManagerName === 'yarn') {
|
||||
spawnOptions.env = {
|
||||
...process.env,
|
||||
// Supported with yarn 1
|
||||
'npm_config_ignore_scripts': 'true',
|
||||
// Supported with yarn 2+
|
||||
'YARN_ENABLE_SCRIPTS': 'false',
|
||||
};
|
||||
}
|
||||
else {
|
||||
args.push('--ignore-scripts');
|
||||
}
|
||||
}
|
||||
if (factoryOptions.registry) {
|
||||
args.push(`--registry="${factoryOptions.registry}"`);
|
||||
}
|
||||
if (factoryOptions.force) {
|
||||
args.push('--force');
|
||||
}
|
||||
return new rxjs_1.Observable((obs) => {
|
||||
const spinner = (0, ora_1.default)({
|
||||
text: `Installing packages (${taskPackageManagerName})...`,
|
||||
// Workaround for https://github.com/sindresorhus/ora/issues/136.
|
||||
discardStdin: process.platform != 'win32',
|
||||
}).start();
|
||||
const childProcess = (0, child_process_1.spawn)(taskPackageManagerName, args, spawnOptions).on('close', (code) => {
|
||||
if (code === 0) {
|
||||
spinner.succeed('Packages installed successfully.');
|
||||
spinner.stop();
|
||||
obs.next();
|
||||
obs.complete();
|
||||
}
|
||||
else {
|
||||
if (options.hideOutput) {
|
||||
bufferedOutput.forEach(({ stream, data }) => stream.write(data));
|
||||
}
|
||||
spinner.fail('Package install failed, see above.');
|
||||
obs.error(new src_1.UnsuccessfulWorkflowExecution());
|
||||
}
|
||||
});
|
||||
if (options.hideOutput) {
|
||||
childProcess.stdout?.on('data', (data) => bufferedOutput.push({ stream: process.stdout, data: data }));
|
||||
childProcess.stderr?.on('data', (data) => bufferedOutput.push({ stream: process.stderr, data: data }));
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
exports.default = default_1;
|
||||
29
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/install-task.d.ts
generated
vendored
Executable file
29
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/install-task.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
/**
|
||||
* @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 { TaskConfiguration, TaskConfigurationGenerator } from '../../src';
|
||||
import { NodePackageTaskOptions } from './options';
|
||||
interface NodePackageInstallTaskOptions {
|
||||
packageManager?: string;
|
||||
packageName?: string;
|
||||
workingDirectory?: string;
|
||||
quiet?: boolean;
|
||||
hideOutput?: boolean;
|
||||
allowScripts?: boolean;
|
||||
}
|
||||
export declare class NodePackageInstallTask implements TaskConfigurationGenerator<NodePackageTaskOptions> {
|
||||
quiet: boolean;
|
||||
hideOutput: boolean;
|
||||
allowScripts: boolean;
|
||||
workingDirectory?: string;
|
||||
packageManager?: string;
|
||||
packageName?: string;
|
||||
constructor(workingDirectory?: string);
|
||||
constructor(options: NodePackageInstallTaskOptions);
|
||||
toConfiguration(): TaskConfiguration<NodePackageTaskOptions>;
|
||||
}
|
||||
export {};
|
||||
59
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/install-task.js
generated
vendored
Executable file
59
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/install-task.js
generated
vendored
Executable file
|
|
@ -0,0 +1,59 @@
|
|||
"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.NodePackageInstallTask = void 0;
|
||||
const options_1 = require("./options");
|
||||
class NodePackageInstallTask {
|
||||
quiet = true;
|
||||
hideOutput = true;
|
||||
allowScripts = false;
|
||||
workingDirectory;
|
||||
packageManager;
|
||||
packageName;
|
||||
constructor(options) {
|
||||
if (typeof options === 'string') {
|
||||
this.workingDirectory = options;
|
||||
}
|
||||
else if (typeof options === 'object') {
|
||||
if (options.quiet != undefined) {
|
||||
this.quiet = options.quiet;
|
||||
}
|
||||
if (options.hideOutput != undefined) {
|
||||
this.hideOutput = options.hideOutput;
|
||||
}
|
||||
if (options.workingDirectory != undefined) {
|
||||
this.workingDirectory = options.workingDirectory;
|
||||
}
|
||||
if (options.packageManager != undefined) {
|
||||
this.packageManager = options.packageManager;
|
||||
}
|
||||
if (options.packageName != undefined) {
|
||||
this.packageName = options.packageName;
|
||||
}
|
||||
if (options.allowScripts !== undefined) {
|
||||
this.allowScripts = options.allowScripts;
|
||||
}
|
||||
}
|
||||
}
|
||||
toConfiguration() {
|
||||
return {
|
||||
name: options_1.NodePackageName,
|
||||
options: {
|
||||
command: 'install',
|
||||
quiet: this.quiet,
|
||||
hideOutput: this.hideOutput,
|
||||
workingDirectory: this.workingDirectory,
|
||||
packageManager: this.packageManager,
|
||||
packageName: this.packageName,
|
||||
allowScripts: this.allowScripts,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.NodePackageInstallTask = NodePackageInstallTask;
|
||||
16
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/link-task.d.ts
generated
vendored
Executable file
16
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/link-task.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 { TaskConfiguration, TaskConfigurationGenerator } from '../../src';
|
||||
import { NodePackageTaskOptions } from './options';
|
||||
export declare class NodePackageLinkTask implements TaskConfigurationGenerator<NodePackageTaskOptions> {
|
||||
packageName?: string | undefined;
|
||||
workingDirectory?: string | undefined;
|
||||
quiet: boolean;
|
||||
constructor(packageName?: string | undefined, workingDirectory?: string | undefined);
|
||||
toConfiguration(): TaskConfiguration<NodePackageTaskOptions>;
|
||||
}
|
||||
32
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/link-task.js
generated
vendored
Executable file
32
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/link-task.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.NodePackageLinkTask = void 0;
|
||||
const options_1 = require("./options");
|
||||
class NodePackageLinkTask {
|
||||
packageName;
|
||||
workingDirectory;
|
||||
quiet = true;
|
||||
constructor(packageName, workingDirectory) {
|
||||
this.packageName = packageName;
|
||||
this.workingDirectory = workingDirectory;
|
||||
}
|
||||
toConfiguration() {
|
||||
return {
|
||||
name: options_1.NodePackageName,
|
||||
options: {
|
||||
command: 'link',
|
||||
quiet: this.quiet,
|
||||
workingDirectory: this.workingDirectory,
|
||||
packageName: this.packageName,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.NodePackageLinkTask = NodePackageLinkTask;
|
||||
24
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/options.d.ts
generated
vendored
Executable file
24
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/options.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* @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
|
||||
*/
|
||||
export declare const NodePackageName = "node-package";
|
||||
export interface NodePackageTaskFactoryOptions {
|
||||
rootDirectory?: string;
|
||||
packageManager?: string;
|
||||
allowPackageManagerOverride?: boolean;
|
||||
registry?: string;
|
||||
force?: boolean;
|
||||
}
|
||||
export interface NodePackageTaskOptions {
|
||||
command: string;
|
||||
quiet?: boolean;
|
||||
hideOutput?: boolean;
|
||||
workingDirectory?: string;
|
||||
packageName?: string;
|
||||
packageManager?: string;
|
||||
allowScripts?: boolean;
|
||||
}
|
||||
11
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/options.js
generated
vendored
Executable file
11
my-app/node_modules/@angular-devkit/schematics/tasks/package-manager/options.js
generated
vendored
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
"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.NodePackageName = void 0;
|
||||
exports.NodePackageName = 'node-package';
|
||||
5
my-app/node_modules/@angular-devkit/schematics/tasks/package.json
generated
vendored
Executable file
5
my-app/node_modules/@angular-devkit/schematics/tasks/package.json
generated
vendored
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"name": "@angular-devkit/schematics/tasks",
|
||||
"main": "index.js",
|
||||
"typings": "index.d.ts"
|
||||
}
|
||||
10
my-app/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.d.ts
generated
vendored
Executable file
10
my-app/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import { TaskExecutor } from '../../src';
|
||||
import { RepositoryInitializerTaskFactoryOptions, RepositoryInitializerTaskOptions } from './options';
|
||||
export default function (factoryOptions?: RepositoryInitializerTaskFactoryOptions): TaskExecutor<RepositoryInitializerTaskOptions>;
|
||||
94
my-app/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.js
generated
vendored
Executable file
94
my-app/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.js
generated
vendored
Executable file
|
|
@ -0,0 +1,94 @@
|
|||
"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;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (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 });
|
||||
const core_1 = require("@angular-devkit/core");
|
||||
const child_process_1 = require("child_process");
|
||||
const path = __importStar(require("path"));
|
||||
function default_1(factoryOptions = {}) {
|
||||
const rootDirectory = factoryOptions.rootDirectory || process.cwd();
|
||||
return async (options = {}, context) => {
|
||||
const authorName = options.authorName;
|
||||
const authorEmail = options.authorEmail;
|
||||
const execute = (args, ignoreErrorStream) => {
|
||||
const outputStream = 'ignore';
|
||||
const errorStream = ignoreErrorStream ? 'ignore' : process.stderr;
|
||||
const spawnOptions = {
|
||||
stdio: [process.stdin, outputStream, errorStream],
|
||||
shell: true,
|
||||
cwd: path.join(rootDirectory, options.workingDirectory || ''),
|
||||
env: {
|
||||
...process.env,
|
||||
...(authorName ? { GIT_AUTHOR_NAME: authorName, GIT_COMMITTER_NAME: authorName } : {}),
|
||||
...(authorEmail
|
||||
? { GIT_AUTHOR_EMAIL: authorEmail, GIT_COMMITTER_EMAIL: authorEmail }
|
||||
: {}),
|
||||
},
|
||||
};
|
||||
return new Promise((resolve, reject) => {
|
||||
(0, child_process_1.spawn)('git', args, spawnOptions).on('close', (code) => {
|
||||
if (code === 0) {
|
||||
resolve();
|
||||
}
|
||||
else {
|
||||
reject(code);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
const hasCommand = await execute(['--version']).then(() => true, () => false);
|
||||
if (!hasCommand) {
|
||||
return;
|
||||
}
|
||||
const insideRepo = await execute(['rev-parse', '--is-inside-work-tree'], true).then(() => true, () => false);
|
||||
if (insideRepo) {
|
||||
context.logger.info(core_1.tags.oneLine `
|
||||
Directory is already under version control.
|
||||
Skipping initialization of git.
|
||||
`);
|
||||
return;
|
||||
}
|
||||
// if git is not found or an error was thrown during the `git`
|
||||
// init process just swallow any errors here
|
||||
// NOTE: This will be removed once task error handling is implemented
|
||||
try {
|
||||
await execute(['init']);
|
||||
await execute(['add', '.']);
|
||||
if (options.commit) {
|
||||
const message = options.message || 'initial commit';
|
||||
await execute(['commit', `-m "${message}"`]);
|
||||
}
|
||||
context.logger.info('Successfully initialized git.');
|
||||
}
|
||||
catch { }
|
||||
};
|
||||
}
|
||||
exports.default = default_1;
|
||||
20
my-app/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.d.ts
generated
vendored
Executable file
20
my-app/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.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 { TaskConfiguration, TaskConfigurationGenerator } from '../../src';
|
||||
import { RepositoryInitializerTaskOptions } from './options';
|
||||
export interface CommitOptions {
|
||||
message?: string;
|
||||
name?: string;
|
||||
email?: string;
|
||||
}
|
||||
export declare class RepositoryInitializerTask implements TaskConfigurationGenerator<RepositoryInitializerTaskOptions> {
|
||||
workingDirectory?: string | undefined;
|
||||
commitOptions?: CommitOptions | undefined;
|
||||
constructor(workingDirectory?: string | undefined, commitOptions?: CommitOptions | undefined);
|
||||
toConfiguration(): TaskConfiguration<RepositoryInitializerTaskOptions>;
|
||||
}
|
||||
32
my-app/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.js
generated
vendored
Executable file
32
my-app/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.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.RepositoryInitializerTask = void 0;
|
||||
const options_1 = require("./options");
|
||||
class RepositoryInitializerTask {
|
||||
workingDirectory;
|
||||
commitOptions;
|
||||
constructor(workingDirectory, commitOptions) {
|
||||
this.workingDirectory = workingDirectory;
|
||||
this.commitOptions = commitOptions;
|
||||
}
|
||||
toConfiguration() {
|
||||
return {
|
||||
name: options_1.RepositoryInitializerName,
|
||||
options: {
|
||||
commit: !!this.commitOptions,
|
||||
workingDirectory: this.workingDirectory,
|
||||
authorName: this.commitOptions && this.commitOptions.name,
|
||||
authorEmail: this.commitOptions && this.commitOptions.email,
|
||||
message: this.commitOptions && this.commitOptions.message,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.RepositoryInitializerTask = RepositoryInitializerTask;
|
||||
18
my-app/node_modules/@angular-devkit/schematics/tasks/repo-init/options.d.ts
generated
vendored
Executable file
18
my-app/node_modules/@angular-devkit/schematics/tasks/repo-init/options.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
|
||||
*/
|
||||
export declare const RepositoryInitializerName = "repo-init";
|
||||
export interface RepositoryInitializerTaskFactoryOptions {
|
||||
rootDirectory?: string;
|
||||
}
|
||||
export interface RepositoryInitializerTaskOptions {
|
||||
workingDirectory?: string;
|
||||
commit?: boolean;
|
||||
message?: string;
|
||||
authorName?: string;
|
||||
authorEmail?: string;
|
||||
}
|
||||
11
my-app/node_modules/@angular-devkit/schematics/tasks/repo-init/options.js
generated
vendored
Executable file
11
my-app/node_modules/@angular-devkit/schematics/tasks/repo-init/options.js
generated
vendored
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
"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.RepositoryInitializerName = void 0;
|
||||
exports.RepositoryInitializerName = 'repo-init';
|
||||
10
my-app/node_modules/@angular-devkit/schematics/tasks/run-schematic/executor.d.ts
generated
vendored
Executable file
10
my-app/node_modules/@angular-devkit/schematics/tasks/run-schematic/executor.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import { TaskExecutor } from '../../src';
|
||||
import { RunSchematicTaskOptions } from './options';
|
||||
export default function (): TaskExecutor<RunSchematicTaskOptions<{}>>;
|
||||
29
my-app/node_modules/@angular-devkit/schematics/tasks/run-schematic/executor.js
generated
vendored
Executable file
29
my-app/node_modules/@angular-devkit/schematics/tasks/run-schematic/executor.js
generated
vendored
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
"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 });
|
||||
function default_1() {
|
||||
return (options, context) => {
|
||||
if (!options?.name) {
|
||||
throw new Error('RunSchematicTask requires an options object with a non-empty name property.');
|
||||
}
|
||||
const maybeWorkflow = context.engine.workflow;
|
||||
const collection = options.collection || context.schematic.collection.description.name;
|
||||
if (!maybeWorkflow) {
|
||||
throw new Error('Need Workflow to support executing schematics as post tasks.');
|
||||
}
|
||||
return maybeWorkflow.execute({
|
||||
collection: collection,
|
||||
schematic: options.name,
|
||||
options: options.options,
|
||||
// Allow private when calling from the same collection.
|
||||
allowPrivate: collection == context.schematic.collection.description.name,
|
||||
});
|
||||
};
|
||||
}
|
||||
exports.default = default_1;
|
||||
13
my-app/node_modules/@angular-devkit/schematics/tasks/run-schematic/options.d.ts
generated
vendored
Executable file
13
my-app/node_modules/@angular-devkit/schematics/tasks/run-schematic/options.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
|
||||
*/
|
||||
export declare const RunSchematicName = "run-schematic";
|
||||
export interface RunSchematicTaskOptions<T> {
|
||||
collection: string | null;
|
||||
name: string;
|
||||
options: T;
|
||||
}
|
||||
11
my-app/node_modules/@angular-devkit/schematics/tasks/run-schematic/options.js
generated
vendored
Executable file
11
my-app/node_modules/@angular-devkit/schematics/tasks/run-schematic/options.js
generated
vendored
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
"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.RunSchematicName = void 0;
|
||||
exports.RunSchematicName = 'run-schematic';
|
||||
17
my-app/node_modules/@angular-devkit/schematics/tasks/run-schematic/task.d.ts
generated
vendored
Executable file
17
my-app/node_modules/@angular-devkit/schematics/tasks/run-schematic/task.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* @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 { TaskConfiguration, TaskConfigurationGenerator } from '../../src';
|
||||
import { RunSchematicTaskOptions } from './options';
|
||||
export declare class RunSchematicTask<T> implements TaskConfigurationGenerator<RunSchematicTaskOptions<T>> {
|
||||
protected _collection: string | null;
|
||||
protected _schematic: string;
|
||||
protected _options: T;
|
||||
constructor(s: string, o: T);
|
||||
constructor(c: string, s: string, o: T);
|
||||
toConfiguration(): TaskConfiguration<RunSchematicTaskOptions<T>>;
|
||||
}
|
||||
37
my-app/node_modules/@angular-devkit/schematics/tasks/run-schematic/task.js
generated
vendored
Executable file
37
my-app/node_modules/@angular-devkit/schematics/tasks/run-schematic/task.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.RunSchematicTask = void 0;
|
||||
const options_1 = require("./options");
|
||||
class RunSchematicTask {
|
||||
_collection;
|
||||
_schematic;
|
||||
_options;
|
||||
constructor(c, s, o) {
|
||||
if (arguments.length == 2 || typeof s !== 'string') {
|
||||
o = s;
|
||||
s = c;
|
||||
c = null;
|
||||
}
|
||||
this._collection = c;
|
||||
this._schematic = s;
|
||||
this._options = o;
|
||||
}
|
||||
toConfiguration() {
|
||||
return {
|
||||
name: options_1.RunSchematicName,
|
||||
options: {
|
||||
collection: this._collection,
|
||||
name: this._schematic,
|
||||
options: this._options,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.RunSchematicTask = RunSchematicTask;
|
||||
Loading…
Add table
Add a link
Reference in a new issue