@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.
Files changed (32) hide show
  1. package/LICENSE +21 -0
  2. package/generator/bootstrap/bin.js +150 -107
  3. package/generator/bootstrap/cli.js +150 -107
  4. package/generator/bootstrap/index.js +125 -99
  5. package/generator/bootstrap/process-tree.d.ts +5 -4
  6. package/generator/build-metafile.json +177 -78
  7. package/generator/build-provenance.json +3 -3
  8. package/generator/compiler/index.js +689 -484
  9. package/generator/content/html-worker.js +8 -0
  10. package/generator/contracts.d.ts +20 -2
  11. package/generator/kernel/flags.d.ts +3 -0
  12. package/generator/outputs/index.d.ts +22 -6
  13. package/generator/templates/demo-routes.ts.nunj +21 -1
  14. package/generator/templates/page.ts.nunj +5 -1
  15. package/generator/vite/angular/analog-provenance.json +1 -1
  16. package/generator/vite/angular-composition.d.ts +25 -1
  17. package/generator/vite/content-updates.d.ts +62 -0
  18. package/generator/vite/host-updates.d.ts +85 -5
  19. package/generator/vite/index.js +621 -243
  20. package/generator/vite/lifecycle.d.ts +39 -2
  21. package/helpers/playground/get-playground-inputs.js +6 -3
  22. package/helpers/playground/get-playground-inputs.js.map +1 -1
  23. package/helpers/playground/playground-options.d.ts +28 -0
  24. package/helpers/playground/playground-options.js +122 -0
  25. package/helpers/playground/playground-options.js.map +1 -0
  26. package/helpers/playground/written-union-order.d.ts +33 -0
  27. package/helpers/playground/written-union-order.js +106 -0
  28. package/helpers/playground/written-union-order.js.map +1 -0
  29. package/interfaces/configuration.d.ts +11 -3
  30. package/package.json +4 -4
  31. package/templates/demo-routes.ts.nunj +21 -1
  32. package/templates/page.ts.nunj +5 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Aleksandr Skoropad
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -256,6 +256,21 @@ var ENGINE_SWITCHES = Object.freeze([
256
256
  values: /^(0|false|off|no)$/i,
257
257
  effect: "adding or removing a page compiles the application twice"
258
258
  },
259
+ {
260
+ name: "NGDOC_ANGULAR_DESCRIPTION_PASS",
261
+ values: /^(0|false|off|no)$/i,
262
+ effect: "a page title edit compiles the application twice"
263
+ },
264
+ {
265
+ name: "NGDOC_VITE_CONTENT_UPDATE",
266
+ values: /^(0|false|off|no)$/i,
267
+ effect: "guide text edits reload the page"
268
+ },
269
+ {
270
+ name: "NGDOC_VITE_MODULELESS_SETTLE",
271
+ values: /^(0|false|off|no)$/i,
272
+ effect: "hot updates of files the browser never loaded wait for the newest generation"
273
+ },
259
274
  {
260
275
  name: "NGDOC_VITE_BUILD_HANDOFF",
261
276
  values: /^(0|false|off|no)$/i,
@@ -1612,7 +1627,7 @@ function createParcelEventSource(root, options = {}, subscribe2 = parcel.subscri
1612
1627
 
1613
1628
  // libs/builder/generator/bootstrap/constants.ts
1614
1629
  var GENERATOR_COMPILER_VERSION = "0.0.1";
1615
- var GENERATOR_TOOLCHAIN_DIGEST = "d3b66d41f47865fb003a881897f703f6b49568eefa8f301d410768b97f5647e2";
1630
+ var GENERATOR_TOOLCHAIN_DIGEST = "495b74972f5c2d99ad311bd24b03e2560f77343e401abd7c4d8185e4fee96764";
1616
1631
 
1617
1632
  // libs/builder/generator/bootstrap/index.ts
1618
1633
  import path7 from "node:path";
@@ -1630,7 +1645,10 @@ var INCREMENTAL_PROGRAM_FLAG = "NGDOC_INCREMENTAL_PROGRAM";
1630
1645
  var SHAPE_CLOSURE_FLAG = "NGDOC_SHAPE_CLOSURE";
1631
1646
  var ANGULAR_SHARED_PASS_FLAG = "NGDOC_ANGULAR_SHARED_PASS";
1632
1647
  var ANGULAR_STRUCTURAL_PASS_FLAG = "NGDOC_ANGULAR_STRUCTURAL_PASS";
1648
+ var ANGULAR_DESCRIPTION_PASS_FLAG = "NGDOC_ANGULAR_DESCRIPTION_PASS";
1649
+ var VITE_CONTENT_UPDATE_FLAG = "NGDOC_VITE_CONTENT_UPDATE";
1633
1650
  var VITE_BUILD_HANDOFF_FLAG = "NGDOC_VITE_BUILD_HANDOFF";
1651
+ var VITE_MODULELESS_SETTLE_FLAG = "NGDOC_VITE_MODULELESS_SETTLE";
1634
1652
  var TRACKED_PROGRAM_REUSE_FLAG = "NGDOC_TRACKED_PROGRAM_REUSE";
1635
1653
  var FAST_START_FLAG = "NGDOC_FAST_START";
1636
1654
  var PARALLEL_WRITES_FLAG = "NGDOC_PARALLEL_WRITES";
@@ -1705,6 +1723,21 @@ var FLAGS = Object.freeze(
1705
1723
  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.",
1706
1724
  verify: false
1707
1725
  },
1726
+ {
1727
+ name: ANGULAR_DESCRIPTION_PASS_FLAG,
1728
+ 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.",
1729
+ verify: false
1730
+ },
1731
+ {
1732
+ name: VITE_CONTENT_UPDATE_FLAG,
1733
+ 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.",
1734
+ verify: false
1735
+ },
1736
+ {
1737
+ name: VITE_MODULELESS_SETTLE_FLAG,
1738
+ 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.",
1739
+ verify: false
1740
+ },
1708
1741
  {
1709
1742
  name: VITE_BUILD_HANDOFF_FLAG,
1710
1743
  description: "The server build of the Vite production pipeline publishes the browser build's generation instead of generating again.",
@@ -2690,29 +2723,29 @@ function projectWatchInputs(dependencies) {
2690
2723
  const scopes = /* @__PURE__ */ new Map();
2691
2724
  const references = [];
2692
2725
  for (const dependency of dependencies) {
2693
- if (!isRecord(dependency) || typeof dependency.kind !== "string")
2726
+ if (!isRecord(dependency) || typeof dependency["kind"] !== "string")
2694
2727
  throw new Error("Invalid dependency");
2695
- switch (dependency.kind) {
2728
+ switch (dependency["kind"]) {
2696
2729
  case "content": {
2697
2730
  if (!hasExactKeys(dependency, ["digest", "kind", "path"]))
2698
2731
  throw new Error("Invalid content dependency");
2699
- files.add(path4(dependency.path, "content path"));
2700
- string(dependency.digest, "content digest");
2732
+ files.add(path4(dependency["path"], "content path"));
2733
+ string(dependency["digest"], "content digest");
2701
2734
  break;
2702
2735
  }
2703
2736
  case "existence": {
2704
- if (!hasExactKeys(dependency, ["exists", "kind", "path"]) || typeof dependency.exists !== "boolean")
2737
+ if (!hasExactKeys(dependency, ["exists", "kind", "path"]) || typeof dependency["exists"] !== "boolean")
2705
2738
  throw new Error("Invalid existence dependency");
2706
- files.add(path4(dependency.path, "existence path"));
2739
+ files.add(path4(dependency["path"], "existence path"));
2707
2740
  break;
2708
2741
  }
2709
2742
  case "glob": {
2710
2743
  if (!hasExactKeys(dependency, ["exclude", "include", "kind", "members", "root"]))
2711
2744
  throw new Error("Invalid glob dependency");
2712
- const root = path4(dependency.root, "glob root");
2713
- const include = strings(dependency.include, "glob include");
2714
- const exclude = strings(dependency.exclude, "glob exclude");
2715
- paths(dependency.members, "glob members").forEach((member) => files.add(member));
2745
+ const root = path4(dependency["root"], "glob root");
2746
+ const include = strings(dependency["include"], "glob include");
2747
+ const exclude = strings(dependency["exclude"], "glob exclude");
2748
+ paths(dependency["members"], "glob members").forEach((member) => files.add(member));
2716
2749
  const glob = { root, include, exclude };
2717
2750
  globs.set(JSON.stringify(glob), glob);
2718
2751
  break;
@@ -2720,10 +2753,10 @@ function projectWatchInputs(dependencies) {
2720
2753
  case "semantic": {
2721
2754
  if (!hasExactKeys(dependency, ["digest", "files", "kind", "reason", "scopeId"]))
2722
2755
  throw new Error("Invalid semantic dependency");
2723
- const scopeId = string(dependency.scopeId, "semantic scope ID");
2724
- const digest = string(dependency.digest, "semantic digest");
2725
- string(dependency.reason, "semantic reason");
2726
- const scopeFiles = paths(dependency.files, "semantic files");
2756
+ const scopeId = string(dependency["scopeId"], "semantic scope ID");
2757
+ const digest = string(dependency["digest"], "semantic digest");
2758
+ string(dependency["reason"], "semantic reason");
2759
+ const scopeFiles = paths(dependency["files"], "semantic files");
2727
2760
  scopeFiles.forEach((file) => files.add(file));
2728
2761
  const registered = scopes.get(scopeId) ?? [];
2729
2762
  registered.push({ digest });
@@ -2734,17 +2767,17 @@ function projectWatchInputs(dependencies) {
2734
2767
  if (!hasExactKeys(dependency, ["digest", "kind", "reason", "scopeId"]))
2735
2768
  throw new Error("Invalid semantic-reference dependency");
2736
2769
  references.push({
2737
- scopeId: string(dependency.scopeId, "semantic-reference scope ID"),
2738
- digest: string(dependency.digest, "semantic-reference digest")
2770
+ scopeId: string(dependency["scopeId"], "semantic-reference scope ID"),
2771
+ digest: string(dependency["digest"], "semantic-reference digest")
2739
2772
  });
2740
- string(dependency.reason, "semantic-reference reason");
2773
+ string(dependency["reason"], "semantic-reference reason");
2741
2774
  break;
2742
2775
  }
2743
2776
  case "keyword": {
2744
2777
  if (!hasExactKeys(dependency, ["digest", "key", "kind"]))
2745
2778
  throw new Error("Invalid keyword dependency");
2746
- string(dependency.key, "keyword key");
2747
- string(dependency.digest, "keyword digest");
2779
+ string(dependency["key"], "keyword key");
2780
+ string(dependency["digest"], "keyword digest");
2748
2781
  break;
2749
2782
  }
2750
2783
  // The non-physical kinds are validated but are never watch inputs: they name no path, and
@@ -2752,16 +2785,16 @@ function projectWatchInputs(dependencies) {
2752
2785
  case "semantic-closure": {
2753
2786
  if (!hasExactKeys(dependency, ["digest", "key", "kind", "scopeId"]))
2754
2787
  throw new Error("Invalid semantic-closure dependency");
2755
- string(dependency.scopeId, "semantic-closure scope ID");
2756
- string(dependency.key, "semantic-closure key");
2757
- string(dependency.digest, "semantic-closure digest");
2788
+ string(dependency["scopeId"], "semantic-closure scope ID");
2789
+ string(dependency["key"], "semantic-closure key");
2790
+ string(dependency["digest"], "semantic-closure digest");
2758
2791
  break;
2759
2792
  }
2760
2793
  case "evaluated": {
2761
2794
  if (!hasExactKeys(dependency, ["digest", "entryId", "kind"]))
2762
2795
  throw new Error("Invalid evaluated dependency");
2763
- string(dependency.entryId, "evaluated entry ID");
2764
- string(dependency.digest, "evaluated digest");
2796
+ string(dependency["entryId"], "evaluated entry ID");
2797
+ string(dependency["digest"], "evaluated digest");
2765
2798
  break;
2766
2799
  }
2767
2800
  default:
@@ -5778,7 +5811,7 @@ function normalizeRelative(value) {
5778
5811
  return normalized;
5779
5812
  }
5780
5813
  function trustedBase(last, request) {
5781
- const published = (manifest) => isRecord2(manifest) && manifest.projectId === last.projectId && manifest.revision === last.revision && manifest.generation === last.generation;
5814
+ const published = (manifest) => isRecord2(manifest) && manifest["projectId"] === last.projectId && manifest["revision"] === last.revision && manifest["generation"] === last.generation;
5782
5815
  const base = request.base;
5783
5816
  return isRecord2(base) && published(base.manifest) && published(request.previous) && isRecord2(base.snapshot) && base.snapshot.projectId === last.projectId && base.snapshot.revision === last.revision;
5784
5817
  }
@@ -5792,17 +5825,17 @@ function sameManifestStamp(left, right) {
5792
5825
  return left.dev === right.dev && left.ino === right.ino && left.size === right.size && left.mtimeNs === right.mtimeNs && left.ctimeNs === right.ctimeNs;
5793
5826
  }
5794
5827
  function configurationDigest(candidate) {
5795
- return isRecord2(candidate) && isRecord2(candidate.configuration) ? candidate.configuration.digest : void 0;
5828
+ return isRecord2(candidate) && isRecord2(candidate["configuration"]) ? candidate["configuration"]["digest"] : void 0;
5796
5829
  }
5797
5830
  function unchangedArtifact(artifact, last) {
5798
- const id = artifact.id;
5799
- const outputs = artifact.outputs;
5800
- if (!string2(artifact.revision) || last.revisions.get(id) !== artifact.revision || !Array.isArray(outputs) || outputs.length !== (last.counts.get(id) ?? 0))
5831
+ const id = artifact["id"];
5832
+ const outputs = artifact["outputs"];
5833
+ if (!string2(artifact["revision"]) || last.revisions.get(id) !== artifact["revision"] || !Array.isArray(outputs) || outputs.length !== (last.counts.get(id) ?? 0))
5801
5834
  return false;
5802
5835
  return outputs.every((output) => {
5803
- if (!isRecord2(output) || !string2(output.path)) return false;
5804
- const entry = last.files.get(output.path);
5805
- return entry?.ownerId === id && entry.digest === output.digest && entry.role === output.role;
5836
+ if (!isRecord2(output) || !string2(output["path"])) return false;
5837
+ const entry = last.files.get(output["path"]);
5838
+ return entry?.ownerId === id && entry.digest === output["digest"] && entry.role === output["role"];
5806
5839
  });
5807
5840
  }
5808
5841
  var EMPTY_SCOPE_FACTS = canonicalJson({ definitions: [], references: [] });
@@ -5985,7 +6018,7 @@ function stringArray(value) {
5985
6018
  function isIdentity(value) {
5986
6019
  if (!isRecord2(value) || !exact(value, ["projectId", "entryId", "role"], ["declarationId", "part"]))
5987
6020
  return false;
5988
- return string2(value.projectId) && string2(value.entryId) && [
6021
+ return string2(value["projectId"]) && string2(value["entryId"]) && [
5989
6022
  "page-shell",
5990
6023
  "content",
5991
6024
  "demo-assets",
@@ -5993,7 +6026,7 @@ function isIdentity(value) {
5993
6026
  "category",
5994
6027
  "api-list",
5995
6028
  "aggregate"
5996
- ].includes(String(value.role)) && (value.declarationId === void 0 || string2(value.declarationId)) && (value.part === void 0 || string2(value.part));
6029
+ ].includes(String(value["role"])) && (value["declarationId"] === void 0 || string2(value["declarationId"])) && (value["part"] === void 0 || string2(value["part"]));
5997
6030
  }
5998
6031
  function isFingerprint(value) {
5999
6032
  return isRecord2(value) && exact(value, [
@@ -6003,40 +6036,40 @@ function isFingerprint(value) {
6003
6036
  "configurationDigest",
6004
6037
  "inputDigest",
6005
6038
  "keywordDigest"
6006
- ]) && value.schemaVersion === SCHEMA_VERSION && [
6007
- value.compilerVersion,
6008
- value.toolchainDigest,
6009
- value.configurationDigest,
6010
- value.inputDigest,
6011
- value.keywordDigest
6039
+ ]) && value["schemaVersion"] === SCHEMA_VERSION && [
6040
+ value["compilerVersion"],
6041
+ value["toolchainDigest"],
6042
+ value["configurationDigest"],
6043
+ value["inputDigest"],
6044
+ value["keywordDigest"]
6012
6045
  ].every(string2);
6013
6046
  }
6014
6047
  function isDependency(value) {
6015
- if (!isRecord2(value) || !string2(value.kind)) return false;
6016
- if (value.kind === "content")
6017
- return exact(value, ["kind", "path", "digest"]) && string2(value.path) && string2(value.digest);
6018
- if (value.kind === "existence")
6019
- return exact(value, ["kind", "path", "exists"]) && string2(value.path) && typeof value.exists === "boolean";
6020
- if (value.kind === "glob")
6021
- return exact(value, ["kind", "root", "include", "exclude", "members"]) && string2(value.root) && stringArray(value.include) && stringArray(value.exclude) && stringArray(value.members);
6022
- if (value.kind === "semantic")
6023
- return exact(value, ["kind", "scopeId", "digest", "files", "reason"]) && string2(value.scopeId) && string2(value.digest) && stringArray(value.files) && string2(value.reason);
6024
- if (value.kind === "semantic-reference")
6025
- return exact(value, ["kind", "scopeId", "digest", "reason"]) && string2(value.scopeId) && string2(value.digest) && string2(value.reason);
6026
- if (value.kind === "semantic-closure")
6027
- return exact(value, ["kind", "scopeId", "key", "digest"]) && string2(value.scopeId) && string2(value.key) && string2(value.digest);
6028
- if (value.kind === "evaluated")
6029
- return exact(value, ["kind", "entryId", "digest"]) && string2(value.entryId) && string2(value.digest);
6030
- return value.kind === "keyword" && exact(value, ["kind", "key", "digest"]) && string2(value.key) && string2(value.digest);
6048
+ if (!isRecord2(value) || !string2(value["kind"])) return false;
6049
+ if (value["kind"] === "content")
6050
+ return exact(value, ["kind", "path", "digest"]) && string2(value["path"]) && string2(value["digest"]);
6051
+ if (value["kind"] === "existence")
6052
+ return exact(value, ["kind", "path", "exists"]) && string2(value["path"]) && typeof value["exists"] === "boolean";
6053
+ if (value["kind"] === "glob")
6054
+ return exact(value, ["kind", "root", "include", "exclude", "members"]) && string2(value["root"]) && stringArray(value["include"]) && stringArray(value["exclude"]) && stringArray(value["members"]);
6055
+ if (value["kind"] === "semantic")
6056
+ return exact(value, ["kind", "scopeId", "digest", "files", "reason"]) && string2(value["scopeId"]) && string2(value["digest"]) && stringArray(value["files"]) && string2(value["reason"]);
6057
+ if (value["kind"] === "semantic-reference")
6058
+ return exact(value, ["kind", "scopeId", "digest", "reason"]) && string2(value["scopeId"]) && string2(value["digest"]) && string2(value["reason"]);
6059
+ if (value["kind"] === "semantic-closure")
6060
+ return exact(value, ["kind", "scopeId", "key", "digest"]) && string2(value["scopeId"]) && string2(value["key"]) && string2(value["digest"]);
6061
+ if (value["kind"] === "evaluated")
6062
+ return exact(value, ["kind", "entryId", "digest"]) && string2(value["entryId"]) && string2(value["digest"]);
6063
+ return value["kind"] === "keyword" && exact(value, ["kind", "key", "digest"]) && string2(value["key"]) && string2(value["digest"]);
6031
6064
  }
6032
6065
  function isKeyword(value) {
6033
- 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));
6066
+ 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));
6034
6067
  }
6035
6068
  function isSource(value) {
6036
- 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));
6069
+ 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"]));
6037
6070
  }
6038
6071
  function isDiagnostic(value) {
6039
- 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) && [
6072
+ 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"]) && [
6040
6073
  "discovery",
6041
6074
  "evaluation",
6042
6075
  "semantic",
@@ -6045,8 +6078,8 @@ function isDiagnostic(value) {
6045
6078
  "cache",
6046
6079
  "commit",
6047
6080
  "host"
6048
- ].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(
6049
- (item) => isRecord2(item) && exact(item, ["message", "source"]) && string2(item.message) && isSource(item.source)
6081
+ ].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(
6082
+ (item) => isRecord2(item) && exact(item, ["message", "source"]) && string2(item["message"]) && isSource(item["source"])
6050
6083
  ));
6051
6084
  }
6052
6085
  function isSearch(value) {
@@ -6054,17 +6087,17 @@ function isSearch(value) {
6054
6087
  value,
6055
6088
  ["breadcrumbs", "pageType", "title", "section", "route", "content"],
6056
6089
  ["fragment", "kind", "signature", "description"]
6057
- ) && 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(
6090
+ ) && 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(
6058
6091
  (item) => item === void 0 || string2(item)
6059
6092
  );
6060
6093
  }
6061
6094
  function isAnchor(value) {
6062
- 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));
6095
+ 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"]));
6063
6096
  }
6064
6097
  function isLinkedContent(value) {
6065
- 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))
6098
+ 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"]))
6066
6099
  return false;
6067
- const ir = value.ir;
6100
+ const ir = value["ir"];
6068
6101
  return exact(
6069
6102
  ir,
6070
6103
  [
@@ -6083,7 +6116,9 @@ function isLinkedContent(value) {
6083
6116
  "diagnostics"
6084
6117
  ],
6085
6118
  ["icon", "searchBreadcrumbs"]
6086
- ) && ir.schemaVersion === SCHEMA_VERSION && [ir.id, ir.entryId, ir.title, ir.route, ir.absoluteRoute, ir.html].every(string2) && ["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);
6119
+ ) && ir["schemaVersion"] === SCHEMA_VERSION && [ir["id"], ir["entryId"], ir["title"], ir["route"], ir["absoluteRoute"], ir["html"]].every(
6120
+ string2
6121
+ ) && ["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);
6087
6122
  }
6088
6123
  function isRoute(value) {
6089
6124
  return isRecord2(value) && exact(
@@ -6099,23 +6134,29 @@ function isRoute(value) {
6099
6134
  "modulePath",
6100
6135
  "apiListSegment",
6101
6136
  "demoModulePath",
6102
- "demoNames"
6137
+ "demoNames",
6138
+ "playgroundPages"
6103
6139
  ]
6104
- ) && [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.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"));
6140
+ ) && [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"));
6105
6141
  }
6106
6142
  function isApiList(value) {
6107
6143
  return isRecord2(value) && exact(
6108
6144
  value,
6109
6145
  ["apiEntryId", "scopeId", "scopeTitle", "name", "type", "route"],
6110
6146
  ["description", "signature"]
6111
- ) && [value.apiEntryId, value.scopeId, value.scopeTitle, value.name, value.type, value.route].every(
6112
- string2
6113
- ) && [value.description, value.signature].every((item) => item === void 0 || string2(item));
6147
+ ) && [
6148
+ value["apiEntryId"],
6149
+ value["scopeId"],
6150
+ value["scopeTitle"],
6151
+ value["name"],
6152
+ value["type"],
6153
+ value["route"]
6154
+ ].every(string2) && [value["description"], value["signature"]].every((item) => item === void 0 || string2(item));
6114
6155
  }
6115
6156
  function isFileOutput(value) {
6116
- return isRecord2(value) && exact(value, ["path", "role", "encoding", "content", "digest"]) && string2(value.path) && ["angular", "content", "asset", "routes", "context", "search", "api-list"].includes(
6117
- String(value.role)
6118
- ) && ["utf8", "base64"].includes(String(value.encoding)) && string2(value.content) && string2(value.digest);
6157
+ return isRecord2(value) && exact(value, ["path", "role", "encoding", "content", "digest"]) && string2(value["path"]) && ["angular", "content", "asset", "routes", "context", "search", "api-list"].includes(
6158
+ String(value["role"])
6159
+ ) && ["utf8", "base64"].includes(String(value["encoding"])) && string2(value["content"]) && string2(value["digest"]);
6119
6160
  }
6120
6161
  function isContentDescriptor(value) {
6121
6162
  if (!isRecord2(value) || !exact(
@@ -6139,23 +6180,23 @@ function isContentDescriptor(value) {
6139
6180
  ["icon", "keyword"]
6140
6181
  ))
6141
6182
  return false;
6142
- if (value.schemaVersion !== SCHEMA_VERSION || ![
6143
- value.id,
6144
- value.ownerId,
6145
- value.title,
6146
- value.route,
6147
- value.absoluteRoute,
6148
- value.inputDigest,
6149
- value.requestDigest
6150
- ].every(string2) || ![value.id, value.ownerId, value.inputDigest, value.requestDigest].every(
6183
+ if (value["schemaVersion"] !== SCHEMA_VERSION || ![
6184
+ value["id"],
6185
+ value["ownerId"],
6186
+ value["title"],
6187
+ value["route"],
6188
+ value["absoluteRoute"],
6189
+ value["inputDigest"],
6190
+ value["requestDigest"]
6191
+ ].every(string2) || ![value["id"], value["ownerId"], value["inputDigest"], value["requestDigest"]].every(
6151
6192
  (item) => string2(item) && item.length > 0 && !item.includes("\0")
6152
- ) || !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))
6193
+ ) || !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"]))
6153
6194
  return false;
6154
- const locator = value.locator;
6155
- 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);
6195
+ const locator = value["locator"];
6196
+ 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"]);
6156
6197
  }
6157
6198
  function isPhysicalDescriptorDependency(value) {
6158
- 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");
6199
+ 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");
6159
6200
  }
6160
6201
  function validDescriptorPlan(artifact) {
6161
6202
  const descriptors = artifact.contentDescriptors;
@@ -6240,7 +6281,7 @@ function isPageArtifact(value) {
6240
6281
  "diagnostics"
6241
6282
  ],
6242
6283
  ["contentDescriptors"]
6243
- ) && 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);
6284
+ ) && 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);
6244
6285
  }
6245
6286
  function isJsonTree(value, ancestors = /* @__PURE__ */ new WeakSet()) {
6246
6287
  if (value === null || string2(value) || typeof value === "boolean") return true;
@@ -6275,19 +6316,19 @@ function validOutputDigest(output) {
6275
6316
  }
6276
6317
  }
6277
6318
  function isPublishedGeneratorConfiguration(value) {
6278
- return isJsonTree(value) && isRecord2(value) && exact(value, ["outputRoot", "cacheRoot", "assetDirectory", "themes", "digest"]) && [value.outputRoot, value.cacheRoot].every(
6319
+ return isJsonTree(value) && isRecord2(value) && exact(value, ["outputRoot", "cacheRoot", "assetDirectory", "themes", "digest"]) && [value["outputRoot"], value["cacheRoot"]].every(
6279
6320
  (item) => string2(item) && path6.isAbsolute(item) && path6.resolve(item).replace(/\\/g, "/") === item && !item.includes("\0")
6280
- ) && 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);
6321
+ ) && 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"]);
6281
6322
  }
6282
6323
  function isArtifactSnapshotShape(value) {
6283
6324
  return isJsonTree(value) && isRecord2(value) && exact(
6284
6325
  value,
6285
6326
  ["projectId", "revision", "artifacts", "globalKeywords", "remoteKeywords"],
6286
6327
  ["configuration"]
6287
- ) && (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);
6328
+ ) && (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);
6288
6329
  }
6289
6330
  function isRemoteKeywords(remote) {
6290
- 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));
6331
+ 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"]));
6291
6332
  }
6292
6333
  function isSnapshotEnvelope(value) {
6293
6334
  if (!isRecord2(value) || Object.getPrototypeOf(value) !== Object.prototype) return false;
@@ -6298,7 +6339,7 @@ function isSnapshotEnvelope(value) {
6298
6339
  return descriptor?.enumerable === true && "value" in descriptor;
6299
6340
  }))
6300
6341
  return false;
6301
- const artifacts = value.artifacts;
6342
+ const artifacts = value["artifacts"];
6302
6343
  if (!Array.isArray(artifacts) || Object.getPrototypeOf(artifacts) !== Array.prototype || Reflect.ownKeys(artifacts).length !== artifacts.length + 1)
6303
6344
  return false;
6304
6345
  for (let index = 0; index < artifacts.length; index += 1)
@@ -6307,14 +6348,14 @@ function isSnapshotEnvelope(value) {
6307
6348
  value,
6308
6349
  ["projectId", "revision", "artifacts", "globalKeywords", "remoteKeywords"],
6309
6350
  ["configuration"]
6310
- ) && (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);
6351
+ ) && (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);
6311
6352
  }
6312
6353
  function isOutputManifest(value) {
6313
- 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(
6314
- (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(
6315
- String(file.role)
6354
+ 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(
6355
+ (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(
6356
+ String(file["role"])
6316
6357
  )
6317
- ) && new Set(value.files.map((file) => file.path)).size === value.files.length;
6358
+ ) && new Set(value["files"].map((file) => file.path)).size === value["files"].length;
6318
6359
  }
6319
6360
  function safeRelative(value) {
6320
6361
  try {
@@ -6606,16 +6647,18 @@ function quoteWindowsArgument(value, twice = false) {
6606
6647
  }
6607
6648
  function nodeEntry(command, options) {
6608
6649
  const exists2 = options.isFile ?? isFile;
6609
- const name = /^(ng|npm|npx)(?:\.cmd)?$/i.exec(command)?.[1]?.toLowerCase();
6650
+ const name = /^(ng|npm|npx|pnpm|pnpx)(?:\.cmd)?$/i.exec(command)?.[1]?.toLowerCase();
6610
6651
  if (!name) return void 0;
6652
+ const nodeDirectory = path8.win32.dirname(options.execPath ?? process.execPath);
6653
+ if (name === "pnpm" || name === "pnpx") {
6654
+ const shim = resolveWindowsCommand(name, options);
6655
+ if (!shim || path8.win32.dirname(shim).toLowerCase() !== nodeDirectory.toLowerCase())
6656
+ return void 0;
6657
+ const entry = path8.win32.join(nodeDirectory, "node_modules", "corepack", "dist", `${name}.js`);
6658
+ return exists2(entry) ? entry : void 0;
6659
+ }
6611
6660
  if (name !== "ng") {
6612
- const entry = path8.win32.join(
6613
- path8.win32.dirname(options.execPath ?? process.execPath),
6614
- "node_modules",
6615
- "npm",
6616
- "bin",
6617
- `${name}-cli.js`
6618
- );
6661
+ const entry = path8.win32.join(nodeDirectory, "node_modules", "npm", "bin", `${name}-cli.js`);
6619
6662
  return exists2(entry) ? entry : void 0;
6620
6663
  }
6621
6664
  for (let directory = path8.win32.resolve(options.cwd); ; ) {