@ng-doc/builder 21.0.5 → 21.0.6
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/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 +3 -3
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"}
|
|
@@ -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":[],"mapp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G,IAAI,CAAC;gBAChB,WAAW,EAAE,CAAC;gBACd,OAAO,GAAG,IAAI,CAAC;YACjB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAA,iBAAK,GAAE,CAAC,CAAC;IACnB,CAAC;IAED,OAAO,OAAO,CAAC,IAAI,CACjB,IAAA,eAAG,EAAC,CAAC,MAAM,EAAE,EAAE,CACb,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QACtB,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACvE,CAAC,CAAC,CACH,EACD,IAAA,kBAAM,EAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,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": "21.0.
|
|
3
|
+
"version": "21.0.6",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"builders": "./builders.json",
|
|
6
6
|
"schematics": "./schematics/collection.json",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@ng-doc/core": "21.0.
|
|
15
|
-
"@ng-doc/utils": "21.0.
|
|
14
|
+
"@ng-doc/core": "21.0.6",
|
|
15
|
+
"@ng-doc/utils": "21.0.6",
|
|
16
16
|
"@angular-devkit/architect": ">=0.2100.0 < 0.2200.0",
|
|
17
17
|
"@angular-devkit/build-angular": ">=21.0.0 < 22.0.0",
|
|
18
18
|
"minimatch": "9.0.1",
|