@ng-doc/builder 22.1.0 → 22.2.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/LICENSE +21 -0
- package/generator/bootstrap/bin.js +150 -107
- package/generator/bootstrap/cli.js +150 -107
- package/generator/bootstrap/index.js +125 -99
- package/generator/bootstrap/process-tree.d.ts +5 -4
- package/generator/build-metafile.json +177 -78
- package/generator/build-provenance.json +3 -3
- package/generator/compiler/index.js +689 -484
- package/generator/content/html-worker.js +8 -0
- package/generator/contracts.d.ts +20 -2
- package/generator/kernel/flags.d.ts +3 -0
- package/generator/outputs/index.d.ts +22 -6
- package/generator/templates/demo-routes.ts.nunj +21 -1
- package/generator/templates/page.ts.nunj +5 -1
- package/generator/vite/angular/analog-provenance.json +1 -1
- package/generator/vite/angular-composition.d.ts +25 -1
- package/generator/vite/content-updates.d.ts +62 -0
- package/generator/vite/host-updates.d.ts +85 -5
- package/generator/vite/index.js +621 -243
- package/generator/vite/lifecycle.d.ts +39 -2
- package/helpers/playground/get-playground-inputs.js +6 -3
- package/helpers/playground/get-playground-inputs.js.map +1 -1
- package/helpers/playground/playground-options.d.ts +28 -0
- package/helpers/playground/playground-options.js +122 -0
- package/helpers/playground/playground-options.js.map +1 -0
- package/helpers/playground/written-union-order.d.ts +33 -0
- package/helpers/playground/written-union-order.js +106 -0
- package/helpers/playground/written-union-order.js.map +1 -0
- package/interfaces/configuration.d.ts +11 -3
- package/package.json +4 -4
- package/templates/demo-routes.ts.nunj +21 -1
- package/templates/page.ts.nunj +5 -1
|
@@ -250,6 +250,21 @@ var ENGINE_SWITCHES = Object.freeze([
|
|
|
250
250
|
values: /^(0|false|off|no)$/i,
|
|
251
251
|
effect: "adding or removing a page compiles the application twice"
|
|
252
252
|
},
|
|
253
|
+
{
|
|
254
|
+
name: "NGDOC_ANGULAR_DESCRIPTION_PASS",
|
|
255
|
+
values: /^(0|false|off|no)$/i,
|
|
256
|
+
effect: "a page title edit compiles the application twice"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
name: "NGDOC_VITE_CONTENT_UPDATE",
|
|
260
|
+
values: /^(0|false|off|no)$/i,
|
|
261
|
+
effect: "guide text edits reload the page"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: "NGDOC_VITE_MODULELESS_SETTLE",
|
|
265
|
+
values: /^(0|false|off|no)$/i,
|
|
266
|
+
effect: "hot updates of files the browser never loaded wait for the newest generation"
|
|
267
|
+
},
|
|
253
268
|
{
|
|
254
269
|
name: "NGDOC_VITE_BUILD_HANDOFF",
|
|
255
270
|
values: /^(0|false|off|no)$/i,
|
|
@@ -1606,7 +1621,7 @@ function createParcelEventSource(root, options = {}, subscribe2 = parcel.subscri
|
|
|
1606
1621
|
|
|
1607
1622
|
// libs/builder/generator/bootstrap/constants.ts
|
|
1608
1623
|
var GENERATOR_COMPILER_VERSION = "0.0.1";
|
|
1609
|
-
var GENERATOR_TOOLCHAIN_DIGEST = "
|
|
1624
|
+
var GENERATOR_TOOLCHAIN_DIGEST = "495b74972f5c2d99ad311bd24b03e2560f77343e401abd7c4d8185e4fee96764";
|
|
1610
1625
|
|
|
1611
1626
|
// libs/builder/generator/bootstrap/index.ts
|
|
1612
1627
|
import path7 from "node:path";
|
|
@@ -1624,7 +1639,10 @@ var INCREMENTAL_PROGRAM_FLAG = "NGDOC_INCREMENTAL_PROGRAM";
|
|
|
1624
1639
|
var SHAPE_CLOSURE_FLAG = "NGDOC_SHAPE_CLOSURE";
|
|
1625
1640
|
var ANGULAR_SHARED_PASS_FLAG = "NGDOC_ANGULAR_SHARED_PASS";
|
|
1626
1641
|
var ANGULAR_STRUCTURAL_PASS_FLAG = "NGDOC_ANGULAR_STRUCTURAL_PASS";
|
|
1642
|
+
var ANGULAR_DESCRIPTION_PASS_FLAG = "NGDOC_ANGULAR_DESCRIPTION_PASS";
|
|
1643
|
+
var VITE_CONTENT_UPDATE_FLAG = "NGDOC_VITE_CONTENT_UPDATE";
|
|
1627
1644
|
var VITE_BUILD_HANDOFF_FLAG = "NGDOC_VITE_BUILD_HANDOFF";
|
|
1645
|
+
var VITE_MODULELESS_SETTLE_FLAG = "NGDOC_VITE_MODULELESS_SETTLE";
|
|
1628
1646
|
var TRACKED_PROGRAM_REUSE_FLAG = "NGDOC_TRACKED_PROGRAM_REUSE";
|
|
1629
1647
|
var FAST_START_FLAG = "NGDOC_FAST_START";
|
|
1630
1648
|
var PARALLEL_WRITES_FLAG = "NGDOC_PARALLEL_WRITES";
|
|
@@ -1699,6 +1717,21 @@ var FLAGS = Object.freeze(
|
|
|
1699
1717
|
description: "In the Vite host, the generated modules and description modules a generation creates or deletes join that generation's Angular compiler pass instead of starting a pass of their own.",
|
|
1700
1718
|
verify: false
|
|
1701
1719
|
},
|
|
1720
|
+
{
|
|
1721
|
+
name: ANGULAR_DESCRIPTION_PASS_FLAG,
|
|
1722
|
+
description: "In the Vite host, an edited description module joins the Angular compiler pass of the generation it starts, when that generation rewrites generated TypeScript modules, instead of taking a pass of its own first.",
|
|
1723
|
+
verify: false
|
|
1724
|
+
},
|
|
1725
|
+
{
|
|
1726
|
+
name: VITE_CONTENT_UPDATE_FLAG,
|
|
1727
|
+
description: "In the Vite host, a generation that changes only content modules and the search index updates the open pages in place instead of reloading them.",
|
|
1728
|
+
verify: false
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
name: VITE_MODULELESS_SETTLE_FLAG,
|
|
1732
|
+
description: "In the Vite host, a hot update that hands Vite no module to update settles once it is acknowledged, instead of waiting for the newest generation to be published.",
|
|
1733
|
+
verify: false
|
|
1734
|
+
},
|
|
1702
1735
|
{
|
|
1703
1736
|
name: VITE_BUILD_HANDOFF_FLAG,
|
|
1704
1737
|
description: "The server build of the Vite production pipeline publishes the browser build's generation instead of generating again.",
|
|
@@ -2684,29 +2717,29 @@ function projectWatchInputs(dependencies) {
|
|
|
2684
2717
|
const scopes = /* @__PURE__ */ new Map();
|
|
2685
2718
|
const references = [];
|
|
2686
2719
|
for (const dependency of dependencies) {
|
|
2687
|
-
if (!isRecord(dependency) || typeof dependency
|
|
2720
|
+
if (!isRecord(dependency) || typeof dependency["kind"] !== "string")
|
|
2688
2721
|
throw new Error("Invalid dependency");
|
|
2689
|
-
switch (dependency
|
|
2722
|
+
switch (dependency["kind"]) {
|
|
2690
2723
|
case "content": {
|
|
2691
2724
|
if (!hasExactKeys(dependency, ["digest", "kind", "path"]))
|
|
2692
2725
|
throw new Error("Invalid content dependency");
|
|
2693
|
-
files.add(path4(dependency
|
|
2694
|
-
string(dependency
|
|
2726
|
+
files.add(path4(dependency["path"], "content path"));
|
|
2727
|
+
string(dependency["digest"], "content digest");
|
|
2695
2728
|
break;
|
|
2696
2729
|
}
|
|
2697
2730
|
case "existence": {
|
|
2698
|
-
if (!hasExactKeys(dependency, ["exists", "kind", "path"]) || typeof dependency
|
|
2731
|
+
if (!hasExactKeys(dependency, ["exists", "kind", "path"]) || typeof dependency["exists"] !== "boolean")
|
|
2699
2732
|
throw new Error("Invalid existence dependency");
|
|
2700
|
-
files.add(path4(dependency
|
|
2733
|
+
files.add(path4(dependency["path"], "existence path"));
|
|
2701
2734
|
break;
|
|
2702
2735
|
}
|
|
2703
2736
|
case "glob": {
|
|
2704
2737
|
if (!hasExactKeys(dependency, ["exclude", "include", "kind", "members", "root"]))
|
|
2705
2738
|
throw new Error("Invalid glob dependency");
|
|
2706
|
-
const root = path4(dependency
|
|
2707
|
-
const include = strings(dependency
|
|
2708
|
-
const exclude = strings(dependency
|
|
2709
|
-
paths(dependency
|
|
2739
|
+
const root = path4(dependency["root"], "glob root");
|
|
2740
|
+
const include = strings(dependency["include"], "glob include");
|
|
2741
|
+
const exclude = strings(dependency["exclude"], "glob exclude");
|
|
2742
|
+
paths(dependency["members"], "glob members").forEach((member) => files.add(member));
|
|
2710
2743
|
const glob = { root, include, exclude };
|
|
2711
2744
|
globs.set(JSON.stringify(glob), glob);
|
|
2712
2745
|
break;
|
|
@@ -2714,10 +2747,10 @@ function projectWatchInputs(dependencies) {
|
|
|
2714
2747
|
case "semantic": {
|
|
2715
2748
|
if (!hasExactKeys(dependency, ["digest", "files", "kind", "reason", "scopeId"]))
|
|
2716
2749
|
throw new Error("Invalid semantic dependency");
|
|
2717
|
-
const scopeId = string(dependency
|
|
2718
|
-
const digest = string(dependency
|
|
2719
|
-
string(dependency
|
|
2720
|
-
const scopeFiles = paths(dependency
|
|
2750
|
+
const scopeId = string(dependency["scopeId"], "semantic scope ID");
|
|
2751
|
+
const digest = string(dependency["digest"], "semantic digest");
|
|
2752
|
+
string(dependency["reason"], "semantic reason");
|
|
2753
|
+
const scopeFiles = paths(dependency["files"], "semantic files");
|
|
2721
2754
|
scopeFiles.forEach((file) => files.add(file));
|
|
2722
2755
|
const registered = scopes.get(scopeId) ?? [];
|
|
2723
2756
|
registered.push({ digest });
|
|
@@ -2728,17 +2761,17 @@ function projectWatchInputs(dependencies) {
|
|
|
2728
2761
|
if (!hasExactKeys(dependency, ["digest", "kind", "reason", "scopeId"]))
|
|
2729
2762
|
throw new Error("Invalid semantic-reference dependency");
|
|
2730
2763
|
references.push({
|
|
2731
|
-
scopeId: string(dependency
|
|
2732
|
-
digest: string(dependency
|
|
2764
|
+
scopeId: string(dependency["scopeId"], "semantic-reference scope ID"),
|
|
2765
|
+
digest: string(dependency["digest"], "semantic-reference digest")
|
|
2733
2766
|
});
|
|
2734
|
-
string(dependency
|
|
2767
|
+
string(dependency["reason"], "semantic-reference reason");
|
|
2735
2768
|
break;
|
|
2736
2769
|
}
|
|
2737
2770
|
case "keyword": {
|
|
2738
2771
|
if (!hasExactKeys(dependency, ["digest", "key", "kind"]))
|
|
2739
2772
|
throw new Error("Invalid keyword dependency");
|
|
2740
|
-
string(dependency
|
|
2741
|
-
string(dependency
|
|
2773
|
+
string(dependency["key"], "keyword key");
|
|
2774
|
+
string(dependency["digest"], "keyword digest");
|
|
2742
2775
|
break;
|
|
2743
2776
|
}
|
|
2744
2777
|
// The non-physical kinds are validated but are never watch inputs: they name no path, and
|
|
@@ -2746,16 +2779,16 @@ function projectWatchInputs(dependencies) {
|
|
|
2746
2779
|
case "semantic-closure": {
|
|
2747
2780
|
if (!hasExactKeys(dependency, ["digest", "key", "kind", "scopeId"]))
|
|
2748
2781
|
throw new Error("Invalid semantic-closure dependency");
|
|
2749
|
-
string(dependency
|
|
2750
|
-
string(dependency
|
|
2751
|
-
string(dependency
|
|
2782
|
+
string(dependency["scopeId"], "semantic-closure scope ID");
|
|
2783
|
+
string(dependency["key"], "semantic-closure key");
|
|
2784
|
+
string(dependency["digest"], "semantic-closure digest");
|
|
2752
2785
|
break;
|
|
2753
2786
|
}
|
|
2754
2787
|
case "evaluated": {
|
|
2755
2788
|
if (!hasExactKeys(dependency, ["digest", "entryId", "kind"]))
|
|
2756
2789
|
throw new Error("Invalid evaluated dependency");
|
|
2757
|
-
string(dependency
|
|
2758
|
-
string(dependency
|
|
2790
|
+
string(dependency["entryId"], "evaluated entry ID");
|
|
2791
|
+
string(dependency["digest"], "evaluated digest");
|
|
2759
2792
|
break;
|
|
2760
2793
|
}
|
|
2761
2794
|
default:
|
|
@@ -5772,7 +5805,7 @@ function normalizeRelative(value) {
|
|
|
5772
5805
|
return normalized;
|
|
5773
5806
|
}
|
|
5774
5807
|
function trustedBase(last, request) {
|
|
5775
|
-
const published = (manifest) => isRecord2(manifest) && manifest
|
|
5808
|
+
const published = (manifest) => isRecord2(manifest) && manifest["projectId"] === last.projectId && manifest["revision"] === last.revision && manifest["generation"] === last.generation;
|
|
5776
5809
|
const base = request.base;
|
|
5777
5810
|
return isRecord2(base) && published(base.manifest) && published(request.previous) && isRecord2(base.snapshot) && base.snapshot.projectId === last.projectId && base.snapshot.revision === last.revision;
|
|
5778
5811
|
}
|
|
@@ -5786,17 +5819,17 @@ function sameManifestStamp(left, right) {
|
|
|
5786
5819
|
return left.dev === right.dev && left.ino === right.ino && left.size === right.size && left.mtimeNs === right.mtimeNs && left.ctimeNs === right.ctimeNs;
|
|
5787
5820
|
}
|
|
5788
5821
|
function configurationDigest(candidate) {
|
|
5789
|
-
return isRecord2(candidate) && isRecord2(candidate
|
|
5822
|
+
return isRecord2(candidate) && isRecord2(candidate["configuration"]) ? candidate["configuration"]["digest"] : void 0;
|
|
5790
5823
|
}
|
|
5791
5824
|
function unchangedArtifact(artifact, last) {
|
|
5792
|
-
const id = artifact
|
|
5793
|
-
const outputs = artifact
|
|
5794
|
-
if (!string2(artifact
|
|
5825
|
+
const id = artifact["id"];
|
|
5826
|
+
const outputs = artifact["outputs"];
|
|
5827
|
+
if (!string2(artifact["revision"]) || last.revisions.get(id) !== artifact["revision"] || !Array.isArray(outputs) || outputs.length !== (last.counts.get(id) ?? 0))
|
|
5795
5828
|
return false;
|
|
5796
5829
|
return outputs.every((output) => {
|
|
5797
|
-
if (!isRecord2(output) || !string2(output
|
|
5798
|
-
const entry = last.files.get(output
|
|
5799
|
-
return entry?.ownerId === id && entry.digest === output
|
|
5830
|
+
if (!isRecord2(output) || !string2(output["path"])) return false;
|
|
5831
|
+
const entry = last.files.get(output["path"]);
|
|
5832
|
+
return entry?.ownerId === id && entry.digest === output["digest"] && entry.role === output["role"];
|
|
5800
5833
|
});
|
|
5801
5834
|
}
|
|
5802
5835
|
var EMPTY_SCOPE_FACTS = canonicalJson({ definitions: [], references: [] });
|
|
@@ -5979,7 +6012,7 @@ function stringArray(value) {
|
|
|
5979
6012
|
function isIdentity(value) {
|
|
5980
6013
|
if (!isRecord2(value) || !exact(value, ["projectId", "entryId", "role"], ["declarationId", "part"]))
|
|
5981
6014
|
return false;
|
|
5982
|
-
return string2(value
|
|
6015
|
+
return string2(value["projectId"]) && string2(value["entryId"]) && [
|
|
5983
6016
|
"page-shell",
|
|
5984
6017
|
"content",
|
|
5985
6018
|
"demo-assets",
|
|
@@ -5987,7 +6020,7 @@ function isIdentity(value) {
|
|
|
5987
6020
|
"category",
|
|
5988
6021
|
"api-list",
|
|
5989
6022
|
"aggregate"
|
|
5990
|
-
].includes(String(value
|
|
6023
|
+
].includes(String(value["role"])) && (value["declarationId"] === void 0 || string2(value["declarationId"])) && (value["part"] === void 0 || string2(value["part"]));
|
|
5991
6024
|
}
|
|
5992
6025
|
function isFingerprint(value) {
|
|
5993
6026
|
return isRecord2(value) && exact(value, [
|
|
@@ -5997,40 +6030,40 @@ function isFingerprint(value) {
|
|
|
5997
6030
|
"configurationDigest",
|
|
5998
6031
|
"inputDigest",
|
|
5999
6032
|
"keywordDigest"
|
|
6000
|
-
]) && value
|
|
6001
|
-
value
|
|
6002
|
-
value
|
|
6003
|
-
value
|
|
6004
|
-
value
|
|
6005
|
-
value
|
|
6033
|
+
]) && value["schemaVersion"] === SCHEMA_VERSION && [
|
|
6034
|
+
value["compilerVersion"],
|
|
6035
|
+
value["toolchainDigest"],
|
|
6036
|
+
value["configurationDigest"],
|
|
6037
|
+
value["inputDigest"],
|
|
6038
|
+
value["keywordDigest"]
|
|
6006
6039
|
].every(string2);
|
|
6007
6040
|
}
|
|
6008
6041
|
function isDependency(value) {
|
|
6009
|
-
if (!isRecord2(value) || !string2(value
|
|
6010
|
-
if (value
|
|
6011
|
-
return exact(value, ["kind", "path", "digest"]) && string2(value
|
|
6012
|
-
if (value
|
|
6013
|
-
return exact(value, ["kind", "path", "exists"]) && string2(value
|
|
6014
|
-
if (value
|
|
6015
|
-
return exact(value, ["kind", "root", "include", "exclude", "members"]) && string2(value
|
|
6016
|
-
if (value
|
|
6017
|
-
return exact(value, ["kind", "scopeId", "digest", "files", "reason"]) && string2(value
|
|
6018
|
-
if (value
|
|
6019
|
-
return exact(value, ["kind", "scopeId", "digest", "reason"]) && string2(value
|
|
6020
|
-
if (value
|
|
6021
|
-
return exact(value, ["kind", "scopeId", "key", "digest"]) && string2(value
|
|
6022
|
-
if (value
|
|
6023
|
-
return exact(value, ["kind", "entryId", "digest"]) && string2(value
|
|
6024
|
-
return value
|
|
6042
|
+
if (!isRecord2(value) || !string2(value["kind"])) return false;
|
|
6043
|
+
if (value["kind"] === "content")
|
|
6044
|
+
return exact(value, ["kind", "path", "digest"]) && string2(value["path"]) && string2(value["digest"]);
|
|
6045
|
+
if (value["kind"] === "existence")
|
|
6046
|
+
return exact(value, ["kind", "path", "exists"]) && string2(value["path"]) && typeof value["exists"] === "boolean";
|
|
6047
|
+
if (value["kind"] === "glob")
|
|
6048
|
+
return exact(value, ["kind", "root", "include", "exclude", "members"]) && string2(value["root"]) && stringArray(value["include"]) && stringArray(value["exclude"]) && stringArray(value["members"]);
|
|
6049
|
+
if (value["kind"] === "semantic")
|
|
6050
|
+
return exact(value, ["kind", "scopeId", "digest", "files", "reason"]) && string2(value["scopeId"]) && string2(value["digest"]) && stringArray(value["files"]) && string2(value["reason"]);
|
|
6051
|
+
if (value["kind"] === "semantic-reference")
|
|
6052
|
+
return exact(value, ["kind", "scopeId", "digest", "reason"]) && string2(value["scopeId"]) && string2(value["digest"]) && string2(value["reason"]);
|
|
6053
|
+
if (value["kind"] === "semantic-closure")
|
|
6054
|
+
return exact(value, ["kind", "scopeId", "key", "digest"]) && string2(value["scopeId"]) && string2(value["key"]) && string2(value["digest"]);
|
|
6055
|
+
if (value["kind"] === "evaluated")
|
|
6056
|
+
return exact(value, ["kind", "entryId", "digest"]) && string2(value["entryId"]) && string2(value["digest"]);
|
|
6057
|
+
return value["kind"] === "keyword" && exact(value, ["kind", "key", "digest"]) && string2(value["key"]) && string2(value["digest"]);
|
|
6025
6058
|
}
|
|
6026
6059
|
function isKeyword(value) {
|
|
6027
|
-
return isRecord2(value) && exact(value, ["key", "title", "path"], ["type", "languages", "description"]) && string2(value
|
|
6060
|
+
return isRecord2(value) && exact(value, ["key", "title", "path"], ["type", "languages", "description"]) && string2(value["key"]) && string2(value["title"]) && string2(value["path"]) && (value["type"] === void 0 || value["type"] === "link") && (value["languages"] === void 0 || stringArray(value["languages"])) && [value["description"], value["signature"]].every((item) => item === void 0 || string2(item));
|
|
6028
6061
|
}
|
|
6029
6062
|
function isSource(value) {
|
|
6030
|
-
return isRecord2(value) && exact(value, ["path"], ["line", "column"]) && string2(value
|
|
6063
|
+
return isRecord2(value) && exact(value, ["path"], ["line", "column"]) && string2(value["path"]) && (value["line"] === void 0 || finite(value["line"])) && (value["column"] === void 0 || finite(value["column"]));
|
|
6031
6064
|
}
|
|
6032
6065
|
function isDiagnostic(value) {
|
|
6033
|
-
return isRecord2(value) && exact(value, ["code", "severity", "message", "stage"], ["source", "ownerId", "related"]) && string2(value
|
|
6066
|
+
return isRecord2(value) && exact(value, ["code", "severity", "message", "stage"], ["source", "ownerId", "related"]) && string2(value["code"]) && ["error", "warning", "info"].includes(String(value["severity"])) && string2(value["message"]) && [
|
|
6034
6067
|
"discovery",
|
|
6035
6068
|
"evaluation",
|
|
6036
6069
|
"semantic",
|
|
@@ -6039,8 +6072,8 @@ function isDiagnostic(value) {
|
|
|
6039
6072
|
"cache",
|
|
6040
6073
|
"commit",
|
|
6041
6074
|
"host"
|
|
6042
|
-
].includes(String(value
|
|
6043
|
-
(item) => isRecord2(item) && exact(item, ["message", "source"]) && string2(item
|
|
6075
|
+
].includes(String(value["stage"])) && (value["source"] === void 0 || isSource(value["source"])) && (value["ownerId"] === void 0 || string2(value["ownerId"])) && (value["related"] === void 0 || Array.isArray(value["related"]) && value["related"].every(
|
|
6076
|
+
(item) => isRecord2(item) && exact(item, ["message", "source"]) && string2(item["message"]) && isSource(item["source"])
|
|
6044
6077
|
));
|
|
6045
6078
|
}
|
|
6046
6079
|
function isSearch(value) {
|
|
@@ -6048,17 +6081,17 @@ function isSearch(value) {
|
|
|
6048
6081
|
value,
|
|
6049
6082
|
["breadcrumbs", "pageType", "title", "section", "route", "content"],
|
|
6050
6083
|
["fragment", "kind", "signature", "description"]
|
|
6051
|
-
) && stringArray(value
|
|
6084
|
+
) && stringArray(value["breadcrumbs"]) && ["guide", "api"].includes(String(value["pageType"])) && [value["title"], value["section"], value["route"], value["content"]].every(string2) && [value["fragment"], value["kind"], value["signature"], value["description"]].every(
|
|
6052
6085
|
(item) => item === void 0 || string2(item)
|
|
6053
6086
|
);
|
|
6054
6087
|
}
|
|
6055
6088
|
function isAnchor(value) {
|
|
6056
|
-
return isRecord2(value) && exact(value, ["anchorId", "anchor", "title", "type"], ["scope"]) && [value
|
|
6089
|
+
return isRecord2(value) && exact(value, ["anchorId", "anchor", "title", "type"], ["scope"]) && [value["anchorId"], value["anchor"], value["title"]].every(string2) && ["heading", "member"].includes(String(value["type"])) && (value["scope"] === void 0 || isRecord2(value["scope"]) && exact(value["scope"], ["key", "title"]) && string2(value["scope"]["key"]) && string2(value["scope"]["title"]));
|
|
6057
6090
|
}
|
|
6058
6091
|
function isLinkedContent(value) {
|
|
6059
|
-
if (!isRecord2(value) || !exact(value, ["ir", "html", "searchRecords", "keywordDigest"]) || !string2(value
|
|
6092
|
+
if (!isRecord2(value) || !exact(value, ["ir", "html", "searchRecords", "keywordDigest"]) || !string2(value["html"]) || !string2(value["keywordDigest"]) || !Array.isArray(value["searchRecords"]) || !value["searchRecords"].every(isSearch) || !isRecord2(value["ir"]))
|
|
6060
6093
|
return false;
|
|
6061
|
-
const ir = value
|
|
6094
|
+
const ir = value["ir"];
|
|
6062
6095
|
return exact(
|
|
6063
6096
|
ir,
|
|
6064
6097
|
[
|
|
@@ -6077,7 +6110,9 @@ function isLinkedContent(value) {
|
|
|
6077
6110
|
"diagnostics"
|
|
6078
6111
|
],
|
|
6079
6112
|
["icon", "searchBreadcrumbs"]
|
|
6080
|
-
) && ir
|
|
6113
|
+
) && ir["schemaVersion"] === SCHEMA_VERSION && [ir["id"], ir["entryId"], ir["title"], ir["route"], ir["absoluteRoute"], ir["html"]].every(
|
|
6114
|
+
string2
|
|
6115
|
+
) && ["guide-tab", "api-tab", "header", "demo-assets"].includes(String(ir["role"])) && (ir["searchBreadcrumbs"] === void 0 || stringArray(ir["searchBreadcrumbs"])) && (ir["icon"] === void 0 || string2(ir["icon"])) && Array.isArray(ir["anchors"]) && ir["anchors"].every(isAnchor) && Array.isArray(ir["exportedKeywords"]) && ir["exportedKeywords"].every(isKeyword) && stringArray(ir["usedKeywords"]) && Array.isArray(ir["dependencies"]) && ir["dependencies"].every(isDependency) && Array.isArray(ir["diagnostics"]) && ir["diagnostics"].every(isDiagnostic);
|
|
6081
6116
|
}
|
|
6082
6117
|
function isRoute(value) {
|
|
6083
6118
|
return isRecord2(value) && exact(
|
|
@@ -6093,23 +6128,29 @@ function isRoute(value) {
|
|
|
6093
6128
|
"modulePath",
|
|
6094
6129
|
"apiListSegment",
|
|
6095
6130
|
"demoModulePath",
|
|
6096
|
-
"demoNames"
|
|
6131
|
+
"demoNames",
|
|
6132
|
+
"playgroundPages"
|
|
6097
6133
|
]
|
|
6098
|
-
) && [value
|
|
6134
|
+
) && [value["id"], value["path"], value["title"]].every(string2) && (value["parentId"] === void 0 || string2(value["parentId"])) && (value["order"] === void 0 || finite(value["order"])) && (value["hidden"] === void 0 || typeof value["hidden"] === "boolean") && (value["icon"] === void 0 || string2(value["icon"])) && (value["modulePath"] === void 0 || string2(value["modulePath"])) && (value["apiListSegment"] === void 0 || string2(value["apiListSegment"])) && (value["demoModulePath"] === void 0 || string2(value["demoModulePath"])) && (value["demoNames"] === void 0 || stringArray(value["demoNames"])) && (value["playgroundPages"] === void 0 || stringArray(value["playgroundPages"])) && (value["metadata"] === void 0 || isRecord2(value["metadata"]) && exact(value["metadata"], ["description", "tags"]) && string2(value["metadata"]["description"]) && isRecord2(value["metadata"]["tags"]) && Object.values(value["metadata"]["tags"]).every(stringArray)) && (value["category"] === void 0 || isRecord2(value["category"]) && exact(value["category"], ["runtimeImport"], ["expandable", "expanded"]) && isRecord2(value["category"]["runtimeImport"]) && exact(value["category"]["runtimeImport"], ["source", "exportName"]) && string2(value["category"]["runtimeImport"]["source"]) && string2(value["category"]["runtimeImport"]["exportName"]) && (value["category"]["expandable"] === void 0 || typeof value["category"]["expandable"] === "boolean") && (value["category"]["expanded"] === void 0 || typeof value["category"]["expanded"] === "boolean"));
|
|
6099
6135
|
}
|
|
6100
6136
|
function isApiList(value) {
|
|
6101
6137
|
return isRecord2(value) && exact(
|
|
6102
6138
|
value,
|
|
6103
6139
|
["apiEntryId", "scopeId", "scopeTitle", "name", "type", "route"],
|
|
6104
6140
|
["description", "signature"]
|
|
6105
|
-
) && [
|
|
6106
|
-
|
|
6107
|
-
|
|
6141
|
+
) && [
|
|
6142
|
+
value["apiEntryId"],
|
|
6143
|
+
value["scopeId"],
|
|
6144
|
+
value["scopeTitle"],
|
|
6145
|
+
value["name"],
|
|
6146
|
+
value["type"],
|
|
6147
|
+
value["route"]
|
|
6148
|
+
].every(string2) && [value["description"], value["signature"]].every((item) => item === void 0 || string2(item));
|
|
6108
6149
|
}
|
|
6109
6150
|
function isFileOutput(value) {
|
|
6110
|
-
return isRecord2(value) && exact(value, ["path", "role", "encoding", "content", "digest"]) && string2(value
|
|
6111
|
-
String(value
|
|
6112
|
-
) && ["utf8", "base64"].includes(String(value
|
|
6151
|
+
return isRecord2(value) && exact(value, ["path", "role", "encoding", "content", "digest"]) && string2(value["path"]) && ["angular", "content", "asset", "routes", "context", "search", "api-list"].includes(
|
|
6152
|
+
String(value["role"])
|
|
6153
|
+
) && ["utf8", "base64"].includes(String(value["encoding"])) && string2(value["content"]) && string2(value["digest"]);
|
|
6113
6154
|
}
|
|
6114
6155
|
function isContentDescriptor(value) {
|
|
6115
6156
|
if (!isRecord2(value) || !exact(
|
|
@@ -6133,23 +6174,23 @@ function isContentDescriptor(value) {
|
|
|
6133
6174
|
["icon", "keyword"]
|
|
6134
6175
|
))
|
|
6135
6176
|
return false;
|
|
6136
|
-
if (value
|
|
6137
|
-
value
|
|
6138
|
-
value
|
|
6139
|
-
value
|
|
6140
|
-
value
|
|
6141
|
-
value
|
|
6142
|
-
value
|
|
6143
|
-
value
|
|
6144
|
-
].every(string2) || ![value
|
|
6177
|
+
if (value["schemaVersion"] !== SCHEMA_VERSION || ![
|
|
6178
|
+
value["id"],
|
|
6179
|
+
value["ownerId"],
|
|
6180
|
+
value["title"],
|
|
6181
|
+
value["route"],
|
|
6182
|
+
value["absoluteRoute"],
|
|
6183
|
+
value["inputDigest"],
|
|
6184
|
+
value["requestDigest"]
|
|
6185
|
+
].every(string2) || ![value["id"], value["ownerId"], value["inputDigest"], value["requestDigest"]].every(
|
|
6145
6186
|
(item) => string2(item) && item.length > 0 && !item.includes("\0")
|
|
6146
|
-
) || !finite(value
|
|
6187
|
+
) || !finite(value["ordinal"]) || value["ordinal"] < 0 || !Number.isInteger(value["ordinal"]) || !["guide-tab", "api-tab", "header"].includes(String(value["role"])) || !stringArray(value["searchBreadcrumbs"]) || !Array.isArray(value["dependencies"]) || !value["dependencies"].every((dependency) => isPhysicalDescriptorDependency(dependency)) || new Set(value["dependencies"].map((dependency) => canonicalJson(dependency))).size !== value["dependencies"].length || !stringArray(value["closureIds"]) || value["icon"] !== void 0 && !string2(value["icon"]) || value["keyword"] !== void 0 && !string2(value["keyword"]) || !isRecord2(value["locator"]))
|
|
6147
6188
|
return false;
|
|
6148
|
-
const locator = value
|
|
6149
|
-
return value
|
|
6189
|
+
const locator = value["locator"];
|
|
6190
|
+
return value["role"] === "header" ? exact(locator, ["kind"]) && locator["kind"] === "header" : value["role"] === "guide-tab" ? exact(locator, ["kind", "markdown"]) && locator["kind"] === "guide-tab" && string2(locator["markdown"]) : exact(locator, ["kind", "declarationId"]) && locator["kind"] === "api-tab" && string2(locator["declarationId"]);
|
|
6150
6191
|
}
|
|
6151
6192
|
function isPhysicalDescriptorDependency(value) {
|
|
6152
|
-
return isRecord2(value) && (value
|
|
6193
|
+
return isRecord2(value) && (value["kind"] === "content" && exact(value, ["kind", "path", "digest"]) && absoluteNormalizedPath(value["path"]) && string2(value["digest"]) || value["kind"] === "existence" && exact(value, ["kind", "path", "exists"]) && absoluteNormalizedPath(value["path"]) && typeof value["exists"] === "boolean");
|
|
6153
6194
|
}
|
|
6154
6195
|
function validDescriptorPlan(artifact) {
|
|
6155
6196
|
const descriptors = artifact.contentDescriptors;
|
|
@@ -6234,7 +6275,7 @@ function isPageArtifact(value) {
|
|
|
6234
6275
|
"diagnostics"
|
|
6235
6276
|
],
|
|
6236
6277
|
["contentDescriptors"]
|
|
6237
|
-
) && string2(value
|
|
6278
|
+
) && string2(value["id"]) && isIdentity(value["identity"]) && string2(value["revision"]) && isFingerprint(value["fingerprint"]) && Array.isArray(value["dependencies"]) && value["dependencies"].every(isDependency) && Array.isArray(value["content"]) && value["content"].every(isLinkedContent) && Array.isArray(value["exportedKeywords"]) && value["exportedKeywords"].every(isKeyword) && stringArray(value["usedKeywords"]) && Array.isArray(value["searchRecords"]) && value["searchRecords"].every(isSearch) && Array.isArray(value["routes"]) && value["routes"].every(isRoute) && Array.isArray(value["apiList"]) && value["apiList"].every(isApiList) && Array.isArray(value["outputs"]) && value["outputs"].every((output) => isFileOutput(output) && validOutputDigest(output)) && Array.isArray(value["diagnostics"]) && value["diagnostics"].every(isDiagnostic) && validDescriptorPlan(value);
|
|
6238
6279
|
}
|
|
6239
6280
|
function isJsonTree(value, ancestors = /* @__PURE__ */ new WeakSet()) {
|
|
6240
6281
|
if (value === null || string2(value) || typeof value === "boolean") return true;
|
|
@@ -6269,19 +6310,19 @@ function validOutputDigest(output) {
|
|
|
6269
6310
|
}
|
|
6270
6311
|
}
|
|
6271
6312
|
function isPublishedGeneratorConfiguration(value) {
|
|
6272
|
-
return isJsonTree(value) && isRecord2(value) && exact(value, ["outputRoot", "cacheRoot", "assetDirectory", "themes", "digest"]) && [value
|
|
6313
|
+
return isJsonTree(value) && isRecord2(value) && exact(value, ["outputRoot", "cacheRoot", "assetDirectory", "themes", "digest"]) && [value["outputRoot"], value["cacheRoot"]].every(
|
|
6273
6314
|
(item) => string2(item) && path6.isAbsolute(item) && path6.resolve(item).replace(/\\/g, "/") === item && !item.includes("\0")
|
|
6274
|
-
) && string2(value
|
|
6315
|
+
) && string2(value["assetDirectory"]) && !path6.win32.parse(value["assetDirectory"]).root && safeRelative(value["assetDirectory"]) && isRecord2(value["themes"]) && exact(value["themes"], ["light", "dark"]) && string2(value["themes"]["light"]) && string2(value["themes"]["dark"]) && string2(value["digest"]);
|
|
6275
6316
|
}
|
|
6276
6317
|
function isArtifactSnapshotShape(value) {
|
|
6277
6318
|
return isJsonTree(value) && isRecord2(value) && exact(
|
|
6278
6319
|
value,
|
|
6279
6320
|
["projectId", "revision", "artifacts", "globalKeywords", "remoteKeywords"],
|
|
6280
6321
|
["configuration"]
|
|
6281
|
-
) && (value
|
|
6322
|
+
) && (value["configuration"] === void 0 || isPublishedGeneratorConfiguration(value["configuration"])) && string2(value["projectId"]) && string2(value["revision"]) && Array.isArray(value["artifacts"]) && value["artifacts"].every(isPageArtifact) && Array.isArray(value["globalKeywords"]) && value["globalKeywords"].every(isKeyword) && Array.isArray(value["remoteKeywords"]) && value["remoteKeywords"].every(isRemoteKeywords);
|
|
6282
6323
|
}
|
|
6283
6324
|
function isRemoteKeywords(remote) {
|
|
6284
|
-
return isRecord2(remote) && exact(remote, ["loaderId", "digest", "keywords"], ["validator"]) && string2(remote
|
|
6325
|
+
return isRecord2(remote) && exact(remote, ["loaderId", "digest", "keywords"], ["validator"]) && string2(remote["loaderId"]) && string2(remote["digest"]) && Array.isArray(remote["keywords"]) && remote["keywords"].every(isKeyword) && (remote["validator"] === void 0 || string2(remote["validator"]));
|
|
6285
6326
|
}
|
|
6286
6327
|
function isSnapshotEnvelope(value) {
|
|
6287
6328
|
if (!isRecord2(value) || Object.getPrototypeOf(value) !== Object.prototype) return false;
|
|
@@ -6292,7 +6333,7 @@ function isSnapshotEnvelope(value) {
|
|
|
6292
6333
|
return descriptor?.enumerable === true && "value" in descriptor;
|
|
6293
6334
|
}))
|
|
6294
6335
|
return false;
|
|
6295
|
-
const artifacts = value
|
|
6336
|
+
const artifacts = value["artifacts"];
|
|
6296
6337
|
if (!Array.isArray(artifacts) || Object.getPrototypeOf(artifacts) !== Array.prototype || Reflect.ownKeys(artifacts).length !== artifacts.length + 1)
|
|
6297
6338
|
return false;
|
|
6298
6339
|
for (let index = 0; index < artifacts.length; index += 1)
|
|
@@ -6301,14 +6342,14 @@ function isSnapshotEnvelope(value) {
|
|
|
6301
6342
|
value,
|
|
6302
6343
|
["projectId", "revision", "artifacts", "globalKeywords", "remoteKeywords"],
|
|
6303
6344
|
["configuration"]
|
|
6304
|
-
) && (value
|
|
6345
|
+
) && (value["configuration"] === void 0 || isPublishedGeneratorConfiguration(value["configuration"])) && string2(value["projectId"]) && string2(value["revision"]) && isJsonTree(value["globalKeywords"]) && Array.isArray(value["globalKeywords"]) && value["globalKeywords"].every(isKeyword) && isJsonTree(value["remoteKeywords"]) && Array.isArray(value["remoteKeywords"]) && value["remoteKeywords"].every(isRemoteKeywords);
|
|
6305
6346
|
}
|
|
6306
6347
|
function isOutputManifest(value) {
|
|
6307
|
-
return isJsonTree(value) && isRecord2(value) && exact(value, ["schemaVersion", "projectId", "generation", "revision", "files"]) && value
|
|
6308
|
-
(file) => isRecord2(file) && exact(file, ["path", "ownerId", "digest", "role"]) && string2(file
|
|
6309
|
-
String(file
|
|
6348
|
+
return isJsonTree(value) && isRecord2(value) && exact(value, ["schemaVersion", "projectId", "generation", "revision", "files"]) && value["schemaVersion"] === OUTPUT_SCHEMA_VERSION && string2(value["projectId"]) && finite(value["generation"]) && string2(value["revision"]) && Array.isArray(value["files"]) && value["files"].every(
|
|
6349
|
+
(file) => isRecord2(file) && exact(file, ["path", "ownerId", "digest", "role"]) && string2(file["path"]) && string2(file["ownerId"]) && string2(file["digest"]) && safeRelative(file["path"]) && ["angular", "content", "asset", "routes", "context", "search", "api-list"].includes(
|
|
6350
|
+
String(file["role"])
|
|
6310
6351
|
)
|
|
6311
|
-
) && new Set(value
|
|
6352
|
+
) && new Set(value["files"].map((file) => file.path)).size === value["files"].length;
|
|
6312
6353
|
}
|
|
6313
6354
|
function safeRelative(value) {
|
|
6314
6355
|
try {
|
|
@@ -6600,16 +6641,18 @@ function quoteWindowsArgument(value, twice = false) {
|
|
|
6600
6641
|
}
|
|
6601
6642
|
function nodeEntry(command, options) {
|
|
6602
6643
|
const exists2 = options.isFile ?? isFile;
|
|
6603
|
-
const name = /^(ng|npm|npx)(?:\.cmd)?$/i.exec(command)?.[1]?.toLowerCase();
|
|
6644
|
+
const name = /^(ng|npm|npx|pnpm|pnpx)(?:\.cmd)?$/i.exec(command)?.[1]?.toLowerCase();
|
|
6604
6645
|
if (!name) return void 0;
|
|
6646
|
+
const nodeDirectory = path8.win32.dirname(options.execPath ?? process.execPath);
|
|
6647
|
+
if (name === "pnpm" || name === "pnpx") {
|
|
6648
|
+
const shim = resolveWindowsCommand(name, options);
|
|
6649
|
+
if (!shim || path8.win32.dirname(shim).toLowerCase() !== nodeDirectory.toLowerCase())
|
|
6650
|
+
return void 0;
|
|
6651
|
+
const entry = path8.win32.join(nodeDirectory, "node_modules", "corepack", "dist", `${name}.js`);
|
|
6652
|
+
return exists2(entry) ? entry : void 0;
|
|
6653
|
+
}
|
|
6605
6654
|
if (name !== "ng") {
|
|
6606
|
-
const entry = path8.win32.join(
|
|
6607
|
-
path8.win32.dirname(options.execPath ?? process.execPath),
|
|
6608
|
-
"node_modules",
|
|
6609
|
-
"npm",
|
|
6610
|
-
"bin",
|
|
6611
|
-
`${name}-cli.js`
|
|
6612
|
-
);
|
|
6655
|
+
const entry = path8.win32.join(nodeDirectory, "node_modules", "npm", "bin", `${name}-cli.js`);
|
|
6613
6656
|
return exists2(entry) ? entry : void 0;
|
|
6614
6657
|
}
|
|
6615
6658
|
for (let directory = path8.win32.resolve(options.cwd); ; ) {
|