@angular-builders/custom-esbuild 20.0.0-beta.0 → 20.1.0-beta.0
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 +34 -2
- package/builders.json +5 -0
- package/dist/application/index.d.ts +1 -1
- package/dist/application/schema.json +6 -4
- package/dist/custom-esbuild-schema.d.ts +5 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/load-plugins.d.ts +2 -2
- package/dist/load-plugins.js.map +1 -1
- package/dist/unit-test/index.d.ts +9 -0
- package/dist/unit-test/index.js +59 -0
- package/dist/unit-test/index.js.map +1 -0
- package/dist/unit-test/schema.json +155 -0
- package/package.json +9 -8
package/README.md
CHANGED
|
@@ -13,6 +13,8 @@ Allow customizing ESBuild configuration
|
|
|
13
13
|
- [Example](#example)
|
|
14
14
|
- [Custom ESBuild `dev-server`](#custom-esbuild-dev-server)
|
|
15
15
|
- [Example](#example)
|
|
16
|
+
- [Custom ESBuild `unit-test`](#custom-esbuild-unit-test)
|
|
17
|
+
- [Example](#example-1)
|
|
16
18
|
- [Index Transform](#index-transform)
|
|
17
19
|
- [Example](#example-2)
|
|
18
20
|
- [ES Modules (ESM) Support](#es-modules-esm-support)
|
|
@@ -46,7 +48,7 @@ Allow customizing ESBuild configuration
|
|
|
46
48
|
"architect": {
|
|
47
49
|
...
|
|
48
50
|
"[architect-target]": {
|
|
49
|
-
"builder": "@angular-builders/custom-esbuild:[application|dev-server]",
|
|
51
|
+
"builder": "@angular-builders/custom-esbuild:[application|dev-server|unit-test]",
|
|
50
52
|
"options": {
|
|
51
53
|
...
|
|
52
54
|
}
|
|
@@ -54,7 +56,7 @@ Allow customizing ESBuild configuration
|
|
|
54
56
|
Where:
|
|
55
57
|
- [project] is the name of the project to which you want to add the builder
|
|
56
58
|
- [architect-target] is the name of build target you want to run (build, serve, test etc. or any custom target)
|
|
57
|
-
- [application|dev-server] one of the supported builders - [application](#Custom-
|
|
59
|
+
- [application|dev-server|unit-test] one of the supported builders - [application](#Custom-esbuild-application), [dev-server](#Custom-esbuild-dev-server), or [unit-test](#Custom-esbuild-unit-test)
|
|
58
60
|
3. If `[architect-target]` is not one of the predefined targets (like build, serve, test etc.) then run it like this:
|
|
59
61
|
`ng run [project]:[architect-target]`
|
|
60
62
|
If it is one of the predefined targets, you can run it with `ng [architect-target]`
|
|
@@ -81,6 +83,7 @@ Allow customizing ESBuild configuration
|
|
|
81
83
|
|
|
82
84
|
- [@angular-builders/custom-esbuild:application](#Custom-esbuild-application)
|
|
83
85
|
- [@angular-builders/custom-esbuild:dev-server](#Custom-esbuild-dev-server)
|
|
86
|
+
- [@angular-builders/custom-esbuild:unit-test](#Custom-esbuild-unit-test)
|
|
84
87
|
|
|
85
88
|
## Custom ESBuild `application`
|
|
86
89
|
|
|
@@ -228,6 +231,35 @@ The `@angular-builders/custom-esbuild:dev-server` is an enhanced version of the
|
|
|
228
231
|
}
|
|
229
232
|
```
|
|
230
233
|
|
|
234
|
+
## Custom ESBuild `unit-test`
|
|
235
|
+
|
|
236
|
+
The `@angular-builders/custom-esbuild:unit-test` builder is an enhanced version of the `@angular/build:unit-test` builder that reuses your application ESBuild plugins during test execution. It reads the `plugins` from the referenced `:application` build target and runs the official unit test builder with those plugins applied.
|
|
237
|
+
There is no need to specify a `runner` option as the only supported test runner is Vitest.
|
|
238
|
+
|
|
239
|
+
### Example-1
|
|
240
|
+
|
|
241
|
+
`angular.json`:
|
|
242
|
+
|
|
243
|
+
```js
|
|
244
|
+
"architect": {
|
|
245
|
+
...
|
|
246
|
+
"build": {
|
|
247
|
+
"builder": "@angular-builders/custom-esbuild:application",
|
|
248
|
+
"options": {
|
|
249
|
+
"plugins": ["./esbuild/plugin-1.js"]
|
|
250
|
+
...
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"test": {
|
|
254
|
+
"builder": "@angular-builders/custom-esbuild:unit-test",
|
|
255
|
+
"options": {
|
|
256
|
+
"buildTarget": "my-project:build",
|
|
257
|
+
"tsConfig": "src/tsconfig.spec.json"
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
231
263
|
# Index Transform
|
|
232
264
|
|
|
233
265
|
Since Angular 8, `index.html` is not generated as part of the build. If you want to modify your `index.html`, you should use the `indexHtmlTransformer` option. `indexHtmlTransformer` is a path (relative to the workspace root) to a `.js` or `.ts` file that exports a transformation function for `index.html`. If `indexHtmlTransformer` is written in TypeScript, the application's `tsConfig` file will be used by `tsnode` for its execution:
|
package/builders.json
CHANGED
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
"implementation": "./dist/dev-server",
|
|
11
11
|
"schema": "./dist/dev-server/schema.json",
|
|
12
12
|
"description": "Build browser app extended with custom esbuild config"
|
|
13
|
+
},
|
|
14
|
+
"unit-test": {
|
|
15
|
+
"implementation": "./dist/unit-test",
|
|
16
|
+
"schema": "./dist/unit-test/schema.json",
|
|
17
|
+
"description": "Run unit test extended with custom esbuild config"
|
|
13
18
|
}
|
|
14
19
|
}
|
|
15
20
|
}
|
|
@@ -3,7 +3,7 @@ import { json } from '@angular-devkit/core';
|
|
|
3
3
|
import { CustomEsbuildApplicationSchema } from '../custom-esbuild-schema';
|
|
4
4
|
export declare function buildCustomEsbuildApplication(options: CustomEsbuildApplicationSchema, context: BuilderContext): import("rxjs").Observable<import("@angular-devkit/architect").BuilderOutput>;
|
|
5
5
|
declare const _default: import("@angular-devkit/architect").Builder<json.JsonObject & import("@angular/build").ApplicationBuilderOptions & {
|
|
6
|
-
plugins?:
|
|
6
|
+
plugins?: import("../custom-esbuild-schema").PluginConfig[];
|
|
7
7
|
indexHtmlTransformer?: string;
|
|
8
8
|
}>;
|
|
9
9
|
export default _default;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"properties": {
|
|
7
7
|
"assets": {
|
|
8
8
|
"type": "array",
|
|
9
|
-
"description": "
|
|
9
|
+
"description": "Define the assets to be copied to the output directory. These assets are copied as-is without any further processing or hashing.",
|
|
10
10
|
"default": [],
|
|
11
11
|
"items": {
|
|
12
12
|
"$ref": "#/definitions/assetPattern"
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
]
|
|
289
289
|
},
|
|
290
290
|
"loader": {
|
|
291
|
-
"description": "Defines the type of loader to use with a specified file extension when used with a JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content as a Uint8Array; `file` emits the file and provides the runtime location of the file; `empty` considers the content to be empty and not include it in bundles.",
|
|
291
|
+
"description": "Defines the type of loader to use with a specified file extension when used with a JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content as a Uint8Array; `file` emits the file and provides the runtime location of the file; `dataurl` inlines the content as a data URL with best guess of MIME type; `base64` inlines the content as a Base64-encoded string; `empty` considers the content to be empty and not include it in bundles.",
|
|
292
292
|
"type": "object",
|
|
293
293
|
"patternProperties": {
|
|
294
294
|
"^\\.\\S+$": {
|
|
@@ -296,6 +296,8 @@
|
|
|
296
296
|
"text",
|
|
297
297
|
"binary",
|
|
298
298
|
"file",
|
|
299
|
+
"dataurl",
|
|
300
|
+
"base64",
|
|
299
301
|
"empty"
|
|
300
302
|
]
|
|
301
303
|
}
|
|
@@ -467,7 +469,7 @@
|
|
|
467
469
|
},
|
|
468
470
|
"outputHashing": {
|
|
469
471
|
"type": "string",
|
|
470
|
-
"description": "Define the output filename cache-busting hashing mode.",
|
|
472
|
+
"description": "Define the output filename cache-busting hashing mode.\n\n- `none`: No hashing.\n- `all`: Hash for all output bundles. \n- `media`: Hash for all output media (e.g., images, fonts, etc. that are referenced in CSS files).\n- `bundles`: Hash for output of lazy and main bundles.",
|
|
471
473
|
"default": "none",
|
|
472
474
|
"enum": [
|
|
473
475
|
"none",
|
|
@@ -651,7 +653,7 @@
|
|
|
651
653
|
},
|
|
652
654
|
"outputMode": {
|
|
653
655
|
"type": "string",
|
|
654
|
-
"description": "Defines the build output
|
|
656
|
+
"description": "Defines the type of build output artifact. 'static': Generates a static site build artifact for deployment on any static hosting service. 'server': Generates a server application build artifact, required for applications using hybrid rendering or APIs.",
|
|
655
657
|
"enum": [
|
|
656
658
|
"static",
|
|
657
659
|
"server"
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { ApplicationBuilderOptions, DevServerBuilderOptions } from '@angular/build';
|
|
1
|
+
import { ApplicationBuilderOptions, DevServerBuilderOptions, UnitTestBuilderOptions } from '@angular/build';
|
|
2
2
|
export type PluginConfig = string | {
|
|
3
3
|
path: string;
|
|
4
4
|
options?: Record<string, unknown>;
|
|
5
5
|
};
|
|
6
6
|
export type CustomEsbuildApplicationSchema = ApplicationBuilderOptions & {
|
|
7
|
-
plugins?:
|
|
7
|
+
plugins?: PluginConfig[];
|
|
8
8
|
indexHtmlTransformer?: string;
|
|
9
9
|
};
|
|
10
10
|
export type CustomEsbuildDevServerSchema = DevServerBuilderOptions & {
|
|
11
11
|
middlewares?: string[];
|
|
12
12
|
};
|
|
13
|
+
export type CustomEsbuildUnitTestSchema = Omit<UnitTestBuilderOptions, 'runner'> & {
|
|
14
|
+
plugins?: PluginConfig[];
|
|
15
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./application"), exports);
|
|
18
18
|
__exportStar(require("./dev-server"), exports);
|
|
19
|
+
__exportStar(require("./unit-test"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,+CAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,+CAA6B;AAC7B,8CAA4B"}
|
package/dist/load-plugins.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Plugin } from 'esbuild';
|
|
2
2
|
import type { logging } from '@angular-devkit/core';
|
|
3
|
-
import { CustomEsbuildApplicationSchema, CustomEsbuildDevServerSchema, PluginConfig } from './custom-esbuild-schema';
|
|
3
|
+
import { CustomEsbuildApplicationSchema, CustomEsbuildDevServerSchema, CustomEsbuildUnitTestSchema, PluginConfig } from './custom-esbuild-schema';
|
|
4
4
|
import { Target } from '@angular-devkit/architect';
|
|
5
|
-
export declare function loadPlugins(pluginConfig: PluginConfig[] | undefined, workspaceRoot: string, tsConfig: string, logger: logging.LoggerApi, builderOptions: CustomEsbuildApplicationSchema | CustomEsbuildDevServerSchema, target: Target): Promise<Plugin[]>;
|
|
5
|
+
export declare function loadPlugins(pluginConfig: PluginConfig[] | undefined, workspaceRoot: string, tsConfig: string, logger: logging.LoggerApi, builderOptions: CustomEsbuildApplicationSchema | CustomEsbuildDevServerSchema | CustomEsbuildUnitTestSchema, target: Target): Promise<Plugin[]>;
|
package/dist/load-plugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-plugins.js","sourceRoot":"","sources":["../src/load-plugins.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"load-plugins.js","sourceRoot":"","sources":["../src/load-plugins.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,kCAoCC;AAhDD,gDAAkC;AAGlC,qDAAsD;AAS/C,KAAK,UAAU,WAAW,CAC/B,YAAwC,EACxC,aAAqB,EACrB,QAAgB,EAChB,MAAyB,EACzB,cAA2G,EAC3G,MAAc;IAEd,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAC,YAAY,EAAC,EAAE;QAC5C,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;YACrC,MAAM,gBAAgB,GAAG,MAAM,IAAA,mBAAU,EAOvC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC5D,IAAI,OAAO,gBAAgB,KAAK,UAAU,EAAE,CAAC;gBAC3C,OAAO,gBAAgB,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;YAClD,CAAC;iBAAM,CAAC;gBACN,OAAO,gBAAgB,CAAC;YAC1B,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,aAAa,GAAG,MAAM,IAAA,mBAAU,EACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,IAAI,CAAC,EAC3C,QAAQ,EACR,MAAM,CACP,CAAC;YACF,OAAO,aAAa,CAAC,YAAY,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;QACrE,CAAC;IACH,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BuilderContext } from '@angular-devkit/architect';
|
|
2
|
+
import { UnitTestBuilderOptions } from '@angular/build';
|
|
3
|
+
import { json } from '@angular-devkit/core';
|
|
4
|
+
import { CustomEsbuildUnitTestSchema } from '../custom-esbuild-schema';
|
|
5
|
+
export declare function executeCustomEsbuildUnitTestBuilder(options: CustomEsbuildUnitTestSchema, context: BuilderContext): import("rxjs").Observable<import("@angular-devkit/architect").BuilderOutput>;
|
|
6
|
+
declare const _default: import("@angular-devkit/architect").Builder<json.JsonObject & Omit<UnitTestBuilderOptions, "runner"> & {
|
|
7
|
+
plugins?: import("../custom-esbuild-schema").PluginConfig[];
|
|
8
|
+
}>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.executeCustomEsbuildUnitTestBuilder = executeCustomEsbuildUnitTestBuilder;
|
|
37
|
+
const path = __importStar(require("node:path"));
|
|
38
|
+
const architect_1 = require("@angular-devkit/architect");
|
|
39
|
+
const build_1 = require("@angular/build");
|
|
40
|
+
const core_1 = require("@angular-devkit/core");
|
|
41
|
+
const rxjs_1 = require("rxjs");
|
|
42
|
+
const load_plugins_1 = require("../load-plugins");
|
|
43
|
+
function executeCustomEsbuildUnitTestBuilder(options, context) {
|
|
44
|
+
if (Array.isArray(options.browsers) && !options.browsers.length) {
|
|
45
|
+
delete options.browsers;
|
|
46
|
+
}
|
|
47
|
+
const buildTarget = (0, architect_1.targetFromTargetString)(options.buildTarget);
|
|
48
|
+
async function getBuildTargetOptions() {
|
|
49
|
+
return (await context.getTargetOptions(buildTarget));
|
|
50
|
+
}
|
|
51
|
+
const workspaceRoot = (0, core_1.getSystemPath)((0, core_1.normalize)(context.workspaceRoot));
|
|
52
|
+
const tsConfig = path.join(workspaceRoot, options.tsConfig);
|
|
53
|
+
return (0, rxjs_1.from)(getBuildTargetOptions()).pipe((0, rxjs_1.switchMap)(async (buildOptions) => {
|
|
54
|
+
const codePlugins = await (0, load_plugins_1.loadPlugins)(buildOptions.plugins, workspaceRoot, tsConfig, context.logger, options, context.target);
|
|
55
|
+
return { codePlugins };
|
|
56
|
+
}), (0, rxjs_1.switchMap)(extensions => (0, build_1.executeUnitTestBuilder)({ ...options, runner: 'vitest' }, context, extensions)));
|
|
57
|
+
}
|
|
58
|
+
exports.default = (0, architect_1.createBuilder)(executeCustomEsbuildUnitTestBuilder);
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/unit-test/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,kFAwCC;AApDD,gDAAkC;AAClC,yDAAkG;AAClG,0CAAgF;AAChF,+CAAsE;AACtE,+BAAuC;AAEvC,kDAA8C;AAM9C,SAAgB,mCAAmC,CACjD,OAAoC,EACpC,OAAuB;IAEvB,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QAChE,OAAO,OAAO,CAAC,QAAQ,CAAC;IAC1B,CAAC;IAED,MAAM,WAAW,GAAG,IAAA,kCAAsB,EAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAEhE,KAAK,UAAU,qBAAqB;QAClC,OAAO,CAAC,MAAM,OAAO,CAAC,gBAAgB,CACpC,WAAW,CACZ,CAA8C,CAAC;IAClD,CAAC;IAED,MAAM,aAAa,GAAG,IAAA,oBAAa,EAAC,IAAA,gBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;IACtE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE5D,OAAO,IAAA,WAAI,EAAC,qBAAqB,EAAE,CAAC,CAAC,IAAI,CACvC,IAAA,gBAAS,EAAC,KAAK,EAAC,YAAY,EAAC,EAAE;QAC7B,MAAM,WAAW,GAAG,MAAM,IAAA,0BAAW,EACnC,YAAY,CAAC,OAAO,EACpB,aAAa,EACb,QAAQ,EACR,OAAO,CAAC,MAAM,EACd,OAAO,EACP,OAAO,CAAC,MAAM,CACf,CAAC;QAEF,OAAO,EAAE,WAAW,EAAE,CAAC;IACzB,CAAC,CAAC,EACF,IAAA,gBAAS,EAAC,UAAU,CAAC,EAAE,CACrB,IAAA,8BAAsB,EACpB,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,QAA4C,EAAE,EACpE,OAAO,EACP,UAAU,CACX,CACF,CACF,CAAC;AACJ,CAAC;AAED,kBAAe,IAAA,yBAAa,EAC1B,mCAAmC,CACpC,CAAC"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"title": "Custom application schema for Unit Test Facade",
|
|
4
|
+
"description": "Unit testing options for Angular applications.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"buildTarget": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "A build builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
|
|
10
|
+
"pattern": "^[^:\\s]*:[^:\\s]*(:[^\\s]+)?$"
|
|
11
|
+
},
|
|
12
|
+
"tsConfig": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The name of the TypeScript configuration file."
|
|
15
|
+
},
|
|
16
|
+
"browsers": {
|
|
17
|
+
"description": "A list of browsers to use for test execution. If undefined, jsdom on Node.js will be used instead of a browser. For Vitest and Karma, browser names ending with 'Headless' (e.g., 'ChromeHeadless') will enable headless mode for that browser.",
|
|
18
|
+
"type": "array",
|
|
19
|
+
"items": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"minItems": 1
|
|
23
|
+
},
|
|
24
|
+
"include": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
},
|
|
29
|
+
"default": [
|
|
30
|
+
"**/*.spec.ts"
|
|
31
|
+
],
|
|
32
|
+
"description": "Globs of files to include, relative to project root. \nThere are 2 special cases:\n - when a path to directory is provided, all spec files ending \".spec.@(ts|tsx)\" will be included\n - when a path to a file is provided, and a matching spec file exists it will be included instead."
|
|
33
|
+
},
|
|
34
|
+
"exclude": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"items": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
"default": [],
|
|
40
|
+
"description": "Globs of files to exclude, relative to the project root."
|
|
41
|
+
},
|
|
42
|
+
"watch": {
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"description": "Re-run tests when source files change. Defaults to `true` in TTY environments and `false` otherwise."
|
|
45
|
+
},
|
|
46
|
+
"debug": {
|
|
47
|
+
"type": "boolean",
|
|
48
|
+
"description": "Initialize the test runner to support using the Node Inspector for test debugging.",
|
|
49
|
+
"default": false
|
|
50
|
+
},
|
|
51
|
+
"codeCoverage": {
|
|
52
|
+
"type": "boolean",
|
|
53
|
+
"description": "Output a code coverage report.",
|
|
54
|
+
"default": false
|
|
55
|
+
},
|
|
56
|
+
"codeCoverageExclude": {
|
|
57
|
+
"type": "array",
|
|
58
|
+
"description": "Globs to exclude from code coverage.",
|
|
59
|
+
"items": {
|
|
60
|
+
"type": "string"
|
|
61
|
+
},
|
|
62
|
+
"default": []
|
|
63
|
+
},
|
|
64
|
+
"codeCoverageReporters": {
|
|
65
|
+
"type": "array",
|
|
66
|
+
"description": "Reporters to use for code coverage results.",
|
|
67
|
+
"items": {
|
|
68
|
+
"oneOf": [
|
|
69
|
+
{
|
|
70
|
+
"$ref": "#/definitions/coverage-reporters"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"type": "array",
|
|
74
|
+
"minItems": 1,
|
|
75
|
+
"maxItems": 2,
|
|
76
|
+
"items": [
|
|
77
|
+
{
|
|
78
|
+
"$ref": "#/definitions/coverage-reporters"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"type": "object"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"reporters": {
|
|
89
|
+
"type": "array",
|
|
90
|
+
"description": "Test runner reporters to use. Directly passed to the test runner.",
|
|
91
|
+
"items": {
|
|
92
|
+
"type": "string"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"providersFile": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"description": "TypeScript file that exports an array of Angular providers to use during test execution. The array must be a default export.",
|
|
98
|
+
"minLength": 1
|
|
99
|
+
},
|
|
100
|
+
"setupFiles": {
|
|
101
|
+
"type": "array",
|
|
102
|
+
"items": {
|
|
103
|
+
"type": "string"
|
|
104
|
+
},
|
|
105
|
+
"description": "A list of global setup and configuration files that are included before the test files. The application's polyfills are always included before these files. The Angular Testbed is also initialized prior to the execution of these files."
|
|
106
|
+
},
|
|
107
|
+
"plugins": {
|
|
108
|
+
"type": "array",
|
|
109
|
+
"description": "A list of paths to ESBuild plugins",
|
|
110
|
+
"default": [],
|
|
111
|
+
"items": {
|
|
112
|
+
"anyOf": [
|
|
113
|
+
{
|
|
114
|
+
"type": "string"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"type": "object",
|
|
118
|
+
"properties": {
|
|
119
|
+
"path": {
|
|
120
|
+
"type": "string"
|
|
121
|
+
},
|
|
122
|
+
"options": {
|
|
123
|
+
"type": "object"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"required": [
|
|
127
|
+
"path"
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"uniqueItems": true
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"additionalProperties": false,
|
|
136
|
+
"required": [
|
|
137
|
+
"buildTarget",
|
|
138
|
+
"tsConfig"
|
|
139
|
+
],
|
|
140
|
+
"definitions": {
|
|
141
|
+
"coverage-reporters": {
|
|
142
|
+
"enum": [
|
|
143
|
+
"html",
|
|
144
|
+
"lcov",
|
|
145
|
+
"lcovonly",
|
|
146
|
+
"text",
|
|
147
|
+
"text-summary",
|
|
148
|
+
"cobertura",
|
|
149
|
+
"json",
|
|
150
|
+
"json-summary"
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"$id": "UnitTestCustomApplicationSchema"
|
|
155
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-builders/custom-esbuild",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.1.0-beta.0",
|
|
4
4
|
"description": "Custom esbuild builders for Angular build facade. Allow to modify Angular build configuration without ejecting it",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -40,20 +40,21 @@
|
|
|
40
40
|
},
|
|
41
41
|
"builders": "builders.json",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@angular-builders/common": "4.0.0
|
|
44
|
-
"@angular-devkit/architect": ">=0.
|
|
45
|
-
"@angular-devkit/core": "^20.
|
|
46
|
-
"@angular/build": "^20.
|
|
43
|
+
"@angular-builders/common": "4.0.0",
|
|
44
|
+
"@angular-devkit/architect": ">=0.2001.0 < 0.2100.0",
|
|
45
|
+
"@angular-devkit/core": "^20.1.0",
|
|
46
|
+
"@angular/build": "^20.1.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@angular/compiler-cli": "^20.
|
|
49
|
+
"@angular/compiler-cli": "^20.1.0",
|
|
50
|
+
"vitest": ">=2"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
|
-
"esbuild": "0.25.
|
|
53
|
+
"esbuild": "0.25.9",
|
|
53
54
|
"jest": "29.7.0",
|
|
54
55
|
"rimraf": "^5.0.0",
|
|
55
56
|
"ts-node": "^10.0.0",
|
|
56
57
|
"typescript": "5.8.3"
|
|
57
58
|
},
|
|
58
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "0756041cfa2de2234ccb5a9129d332affaf60b7b"
|
|
59
60
|
}
|