@angular-devkit/build-angular 21.2.3 → 22.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/builders.json +0 -20
- package/package.json +22 -39
- package/src/builders/app-shell/index.js +2 -2
- package/src/builders/app-shell/index.js.map +1 -1
- package/src/builders/karma/index.js +1 -1
- package/src/builders/karma/index.js.map +1 -1
- package/src/builders/server/index.js +1 -0
- package/src/builders/server/index.js.map +1 -1
- package/src/builders/ssr-dev-server/utils.js +2 -6
- package/src/builders/ssr-dev-server/utils.js.map +1 -1
- package/src/index.d.ts +0 -1
- package/src/index.js +1 -3
- package/src/index.js.map +1 -1
- package/src/tools/webpack/utils/stats.js +1 -2
- package/src/tools/webpack/utils/stats.js.map +1 -1
- package/src/utils/index.d.ts +0 -1
- package/src/utils/index.js +0 -1
- package/src/utils/index.js.map +1 -1
- package/src/utils/normalize-asset-patterns.js +1 -1
- package/src/utils/normalize-asset-patterns.js.map +1 -1
- package/src/utils/normalize-cache.js +1 -1
- package/src/utils/process-bundle.js +5 -5
- package/src/utils/process-bundle.js.map +1 -1
- package/src/builders/jest/index.d.ts +0 -11
- package/src/builders/jest/index.js +0 -213
- package/src/builders/jest/index.js.map +0 -1
- package/src/builders/jest/init-test-bed.mjs +0 -24
- package/src/builders/jest/jest-global.mjs +0 -19
- package/src/builders/jest/jest.config.mjs +0 -11
- package/src/builders/jest/options.d.ts +0 -21
- package/src/builders/jest/options.js +0 -25
- package/src/builders/jest/options.js.map +0 -1
- package/src/builders/jest/schema.d.ts +0 -26
- package/src/builders/jest/schema.js +0 -5
- package/src/builders/jest/schema.js.map +0 -1
- package/src/builders/jest/schema.json +0 -44
- package/src/builders/protractor/index.d.ts +0 -16
- package/src/builders/protractor/index.js +0 -177
- package/src/builders/protractor/index.js.map +0 -1
- package/src/builders/protractor/schema.d.ts +0 -47
- package/src/builders/protractor/schema.js +0 -5
- package/src/builders/protractor/schema.js.map +0 -1
- package/src/builders/protractor/schema.json +0 -58
- package/src/builders/protractor-error/index.d.ts +0 -10
- package/src/builders/protractor-error/index.js +0 -15
- package/src/builders/protractor-error/index.js.map +0 -1
- package/src/builders/web-test-runner/builder-status-warnings.d.ts +0 -11
- package/src/builders/web-test-runner/builder-status-warnings.js +0 -46
- package/src/builders/web-test-runner/builder-status-warnings.js.map +0 -1
- package/src/builders/web-test-runner/index.d.ts +0 -10
- package/src/builders/web-test-runner/index.js +0 -162
- package/src/builders/web-test-runner/index.js.map +0 -1
- package/src/builders/web-test-runner/jasmine_runner.js +0 -91
- package/src/builders/web-test-runner/options.d.ts +0 -24
- package/src/builders/web-test-runner/options.js +0 -26
- package/src/builders/web-test-runner/options.js.map +0 -1
- package/src/builders/web-test-runner/schema.d.ts +0 -192
- package/src/builders/web-test-runner/schema.js +0 -16
- package/src/builders/web-test-runner/schema.js.map +0 -1
- package/src/builders/web-test-runner/schema.json +0 -297
- package/src/builders/web-test-runner/test_page.html +0 -40
- package/src/builders/web-test-runner/write-test-files.d.ts +0 -9
- package/src/builders/web-test-runner/write-test-files.js +0 -42
- package/src/builders/web-test-runner/write-test-files.js.map +0 -1
- package/src/utils/run-module-as-observable-fork.d.ts +0 -10
- package/src/utils/run-module-as-observable-fork.js +0 -78
- package/src/utils/run-module-as-observable-fork.js.map +0 -1
- package/src/utils/run-module-worker.js +0 -18
- package/src/utils/test-files.d.ts +0 -18
- package/src/utils/test-files.js +0 -32
- package/src/utils/test-files.js.map +0 -1
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
-
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
-
}
|
|
15
|
-
Object.defineProperty(o, k2, desc);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
-
var ownKeys = function(o) {
|
|
27
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
-
var ar = [];
|
|
29
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
-
return ar;
|
|
31
|
-
};
|
|
32
|
-
return ownKeys(o);
|
|
33
|
-
};
|
|
34
|
-
return function (mod) {
|
|
35
|
-
if (mod && mod.__esModule) return mod;
|
|
36
|
-
var result = {};
|
|
37
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
-
__setModuleDefault(result, mod);
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
|
-
})();
|
|
42
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
const private_1 = require("@angular/build/private");
|
|
44
|
-
const architect_1 = require("@angular-devkit/architect");
|
|
45
|
-
const node_child_process_1 = require("node:child_process");
|
|
46
|
-
const node_crypto_1 = require("node:crypto");
|
|
47
|
-
const fs = __importStar(require("node:fs/promises"));
|
|
48
|
-
const path = __importStar(require("node:path"));
|
|
49
|
-
const node_util_1 = require("node:util");
|
|
50
|
-
const color_1 = require("../../utils/color");
|
|
51
|
-
const test_files_1 = require("../../utils/test-files");
|
|
52
|
-
const schema_1 = require("../browser-esbuild/schema");
|
|
53
|
-
const write_test_files_1 = require("../web-test-runner/write-test-files");
|
|
54
|
-
const options_1 = require("./options");
|
|
55
|
-
const execFile = (0, node_util_1.promisify)(node_child_process_1.execFile);
|
|
56
|
-
/** Main execution function for the Jest builder. */
|
|
57
|
-
exports.default = (0, architect_1.createBuilder)(async (schema, context) => {
|
|
58
|
-
context.logger.warn('NOTE: The Jest builder is currently EXPERIMENTAL and will be removed in version 22.');
|
|
59
|
-
const options = (0, options_1.normalizeOptions)(schema);
|
|
60
|
-
const testOut = path.join(context.workspaceRoot, 'dist/test-out', (0, node_crypto_1.randomUUID)()); // TODO(dgp1130): Hide in temp directory.
|
|
61
|
-
// Verify Jest installation and get the path to it's binary.
|
|
62
|
-
// We need to `node_modules/.bin/jest`, but there is no means to resolve that directly. Fortunately Jest's `package.json` exports the
|
|
63
|
-
// same file at `bin/jest`, so we can just resolve that instead.
|
|
64
|
-
const jest = resolveModule('jest/bin/jest');
|
|
65
|
-
if (!jest) {
|
|
66
|
-
return {
|
|
67
|
-
success: false,
|
|
68
|
-
// TODO(dgp1130): Display a more accurate message for non-NPM users.
|
|
69
|
-
error: 'Jest is not installed, most likely you need to run `npm install jest --save-dev` in your project.',
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
// Verify that JSDom is installed in the project.
|
|
73
|
-
const environment = resolveModule('jest-environment-jsdom');
|
|
74
|
-
if (!environment) {
|
|
75
|
-
return {
|
|
76
|
-
success: false,
|
|
77
|
-
// TODO(dgp1130): Display a more accurate message for non-NPM users.
|
|
78
|
-
error: '`jest-environment-jsdom` is not installed. Install it with `npm install jest-environment-jsdom --save-dev`.',
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
const [testFiles, customConfig] = await Promise.all([
|
|
82
|
-
(0, test_files_1.findTestFiles)(options.include, options.exclude, context.workspaceRoot),
|
|
83
|
-
findCustomJestConfig(context.workspaceRoot),
|
|
84
|
-
]);
|
|
85
|
-
// Warn if a custom Jest configuration is found. We won't use it, so if a developer is trying to use a custom config, this hopefully
|
|
86
|
-
// makes a better experience than silently ignoring the configuration.
|
|
87
|
-
// Ideally, this would be a hard error. However a Jest config could exist for testing other files in the workspace outside of Angular
|
|
88
|
-
// CLI, so we likely can't produce a hard error in this situation without an opt-out.
|
|
89
|
-
if (customConfig) {
|
|
90
|
-
context.logger.warn('A custom Jest config was found, but this is not supported by `@angular-devkit/build-angular:jest` and will be' +
|
|
91
|
-
` ignored: ${customConfig}. This is an experiment to see if completely abstracting away Jest's configuration is viable. Please` +
|
|
92
|
-
` consider if your use case can be met without directly modifying the Jest config. If this is a major obstacle for your use` +
|
|
93
|
-
` case, please post it in this issue so we can collect feedback and evaluate: https://github.com/angular/angular-cli/issues/25434.`);
|
|
94
|
-
}
|
|
95
|
-
// Build all the test files.
|
|
96
|
-
const jestGlobal = path.join(__dirname, 'jest-global.mjs');
|
|
97
|
-
const initTestBed = path.join(__dirname, 'init-test-bed.mjs');
|
|
98
|
-
const buildResult = await first((0, private_1.buildApplicationInternal)({
|
|
99
|
-
// Build all the test files and also the `jest-global` and `init-test-bed` scripts.
|
|
100
|
-
entryPoints: new Set([...testFiles, jestGlobal, initTestBed]),
|
|
101
|
-
tsConfig: options.tsConfig,
|
|
102
|
-
polyfills: options.polyfills ?? ['zone.js', 'zone.js/testing'],
|
|
103
|
-
outputPath: testOut,
|
|
104
|
-
aot: options.aot,
|
|
105
|
-
index: false,
|
|
106
|
-
outputHashing: schema_1.OutputHashing.None,
|
|
107
|
-
outExtension: 'mjs', // Force native ESM.
|
|
108
|
-
optimization: false,
|
|
109
|
-
sourceMap: {
|
|
110
|
-
scripts: true,
|
|
111
|
-
styles: false,
|
|
112
|
-
vendor: false,
|
|
113
|
-
},
|
|
114
|
-
}, context));
|
|
115
|
-
if (buildResult.kind === private_1.ResultKind.Failure) {
|
|
116
|
-
return { success: false };
|
|
117
|
-
}
|
|
118
|
-
else if (buildResult.kind !== private_1.ResultKind.Full) {
|
|
119
|
-
return {
|
|
120
|
-
success: false,
|
|
121
|
-
error: 'A full build result is required from the application builder.',
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
// Write test files
|
|
125
|
-
await (0, write_test_files_1.writeTestFiles)(buildResult.files, testOut);
|
|
126
|
-
// Execute Jest on the built output directory.
|
|
127
|
-
const jestProc = execFile(process.execPath, [
|
|
128
|
-
'--experimental-vm-modules',
|
|
129
|
-
jest,
|
|
130
|
-
`--rootDir=${testOut}`,
|
|
131
|
-
`--config=${path.join(__dirname, 'jest.config.mjs')}`,
|
|
132
|
-
'--testEnvironment=jsdom',
|
|
133
|
-
// TODO(dgp1130): Enable cache once we have a mechanism for properly clearing / disabling it.
|
|
134
|
-
'--no-cache',
|
|
135
|
-
// Run basically all files in the output directory, any excluded files were already dropped by the build.
|
|
136
|
-
`--testMatch="<rootDir>/**/*.mjs"`,
|
|
137
|
-
// Load polyfills and initialize the environment before executing each test file.
|
|
138
|
-
// IMPORTANT: Order matters here.
|
|
139
|
-
// First, we execute `jest-global.mjs` to initialize the `jest` global variable.
|
|
140
|
-
// Second, we execute user polyfills, including `zone.js` and `zone.js/testing`. This is dependent on the Jest global so it can patch
|
|
141
|
-
// the environment for fake async to work correctly.
|
|
142
|
-
// Third, we initialize `TestBed`. This is dependent on fake async being set up correctly beforehand.
|
|
143
|
-
`--setupFilesAfterEnv="<rootDir>/jest-global.mjs"`,
|
|
144
|
-
...(options.polyfills?.length ? [`--setupFilesAfterEnv="<rootDir>/polyfills.mjs"`] : []),
|
|
145
|
-
`--setupFilesAfterEnv="<rootDir>/init-test-bed.mjs"`,
|
|
146
|
-
// Don't run any infrastructure files as tests, they are manually loaded where needed.
|
|
147
|
-
`--testPathIgnorePatterns="<rootDir>/jest-global\\.mjs"`,
|
|
148
|
-
...(options.polyfills ? [`--testPathIgnorePatterns="<rootDir>/polyfills\\.mjs"`] : []),
|
|
149
|
-
`--testPathIgnorePatterns="<rootDir>/init-test-bed\\.mjs"`,
|
|
150
|
-
// Skip shared chunks, as they are not entry points to tests.
|
|
151
|
-
`--testPathIgnorePatterns="<rootDir>/chunk-.*\\.mjs"`,
|
|
152
|
-
// Optionally enable color.
|
|
153
|
-
...(color_1.colors.enabled ? ['--colors'] : []),
|
|
154
|
-
]);
|
|
155
|
-
// Stream test output to the terminal.
|
|
156
|
-
jestProc.child.stdout?.on('data', (chunk) => {
|
|
157
|
-
context.logger.info(chunk);
|
|
158
|
-
});
|
|
159
|
-
jestProc.child.stderr?.on('data', (chunk) => {
|
|
160
|
-
// Write to stderr directly instead of `context.logger.error(chunk)` because the logger will overwrite Jest's coloring information.
|
|
161
|
-
process.stderr.write(chunk);
|
|
162
|
-
});
|
|
163
|
-
try {
|
|
164
|
-
await jestProc;
|
|
165
|
-
}
|
|
166
|
-
catch (error) {
|
|
167
|
-
// No need to propagate error message, already piped to terminal output.
|
|
168
|
-
// TODO(dgp1130): Handle process spawning failures.
|
|
169
|
-
return { success: false };
|
|
170
|
-
}
|
|
171
|
-
return { success: true };
|
|
172
|
-
});
|
|
173
|
-
/** Returns the first item yielded by the given generator and cancels the execution. */
|
|
174
|
-
async function first(generator) {
|
|
175
|
-
for await (const value of generator) {
|
|
176
|
-
return value;
|
|
177
|
-
}
|
|
178
|
-
throw new Error('Expected generator to emit at least once.');
|
|
179
|
-
}
|
|
180
|
-
/** Safely resolves the given Node module string. */
|
|
181
|
-
function resolveModule(module) {
|
|
182
|
-
try {
|
|
183
|
-
return require.resolve(module);
|
|
184
|
-
}
|
|
185
|
-
catch {
|
|
186
|
-
return undefined;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
/** Returns whether or not the provided directory includes a Jest configuration file. */
|
|
190
|
-
async function findCustomJestConfig(dir) {
|
|
191
|
-
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
192
|
-
// Jest supports many file extensions (`js`, `ts`, `cjs`, `cts`, `json`, etc.) Just look
|
|
193
|
-
// for anything with that prefix.
|
|
194
|
-
const config = entries.find((entry) => entry.isFile() && entry.name.startsWith('jest.config.'));
|
|
195
|
-
if (config) {
|
|
196
|
-
return path.join(dir, config.name);
|
|
197
|
-
}
|
|
198
|
-
// Jest also supports a `jest` key in `package.json`, look for a config there.
|
|
199
|
-
const packageJsonPath = path.join(dir, 'package.json');
|
|
200
|
-
let packageJson;
|
|
201
|
-
try {
|
|
202
|
-
packageJson = await fs.readFile(packageJsonPath, 'utf8');
|
|
203
|
-
}
|
|
204
|
-
catch {
|
|
205
|
-
return undefined; // No package.json, therefore no Jest configuration in it.
|
|
206
|
-
}
|
|
207
|
-
const json = JSON.parse(packageJson);
|
|
208
|
-
if ('jest' in json) {
|
|
209
|
-
return packageJsonPath;
|
|
210
|
-
}
|
|
211
|
-
return undefined;
|
|
212
|
-
}
|
|
213
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oDAA8E;AAC9E,yDAAyF;AACzF,2DAA4D;AAC5D,6CAAyC;AACzC,qDAAuC;AACvC,gDAAkC;AAClC,yCAAsC;AACtC,6CAA2C;AAC3C,uDAAuD;AACvD,sDAA0D;AAC1D,0EAAqE;AACrE,uCAA6C;AAG7C,MAAM,QAAQ,GAAG,IAAA,qBAAS,EAAC,6BAAU,CAAC,CAAC;AAEvC,oDAAoD;AACpD,kBAAe,IAAA,yBAAa,EAC1B,KAAK,EAAE,MAAyB,EAAE,OAAuB,EAA0B,EAAE;IACnF,OAAO,CAAC,MAAM,CAAC,IAAI,CACjB,qFAAqF,CACtF,CAAC;IAEF,MAAM,OAAO,GAAG,IAAA,0BAAgB,EAAC,MAAM,CAAC,CAAC;IACzC,M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;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
// TODO(dgp1130): These imports likely don't resolve in stricter package environments like `pnpm`, since they are resolved relative to
|
|
10
|
-
// `@angular-devkit/build-angular` rather than the user's workspace. Should look into virtual modules to support those use cases.
|
|
11
|
-
|
|
12
|
-
import { NgModule, provideZoneChangeDetection } from '@angular/core';
|
|
13
|
-
import { getTestBed } from '@angular/core/testing';
|
|
14
|
-
import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';
|
|
15
|
-
|
|
16
|
-
@NgModule({
|
|
17
|
-
providers: [typeof window.Zone !== 'undefined' ? provideZoneChangeDetection() : []],
|
|
18
|
-
})
|
|
19
|
-
class TestModule {}
|
|
20
|
-
|
|
21
|
-
getTestBed().initTestEnvironment([BrowserTestingModule, TestModule], platformBrowserTesting(), {
|
|
22
|
-
errorOnUnknownElements: true,
|
|
23
|
-
errorOnUnknownProperties: true,
|
|
24
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @fileoverview Zone.js requires the `jest` global to be initialized in order to know that it must patch the environment to support Jest
|
|
11
|
-
* execution. When running ESM code, Jest does _not_ inject the global `jest` symbol, so Zone.js would not normally know it is running
|
|
12
|
-
* within Jest as users are supposed to import from `@jest/globals` or use `import.meta.jest`. Zone.js is not currently aware of this, so we
|
|
13
|
-
* manually set this global to get Zone.js to run correctly.
|
|
14
|
-
*
|
|
15
|
-
* TODO(dgp1130): Update Zone.js to directly support Jest ESM executions so we can drop this.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
// eslint-disable-next-line no-undef
|
|
19
|
-
globalThis.jest = import.meta.jest;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
// Empty config file, everything is specified via CLI options right now.
|
|
10
|
-
// This file is used just so Jest doesn't accidentally inherit a custom user-specified Jest config.
|
|
11
|
-
export default {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
-
*/
|
|
8
|
-
import { Schema as JestBuilderSchema } from './schema';
|
|
9
|
-
/**
|
|
10
|
-
* Options supported for the Jest builder. The schema is an approximate
|
|
11
|
-
* representation of the options type, but this is a more precise version.
|
|
12
|
-
*/
|
|
13
|
-
export type JestBuilderOptions = JestBuilderSchema & {
|
|
14
|
-
include: string[];
|
|
15
|
-
exclude: string[];
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Normalizes input options validated by the schema to a more precise and useful
|
|
19
|
-
* options type in {@link JestBuilderOptions}.
|
|
20
|
-
*/
|
|
21
|
-
export declare function normalizeOptions(schema: JestBuilderSchema): JestBuilderOptions;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.normalizeOptions = normalizeOptions;
|
|
11
|
-
/**
|
|
12
|
-
* Normalizes input options validated by the schema to a more precise and useful
|
|
13
|
-
* options type in {@link JestBuilderOptions}.
|
|
14
|
-
*/
|
|
15
|
-
function normalizeOptions(schema) {
|
|
16
|
-
return {
|
|
17
|
-
// Options with default values can't actually be null, even if the types say so.
|
|
18
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
19
|
-
include: schema.include,
|
|
20
|
-
exclude: schema.exclude,
|
|
21
|
-
/* eslint-enable @typescript-eslint/no-non-null-assertion */
|
|
22
|
-
...schema,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=options.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["options.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAiBH,4CAUC;AAdD;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,MAAyB;IACxD,OAAO;QACL,gFAAgF;QAChF,6DAA6D;QAC7D,OAAO,EAAE,MAAM,CAAC,OAAQ;QACxB,OAAO,EAAE,MAAM,CAAC,OAAQ;QACxB,4DAA4D;QAE5D,GAAG,MAAM;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Jest target options
|
|
3
|
-
*/
|
|
4
|
-
export type Schema = {
|
|
5
|
-
/**
|
|
6
|
-
* Run tests using Ahead of Time compilation.
|
|
7
|
-
*/
|
|
8
|
-
aot?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Globs of files to exclude, relative to the project root.
|
|
11
|
-
*/
|
|
12
|
-
exclude?: string[];
|
|
13
|
-
/**
|
|
14
|
-
* Globs of files to include, relative to project root.
|
|
15
|
-
*/
|
|
16
|
-
include?: string[];
|
|
17
|
-
/**
|
|
18
|
-
* A list of polyfills to include in the build. Can be a full path for a file, relative to
|
|
19
|
-
* the current workspace or module specifier. Example: 'zone.js'.
|
|
20
|
-
*/
|
|
21
|
-
polyfills?: string[];
|
|
22
|
-
/**
|
|
23
|
-
* The name of the TypeScript configuration file.
|
|
24
|
-
*/
|
|
25
|
-
tsConfig: string;
|
|
26
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
|
3
|
-
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";AACA,mFAAmF;AACnF,oFAAoF"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"title": "Jest browser schema for Build Facade.",
|
|
4
|
-
"description": "Jest target options",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"include": {
|
|
8
|
-
"type": "array",
|
|
9
|
-
"items": {
|
|
10
|
-
"type": "string"
|
|
11
|
-
},
|
|
12
|
-
"default": ["**/*.spec.ts"],
|
|
13
|
-
"description": "Globs of files to include, relative to project root."
|
|
14
|
-
},
|
|
15
|
-
"exclude": {
|
|
16
|
-
"type": "array",
|
|
17
|
-
"items": {
|
|
18
|
-
"type": "string"
|
|
19
|
-
},
|
|
20
|
-
"default": [],
|
|
21
|
-
"description": "Globs of files to exclude, relative to the project root."
|
|
22
|
-
},
|
|
23
|
-
"tsConfig": {
|
|
24
|
-
"type": "string",
|
|
25
|
-
"description": "The name of the TypeScript configuration file."
|
|
26
|
-
},
|
|
27
|
-
"polyfills": {
|
|
28
|
-
"type": "array",
|
|
29
|
-
"description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
|
|
30
|
-
"items": {
|
|
31
|
-
"type": "string",
|
|
32
|
-
"uniqueItems": true
|
|
33
|
-
},
|
|
34
|
-
"default": []
|
|
35
|
-
},
|
|
36
|
-
"aot": {
|
|
37
|
-
"type": "boolean",
|
|
38
|
-
"description": "Run tests using Ahead of Time compilation.",
|
|
39
|
-
"default": false
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"additionalProperties": false,
|
|
43
|
-
"required": ["tsConfig"]
|
|
44
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
-
*/
|
|
8
|
-
import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
|
|
9
|
-
import { Schema as ProtractorBuilderOptions } from './schema';
|
|
10
|
-
export type { ProtractorBuilderOptions };
|
|
11
|
-
/**
|
|
12
|
-
* @experimental Direct usage of this function is considered experimental.
|
|
13
|
-
*/
|
|
14
|
-
export declare function execute(options: ProtractorBuilderOptions, context: BuilderContext): Promise<BuilderOutput>;
|
|
15
|
-
declare const _default: import("@angular-devkit/architect").Builder<ProtractorBuilderOptions & import("@angular-devkit/core").JsonObject>;
|
|
16
|
-
export default _default;
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
-
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
-
}
|
|
15
|
-
Object.defineProperty(o, k2, desc);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
-
var ownKeys = function(o) {
|
|
27
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
-
var ar = [];
|
|
29
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
-
return ar;
|
|
31
|
-
};
|
|
32
|
-
return ownKeys(o);
|
|
33
|
-
};
|
|
34
|
-
return function (mod) {
|
|
35
|
-
if (mod && mod.__esModule) return mod;
|
|
36
|
-
var result = {};
|
|
37
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
-
__setModuleDefault(result, mod);
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
|
-
})();
|
|
42
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.execute = execute;
|
|
44
|
-
const architect_1 = require("@angular-devkit/architect");
|
|
45
|
-
const core_1 = require("@angular-devkit/core");
|
|
46
|
-
const node_path_1 = require("node:path");
|
|
47
|
-
const url = __importStar(require("node:url"));
|
|
48
|
-
const utils_1 = require("../../utils");
|
|
49
|
-
const error_1 = require("../../utils/error");
|
|
50
|
-
function runProtractor(root, options) {
|
|
51
|
-
const additionalProtractorConfig = {
|
|
52
|
-
baseUrl: options.baseUrl,
|
|
53
|
-
specs: options.specs && options.specs.length ? options.specs : undefined,
|
|
54
|
-
suite: options.suite,
|
|
55
|
-
jasmineNodeOpts: {
|
|
56
|
-
grep: options.grep,
|
|
57
|
-
invertGrep: options.invertGrep,
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
// TODO: Protractor manages process.exit itself, so this target will allways quit the
|
|
61
|
-
// process. To work around this we run it in a subprocess.
|
|
62
|
-
// https://github.com/angular/protractor/issues/4160
|
|
63
|
-
return (0, utils_1.runModuleAsObservableFork)(root, 'protractor/built/launcher', 'init', [
|
|
64
|
-
(0, node_path_1.resolve)(root, options.protractorConfig),
|
|
65
|
-
additionalProtractorConfig,
|
|
66
|
-
]).toPromise();
|
|
67
|
-
}
|
|
68
|
-
async function updateWebdriver() {
|
|
69
|
-
// The webdriver-manager update command can only be accessed via a deep import.
|
|
70
|
-
const webdriverDeepImport = 'webdriver-manager/built/lib/cmds/update';
|
|
71
|
-
let path;
|
|
72
|
-
try {
|
|
73
|
-
const protractorPath = require.resolve('protractor');
|
|
74
|
-
path = require.resolve(webdriverDeepImport, { paths: [protractorPath] });
|
|
75
|
-
}
|
|
76
|
-
catch (error) {
|
|
77
|
-
(0, error_1.assertIsError)(error);
|
|
78
|
-
if (error.code !== 'MODULE_NOT_FOUND') {
|
|
79
|
-
throw error;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
if (!path) {
|
|
83
|
-
throw new Error(core_1.tags.stripIndents `
|
|
84
|
-
Cannot automatically find webdriver-manager to update.
|
|
85
|
-
Update webdriver-manager manually and run 'ng e2e --no-webdriver-update' instead.
|
|
86
|
-
`);
|
|
87
|
-
}
|
|
88
|
-
const webdriverUpdate = await Promise.resolve(`${path}`).then(s => __importStar(require(s)));
|
|
89
|
-
// const webdriverUpdate = await import(path) as typeof import ('webdriver-manager/built/lib/cmds/update');
|
|
90
|
-
// run `webdriver-manager update --standalone false --gecko false --quiet`
|
|
91
|
-
// if you change this, update the command comment in prev line
|
|
92
|
-
return webdriverUpdate.program.run({
|
|
93
|
-
standalone: false,
|
|
94
|
-
gecko: false,
|
|
95
|
-
quiet: true,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* @experimental Direct usage of this function is considered experimental.
|
|
100
|
-
*/
|
|
101
|
-
async function execute(options, context) {
|
|
102
|
-
context.logger.warn('Protractor has reached end-of-life and is no longer supported by the Angular team. The `protractor` builder will be removed in a future Angular major version. For additional information and alternatives, please see https://blog.angular.dev/protractor-deprecation-update-august-2023-2beac7402ce0.');
|
|
103
|
-
// ensure that only one of these options is used
|
|
104
|
-
if (options.devServerTarget && options.baseUrl) {
|
|
105
|
-
throw new Error(core_1.tags.stripIndents `
|
|
106
|
-
The 'baseUrl' option cannot be used with 'devServerTarget'.
|
|
107
|
-
When present, 'devServerTarget' will be used to automatically setup 'baseUrl' for Protractor.
|
|
108
|
-
`);
|
|
109
|
-
}
|
|
110
|
-
if (options.webdriverUpdate) {
|
|
111
|
-
await updateWebdriver();
|
|
112
|
-
}
|
|
113
|
-
let baseUrl = options.baseUrl;
|
|
114
|
-
let server;
|
|
115
|
-
try {
|
|
116
|
-
if (options.devServerTarget) {
|
|
117
|
-
const target = (0, architect_1.targetFromTargetString)(options.devServerTarget);
|
|
118
|
-
const serverOptions = await context.getTargetOptions(target);
|
|
119
|
-
const overrides = {
|
|
120
|
-
watch: false,
|
|
121
|
-
liveReload: false,
|
|
122
|
-
};
|
|
123
|
-
if (options.host !== undefined) {
|
|
124
|
-
overrides.host = options.host;
|
|
125
|
-
}
|
|
126
|
-
else if (typeof serverOptions.host === 'string') {
|
|
127
|
-
options.host = serverOptions.host;
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
options.host = overrides.host = 'localhost';
|
|
131
|
-
}
|
|
132
|
-
if (options.port !== undefined) {
|
|
133
|
-
overrides.port = options.port;
|
|
134
|
-
}
|
|
135
|
-
else if (typeof serverOptions.port === 'number') {
|
|
136
|
-
options.port = serverOptions.port;
|
|
137
|
-
}
|
|
138
|
-
server = await context.scheduleTarget(target, overrides);
|
|
139
|
-
const result = await server.result;
|
|
140
|
-
if (!result.success) {
|
|
141
|
-
return { success: false };
|
|
142
|
-
}
|
|
143
|
-
if (typeof serverOptions.publicHost === 'string') {
|
|
144
|
-
let publicHost = serverOptions.publicHost;
|
|
145
|
-
if (!/^\w+:\/\//.test(publicHost)) {
|
|
146
|
-
publicHost = `${serverOptions.ssl ? 'https' : 'http'}://${publicHost}`;
|
|
147
|
-
}
|
|
148
|
-
const clientUrl = url.parse(publicHost);
|
|
149
|
-
baseUrl = url.format(clientUrl);
|
|
150
|
-
}
|
|
151
|
-
else if (typeof result.baseUrl === 'string') {
|
|
152
|
-
baseUrl = result.baseUrl;
|
|
153
|
-
}
|
|
154
|
-
else if (typeof result.port === 'number') {
|
|
155
|
-
baseUrl = url.format({
|
|
156
|
-
protocol: serverOptions.ssl ? 'https' : 'http',
|
|
157
|
-
hostname: options.host,
|
|
158
|
-
port: result.port.toString(),
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
// Like the baseUrl in protractor config file when using the API we need to add
|
|
163
|
-
// a trailing slash when provide to the baseUrl.
|
|
164
|
-
if (baseUrl && !baseUrl.endsWith('/')) {
|
|
165
|
-
baseUrl += '/';
|
|
166
|
-
}
|
|
167
|
-
return await runProtractor(context.workspaceRoot, { ...options, baseUrl });
|
|
168
|
-
}
|
|
169
|
-
catch {
|
|
170
|
-
return { success: false };
|
|
171
|
-
}
|
|
172
|
-
finally {
|
|
173
|
-
await server?.stop();
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
exports.default = (0, architect_1.createBuilder)(execute);
|
|
177
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFH,0BAmFC;AApKD,yDAKmC;AACnC,+CAA4C;AAC5C,yCAAoC;AACpC,8CAAgC;AAChC,uCAAwD;AACxD,6CAAkD;AAWlD,SAAS,aAAa,CAAC,IAAY,EAAE,OAAiC;IACpE,MAAM,0BAA0B,GAAiE;QAC/F,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QACxE,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,eAAe,EAAE;YACf,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF,CAAC;IAEF,qFAAqF;IACrF,0DAA0D;IAC1D,oDAAoD;IACpD,OAAO,IAAA,iCAAyB,EAAC,IAAI,EAAE,2BAA2B,EAAE,MAAM,EAAE;QAC1E,IAAA,mBAAO,EAAC,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC;QACvC,0BAA0B;KAC3B,CAAC,CAAC,SAAS,EAA4B,CAAC;AAC3C,CAAC;AAED,KAAK,UAAU,eAAe;IAC5B,+EAA+E;IAC/E,MAAM,mBAAmB,GAAG,yCAAyC,CAAC;IAEtE,IAAI,IAAI,CAAC;IACT,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAErD,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,KAAK,EAAE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