@ng-doc/builder 22.0.0-beta.1 → 22.0.0-beta.2
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/application/index.js +5 -0
- package/application/index.js.map +1 -1
- package/application/schema.json +10 -2
- package/engine/build-ng-doc.js +1 -16
- package/engine/build-ng-doc.js.map +1 -1
- package/engine/builders/shared/entry.builder.js +1 -13
- package/engine/builders/shared/entry.builder.js.map +1 -1
- package/engine/core/operators/entries-emitter.js +2 -6
- package/engine/core/operators/entries-emitter.js.map +1 -1
- package/engine/core/stores/index.d.ts +0 -1
- package/engine/core/stores/index.js +0 -1
- package/engine/core/stores/index.js.map +1 -1
- package/engine/core/watcher/watch.js +19 -1
- package/engine/core/watcher/watch.js.map +1 -1
- package/engine/variables.d.ts +1 -0
- package/engine/variables.js +1 -0
- package/engine/variables.js.map +1 -1
- package/interfaces/schema.d.ts +1 -0
- package/package.json +6 -6
- package/engine/core/stores/entry-status.d.ts +0 -23
- package/engine/core/stores/entry-status.js +0 -36
- package/engine/core/stores/entry-status.js.map +0 -1
package/application/index.js
CHANGED
|
@@ -7,6 +7,7 @@ const rxjs_1 = require("rxjs");
|
|
|
7
7
|
const operators_1 = require("rxjs/operators");
|
|
8
8
|
const build_ng_doc_1 = require("../engine/build-ng-doc");
|
|
9
9
|
const transform_index_html_1 = require("../engine/transform-index-html");
|
|
10
|
+
const variables_1 = require("../engine/variables");
|
|
10
11
|
const create_builder_context_1 = require("../helpers/create-builder-context");
|
|
11
12
|
/**
|
|
12
13
|
* Attach NgDocWebpackPlugin before Angular Plugins
|
|
@@ -22,6 +23,10 @@ async function runBrowser(options, context) {
|
|
|
22
23
|
? await context.getTargetOptions(browserTarget)
|
|
23
24
|
: options;
|
|
24
25
|
const builderContext = (0, create_builder_context_1.createBuilderContext)(targetOptions, context, options.ngDoc?.config);
|
|
26
|
+
// In a one-shot build there is nothing to watch, and the file watcher would
|
|
27
|
+
// crawl the whole workspace only to be torn down right after the first build,
|
|
28
|
+
// potentially keeping the process alive (see #333)
|
|
29
|
+
variables_1.GLOBALS.watch = !!options.watch;
|
|
25
30
|
const runner = (0, build_ng_doc_1.buildNgDoc)(builderContext);
|
|
26
31
|
await (0, rxjs_1.firstValueFrom)(runner.pipe((0, operators_1.first)()));
|
|
27
32
|
return (0, rxjs_1.firstValueFrom)((0, architect_1.fromAsyncIterable)((0, build_angular_1.buildApplication)(options, context, { indexHtmlTransformer: transform_index_html_1.transformIndexHtml })));
|
package/application/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/builder/application/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/builder/application/index.ts"],"names":[],"mappings":";;AAuBA,gCA2BC;AAlDD,yDAMmC;AACnC,iEAAiE;AACjE,+BAAkD;AAClD,8CAAuC;AAEvC,yDAAoD;AACpD,yEAAoE;AACpE,mDAA8C;AAC9C,8EAAyE;AAGzE;;;;;GAKG;AACI,KAAK,UAAU,UAAU,CAAC,OAAoB,EAAE,OAAuB;IAC5E,MAAM,aAAa,GAAkB,OAAO,CAAC,WAAW;QACtD,CAAC,CAAC,IAAA,kCAAsB,EAAC,OAAO,CAAC,WAAW,CAAC;QAC7C,CAAC,CAAC,IAAI,CAAC;IACT,MAAM,aAAa,GAAQ,aAAa;QACtC,CAAC,CAAC,MAAM,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC;QAC/C,CAAC,CAAE,OAAe,CAAC;IACrB,MAAM,cAAc,GAAwB,IAAA,6CAAoB,EAC9D,aAAa,EACb,OAAO,EACP,OAAO,CAAC,KAAK,EAAE,MAAM,CACtB,CAAC;IAEF,4EAA4E;IAC5E,8EAA8E;IAC9E,mDAAmD;IACnD,mBAAO,CAAC,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IAEhC,MAAM,MAAM,GAAqB,IAAA,yBAAU,EAAC,cAAc,CAAC,CAAC;IAE5D,MAAM,IAAA,qBAAc,EAAC,MAAM,CAAC,IAAI,CAAC,IAAA,iBAAK,GAAE,CAAC,CAAC,CAAC;IAE3C,OAAO,IAAA,qBAAc,EACnB,IAAA,6BAAiB,EACf,IAAA,gCAAgB,EAAC,OAAc,EAAE,OAAO,EAAE,EAAE,oBAAoB,EAAE,yCAAkB,EAAE,CAAC,CACxF,CACF,CAAC;AACJ,CAAC;AAED,6DAA6D;AAC7D,aAAa;AACb,kBAAe,IAAA,yBAAa,EAAC,UAAU,CAAC,CAAC"}
|
package/application/schema.json
CHANGED
|
@@ -52,6 +52,14 @@
|
|
|
52
52
|
"type": "object",
|
|
53
53
|
"additionalProperties": false,
|
|
54
54
|
"properties": {
|
|
55
|
+
"allowedHosts": {
|
|
56
|
+
"description": "A list of hostnames that are allowed to access the server-side application. For more information, see https://angular.dev/best-practices/security#preventing-server-side-request-forgery-ssrf.",
|
|
57
|
+
"type": "array",
|
|
58
|
+
"uniqueItems": true,
|
|
59
|
+
"items": {
|
|
60
|
+
"type": "string"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
55
63
|
"autoCsp": {
|
|
56
64
|
"description": "Enables automatic generation of a hash-based Strict Content Security Policy (https://web.dev/articles/strict-csp#choose-hash) based on scripts in index.html. Will default to true once we are out of experimental/preview phases.",
|
|
57
65
|
"default": false,
|
|
@@ -634,8 +642,8 @@
|
|
|
634
642
|
"type": "string",
|
|
635
643
|
"description": "The server entry-point that when executed will spawn the web server."
|
|
636
644
|
},
|
|
637
|
-
"
|
|
638
|
-
"description": "Specifies the platform for which the server bundle is generated. This affects the APIs and modules available in the server-side code. \n\n- `node`: (Default) Generates a bundle optimized for Node.js environments. \n- `neutral`: Generates a platform-neutral bundle suitable for environments like edge workers, and other serverless platforms. This option avoids using Node.js-specific APIs, making the bundle more portable. \n\nPlease note that this feature does not provide polyfills for Node.js modules.
|
|
645
|
+
"platform": {
|
|
646
|
+
"description": "Specifies the platform for which the server bundle is generated. This affects the APIs and modules available in the server-side code. \n\n- `node`: (Default) Generates a bundle optimized for Node.js environments. \n- `neutral`: Generates a platform-neutral bundle suitable for environments like edge workers, and other serverless platforms. This option avoids using Node.js-specific APIs, making the bundle more portable. \n\nPlease note that this feature does not provide polyfills for Node.js modules.",
|
|
639
647
|
"default": "node",
|
|
640
648
|
"enum": [
|
|
641
649
|
"node",
|
package/engine/build-ng-doc.js
CHANGED
|
@@ -32,27 +32,12 @@ function buildNgDoc(context) {
|
|
|
32
32
|
(0, helpers_1.importUtils)(),
|
|
33
33
|
(0, helpers_1.importEsm)('@angular/compiler'),
|
|
34
34
|
]).pipe((0, rxjs_1.switchMap)(() => (0, rxjs_1.merge)((0, builder_1.entriesEmitter)(context), (0, global_1.globalBuilders)(context))));
|
|
35
|
-
/**
|
|
36
|
-
* The pipeline emits every time the builder stack is empty, but on the initial build
|
|
37
|
-
* an empty stack does not guarantee that every entry page has been collected into the
|
|
38
|
-
* PageStore (entries can register late). Hold back the first emission until all
|
|
39
|
-
* discovered entries have resolved, so the very first build the application/dev-server
|
|
40
|
-
* builders consume is generated from a complete PageStore (see issue #322). Subsequent
|
|
41
|
-
* (watch) rebuilds are not gated.
|
|
42
|
-
*/
|
|
43
|
-
let initialBuildComplete = false;
|
|
44
35
|
return emitter.pipe((0, builder_1.printBuildProgress)(), (0, builder_1.whenStackIsEmpty)(), (0, resolve_async_file_outputs_1.resolveAsyncFileOutputs)(), (0, builder_1.emitFileOutput)(), (0, operators_1.tap)(() => {
|
|
45
36
|
(0, builder_1.setColdStartFalse)();
|
|
46
37
|
// console.log(
|
|
47
38
|
// output.state,
|
|
48
39
|
// isBuilderDone(output) ? output.result.filePath : output.error,
|
|
49
40
|
// );
|
|
50
|
-
}), (0, builder_1.printErrors)(), (0, operators_1.
|
|
51
|
-
if (initialBuildComplete) {
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
initialBuildComplete = (0, builder_1.allEntriesResolved)();
|
|
55
|
-
return initialBuildComplete;
|
|
56
|
-
}), (0, operators_1.debounceTime)(100), (0, operators_1.map)(() => void 0), (0, builder_1.emitCache)(), (0, operators_2.progress)());
|
|
41
|
+
}), (0, builder_1.printErrors)(), (0, operators_1.debounceTime)(100), (0, operators_1.map)(() => void 0), (0, builder_1.emitCache)(), (0, operators_2.progress)());
|
|
57
42
|
}
|
|
58
43
|
//# sourceMappingURL=build-ng-doc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-ng-doc.js","sourceRoot":"","sources":["../../../../libs/builder/engine/build-ng-doc.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"build-ng-doc.js","sourceRoot":"","sources":["../../../../libs/builder/engine/build-ng-doc.ts"],"names":[],"mappings":";;AA2BA,gCAsCC;;AAjED,6CAWyB;AACzB,oDAAoB;AACpB,+BAA8D;AAC9D,8CAAwD;AAExD,wCAAoD;AAEpD,4CAAwC;AACxC,8CAAmD;AACnD,mCAAkD;AAClD,4FAAsF;AAEtF;;;GAGG;AACH,SAAgB,UAAU,CAAC,OAA4B;IACrD,uBAAuB;IACvB,iBAAO,CAAC,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC;IAEtD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAC1B,IAAA,sBAAY,GAAE,CAAC;IACjB,CAAC;IAED,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,IAAI,IAAA,+BAAuB,EAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QAC5E,aAAa;IACf,CAAC;SAAM,CAAC;QACN,YAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,eAAQ,EAAC;QACvB,IAAA,4BAAkB,EAAC,OAAO,CAAC;QAC3B,IAAA,qBAAW,GAAE;QACb,IAAA,mBAAS,EAAC,mBAAmB,CAAC;KAC/B,CAAC,CAAC,IAAI,CAAC,IAAA,gBAAS,EAAC,GAAG,EAAE,CAAC,IAAA,YAAK,EAAC,IAAA,wBAAc,EAAC,OAAO,CAAC,EAAE,IAAA,uBAAc,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAElF,OAAO,OAAO,CAAC,IAAI,CACjB,IAAA,4BAAkB,GAAE,EACpB,IAAA,0BAAgB,GAAE,EAClB,IAAA,oDAAuB,GAAE,EACzB,IAAA,wBAAc,GAAE,EAChB,IAAA,eAAG,EAAC,GAAG,EAAE;QACP,IAAA,2BAAiB,GAAE,CAAC;QACpB,eAAe;QACf,kBAAkB;QAClB,mEAAmE;QACnE,KAAK;IACP,CAAC,CAAC,EACF,IAAA,qBAAW,GAAE,EACb,IAAA,wBAAY,EAAC,GAAG,CAAC,EACjB,IAAA,eAAG,EAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EACjB,IAAA,mBAAS,GAAE,EACX,IAAA,oBAAQ,GAAE,CACS,CAAC;AACxB,CAAC"}
|
|
@@ -29,19 +29,7 @@ function entryBuilder(config) {
|
|
|
29
29
|
core_1.PageStore.add([entryPath, metadata]);
|
|
30
30
|
return metadata;
|
|
31
31
|
}));
|
|
32
|
-
return (0, core_1.createBuilder)([(0, core_1.createMainTrigger)((0, core_1.watchFile)(entryPath, 'update'), (0, core_1.onDependenciesChange)(dependencies))], () => builder).pipe((0, rxjs_1.
|
|
33
|
-
// Track whether this entry failed to build so the completion gate doesn't wait
|
|
34
|
-
// forever for a page that will never register (see issue #322).
|
|
35
|
-
if ((0, core_1.isBuilderError)(state)) {
|
|
36
|
-
core_1.FailedEntries.add(entryPath);
|
|
37
|
-
}
|
|
38
|
-
else if ((0, core_1.isBuilderDone)(state)) {
|
|
39
|
-
core_1.FailedEntries.delete(entryPath);
|
|
40
|
-
}
|
|
41
|
-
}), (0, rxjs_1.finalize)(() => {
|
|
42
|
-
core_1.PageStore.delete(entryPath);
|
|
43
|
-
core_1.FailedEntries.delete(entryPath);
|
|
44
|
-
}), (0, rxjs_1.takeUntil)((0, core_1.watchFile)(entryPath, 'delete')));
|
|
32
|
+
return (0, core_1.createBuilder)([(0, core_1.createMainTrigger)((0, core_1.watchFile)(entryPath, 'update'), (0, core_1.onDependenciesChange)(dependencies))], () => builder).pipe((0, rxjs_1.finalize)(() => core_1.PageStore.delete(entryPath)), (0, rxjs_1.takeUntil)((0, core_1.watchFile)(entryPath, 'delete')));
|
|
45
33
|
}
|
|
46
34
|
/**
|
|
47
35
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.builder.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/builders/shared/entry.builder.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"entry.builder.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/builders/shared/entry.builder.ts"],"names":[],"mappings":";;AAiCA,oCAoCC;AApED,+BAA+C;AAE/C,8CAAiD;AACjD,8CAAmE;AAEnE,qCAQoB;AACpB,wCAAiD;AASjD;;;;;;;;GAQG;AACH,SAAgB,YAAY,CAC1B,MAAc;IAEd,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC3C,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAClE,MAAM,YAAY,GAAG,IAAI,uBAAa,EAAU,CAAC;IAEjD,MAAM,OAAO,GAAG,IAAA,SAAE,EAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAC7B,IAAA,eAAQ,EAAC,GAAG,EAAE,KAAK,IAAI,EAAE;QACvB,YAAY,CAAC,KAAK,EAAE,CAAC;QAErB,MAAM,UAAU,CAAC,qBAAqB,EAAE,CAAC;QAEzC,MAAM,OAAO,GAAG,MAAM,IAAA,yBAAe,EACnC,UAAU,EACV,OAAO,CAAC,QAAQ,EAChB,OAAO,CAAC,OAAO,CAAC,aAAa,CAC9B,CAAC;QACF,MAAM,IAAI,GAAG,CAAC,MAAM,IAAA,wBAAc,EAAiB,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QACrE,MAAM,QAAQ,GAAG,IAAA,6BAAmB,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;QAEhE,2BAA2B,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAEpD,gBAAS,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;QAErC,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,IAAA,oBAAa,EAClB,CAAC,IAAA,wBAAiB,EAAC,IAAA,gBAAS,EAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,IAAA,2BAAoB,EAAC,YAAY,CAAC,CAAC,CAAC,EACvF,GAAG,EAAE,CAAC,OAAO,CACd,CAAC,IAAI,CACJ,IAAA,eAAQ,EAAC,GAAG,EAAE,CAAC,gBAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAC3C,IAAA,gBAAS,EAAC,IAAA,gBAAS,EAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAC1C,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,2BAA2B,CAClC,QAAkC,EAClC,YAAmC;IAEnC,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;QACpB,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;QAE3D,2BAA2B,CAAC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC"}
|
|
@@ -12,7 +12,6 @@ const helpers_1 = require("../../../helpers");
|
|
|
12
12
|
const builders_1 = require("../../builders");
|
|
13
13
|
const api_list_1 = require("../../builders/api-list");
|
|
14
14
|
const variables_1 = require("../../variables");
|
|
15
|
-
const stores_1 = require("../stores");
|
|
16
15
|
const watcher_1 = require("../watcher");
|
|
17
16
|
/**
|
|
18
17
|
*
|
|
@@ -25,14 +24,11 @@ function entriesEmitter(context) {
|
|
|
25
24
|
]);
|
|
26
25
|
return (0, watcher_1.watchFolder)(context.docsPath, 'create').pipe((0, operators_1.map)((events) => events.map((event) => event.path)), (0, operators_1.startWith)(entries), (0, operators_1.map)((events) => events
|
|
27
26
|
.map((filePath) => {
|
|
28
|
-
const entryPath = path_1.default.resolve(filePath);
|
|
29
27
|
if ((0, minimatch_1.minimatch)(filePath, variables_1.PAGE_PATTERN, { dot: true })) {
|
|
30
|
-
|
|
31
|
-
return (0, builders_1.pageBuilder)(context, entryPath);
|
|
28
|
+
return (0, builders_1.pageBuilder)(context, path_1.default.resolve(filePath));
|
|
32
29
|
}
|
|
33
30
|
if ((0, minimatch_1.minimatch)(filePath, variables_1.API_PATTERN, { dot: true })) {
|
|
34
|
-
|
|
35
|
-
return (0, api_list_1.apiBuilder)(context, entryPath);
|
|
31
|
+
return (0, api_list_1.apiBuilder)(context, path_1.default.resolve(filePath));
|
|
36
32
|
}
|
|
37
33
|
return null;
|
|
38
34
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entries-emitter.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/core/operators/entries-emitter.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"entries-emitter.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/core/operators/entries-emitter.ts"],"names":[],"mappings":";;AAmBA,wCA6BC;;AAhDD,uCAAyC;AACzC,yCAAiC;AACjC,yCAAsC;AACtC,wDAAwB;AACxB,+BAAmD;AACnD,8CAAwD;AAExD,8CAAyC;AAEzC,6CAA6C;AAC7C,sDAAqD;AACrD,+CAA4D;AAE5D,wCAAyC;AAEzC;;;GAGG;AACH,SAAgB,cAAc,CAC5B,OAA4B;IAE5B,MA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AE,CAAC,IAAA,YAAK,EAAC,GAAG,QAAQ,CAAC,CAAC,CAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./api"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./entry-status"), exports);
|
|
6
5
|
tslib_1.__exportStar(require("./index-store"), exports);
|
|
7
6
|
tslib_1.__exportStar(require("./keywords"), exports);
|
|
8
7
|
tslib_1.__exportStar(require("./page-store"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/core/stores/index.ts"],"names":[],"mappings":";;;AAAA,gDAAsB;AACtB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/core/stores/index.ts"],"names":[],"mappings":";;;AAAA,gDAAsB;AACtB,wDAA8B;AAC9B,qDAA2B;AAC3B,uDAA6B"}
|
|
@@ -14,9 +14,15 @@ let WATCHER = null;
|
|
|
14
14
|
* @param dir
|
|
15
15
|
*/
|
|
16
16
|
function watch(path, dir) {
|
|
17
|
+
// One-shot builds don't need to react to file changes, so the watcher
|
|
18
|
+
// is not started at all to let the process exit as soon as the build is done
|
|
19
|
+
if (!builder_1.GLOBALS.watch) {
|
|
20
|
+
return rxjs_1.NEVER;
|
|
21
|
+
}
|
|
17
22
|
path = (0, path_1.resolve)(path);
|
|
18
23
|
if (!WATCHER) {
|
|
19
24
|
let unsubscribe = () => { };
|
|
25
|
+
let disposed = false;
|
|
20
26
|
WATCHER = new rxjs_1.Observable((subscriber) => {
|
|
21
27
|
watcher
|
|
22
28
|
.subscribe(builder_1.GLOBALS.workspaceRoot, (err, events) => {
|
|
@@ -27,8 +33,20 @@ function watch(path, dir) {
|
|
|
27
33
|
}
|
|
28
34
|
subscriber.next(events);
|
|
29
35
|
}, { ignore: ['node_modules'] })
|
|
30
|
-
.then((unsub) =>
|
|
36
|
+
.then((unsub) => {
|
|
37
|
+
// The teardown may run before this promise resolves (e.g. a one-shot build
|
|
38
|
+
// that finishes while the watcher is still crawling the workspace);
|
|
39
|
+
// in that case the subscription must be closed here, otherwise it keeps
|
|
40
|
+
// the process alive forever (see #333)
|
|
41
|
+
if (disposed) {
|
|
42
|
+
unsub.unsubscribe();
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
unsubscribe = unsub.unsubscribe;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
31
48
|
return () => {
|
|
49
|
+
disposed = true;
|
|
32
50
|
unsubscribe();
|
|
33
51
|
WATCHER = null;
|
|
34
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/core/watcher/watch.ts"],"names":[],"mappings":";;AAaA,
|
|
1
|
+
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/core/watcher/watch.ts"],"names":[],"mappings":";;AAaA,sBAyDC;;AAtED,6CAA0C;AAC1C,iEAA2C;AAC3C,+BAA+B;AAC/B,+BAAyC;AACzC,8CAAoD;AAEpD,IAAI,OAAO,GAAuC,IAAI,CAAC;AAEvD;;;;GAIG;AACH,SAAgB,KAAK,CAAC,IAAY,EAAE,GAAa;IAC/C,sEAAsE;IACtE,6EAA6E;IAC7E,IAAI,CAAC,iBAAO,CAAC,KAAK,EAAE,CAAC;QACnB,OAAO,YAAK,CAAC;IACf,CAAC;IAED,IAAI,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,CAAC;IAErB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,IAAI,WAAW,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;QAC3B,IAAI,QAAQ,GAAG,KAAK,CAAC;QAErB,OAAO,GAAG,IAAI,iBAAU,CAAkB,CAAC,UAAU,EAAE,EAAE;YACvD,OA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,CAAC,CACtC,CAAC;AACJ,CAAC"}
|
package/engine/variables.d.ts
CHANGED
package/engine/variables.js
CHANGED
package/engine/variables.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables.js","sourceRoot":"","sources":["../../../../libs/builder/engine/variables.ts"],"names":[],"mappings":";;;;AAAA,mDAA6B;AAEhB,QAAA,OAAO,GAAG;
|
|
1
|
+
{"version":3,"file":"variables.js","sourceRoot":"","sources":["../../../../libs/builder/engine/variables.ts"],"names":[],"mappings":";;;;AAAA,mDAA6B;AAEhB,QAAA,OAAO,GAAG;IACrB,aAAa,EAAE,EAAE;IACjB,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAO,CAAC,aAAa,EAAE,CAAC,CAAC;CACjE,CAAC;AACW,QAAA,SAAS,GAAW,gBAAgB,CAAC;AACrC,QAAA,aAAa,GAAW,oBAAoB,CAAC;AAC7C,QAAA,QAAQ,GAAW,eAAe,CAAC;AAEnC,QAAA,YAAY,GAAW,MAAM,iBAAS,EAAE,CAAC;AACzC,QAAA,gBAAgB,GAAW,MAAM,qBAAa,EAAE,CAAC;AACjD,QAAA,WAAW,GAAW,MAAM,gBAAQ,EAAE,CAAC;AACvC,QAAA,UAAU,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AACpD,QAAA,cAAc,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC"}
|
package/interfaces/schema.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-doc/builder",
|
|
3
|
-
"version": "22.0.0-beta.
|
|
3
|
+
"version": "22.0.0-beta.2",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"builders": "./builders.json",
|
|
6
6
|
"schematics": "./schematics/collection.json",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@ng-doc/core": "22.0.0-beta.
|
|
15
|
-
"@ng-doc/utils": "22.0.0-beta.
|
|
16
|
-
"@angular-devkit/architect": ">=0.
|
|
17
|
-
"@angular-devkit/build-angular": ">=
|
|
14
|
+
"@ng-doc/core": "22.0.0-beta.2",
|
|
15
|
+
"@ng-doc/utils": "22.0.0-beta.2",
|
|
16
|
+
"@angular-devkit/architect": ">=0.2200.0 < 0.2300.0",
|
|
17
|
+
"@angular-devkit/build-angular": ">=22.0.0 < 23.0.0",
|
|
18
18
|
"minimatch": "9.0.1",
|
|
19
19
|
"rxjs": "^7.0.0",
|
|
20
20
|
"ts-morph": "22.0.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"overrides": {
|
|
44
44
|
"nunjucks": {
|
|
45
|
-
"chokidar": "^
|
|
45
|
+
"chokidar": "^5.0.0"
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"types": "./index.d.ts",
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Set of resolved entry file paths (pages and API files) discovered when the build
|
|
3
|
-
* starts. Populated by the entries emitter as it creates a builder for each entry.
|
|
4
|
-
*/
|
|
5
|
-
export declare const ExpectedEntries: Set<string>;
|
|
6
|
-
/**
|
|
7
|
-
* Set of entry file paths whose build ended in an error. Such entries never register
|
|
8
|
-
* a page in the {@link PageStore}, so the completion gate must treat them as resolved
|
|
9
|
-
* to avoid waiting forever.
|
|
10
|
-
*/
|
|
11
|
-
export declare const FailedEntries: Set<string>;
|
|
12
|
-
/**
|
|
13
|
-
* Returns `true` once every entry discovered at build start has either registered its
|
|
14
|
-
* page in the {@link PageStore} or failed to build.
|
|
15
|
-
*
|
|
16
|
-
* The build pipeline declares itself "done" the first time the global builder stack is
|
|
17
|
-
* empty. However, entry pages can register in the `PageStore` late (e.g. on a cold
|
|
18
|
-
* build the guide pages are processed after a large API), so an empty stack does not
|
|
19
|
-
* guarantee that every page has been collected. Gating completion on this check
|
|
20
|
-
* prevents `routes.ts`/`context.ts` from being generated from a partially-populated
|
|
21
|
-
* `PageStore` (see issue #322).
|
|
22
|
-
*/
|
|
23
|
-
export declare function allEntriesResolved(): boolean;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FailedEntries = exports.ExpectedEntries = void 0;
|
|
4
|
-
exports.allEntriesResolved = allEntriesResolved;
|
|
5
|
-
const page_store_1 = require("./page-store");
|
|
6
|
-
/**
|
|
7
|
-
* Set of resolved entry file paths (pages and API files) discovered when the build
|
|
8
|
-
* starts. Populated by the entries emitter as it creates a builder for each entry.
|
|
9
|
-
*/
|
|
10
|
-
exports.ExpectedEntries = new Set();
|
|
11
|
-
/**
|
|
12
|
-
* Set of entry file paths whose build ended in an error. Such entries never register
|
|
13
|
-
* a page in the {@link PageStore}, so the completion gate must treat them as resolved
|
|
14
|
-
* to avoid waiting forever.
|
|
15
|
-
*/
|
|
16
|
-
exports.FailedEntries = new Set();
|
|
17
|
-
/**
|
|
18
|
-
* Returns `true` once every entry discovered at build start has either registered its
|
|
19
|
-
* page in the {@link PageStore} or failed to build.
|
|
20
|
-
*
|
|
21
|
-
* The build pipeline declares itself "done" the first time the global builder stack is
|
|
22
|
-
* empty. However, entry pages can register in the `PageStore` late (e.g. on a cold
|
|
23
|
-
* build the guide pages are processed after a large API), so an empty stack does not
|
|
24
|
-
* guarantee that every page has been collected. Gating completion on this check
|
|
25
|
-
* prevents `routes.ts`/`context.ts` from being generated from a partially-populated
|
|
26
|
-
* `PageStore` (see issue #322).
|
|
27
|
-
*/
|
|
28
|
-
function allEntriesResolved() {
|
|
29
|
-
for (const entryPath of exports.ExpectedEntries) {
|
|
30
|
-
if (page_store_1.PageStore.get(entryPath) === undefined && !exports.FailedEntries.has(entryPath)) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=entry-status.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-status.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/core/stores/entry-status.ts"],"names":[],"mappings":";;;AA0BA,gDAQC;AAlCD,6CAAyC;AAEzC;;;GAGG;AACU,QAAA,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;AAEjD;;;;GAIG;AACU,QAAA,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,SAAgB,kBAAkB;IAChC,KAAK,MAAM,SAAS,IAAI,uBAAe,EAAE,CAAC;QACxC,IAAI,sBAAS,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,SAAS,IAAI,CAAC,qBAAa,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YAC5E,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|