Updated the files.

This commit is contained in:
Batuhan Berk Başoğlu 2024-02-08 19:38:41 -05:00
parent 1553e6b971
commit 753967d4f5
23418 changed files with 3784666 additions and 0 deletions

View 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<{}>>;

View 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;

View 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;
}

View 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';

View 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>>;
}

View 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;