Conexio amb la api

This commit is contained in:
janmaroto 2022-02-09 18:30:03 +01:00
commit b12369cb47
48513 changed files with 7391639 additions and 7 deletions

0
README.md Normal file → Executable file
View file

184
angular.json Executable file
View file

@ -0,0 +1,184 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"defaultProject": "app",
"newProjectRoot": "projects",
"projects": {
"app": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "www",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "src/assets",
"output": "assets"
},
{
"glob": "**/*.svg",
"input": "node_modules/ionicons/dist/ionicons/svg",
"output": "./svg"
}
],
"styles": ["src/theme/variables.scss", "src/global.scss"],
"scripts": [],
"aot": false,
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
},
"ci": {
"progress": false
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "app:build"
},
"configurations": {
"production": {
"browserTarget": "app:build:production"
},
"ci": {
"progress": false
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "app:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"styles": [],
"scripts": [],
"assets": [
{
"glob": "favicon.ico",
"input": "src/",
"output": "/"
},
{
"glob": "**/*",
"input": "src/assets",
"output": "/assets"
}
]
},
"configurations": {
"ci": {
"progress": false,
"watch": false
}
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "app:serve"
},
"configurations": {
"production": {
"devServerTarget": "app:serve:production"
},
"ci": {
"devServerTarget": "app:serve:ci"
}
}
},
"ionic-cordova-build": {
"builder": "@ionic/angular-toolkit:cordova-build",
"options": {
"browserTarget": "app:build"
},
"configurations": {
"production": {
"browserTarget": "app:build:production"
}
}
},
"ionic-cordova-serve": {
"builder": "@ionic/angular-toolkit:cordova-serve",
"options": {
"cordovaBuildTarget": "app:ionic-cordova-build",
"devServerTarget": "app:serve"
},
"configurations": {
"production": {
"cordovaBuildTarget": "app:ionic-cordova-build:production",
"devServerTarget": "app:serve:production"
}
}
}
}
}
},
"cli": {
"defaultCollection": "@ionic/angular-toolkit"
},
"schematics": {
"@ionic/angular-toolkit:component": {
"styleext": "scss"
},
"@ionic/angular-toolkit:page": {
"styleext": "scss"
}
}
}

37
e2e/protractor.conf.js Executable file
View file

@ -0,0 +1,37 @@
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');
/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome'
},
directConnect: true,
SELENIUM_PROMISE_MANAGER: false,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: StacktraceOption.PRETTY
}
}));
}
};

14
e2e/src/app.e2e-spec.ts Executable file
View file

@ -0,0 +1,14 @@
import { AppPage } from './app.po';
describe('new App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should be blank', () => {
page.navigateTo();
expect(page.getParagraphText()).toContain('Start with Ionic UI Components');
});
});

11
e2e/src/app.po.ts Executable file
View file

@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.deepCss('app-root ion-content')).getText();
}
}

12
e2e/tsconfig.json Executable file
View file

@ -0,0 +1,12 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es2018",
"types": [
"jasmine",
"node"
]
}
}

5
ionic.config.json Executable file
View file

@ -0,0 +1,5 @@
{
"name": "projecte_janmaroto",
"integrations": {},
"type": "angular"
}

44
karma.conf.js Executable file
View file

@ -0,0 +1,44 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/ngv'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};

1
node_modules/.bin/acorn generated vendored Symbolic link
View file

@ -0,0 +1 @@
../acorn/bin/acorn

1
node_modules/.bin/ansi-html generated vendored Symbolic link
View file

@ -0,0 +1 @@
../ansi-html/bin/ansi-html

1
node_modules/.bin/atob generated vendored Symbolic link
View file

@ -0,0 +1 @@
../atob/bin/atob.js

1
node_modules/.bin/autoprefixer generated vendored Symbolic link
View file

@ -0,0 +1 @@
../autoprefixer/bin/autoprefixer

1
node_modules/.bin/blocking-proxy generated vendored Symbolic link
View file

@ -0,0 +1 @@
../blocking-proxy/built/lib/bin.js

1
node_modules/.bin/browserslist generated vendored Symbolic link
View file

@ -0,0 +1 @@
../browserslist/cli.js

1
node_modules/.bin/build-optimizer generated vendored Symbolic link
View file

@ -0,0 +1 @@
../@angular-devkit/build-optimizer/src/build-optimizer/cli.js

1
node_modules/.bin/css-blank-pseudo generated vendored Symbolic link
View file

@ -0,0 +1 @@
../css-blank-pseudo/cli.js

1
node_modules/.bin/css-has-pseudo generated vendored Symbolic link
View file

@ -0,0 +1 @@
../css-has-pseudo/cli.js

1
node_modules/.bin/css-prefers-color-scheme generated vendored Symbolic link
View file

@ -0,0 +1 @@
../css-prefers-color-scheme/cli.js

1
node_modules/.bin/cssesc generated vendored Symbolic link
View file

@ -0,0 +1 @@
../cssesc/bin/cssesc

1
node_modules/.bin/errno generated vendored Symbolic link
View file

@ -0,0 +1 @@
../errno/cli.js

1
node_modules/.bin/eslint generated vendored Symbolic link
View file

@ -0,0 +1 @@
../eslint/bin/eslint.js

1
node_modules/.bin/esparse generated vendored Symbolic link
View file

@ -0,0 +1 @@
../esprima/bin/esparse.js

1
node_modules/.bin/esvalidate generated vendored Symbolic link
View file

@ -0,0 +1 @@
../esprima/bin/esvalidate.js

1
node_modules/.bin/image-size generated vendored Symbolic link
View file

@ -0,0 +1 @@
../image-size/bin/image-size.js

1
node_modules/.bin/import-local-fixture generated vendored Symbolic link
View file

@ -0,0 +1 @@
../import-local/fixtures/cli.js

1
node_modules/.bin/installed-package-contents generated vendored Symbolic link
View file

@ -0,0 +1 @@
../@npmcli/installed-package-contents/index.js

1
node_modules/.bin/is-docker generated vendored Symbolic link
View file

@ -0,0 +1 @@
../is-docker/cli.js

1
node_modules/.bin/ivy-ngcc generated vendored Symbolic link
View file

@ -0,0 +1 @@
../@angular/compiler-cli/ngcc/main-ivy-ngcc.js

1
node_modules/.bin/jasmine generated vendored Symbolic link
View file

@ -0,0 +1 @@
../jasmine/bin/jasmine.js

1
node_modules/.bin/js-yaml generated vendored Symbolic link
View file

@ -0,0 +1 @@
../js-yaml/bin/js-yaml.js

1
node_modules/.bin/jsdoctypeparser generated vendored Symbolic link
View file

@ -0,0 +1 @@
../jsdoctypeparser/bin/jsdoctypeparser

1
node_modules/.bin/jsesc generated vendored Symbolic link
View file

@ -0,0 +1 @@
../jsesc/bin/jsesc

1
node_modules/.bin/json5 generated vendored Symbolic link
View file

@ -0,0 +1 @@
../json5/lib/cli.js

1
node_modules/.bin/karma generated vendored Symbolic link
View file

@ -0,0 +1 @@
../karma/bin/karma

1
node_modules/.bin/lessc generated vendored Symbolic link
View file

@ -0,0 +1 @@
../less/bin/lessc

1
node_modules/.bin/mime generated vendored Symbolic link
View file

@ -0,0 +1 @@
../mime/cli.js

1
node_modules/.bin/mkdirp generated vendored Symbolic link
View file

@ -0,0 +1 @@
../mkdirp/bin/cmd.js

1
node_modules/.bin/multicast-dns generated vendored Symbolic link
View file

@ -0,0 +1 @@
../multicast-dns/cli.js

1
node_modules/.bin/nanoid generated vendored Symbolic link
View file

@ -0,0 +1 @@
../nanoid/bin/nanoid.cjs

1
node_modules/.bin/needle generated vendored Symbolic link
View file

@ -0,0 +1 @@
../needle/bin/needle

1
node_modules/.bin/ng generated vendored Symbolic link
View file

@ -0,0 +1 @@
../@angular/cli/bin/ng

1
node_modules/.bin/ng-xi18n generated vendored Symbolic link
View file

@ -0,0 +1 @@
../@angular/compiler-cli/src/extract_i18n.js

1
node_modules/.bin/ngc generated vendored Symbolic link
View file

@ -0,0 +1 @@
../@angular/compiler-cli/src/main.js

1
node_modules/.bin/ngcc generated vendored Symbolic link
View file

@ -0,0 +1 @@
../@angular/compiler-cli/ngcc/main-ngcc.js

1
node_modules/.bin/node-gyp generated vendored Symbolic link
View file

@ -0,0 +1 @@
../node-gyp/bin/node-gyp.js

1
node_modules/.bin/nopt generated vendored Symbolic link
View file

@ -0,0 +1 @@
../nopt/bin/nopt.js

1
node_modules/.bin/npm-packlist generated vendored Symbolic link
View file

@ -0,0 +1 @@
../npm-packlist/bin/index.js

1
node_modules/.bin/pacote generated vendored Symbolic link
View file

@ -0,0 +1 @@
../pacote/lib/bin.js

1
node_modules/.bin/parser generated vendored Symbolic link
View file

@ -0,0 +1 @@
../@babel/parser/bin/babel-parser.js

1
node_modules/.bin/protractor generated vendored Symbolic link
View file

@ -0,0 +1 @@
../protractor/bin/protractor

1
node_modules/.bin/regjsparser generated vendored Symbolic link
View file

@ -0,0 +1 @@
../regjsparser/bin/parser

1
node_modules/.bin/rimraf generated vendored Symbolic link
View file

@ -0,0 +1 @@
../rimraf/bin.js

1
node_modules/.bin/sass generated vendored Symbolic link
View file

@ -0,0 +1 @@
../sass/sass.js

1
node_modules/.bin/semver generated vendored Symbolic link
View file

@ -0,0 +1 @@
../semver/bin/semver.js

1
node_modules/.bin/sshpk-conv generated vendored Symbolic link
View file

@ -0,0 +1 @@
../sshpk/bin/sshpk-conv

1
node_modules/.bin/sshpk-sign generated vendored Symbolic link
View file

@ -0,0 +1 @@
../sshpk/bin/sshpk-sign

1
node_modules/.bin/sshpk-verify generated vendored Symbolic link
View file

@ -0,0 +1 @@
../sshpk/bin/sshpk-verify

1
node_modules/.bin/stencil generated vendored Symbolic link
View file

@ -0,0 +1 @@
../@stencil/core/bin/stencil

1
node_modules/.bin/stylus generated vendored Symbolic link
View file

@ -0,0 +1 @@
../stylus/bin/stylus

1
node_modules/.bin/svgo generated vendored Symbolic link
View file

@ -0,0 +1 @@
../svgo/bin/svgo

1
node_modules/.bin/terser generated vendored Symbolic link
View file

@ -0,0 +1 @@
../terser/bin/terser

1
node_modules/.bin/tree-kill generated vendored Symbolic link
View file

@ -0,0 +1 @@
../tree-kill/cli.js

1
node_modules/.bin/ts-node generated vendored Symbolic link
View file

@ -0,0 +1 @@
../ts-node/dist/bin.js

1
node_modules/.bin/tsc generated vendored Symbolic link
View file

@ -0,0 +1 @@
../typescript/bin/tsc

1
node_modules/.bin/tsserver generated vendored Symbolic link
View file

@ -0,0 +1 @@
../typescript/bin/tsserver

1
node_modules/.bin/uuid generated vendored Symbolic link
View file

@ -0,0 +1 @@
../uuid/bin/uuid

1
node_modules/.bin/webdriver-manager generated vendored Symbolic link
View file

@ -0,0 +1 @@
../protractor/bin/webdriver-manager

1
node_modules/.bin/webpack generated vendored Symbolic link
View file

@ -0,0 +1 @@
../webpack/bin/webpack.js

1
node_modules/.bin/webpack-dev-server generated vendored Symbolic link
View file

@ -0,0 +1 @@
../webpack-dev-server/bin/webpack-dev-server.js

1
node_modules/.bin/which generated vendored Symbolic link
View file

@ -0,0 +1 @@
../which/bin/which

21
node_modules/@angular-devkit/architect/LICENSE generated vendored Executable file
View 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.

3
node_modules/@angular-devkit/architect/README.md generated vendored Executable file
View file

@ -0,0 +1,3 @@
# Angular Build Facade
WIP

11
node_modules/@angular-devkit/architect/builders/all-of.d.ts generated vendored Executable file
View 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
*/
import { json } from '@angular-devkit/core';
import { Schema as OperatorSchema } from './operator-schema';
declare const _default: import("../src/internal").Builder<json.JsonObject & OperatorSchema>;
export default _default;

48
node_modules/@angular-devkit/architect/builders/all-of.js generated vendored Executable file
View file

@ -0,0 +1,48 @@
"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 });
const rxjs_1 = require("rxjs");
const operators_1 = require("rxjs/operators");
const src_1 = require("../src");
exports.default = src_1.createBuilder((options, context) => {
const allRuns = [];
context.reportProgress(0, (options.targets ? options.targets.length : 0) +
(options.builders ? options.builders.length : 0));
if (options.targets) {
allRuns.push(...options.targets.map(({ target: targetStr, overrides }, i) => {
const [project, target, configuration] = targetStr.split(/:/g, 3);
return context
.scheduleTarget({ project, target, configuration }, overrides || {})
.then((run) => [i, run]);
}));
}
if (options.builders) {
allRuns.push(...options.builders.map(({ builder, options }, i) => {
return context
.scheduleBuilder(builder, options || {})
.then((run) => [i, run]);
}));
}
const allResults = allRuns.map(() => null);
let n = 0;
context.reportProgress(n++, allRuns.length);
return rxjs_1.from(allRuns).pipe(operators_1.mergeMap((runPromise) => rxjs_1.from(runPromise)), operators_1.mergeMap(([i, run]) => run.output.pipe(operators_1.map((output) => [i, output]))), operators_1.mergeMap(([i, output]) => {
allResults[i] = output;
context.reportProgress(n++, allRuns.length);
if (allResults.some((x) => x === null)) {
// Some builders aren't done running yet.
return rxjs_1.EMPTY;
}
else {
return rxjs_1.of({
success: allResults.every((x) => (x ? x.success : false)),
});
}
}));
});

View file

@ -0,0 +1,25 @@
{
"$schema": "../src/builders-schema.json",
"builders": {
"true": {
"implementation": "./true",
"schema": "./noop-schema.json",
"description": "Always succeed."
},
"false": {
"implementation": "./false",
"schema": "./noop-schema.json",
"description": "Always fails."
},
"allOf": {
"implementation": "./all-of",
"schema": "./operator-schema.json",
"description": "A builder that executes many builders in parallel, and succeed if both succeeds."
},
"concat": {
"implementation": "./concat",
"schema": "./operator-schema.json",
"description": "A builder that executes many builders one after the other, and stops when one fail. It will succeed if all builders succeeds (and return the last output)"
}
}
}

11
node_modules/@angular-devkit/architect/builders/concat.d.ts generated vendored Executable file
View 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
*/
import { json } from '@angular-devkit/core';
import { Schema as OperatorSchema } from './operator-schema';
declare const _default: import("../src/internal").Builder<json.JsonObject & OperatorSchema>;
export default _default;

45
node_modules/@angular-devkit/architect/builders/concat.js generated vendored Executable file
View file

@ -0,0 +1,45 @@
"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 });
const rxjs_1 = require("rxjs");
const operators_1 = require("rxjs/operators");
const src_1 = require("../src");
exports.default = src_1.createBuilder((options, context) => {
const allRuns = [];
context.reportProgress(0, (options.targets ? options.targets.length : 0) +
(options.builders ? options.builders.length : 0));
if (options.targets) {
allRuns.push(...options.targets.map(({ target: targetStr, overrides }) => {
const [project, target, configuration] = targetStr.split(/:/g, 3);
return () => context.scheduleTarget({ project, target, configuration }, overrides || {});
}));
}
if (options.builders) {
allRuns.push(...options.builders.map(({ builder, options }) => {
return () => context.scheduleBuilder(builder, options || {});
}));
}
let stop = null;
let i = 0;
context.reportProgress(i++, allRuns.length);
return rxjs_1.from(allRuns).pipe(operators_1.concatMap((fn) => stop
? rxjs_1.of(null)
: rxjs_1.from(fn()).pipe(operators_1.switchMap((run) => (run === null ? rxjs_1.of(null) : run.output.pipe(operators_1.first()))))), operators_1.map((output) => {
context.reportProgress(i++, allRuns.length);
if (output === null || stop !== null) {
return stop || { success: false };
}
else if (output.success === false) {
return (stop = output);
}
else {
return output;
}
}), operators_1.last());
});

9
node_modules/@angular-devkit/architect/builders/false.d.ts generated vendored Executable file
View file

@ -0,0 +1,9 @@
/**
* @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
*/
declare const _default: import("../src/internal").Builder<import("../../core/src").JsonObject>;
export default _default;

14
node_modules/@angular-devkit/architect/builders/false.js generated vendored Executable file
View file

@ -0,0 +1,14 @@
"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 });
const src_1 = require("../src");
exports.default = src_1.createBuilder(() => ({
success: false,
error: 'False builder always errors.',
}));

View file

@ -0,0 +1,4 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object"
}

View file

@ -0,0 +1,19 @@
/**
* All input types of builders that perform operations on one or multiple sub-builders.
*/
export interface Schema {
builders?: Builder[];
targets?: Target[];
}
export interface Builder {
builder: string;
options?: {
[key: string]: any;
};
}
export interface Target {
overrides?: {
[key: string]: any;
};
target: string;
}

View file

@ -0,0 +1,4 @@
"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 });

View file

@ -0,0 +1,41 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"description": "All input types of builders that perform operations on one or multiple sub-builders.",
"type": "object",
"properties": {
"builders": {
"type": "array",
"items": {
"type": "object",
"properties": {
"builder": {
"type": "string",
"pattern": ".*:.*"
},
"options": {
"type": "object"
}
},
"required": ["builder"]
},
"minItems": 1
},
"targets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"target": {
"type": "string",
"pattern": ".*:.*"
},
"overrides": {
"type": "object"
}
},
"required": ["target"]
},
"minItems": 1
}
}
}

9
node_modules/@angular-devkit/architect/builders/true.d.ts generated vendored Executable file
View file

@ -0,0 +1,9 @@
/**
* @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
*/
declare const _default: import("../src/internal").Builder<import("../../core/src").JsonObject>;
export default _default;

11
node_modules/@angular-devkit/architect/builders/true.js generated vendored Executable file
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 });
const src_1 = require("../src");
exports.default = src_1.createBuilder(() => ({ success: true }));

28
node_modules/@angular-devkit/architect/node/BUILD.bazel generated vendored Executable file
View 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
View 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
View 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);

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

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

65
node_modules/@angular-devkit/architect/package.json generated vendored Executable file
View file

@ -0,0 +1,65 @@
{
"_from": "@angular-devkit/architect@0.1201.4",
"_id": "@angular-devkit/architect@0.1201.4",
"_inBundle": false,
"_integrity": "sha512-hGO5NrZxV8Z7sILwokt7H+1sMf+5tJS9PJszvYlIBSzG0LBkOwwLQDb4MD42ATXFru57SXNqMZDVKoi1kTgxAw==",
"_location": "/@angular-devkit/architect",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@angular-devkit/architect@0.1201.4",
"name": "@angular-devkit/architect",
"escapedName": "@angular-devkit%2farchitect",
"scope": "@angular-devkit",
"rawSpec": "0.1201.4",
"saveSpec": null,
"fetchSpec": "0.1201.4"
},
"_requiredBy": [
"/@angular-devkit/build-angular",
"/@angular-devkit/build-webpack",
"/@angular/cli"
],
"_resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1201.4.tgz",
"_shasum": "bdd4ed088845bc5412ac8ab9dd4355953f09ea70",
"_spec": "@angular-devkit/architect@0.1201.4",
"_where": "/home/jack/Documents/JDA/m14/projecte_janmaroto/node_modules/@angular-devkit/build-angular",
"author": {
"name": "Angular Authors"
},
"bugs": {
"url": "https://github.com/angular/angular-cli/issues"
},
"builders": "./builders/builders.json",
"bundleDependencies": false,
"dependencies": {
"@angular-devkit/core": "12.1.4",
"rxjs": "6.6.7"
},
"deprecated": false,
"description": "Angular Build Facade",
"engines": {
"node": "^12.14.1 || >=14.0.0",
"npm": "^6.11.0 || ^7.5.6",
"yarn": ">= 1.13.0"
},
"experimental": true,
"homepage": "https://github.com/angular/angular-cli",
"keywords": [
"angular",
"Angular CLI",
"devkit",
"sdk",
"Angular DevKit"
],
"license": "MIT",
"main": "src/index.js",
"name": "@angular-devkit/architect",
"repository": {
"type": "git",
"url": "git+https://github.com/angular/angular-cli.git"
},
"typings": "src/index.d.ts",
"version": "0.1201.4"
}

267
node_modules/@angular-devkit/architect/src/api.d.ts generated vendored Executable file
View file

@ -0,0 +1,267 @@
/**
* @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 { analytics, experimental, json, logging } from '@angular-devkit/core';
import { Observable, SubscribableOrPromise } from 'rxjs';
import { Schema as RealBuilderInput, Target as RealTarget } from './input-schema';
import { Schema as RealBuilderOutput } from './output-schema';
import { State as BuilderProgressState, Schema as RealBuilderProgress } from './progress-schema';
export declare type Target = json.JsonObject & RealTarget;
export { BuilderProgressState };
export declare type BuilderRegistry = experimental.jobs.Registry<json.JsonObject, BuilderInput, BuilderOutput>;
/**
* An API typed BuilderProgress. The interface generated from the schema is too permissive,
* so this API is the one we show in our API. Please note that not all fields are in there; this
* is in addition to fields in the schema.
*/
export declare type TypedBuilderProgress = {
state: BuilderProgressState.Stopped;
} | {
state: BuilderProgressState.Error;
error: json.JsonValue;
} | {
state: BuilderProgressState.Waiting;
status?: string;
} | {
state: BuilderProgressState.Running;
status?: string;
current: number;
total?: number;
};
/**
* Declaration of those types as JsonObject compatible. JsonObject is not compatible with
* optional members, so those wouldn't be directly assignable to our internal Json typings.
* Forcing the type to be both a JsonObject and the type from the Schema tells Typescript they
* are compatible (which they are).
* These types should be used everywhere.
*/
export declare type BuilderInput = json.JsonObject & RealBuilderInput;
export declare type BuilderOutput = json.JsonObject & RealBuilderOutput;
export declare type BuilderProgress = json.JsonObject & RealBuilderProgress & TypedBuilderProgress;
/**
* A progress report is what the tooling will receive. It contains the builder info and the target.
* Although these are serializable, they are only exposed through the tooling interface, not the
* builder interface. The watch dog sends BuilderProgress and the Builder has a set of functions
* to manage the state.
*/
export declare type BuilderProgressReport = BuilderProgress & {
target?: Target;
builder: BuilderInfo;
};
/**
* A Run, which is what is returned by scheduleBuilder or scheduleTarget functions. This should
* be reconstructed across memory boundaries (it's not serializable but all internal information
* are).
*/
export interface BuilderRun {
/**
* Unique amongst runs. This is the same ID as the context generated for the run. It can be
* used to identify multiple unique runs. There is no guarantee that a run is a single output;
* a builder can rebuild on its own and will generate multiple outputs.
*/
id: number;
/**
* The builder information.
*/
info: BuilderInfo;
/**
* The next output from a builder. This is recommended when scheduling a builder and only being
* interested in the result of that single run, not of a watch-mode builder.
*/
result: Promise<BuilderOutput>;
/**
* The output(s) from the builder. A builder can have multiple outputs.
* This always replay the last output when subscribed.
*/
output: Observable<BuilderOutput>;
/**
* The progress report. A progress also contains an ID, which can be different than this run's
* ID (if the builder calls scheduleBuilder or scheduleTarget).
* This will always replay the last progress on new subscriptions.
*/
progress: Observable<BuilderProgressReport>;
/**
* Stop the builder from running. Returns a promise that resolves when the builder is stopped.
* Some builders might not handle stopping properly and should have a timeout here.
*/
stop(): Promise<void>;
}
/**
* Additional optional scheduling options.
*/
export interface ScheduleOptions {
/**
* Logger to pass to the builder. Note that messages will stop being forwarded, and if you want
* to log a builder scheduled from your builder you should forward log events yourself.
*/
logger?: logging.Logger;
/**
* Target to pass to the builder.
*/
target?: Target;
}
/**
* The context received as a second argument in your builder.
*/
export interface BuilderContext {
/**
* Unique amongst contexts. Contexts instances are not guaranteed to be the same (but it could
* be the same context), and all the fields in a context could be the same, yet the builder's
* context could be different. This is the same ID as the corresponding run.
*/
id: number;
/**
* The builder info that called your function. Since the builder info is from the builder.json
* (or the host), it could contain information that is different than expected.
*/
builder: BuilderInfo;
/**
* A logger that appends messages to a log. This could be a separate interface or completely
* ignored. `console.log` could also be completely ignored.
*/
logger: logging.LoggerApi;
/**
* The absolute workspace root of this run. This is a system path and will not be normalized;
* ie. on Windows it will starts with `C:\\` (or whatever drive).
*/
workspaceRoot: string;
/**
* The current directory the user is in. This could be outside the workspace root. This is a
* system path and will not be normalized; ie. on Windows it will starts with `C:\\` (or
* whatever drive).
*/
currentDirectory: string;
/**
* The target that was used to run this builder.
* Target is optional if a builder was ran using `scheduleBuilder()`.
*/
target?: Target;
/**
* Schedule a target in the same workspace. This can be the same target that is being executed
* right now, but targets of the same name are serialized.
* Running the same target and waiting for it to end will result in a deadlocking scenario.
* Targets are considered the same if the project, the target AND the configuration are the same.
* @param target The target to schedule.
* @param overrides A set of options to override the workspace set of options.
* @param scheduleOptions Additional optional scheduling options.
* @return A promise of a run. It will resolve when all the members of the run are available.
*/
scheduleTarget(target: Target, overrides?: json.JsonObject, scheduleOptions?: ScheduleOptions): Promise<BuilderRun>;
/**
* Schedule a builder by its name. This can be the same builder that is being executed.
* @param builderName The name of the builder, ie. its `packageName:builderName` tuple.
* @param options All options to use for the builder (by default empty object). There is no
* additional options added, e.g. from the workspace.
* @param scheduleOptions Additional optional scheduling options.
* @return A promise of a run. It will resolve when all the members of the run are available.
*/
scheduleBuilder(builderName: string, options?: json.JsonObject, scheduleOptions?: ScheduleOptions): Promise<BuilderRun>;
/**
* Resolve and return options for a specified target. If the target isn't defined in the
* workspace this will reject the promise. This object will be read directly from the workspace
* but not validated against the builder of the target.
* @param target The target to resolve the options of.
* @return A non-validated object resolved from the workspace.
*/
getTargetOptions(target: Target): Promise<json.JsonObject>;
getProjectMetadata(projectName: string): Promise<json.JsonObject>;
getProjectMetadata(target: Target): Promise<json.JsonObject>;
/**
* Resolves and return a builder name. The exact format of the name is up to the host,
* so it should not be parsed to gather information (it's free form). This string can be
* used to validate options or schedule a builder directly.
* @param target The target to resolve the builder name.
*/
getBuilderNameForTarget(target: Target): Promise<string>;
/**
* Validates the options against a builder schema. This uses the same methods as the
* scheduleTarget and scheduleBrowser methods to validate and apply defaults to the options.
* It can be generically typed, if you know which interface it is supposed to validate against.
* @param options A generic option object to validate.
* @param builderName The name of a builder to use. This can be gotten for a target by using the
* getBuilderForTarget() method on the context.
*/
validateOptions<T extends json.JsonObject = json.JsonObject>(options: json.JsonObject, builderName: string): Promise<T>;
/**
* Set the builder to running. This should be used if an external event triggered a re-run,
* e.g. a file watched was changed.
*/
reportRunning(): void;
/**
* Update the status string shown on the interface.
* @param status The status to set it to. An empty string can be used to remove the status.
*/
reportStatus(status: string): void;
/**
* Update the progress for this builder run.
* @param current The current progress. This will be between 0 and total.
* @param total A new total to set. By default at the start of a run this is 1. If omitted it
* will use the same value as the last total.
* @param status Update the status string. If omitted the status string is not modified.
*/
reportProgress(current: number, total?: number, status?: string): void;
/**
* API to report analytics. This might be undefined if the feature is unsupported. This might
* not be undefined, but the backend could also not report anything.
*/
readonly analytics: analytics.Analytics;
/**
* Add teardown logic to this Context, so that when it's being stopped it will execute teardown.
*/
addTeardown(teardown: () => Promise<void> | void): void;
}
/**
* An accepted return value from a builder. Can be either an Observable, a Promise or a vector.
*/
export declare type BuilderOutputLike = AsyncIterable<BuilderOutput> | SubscribableOrPromise<BuilderOutput> | BuilderOutput;
export declare function isBuilderOutput(obj: any): obj is BuilderOutput;
export declare function fromAsyncIterable<T>(iterable: AsyncIterable<T>): Observable<T>;
/**
* A builder handler function. The function signature passed to `createBuilder()`.
*/
export interface BuilderHandlerFn<A> {
/**
* Builders are defined by users to perform any kind of task, like building, testing or linting,
* and should use this interface.
* @param input The options (a JsonObject), validated by the schema and received by the
* builder. This can include resolved options from the CLI or the workspace.
* @param context A context that can be used to interact with the Architect framework.
* @return One or many builder output.
*/
(input: A, context: BuilderContext): BuilderOutputLike;
}
/**
* A Builder general information. This is generated by the host and is expanded by the host, but
* the public API contains those fields.
*/
export declare type BuilderInfo = json.JsonObject & {
builderName: string;
description: string;
optionSchema: json.schema.JsonSchema;
};
/**
* Returns a string of "project:target[:configuration]" for the target object.
*/
export declare function targetStringFromTarget({ project, target, configuration }: Target): string;
/**
* Return a Target tuple from a string.
*/
export declare function targetFromTargetString(str: string): Target;
/**
* Schedule a target, and forget about its run. This will return an observable of outputs, that
* as a a teardown will stop the target from running. This means that the Run object this returns
* should not be shared.
*
* The reason this is not part of the Context interface is to keep the Context as normal form as
* possible. This is really an utility that people would implement in their project.
*
* @param context The context of your current execution.
* @param target The target to schedule.
* @param overrides Overrides that are used in the target.
* @param scheduleOptions Additional scheduling options.
*/
export declare function scheduleTargetAndForget(context: BuilderContext, target: Target, overrides?: json.JsonObject, scheduleOptions?: ScheduleOptions): Observable<BuilderOutput>;

98
node_modules/@angular-devkit/architect/src/api.js generated vendored Executable file
View file

@ -0,0 +1,98 @@
"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.scheduleTargetAndForget = exports.targetFromTargetString = exports.targetStringFromTarget = exports.fromAsyncIterable = exports.isBuilderOutput = exports.BuilderProgressState = void 0;
const rxjs_1 = require("rxjs");
const operators_1 = require("rxjs/operators");
const progress_schema_1 = require("./progress-schema");
Object.defineProperty(exports, "BuilderProgressState", { enumerable: true, get: function () { return progress_schema_1.State; } });
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function isBuilderOutput(obj) {
if (!obj || typeof obj.then === 'function' || typeof obj.subscribe === 'function') {
return false;
}
if (typeof obj[Symbol.asyncIterator] === 'function') {
return false;
}
return typeof obj.success === 'boolean';
}
exports.isBuilderOutput = isBuilderOutput;
function fromAsyncIterable(iterable) {
return new rxjs_1.Observable((subscriber) => {
handleAsyncIterator(subscriber, iterable[Symbol.asyncIterator]()).then(() => subscriber.complete(), (error) => subscriber.error(error));
});
}
exports.fromAsyncIterable = fromAsyncIterable;
async function handleAsyncIterator(subscriber, iterator) {
var _a;
const teardown = new Promise((resolve) => subscriber.add(() => resolve()));
try {
while (!subscriber.closed) {
const result = await Promise.race([teardown, iterator.next()]);
if (!result || result.done) {
break;
}
subscriber.next(result.value);
}
}
finally {
await ((_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator));
}
}
/**
* Returns a string of "project:target[:configuration]" for the target object.
*/
function targetStringFromTarget({ project, target, configuration }) {
return `${project}:${target}${configuration !== undefined ? ':' + configuration : ''}`;
}
exports.targetStringFromTarget = targetStringFromTarget;
/**
* Return a Target tuple from a string.
*/
function targetFromTargetString(str) {
const tuple = str.split(/:/, 3);
if (tuple.length < 2) {
throw new Error('Invalid target string: ' + JSON.stringify(str));
}
return {
project: tuple[0],
target: tuple[1],
...(tuple[2] !== undefined && { configuration: tuple[2] }),
};
}
exports.targetFromTargetString = targetFromTargetString;
/**
* Schedule a target, and forget about its run. This will return an observable of outputs, that
* as a a teardown will stop the target from running. This means that the Run object this returns
* should not be shared.
*
* The reason this is not part of the Context interface is to keep the Context as normal form as
* possible. This is really an utility that people would implement in their project.
*
* @param context The context of your current execution.
* @param target The target to schedule.
* @param overrides Overrides that are used in the target.
* @param scheduleOptions Additional scheduling options.
*/
function scheduleTargetAndForget(context, target, overrides, scheduleOptions) {
let resolve = null;
const promise = new Promise((r) => (resolve = r));
context.addTeardown(() => promise);
return rxjs_1.from(context.scheduleTarget(target, overrides, scheduleOptions)).pipe(operators_1.switchMap((run) => new rxjs_1.Observable((observer) => {
const subscription = run.output.subscribe(observer);
return () => {
subscription.unsubscribe();
// We can properly ignore the floating promise as it's a "reverse" promise; the teardown
// is waiting for the resolve.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
run.stop().then(resolve);
};
})));
}
exports.scheduleTargetAndForget = scheduleTargetAndForget;

25
node_modules/@angular-devkit/architect/src/architect.d.ts generated vendored Executable file
View file

@ -0,0 +1,25 @@
/**
* @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 { analytics, experimental, json, logging } from '@angular-devkit/core';
import { Observable } from 'rxjs';
import { BuilderRun, Target } from './api';
import { ArchitectHost } from './internal';
export interface ScheduleOptions {
logger?: logging.Logger;
analytics?: analytics.Analytics;
}
export declare class Architect {
private _host;
private readonly _scheduler;
private readonly _jobCache;
private readonly _infoCache;
constructor(_host: ArchitectHost, registry?: json.schema.SchemaRegistry, additionalJobRegistry?: experimental.jobs.Registry);
has(name: experimental.jobs.JobName): Observable<boolean>;
scheduleBuilder(name: string, options: json.JsonObject, scheduleOptions?: ScheduleOptions): Promise<BuilderRun>;
scheduleTarget(target: Target, overrides?: json.JsonObject, scheduleOptions?: ScheduleOptions): Promise<BuilderRun>;
}

283
node_modules/@angular-devkit/architect/src/architect.js generated vendored Executable file
View file

@ -0,0 +1,283 @@
"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.Architect = void 0;
const core_1 = require("@angular-devkit/core");
const rxjs_1 = require("rxjs");
const operators_1 = require("rxjs/operators");
const api_1 = require("./api");
const schedule_by_name_1 = require("./schedule-by-name");
const inputSchema = require('./input-schema.json');
const outputSchema = require('./output-schema.json');
function _createJobHandlerFromBuilderInfo(info, target, host, registry, baseOptions) {
const jobDescription = {
name: target ? `{${api_1.targetStringFromTarget(target)}}` : info.builderName,
argument: { type: 'object' },
input: inputSchema,
output: outputSchema,
info,
};
function handler(argument, context) {
// Add input validation to the inbound bus.
const inboundBusWithInputValidation = context.inboundBus.pipe(operators_1.concatMap((message) => {
if (message.kind === core_1.experimental.jobs.JobInboundMessageKind.Input) {
const v = message.value;
const options = {
...baseOptions,
...v.options,
};
// Validate v against the options schema.
return registry.compile(info.optionSchema).pipe(operators_1.concatMap((validation) => validation(options)), operators_1.map((validationResult) => {
const { data, success, errors } = validationResult;
if (success) {
return { ...v, options: data };
}
throw new core_1.json.schema.SchemaValidationException(errors);
}), operators_1.map((value) => ({ ...message, value })));
}
else {
return rxjs_1.of(message);
}
}),
// Using a share replay because the job might be synchronously sending input, but
// asynchronously listening to it.
operators_1.shareReplay(1));
// Make an inboundBus that completes instead of erroring out.
// We'll merge the errors into the output instead.
const inboundBus = rxjs_1.onErrorResumeNext(inboundBusWithInputValidation);
const output = rxjs_1.from(host.loadBuilder(info)).pipe(operators_1.concatMap((builder) => {
if (builder === null) {
throw new Error(`Cannot load builder for builderInfo ${JSON.stringify(info, null, 2)}`);
}
return builder.handler(argument, { ...context, inboundBus }).pipe(operators_1.map((output) => {
if (output.kind === core_1.experimental.jobs.JobOutboundMessageKind.Output) {
// Add target to it.
return {
...output,
value: {
...output.value,
...(target ? { target } : 0),
},
};
}
else {
return output;
}
}));
}),
// Share subscriptions to the output, otherwise the the handler will be re-run.
operators_1.shareReplay());
// Separate the errors from the inbound bus into their own observable that completes when the
// builder output does.
const inboundBusErrors = inboundBusWithInputValidation.pipe(operators_1.ignoreElements(), operators_1.takeUntil(rxjs_1.onErrorResumeNext(output.pipe(operators_1.last()))));
// Return the builder output plus any input errors.
return rxjs_1.merge(inboundBusErrors, output);
}
return rxjs_1.of(Object.assign(handler, { jobDescription }));
}
/**
* A JobRegistry that resolves builder targets from the host.
*/
class ArchitectBuilderJobRegistry {
constructor(_host, _registry, _jobCache, _infoCache) {
this._host = _host;
this._registry = _registry;
this._jobCache = _jobCache;
this._infoCache = _infoCache;
}
_resolveBuilder(name) {
const cache = this._infoCache;
if (cache) {
const maybeCache = cache.get(name);
if (maybeCache !== undefined) {
return maybeCache;
}
const info = rxjs_1.from(this._host.resolveBuilder(name)).pipe(operators_1.shareReplay(1));
cache.set(name, info);
return info;
}
return rxjs_1.from(this._host.resolveBuilder(name));
}
_createBuilder(info, target, options) {
const cache = this._jobCache;
if (target) {
const maybeHit = cache && cache.get(api_1.targetStringFromTarget(target));
if (maybeHit) {
return maybeHit;
}
}
else {
const maybeHit = cache && cache.get(info.builderName);
if (maybeHit) {
return maybeHit;
}
}
const result = _createJobHandlerFromBuilderInfo(info, target, this._host, this._registry, options || {});
if (cache) {
if (target) {
cache.set(api_1.targetStringFromTarget(target), result.pipe(operators_1.shareReplay(1)));
}
else {
cache.set(info.builderName, result.pipe(operators_1.shareReplay(1)));
}
}
return result;
}
get(name) {
const m = name.match(/^([^:]+):([^:]+)$/i);
if (!m) {
return rxjs_1.of(null);
}
return rxjs_1.from(this._resolveBuilder(name)).pipe(operators_1.concatMap((builderInfo) => (builderInfo ? this._createBuilder(builderInfo) : rxjs_1.of(null))), operators_1.first(null, null));
}
}
/**
* A JobRegistry that resolves targets from the host.
*/
class ArchitectTargetJobRegistry extends ArchitectBuilderJobRegistry {
get(name) {
const m = name.match(/^{([^:]+):([^:]+)(?::([^:]*))?}$/i);
if (!m) {
return rxjs_1.of(null);
}
const target = {
project: m[1],
target: m[2],
configuration: m[3],
};
return rxjs_1.from(Promise.all([
this._host.getBuilderNameForTarget(target),
this._host.getOptionsForTarget(target),
])).pipe(operators_1.concatMap(([builderStr, options]) => {
if (builderStr === null || options === null) {
return rxjs_1.of(null);
}
return this._resolveBuilder(builderStr).pipe(operators_1.concatMap((builderInfo) => {
if (builderInfo === null) {
return rxjs_1.of(null);
}
return this._createBuilder(builderInfo, target, options);
}));
}), operators_1.first(null, null));
}
}
function _getTargetOptionsFactory(host) {
return core_1.experimental.jobs.createJobHandler((target) => {
return host.getOptionsForTarget(target).then((options) => {
if (options === null) {
throw new Error(`Invalid target: ${JSON.stringify(target)}.`);
}
return options;
});
}, {
name: '..getTargetOptions',
output: { type: 'object' },
argument: inputSchema.properties.target,
});
}
function _getProjectMetadataFactory(host) {
return core_1.experimental.jobs.createJobHandler((target) => {
return host.getProjectMetadata(target).then((options) => {
if (options === null) {
throw new Error(`Invalid target: ${JSON.stringify(target)}.`);
}
return options;
});
}, {
name: '..getProjectMetadata',
output: { type: 'object' },
argument: {
oneOf: [{ type: 'string' }, inputSchema.properties.target],
},
});
}
function _getBuilderNameForTargetFactory(host) {
return core_1.experimental.jobs.createJobHandler(async (target) => {
const builderName = await host.getBuilderNameForTarget(target);
if (!builderName) {
throw new Error(`No builder were found for target ${api_1.targetStringFromTarget(target)}.`);
}
return builderName;
}, {
name: '..getBuilderNameForTarget',
output: { type: 'string' },
argument: inputSchema.properties.target,
});
}
function _validateOptionsFactory(host, registry) {
return core_1.experimental.jobs.createJobHandler(async ([builderName, options]) => {
// Get option schema from the host.
const builderInfo = await host.resolveBuilder(builderName);
if (!builderInfo) {
throw new Error(`No builder info were found for builder ${JSON.stringify(builderName)}.`);
}
return registry
.compile(builderInfo.optionSchema)
.pipe(operators_1.concatMap((validation) => validation(options)), operators_1.switchMap(({ data, success, errors }) => {
if (success) {
return rxjs_1.of(data);
}
throw new core_1.json.schema.SchemaValidationException(errors);
}))
.toPromise();
}, {
name: '..validateOptions',
output: { type: 'object' },
argument: {
type: 'array',
items: [{ type: 'string' }, { type: 'object' }],
},
});
}
class Architect {
constructor(_host, registry = new core_1.json.schema.CoreSchemaRegistry(), additionalJobRegistry) {
this._host = _host;
this._jobCache = new Map();
this._infoCache = new Map();
const privateArchitectJobRegistry = new core_1.experimental.jobs.SimpleJobRegistry();
// Create private jobs.
privateArchitectJobRegistry.register(_getTargetOptionsFactory(_host));
privateArchitectJobRegistry.register(_getBuilderNameForTargetFactory(_host));
privateArchitectJobRegistry.register(_validateOptionsFactory(_host, registry));
privateArchitectJobRegistry.register(_getProjectMetadataFactory(_host));
const jobRegistry = new core_1.experimental.jobs.FallbackRegistry([
new ArchitectTargetJobRegistry(_host, registry, this._jobCache, this._infoCache),
new ArchitectBuilderJobRegistry(_host, registry, this._jobCache, this._infoCache),
privateArchitectJobRegistry,
...(additionalJobRegistry ? [additionalJobRegistry] : []),
]);
this._scheduler = new core_1.experimental.jobs.SimpleScheduler(jobRegistry, registry);
}
has(name) {
return this._scheduler.has(name);
}
scheduleBuilder(name, options, scheduleOptions = {}) {
// The below will match 'project:target:configuration'
if (!/^[^:]+:[^:]+(:[^:]+)?$/.test(name)) {
throw new Error('Invalid builder name: ' + JSON.stringify(name));
}
return schedule_by_name_1.scheduleByName(name, options, {
scheduler: this._scheduler,
logger: scheduleOptions.logger || new core_1.logging.NullLogger(),
currentDirectory: this._host.getCurrentDirectory(),
workspaceRoot: this._host.getWorkspaceRoot(),
analytics: scheduleOptions.analytics,
});
}
scheduleTarget(target, overrides = {}, scheduleOptions = {}) {
return schedule_by_name_1.scheduleByTarget(target, overrides, {
scheduler: this._scheduler,
logger: scheduleOptions.logger || new core_1.logging.NullLogger(),
currentDirectory: this._host.getCurrentDirectory(),
workspaceRoot: this._host.getWorkspaceRoot(),
analytics: scheduleOptions.analytics,
});
}
}
exports.Architect = Architect;

View file

@ -0,0 +1,30 @@
export interface Schema {
/**
* Link to schema.
*/
$schema?: string;
builders: {
[key: string]: Builder;
};
}
/**
* Target options for Builders.
*/
export interface Builder {
/**
* The builder class module.
*/
class?: string;
/**
* Builder description.
*/
description: string;
/**
* The next generation builder module.
*/
implementation?: string;
/**
* Schema for builder option validation.
*/
schema: string;
}

View file

@ -0,0 +1,4 @@
"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 });

View file

@ -0,0 +1,62 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "BuildersSchema",
"title": "Builders schema for validating a list of builders.",
"type": "object",
"properties": {
"$schema": {
"type": "string",
"description": "Link to schema."
},
"builders": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/builder"
}
}
},
"required": ["builders"],
"definitions": {
"builder": {
"type": "object",
"description": "Target options for Builders.",
"allOf": [
{
"properties": {
"schema": {
"type": "string",
"description": "Schema for builder option validation."
},
"description": {
"type": "string",
"description": "Builder description."
}
},
"required": ["schema", "description"]
},
{
"anyOf": [
{
"properties": {
"implementation": {
"type": "string",
"description": "The next generation builder module."
}
},
"required": ["implementation"]
},
{
"properties": {
"class": {
"type": "string",
"description": "The builder class module."
}
},
"required": ["class"]
}
]
}
]
}
}
}

View 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
*/
import { json } from '@angular-devkit/core';
import { BuilderHandlerFn, BuilderOutput } from './api';
import { Builder } from './internal';
export declare function createBuilder<OptT = json.JsonObject, OutT extends BuilderOutput = BuilderOutput>(fn: BuilderHandlerFn<OptT>): Builder<OptT & json.JsonObject>;

Some files were not shown because too many files have changed in this diff Show more