Conexio amb la api
This commit is contained in:
parent
207c0ba819
commit
b12369cb47
48513 changed files with 7391639 additions and 7 deletions
28
node_modules/@angular-devkit/architect/node/BUILD.bazel
generated
vendored
Executable file
28
node_modules/@angular-devkit/architect/node/BUILD.bazel
generated
vendored
Executable file
|
|
@ -0,0 +1,28 @@
|
|||
# Copyright Google Inc. 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
|
||||
|
||||
load("//tools:defaults.bzl", "ts_library")
|
||||
|
||||
licenses(["notice"]) # MIT
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
ts_library(
|
||||
name = "node",
|
||||
srcs = glob(
|
||||
include = ["**/*.ts"],
|
||||
exclude = ["**/*_spec.ts"],
|
||||
),
|
||||
module_name = "@angular-devkit/architect/node",
|
||||
module_root = "index.d.ts",
|
||||
# strict_checks = False,
|
||||
deps = [
|
||||
"//packages/angular_devkit/architect",
|
||||
"//packages/angular_devkit/core",
|
||||
"//packages/angular_devkit/core/node",
|
||||
"@npm//@types/node",
|
||||
"@npm//rxjs",
|
||||
],
|
||||
)
|
||||
8
node_modules/@angular-devkit/architect/node/index.d.ts
generated
vendored
Executable file
8
node_modules/@angular-devkit/architect/node/index.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* @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 * from './node-modules-architect-host';
|
||||
20
node_modules/@angular-devkit/architect/node/index.js
generated
vendored
Executable file
20
node_modules/@angular-devkit/architect/node/index.js
generated
vendored
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
"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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./node-modules-architect-host"), exports);
|
||||
41
node_modules/@angular-devkit/architect/node/node-modules-architect-host.d.ts
generated
vendored
Executable file
41
node_modules/@angular-devkit/architect/node/node-modules-architect-host.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
* @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 { json, workspaces } from '@angular-devkit/core';
|
||||
import { BuilderInfo } from '../src';
|
||||
import { Target } from '../src/input-schema';
|
||||
import { ArchitectHost, Builder } from '../src/internal';
|
||||
export declare type NodeModulesBuilderInfo = BuilderInfo & {
|
||||
import: string;
|
||||
};
|
||||
export interface WorkspaceHost {
|
||||
getBuilderName(project: string, target: string): Promise<string>;
|
||||
getMetadata(project: string): Promise<json.JsonObject>;
|
||||
getOptions(project: string, target: string, configuration?: string): Promise<json.JsonObject>;
|
||||
hasTarget(project: string, target: string): Promise<boolean>;
|
||||
getDefaultConfigurationName(project: string, target: string): Promise<string | undefined>;
|
||||
}
|
||||
export declare class WorkspaceNodeModulesArchitectHost implements ArchitectHost<NodeModulesBuilderInfo> {
|
||||
protected _root: string;
|
||||
private workspaceHost;
|
||||
constructor(workspaceHost: WorkspaceHost, _root: string);
|
||||
constructor(workspace: workspaces.WorkspaceDefinition, _root: string);
|
||||
getBuilderNameForTarget(target: Target): Promise<string>;
|
||||
/**
|
||||
* Resolve a builder. This needs to be a string which will be used in a dynamic `import()`
|
||||
* clause. This should throw if no builder can be found. The dynamic import will throw if
|
||||
* it is unsupported.
|
||||
* @param builderStr The name of the builder to be used.
|
||||
* @returns All the info needed for the builder itself.
|
||||
*/
|
||||
resolveBuilder(builderStr: string): Promise<NodeModulesBuilderInfo>;
|
||||
getCurrentDirectory(): Promise<string>;
|
||||
getWorkspaceRoot(): Promise<string>;
|
||||
getOptionsForTarget(target: Target): Promise<json.JsonObject | null>;
|
||||
getProjectMetadata(target: Target | string): Promise<json.JsonObject | null>;
|
||||
loadBuilder(info: NodeModulesBuilderInfo): Promise<Builder>;
|
||||
}
|
||||
179
node_modules/@angular-devkit/architect/node/node-modules-architect-host.js
generated
vendored
Executable file
179
node_modules/@angular-devkit/architect/node/node-modules-architect-host.js
generated
vendored
Executable file
|
|
@ -0,0 +1,179 @@
|
|||
"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.WorkspaceNodeModulesArchitectHost = void 0;
|
||||
const path = __importStar(require("path"));
|
||||
const v8_1 = require("v8");
|
||||
const internal_1 = require("../src/internal");
|
||||
function clone(obj) {
|
||||
try {
|
||||
return v8_1.deserialize(v8_1.serialize(obj));
|
||||
}
|
||||
catch {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
}
|
||||
function findProjectTarget(workspace, project, target) {
|
||||
const projectDefinition = workspace.projects.get(project);
|
||||
if (!projectDefinition) {
|
||||
throw new Error(`Project "${project}" does not exist.`);
|
||||
}
|
||||
const targetDefinition = projectDefinition.targets.get(target);
|
||||
if (!targetDefinition) {
|
||||
throw new Error('Project target does not exist.');
|
||||
}
|
||||
return targetDefinition;
|
||||
}
|
||||
class WorkspaceNodeModulesArchitectHost {
|
||||
constructor(workspaceOrHost, _root) {
|
||||
this._root = _root;
|
||||
if ('getBuilderName' in workspaceOrHost) {
|
||||
this.workspaceHost = workspaceOrHost;
|
||||
}
|
||||
else {
|
||||
this.workspaceHost = {
|
||||
async getBuilderName(project, target) {
|
||||
const targetDefinition = findProjectTarget(workspaceOrHost, project, target);
|
||||
return targetDefinition.builder;
|
||||
},
|
||||
async getOptions(project, target, configuration) {
|
||||
var _a, _b, _c, _d;
|
||||
const targetDefinition = findProjectTarget(workspaceOrHost, project, target);
|
||||
if (configuration === undefined) {
|
||||
return ((_a = targetDefinition.options) !== null && _a !== void 0 ? _a : {});
|
||||
}
|
||||
if (!((_b = targetDefinition.configurations) === null || _b === void 0 ? void 0 : _b[configuration])) {
|
||||
throw new Error(`Configuration '${configuration}' is not set in the workspace.`);
|
||||
}
|
||||
return ((_d = (_c = targetDefinition.configurations) === null || _c === void 0 ? void 0 : _c[configuration]) !== null && _d !== void 0 ? _d : {});
|
||||
},
|
||||
async getMetadata(project) {
|
||||
const projectDefinition = workspaceOrHost.projects.get(project);
|
||||
if (!projectDefinition) {
|
||||
throw new Error(`Project "${project}" does not exist.`);
|
||||
}
|
||||
return {
|
||||
root: projectDefinition.root,
|
||||
sourceRoot: projectDefinition.sourceRoot,
|
||||
prefix: projectDefinition.prefix,
|
||||
...clone(projectDefinition.extensions),
|
||||
};
|
||||
},
|
||||
async hasTarget(project, target) {
|
||||
var _a;
|
||||
return !!((_a = workspaceOrHost.projects.get(project)) === null || _a === void 0 ? void 0 : _a.targets.has(target));
|
||||
},
|
||||
async getDefaultConfigurationName(project, target) {
|
||||
var _a, _b;
|
||||
return (_b = (_a = workspaceOrHost.projects.get(project)) === null || _a === void 0 ? void 0 : _a.targets.get(target)) === null || _b === void 0 ? void 0 : _b.defaultConfiguration;
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
async getBuilderNameForTarget(target) {
|
||||
return this.workspaceHost.getBuilderName(target.project, target.target);
|
||||
}
|
||||
/**
|
||||
* Resolve a builder. This needs to be a string which will be used in a dynamic `import()`
|
||||
* clause. This should throw if no builder can be found. The dynamic import will throw if
|
||||
* it is unsupported.
|
||||
* @param builderStr The name of the builder to be used.
|
||||
* @returns All the info needed for the builder itself.
|
||||
*/
|
||||
resolveBuilder(builderStr) {
|
||||
const [packageName, builderName] = builderStr.split(':', 2);
|
||||
if (!builderName) {
|
||||
throw new Error('No builder name specified.');
|
||||
}
|
||||
const packageJsonPath = require.resolve(packageName + '/package.json', {
|
||||
paths: [this._root],
|
||||
});
|
||||
const packageJson = require(packageJsonPath);
|
||||
if (!packageJson['builders']) {
|
||||
throw new Error(`Package ${JSON.stringify(packageName)} has no builders defined.`);
|
||||
}
|
||||
const builderJsonPath = path.resolve(path.dirname(packageJsonPath), packageJson['builders']);
|
||||
const builderJson = require(builderJsonPath);
|
||||
const builder = builderJson.builders && builderJson.builders[builderName];
|
||||
if (!builder) {
|
||||
throw new Error(`Cannot find builder ${JSON.stringify(builderStr)}.`);
|
||||
}
|
||||
const importPath = builder.implementation;
|
||||
if (!importPath) {
|
||||
throw new Error('Could not find the implementation for builder ' + builderStr);
|
||||
}
|
||||
return Promise.resolve({
|
||||
name: builderStr,
|
||||
builderName,
|
||||
description: builder['description'],
|
||||
optionSchema: require(path.resolve(path.dirname(builderJsonPath), builder.schema)),
|
||||
import: path.resolve(path.dirname(builderJsonPath), importPath),
|
||||
});
|
||||
}
|
||||
async getCurrentDirectory() {
|
||||
return process.cwd();
|
||||
}
|
||||
async getWorkspaceRoot() {
|
||||
return this._root;
|
||||
}
|
||||
async getOptionsForTarget(target) {
|
||||
if (!(await this.workspaceHost.hasTarget(target.project, target.target))) {
|
||||
return null;
|
||||
}
|
||||
let options = await this.workspaceHost.getOptions(target.project, target.target);
|
||||
const targetConfiguration = target.configuration ||
|
||||
(await this.workspaceHost.getDefaultConfigurationName(target.project, target.target));
|
||||
if (targetConfiguration) {
|
||||
const configurations = targetConfiguration.split(',').map((c) => c.trim());
|
||||
for (const configuration of configurations) {
|
||||
options = {
|
||||
...options,
|
||||
...(await this.workspaceHost.getOptions(target.project, target.target, configuration)),
|
||||
};
|
||||
}
|
||||
}
|
||||
return clone(options);
|
||||
}
|
||||
async getProjectMetadata(target) {
|
||||
const projectName = typeof target === 'string' ? target : target.project;
|
||||
const metadata = this.workspaceHost.getMetadata(projectName);
|
||||
return metadata;
|
||||
}
|
||||
async loadBuilder(info) {
|
||||
const builder = (await Promise.resolve().then(() => __importStar(require(info.import)))).default;
|
||||
if (builder[internal_1.BuilderSymbol]) {
|
||||
return builder;
|
||||
}
|
||||
// Default handling code is for old builders that incorrectly export `default` with non-ESM module
|
||||
if (builder === null || builder === void 0 ? void 0 : builder.default[internal_1.BuilderSymbol]) {
|
||||
return builder.default;
|
||||
}
|
||||
throw new Error('Builder is not a builder');
|
||||
}
|
||||
}
|
||||
exports.WorkspaceNodeModulesArchitectHost = WorkspaceNodeModulesArchitectHost;
|
||||
Loading…
Add table
Add a link
Reference in a new issue