Primeiro commit do projeto Angular
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
export { NodePackageInstallTask } from './package-manager/install-task';
|
||||
export { RepositoryInitializerTask } from './repo-init/init-task';
|
||||
export { RunSchematicTask } from './run-schematic/task';
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RunSchematicTask = exports.RepositoryInitializerTask = 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 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; } });
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,+DAAwE;AAA/D,sHAAA,sBAAsB,OAAA;AAC/B,mDAAkE;AAAzD,sHAAA,yBAAyB,OAAA;AAClC,6CAAwD;AAA/C,wGAAA,gBAAgB,OAAA"}
|
||||
+15
@@ -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.dev/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<{}>;
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.BuiltinTaskExecutor = void 0;
|
||||
const executor_1 = __importDefault(require("../package-manager/executor"));
|
||||
const options_1 = require("../package-manager/options");
|
||||
const executor_2 = __importDefault(require("../repo-init/executor"));
|
||||
const options_2 = require("../repo-init/options");
|
||||
const executor_3 = __importDefault(require("../run-schematic/executor"));
|
||||
const options_3 = require("../run-schematic/options");
|
||||
class BuiltinTaskExecutor {
|
||||
static NodePackage = {
|
||||
name: options_1.NodePackageName,
|
||||
create: async (options) => (0, executor_1.default)(options),
|
||||
};
|
||||
static RepositoryInitializer = {
|
||||
name: options_2.RepositoryInitializerName,
|
||||
create: async (options) => (0, executor_2.default)(options),
|
||||
};
|
||||
static RunSchematic = {
|
||||
name: options_3.RunSchematicName,
|
||||
create: async () => (0, executor_3.default)(),
|
||||
};
|
||||
}
|
||||
exports.BuiltinTaskExecutor = BuiltinTaskExecutor;
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;AAGH,2EAA8D;AAC9D,wDAA4F;AAC5F,qEAAkE;AAClE,kDAG8B;AAC9B,yEAA6D;AAC7D,sDAA4D;AAE5D,MAAa,mBAAmB;IAC9B,MAAM,CAAU,WAAW,GAAuD;QAChF,IAAI,EAAE,yBAAe;QACrB,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,kBAAmB,EAAC,OAAO,CAAqB;KAC5E,CAAC;IACF,MAAM,CAAU,qBAAqB,GACnC;QACE,IAAI,EAAE,mCAAyB;QAC/B,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,kBAA6B,EAAC,OAAO,CAAqB;KACtF,CAAC;IACJ,MAAM,CAAU,YAAY,GAA4B;QACtD,IAAI,EAAE,0BAAgB;QACtB,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,IAAA,kBAAoB,GAAsB;KAC/D,CAAC;;AAbJ,kDAcC"}
|
||||
+14
@@ -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.dev/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>;
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/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 () {
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
return function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__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;
|
||||
exports.default = default_1;
|
||||
const core_1 = require("@angular-devkit/core");
|
||||
const node_child_process_1 = require("node:child_process");
|
||||
const path = __importStar(require("node:path"));
|
||||
const ora_1 = __importDefault(require("ora"));
|
||||
const src_1 = require("../../src");
|
||||
const packageManagers = {
|
||||
'npm': {
|
||||
commands: {
|
||||
installAll: 'install',
|
||||
installPackage: 'install',
|
||||
},
|
||||
},
|
||||
'yarn': {
|
||||
commands: {
|
||||
installAll: 'install',
|
||||
installPackage: 'add',
|
||||
},
|
||||
},
|
||||
'bun': {
|
||||
commands: {
|
||||
installAll: 'install',
|
||||
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 Promise((resolve, reject) => {
|
||||
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, node_child_process_1.spawn)(`${taskPackageManagerName} ${args.join(' ')}`, spawnOptions).on('close', (code) => {
|
||||
if (code === 0) {
|
||||
spinner.succeed('Packages installed successfully.');
|
||||
spinner.stop();
|
||||
resolve();
|
||||
}
|
||||
else {
|
||||
if (options.hideOutput) {
|
||||
bufferedOutput.forEach(({ stream, data }) => stream.write(data));
|
||||
}
|
||||
spinner.fail('Package install failed, see above.');
|
||||
reject(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 }));
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=executor.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"executor.js","sourceRoot":"","sources":["executor.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDH,4BAmGC;AAlJD,+CAAqD;AACrD,2DAAyD;AACzD,gDAAkC;AAClC,8CAAsB;AACtB,mCAAwE;AAUxE,MAAM,eAAe,GAA8C;IACjE,KAAK,EAAE;QACL,QAAQ,EAAE;YACR,UAAU,EAAE,SAAS;YACrB,cAAc,EAAE,SAAS;SAC1B;KACF;IACD,MAAM,EAAE;QACN,QAAQ,EAAE;YACR,UAAU,EAAE,SAAS;YACrB,cAAc,EAAE,KAAK;SACtB;KACF;IACD,KAAK,EAAE;QACL,QAAQ,EAAE;YACR,UAAU,EAAE,SAAS;YACrB,cAAc,EAAE,KAAK;SACtB;KACF;IACD,MAAM,EAAE;QACN,QAAQ,EAAE;YACR,UAAU,EAAE,SAAS;YACrB,cAAc,EAAE,SAAS;SAC1B;KACF;CACF,CAAC;AAEF,MAAa,8BAA+B,SAAQ,oBAAa;IAC/D,YAAY,IAAY;QACtB,KAAK,CAAC,4BAA4B,IAAI,IAAI,CAAC,CAAC;IAC9C,CAAC;CACF;AAJD,wEAIC;AAED,mBACE,iBAAgD,EAAE;IAElD,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,IAAI,KAAK,CAAC;IAClE,MAAM,qBAAqB,GAAG,eAAe,CAAC,kBAAkB,CAAC,CAAC;IAClE,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC3B,MAAM,IAAI,8BAA8B,CAAC,kBAAkB,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,aAAa,GAAG,cAAc,CAAC,aAAa,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAEpE,OAAO,CAAC,UAAkC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;QAClE,I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AAE,CAAC;oBACf,OAAO,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAC;oBACpD,OAAO,CAAC,IAAI,EAAE,CAAC;oBACf,OAAO,EAAE,CAAC;gBACZ,CAAC;qBAAM,CAAC;oBACN,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;wBACvB,cAAc,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;oBACnE,CAAC;oBACD,OAAO,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;oBACnD,MAAM,CAAC,IAAI,mCAA6B,EAAE,CAAC,CAAC;gBAC9C,CAAC;YACH,CAAC,CACF,CAAC;YACF,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBACvB,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE,CAC/C,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAC5D,CAAC;gBACF,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE,CAC/C,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAC5D,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
||||
+29
@@ -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.dev/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 {};
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.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;
|
||||
//# sourceMappingURL=install-task.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"install-task.js","sourceRoot":"","sources":["install-task.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAGH,uCAAoE;AAWpE,MAAa,sBAAsB;IACjC,KAAK,GAAG,IAAI,CAAC;IACb,UAAU,GAAG,IAAI,CAAC;IAClB,YAAY,GAAG,KAAK,CAAC;IACrB,gBAAgB,CAAU;IAC1B,cAAc,CAAU;IACxB,WAAW,CAAU;IAIrB,YAAY,OAAgD;QAC1D,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChC,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC;QAClC,CAAC;aAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YACvC,IAAI,OAAO,CAAC,KAAK,IAAI,SAAS,EAAE,CAAC;gBAC/B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YAC7B,CAAC;YACD,IAAI,OAAO,CAAC,UAAU,IAAI,SAAS,EAAE,CAAC;gBACpC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;YACvC,CAAC;YACD,IAAI,OAAO,CAAC,gBAAgB,IAAI,SAAS,EAAE,CAAC;gBAC1C,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;YACnD,CAAC;YACD,IAAI,OAAO,CAAC,cAAc,IAAI,SAAS,EAAE,CAAC;gBACxC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;YAC/C,CAAC;YACD,IAAI,OAAO,CAAC,WAAW,IAAI,SAAS,EAAE,CAAC;gBACrC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;YACzC,CAAC;YACD,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;gBACvC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;YAC3C,CAAC;QACH,CAAC;IACH,CAAC;IAED,eAAe;QACb,OAAO;YACL,IAAI,EAAE,yBAAe;YACrB,OAAO,EAAE;gBACP,OAAO,EAAE,SAAS;gBAClB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;gBACvC,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;aAChC;SACF,CAAC;IACJ,CAAC;CACF;AAjDD,wDAiDC"}
|
||||
+24
@@ -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.dev/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;
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.NodePackageName = void 0;
|
||||
exports.NodePackageName = 'node-package';
|
||||
//# sourceMappingURL=options.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"options.js","sourceRoot":"","sources":["options.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEU,QAAA,eAAe,GAAG,cAAc,CAAC"}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "@angular-devkit/schematics/tasks",
|
||||
"main": "index.js",
|
||||
"typings": "index.d.ts"
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
import { TaskExecutor } from '../../src';
|
||||
import { RepositoryInitializerTaskFactoryOptions, RepositoryInitializerTaskOptions } from './options';
|
||||
export default function (factoryOptions?: RepositoryInitializerTaskFactoryOptions): TaskExecutor<RepositoryInitializerTaskOptions>;
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
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 () {
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
return function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = default_1;
|
||||
const core_1 = require("@angular-devkit/core");
|
||||
const node_child_process_1 = require("node:child_process");
|
||||
const path = __importStar(require("node: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, node_child_process_1.spawn)(`git ${args.join(' ')}`, 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 { }
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=executor.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"executor.js","sourceRoot":"","sources":["executor.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWH,4BAyEC;AAlFD,+CAA4C;AAC5C,2DAAyD;AACzD,gDAAkC;AAOlC,mBACE,iBAA0D,EAAE;IAE5D,MAAM,aAAa,GAAG,cAAc,CAAC,aAAa,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAEpE,OAAO,KAAK,EAAE,UAA4C,EAAE,EAAE,OAAyB,EAAE,EAAE;QACzF,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,MAAM,WAAW,GAAG,OAAO,CAA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AAW,CAAC,CAAC,CAAC,IAAI,CAClD,GAAG,EAAE,CAAC,IAAI,EACV,GAAG,EAAE,CAAC,KAAK,CACZ,CAAC;QACF,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,CAAC,WAAW,EAAE,uBAAuB,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CACjF,GAAG,EAAE,CAAC,IAAI,EACV,GAAG,EAAE,CAAC,KAAK,CACZ,CAAC;QACF,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,WAAI,CAAC,OAAO,CAAA;;;OAG/B,CAAC,CAAC;YAEH,OAAO;QACT,CAAC;QAED,8DAA8D;QAC9D,4CAA4C;QAC5C,qEAAqE;QACrE,IAAI,CAAC;YACH,MAAM,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACxB,MAAM,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;YAE5B,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;gBACnB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,gBAAgB,CAAC;gBAEpD,MAAM,OAAO,CAAC,CAAC,QAAQ,EAAE,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC;YAC/C,CAAC;YAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;QACvD,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC"}
|
||||
+20
@@ -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.dev/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>;
|
||||
}
|
||||
+33
@@ -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.dev/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;
|
||||
//# sourceMappingURL=init-task.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"init-task.js","sourceRoot":"","sources":["init-task.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAGH,uCAAwF;AAQxF,MAAa,yBAAyB;IAE3B;IACA;IAFT,YACS,gBAAqC,EACrC,aAAyC;QADzC,qBAAgB,GAAhB,gBAAgB,CAAqB;QACrC,kBAAa,GAAb,aAAa,CAA4B;IAC/C,CAAC;IAEJ,eAAe;QACb,OAAO;YACL,IAAI,EAAE,mCAAyB;YAC/B,OAAO,EAAE;gBACP,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa;gBAC5B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;gBACvC,UAAU,EAAE,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI;gBACzD,WAAW,EAAE,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,KAAK;gBAC3D,OAAO,EAAE,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,OAAO;aAC1D;SACF,CAAC;IACJ,CAAC;CACF;AAlBD,8DAkBC"}
|
||||
+18
@@ -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.dev/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;
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RepositoryInitializerName = void 0;
|
||||
exports.RepositoryInitializerName = 'repo-init';
|
||||
//# sourceMappingURL=options.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"options.js","sourceRoot":"","sources":["options.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEU,QAAA,yBAAyB,GAAG,WAAW,CAAC"}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
import { TaskExecutor } from '../../src';
|
||||
import { RunSchematicTaskOptions } from './options';
|
||||
export default function (): TaskExecutor<RunSchematicTaskOptions<{}>>;
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = default_1;
|
||||
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,
|
||||
});
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=executor.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"executor.js","sourceRoot":"","sources":["executor.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAKH,4BAuBC;AAvBD;IACE,OAAO,CAAC,OAAgD,EAAE,OAAyB,EAAE,EAAE;QACrF,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CACb,6EAA6E,CAC9E,CAAC;QACJ,CAAC;QAED,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC9C,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC;QAEvF,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;QAClF,CAAC;QAED,OAAO,aAAa,CAAC,OAAO,CAAC;YAC3B,UAAU,EAAE,UAAU;YACtB,SAAS,EAAE,OAAO,CAAC,IAAI;YACvB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,uDAAuD;YACvD,YAAY,EAAE,UAAU,IAAI,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI;SAC1E,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
||||
+13
@@ -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.dev/license
|
||||
*/
|
||||
export declare const RunSchematicName = "run-schematic";
|
||||
export interface RunSchematicTaskOptions<T> {
|
||||
collection: string | null;
|
||||
name: string;
|
||||
options: T;
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RunSchematicName = void 0;
|
||||
exports.RunSchematicName = 'run-schematic';
|
||||
//# sourceMappingURL=options.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"options.js","sourceRoot":"","sources":["options.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEU,QAAA,gBAAgB,GAAG,eAAe,CAAC"}
|
||||
+17
@@ -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.dev/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>>;
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.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;
|
||||
//# sourceMappingURL=task.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"task.js","sourceRoot":"","sources":["task.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAGH,uCAAsE;AAEtE,MAAa,gBAAgB;IACjB,WAAW,CAAgB;IAC3B,UAAU,CAAS;IACnB,QAAQ,CAAI;IAKtB,YAAY,CAAgB,EAAE,CAAa,EAAE,CAAK;QAChD,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;YACnD,CAAC,GAAG,CAAM,CAAC;YACX,CAAC,GAAG,CAAW,CAAC;YAChB,CAAC,GAAG,IAAI,CAAC;QACX,CAAC;QAED,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,CAAM,CAAC;IACzB,CAAC;IAED,eAAe;QACb,OAAO;YACL,IAAI,EAAE,0BAAgB;YACtB,OAAO,EAAE;gBACP,UAAU,EAAE,IAAI,CAAC,WAAW;gBAC5B,IAAI,EAAE,IAAI,CAAC,UAAU;gBACrB,OAAO,EAAE,IAAI,CAAC,QAAQ;aACvB;SACF,CAAC;IACJ,CAAC;CACF;AA9BD,4CA8BC"}
|
||||
Reference in New Issue
Block a user