@mxpicture/build-api 0.2.56 → 0.2.57

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 (143) hide show
  1. package/dist/barrel/Barrel.d.ts +66 -0
  2. package/dist/barrel/Barrel.d.ts.map +1 -1
  3. package/dist/barrel/Barrel.js +66 -2
  4. package/dist/barrel/Barrel.js.map +1 -1
  5. package/dist/cleanup/Cleanup.d.ts +70 -0
  6. package/dist/cleanup/Cleanup.d.ts.map +1 -1
  7. package/dist/cleanup/Cleanup.js +70 -0
  8. package/dist/cleanup/Cleanup.js.map +1 -1
  9. package/dist/code/code.common.d.ts +37 -4
  10. package/dist/code/code.common.d.ts.map +1 -1
  11. package/dist/code/code.common.js +37 -4
  12. package/dist/code/code.common.js.map +1 -1
  13. package/dist/code/code.exports.d.ts +25 -0
  14. package/dist/code/code.exports.d.ts.map +1 -1
  15. package/dist/code/code.exports.js +25 -1
  16. package/dist/code/code.exports.js.map +1 -1
  17. package/dist/code/code.format.d.ts +23 -0
  18. package/dist/code/code.format.d.ts.map +1 -1
  19. package/dist/code/code.format.js +23 -0
  20. package/dist/code/code.format.js.map +1 -1
  21. package/dist/common/common.fs.d.ts +22 -0
  22. package/dist/common/common.fs.d.ts.map +1 -1
  23. package/dist/common/common.fs.js +22 -0
  24. package/dist/common/common.fs.js.map +1 -1
  25. package/dist/common/common.json.d.ts +27 -0
  26. package/dist/common/common.json.d.ts.map +1 -1
  27. package/dist/common/common.json.js +27 -0
  28. package/dist/common/common.json.js.map +1 -1
  29. package/dist/deps/FixWorkspaceDeps.d.ts +132 -0
  30. package/dist/deps/FixWorkspaceDeps.d.ts.map +1 -1
  31. package/dist/deps/FixWorkspaceDeps.js +120 -2
  32. package/dist/deps/FixWorkspaceDeps.js.map +1 -1
  33. package/dist/git/GitChanges.d.ts +60 -13
  34. package/dist/git/GitChanges.d.ts.map +1 -1
  35. package/dist/git/GitChanges.js +60 -13
  36. package/dist/git/GitChanges.js.map +1 -1
  37. package/dist/git/git.util.d.ts +58 -3
  38. package/dist/git/git.util.d.ts.map +1 -1
  39. package/dist/git/git.util.js +58 -3
  40. package/dist/git/git.util.js.map +1 -1
  41. package/dist/logger/Logger.d.ts +74 -0
  42. package/dist/logger/Logger.d.ts.map +1 -1
  43. package/dist/logger/Logger.js +49 -0
  44. package/dist/logger/Logger.js.map +1 -1
  45. package/dist/npmPublish/NpmPublisher.d.ts +36 -0
  46. package/dist/npmPublish/NpmPublisher.d.ts.map +1 -1
  47. package/dist/npmPublish/NpmPublisher.js +36 -0
  48. package/dist/npmPublish/NpmPublisher.js.map +1 -1
  49. package/dist/osInfo/osInfo.common.d.ts +45 -1
  50. package/dist/osInfo/osInfo.common.d.ts.map +1 -1
  51. package/dist/osInfo/osInfo.common.js +45 -1
  52. package/dist/osInfo/osInfo.common.js.map +1 -1
  53. package/dist/pkg/Pkg.d.ts +69 -0
  54. package/dist/pkg/Pkg.d.ts.map +1 -1
  55. package/dist/pkg/Pkg.js +69 -0
  56. package/dist/pkg/Pkg.js.map +1 -1
  57. package/dist/pkg/SyncPkgVersion.d.ts +35 -0
  58. package/dist/pkg/SyncPkgVersion.d.ts.map +1 -1
  59. package/dist/pkg/SyncPkgVersion.js +35 -0
  60. package/dist/pkg/SyncPkgVersion.js.map +1 -1
  61. package/dist/pkg/UpdatePackages.d.ts +36 -0
  62. package/dist/pkg/UpdatePackages.d.ts.map +1 -1
  63. package/dist/pkg/UpdatePackages.js +36 -0
  64. package/dist/pkg/UpdatePackages.js.map +1 -1
  65. package/dist/pkg/pkg.common.d.ts +73 -0
  66. package/dist/pkg/pkg.common.d.ts.map +1 -1
  67. package/dist/pkg/pkg.common.js +73 -0
  68. package/dist/pkg/pkg.common.js.map +1 -1
  69. package/dist/pkg/pkg.fs.d.ts +53 -0
  70. package/dist/pkg/pkg.fs.d.ts.map +1 -1
  71. package/dist/pkg/pkg.fs.js +53 -0
  72. package/dist/pkg/pkg.fs.js.map +1 -1
  73. package/dist/types/types.barrel.d.ts +28 -0
  74. package/dist/types/types.barrel.d.ts.map +1 -1
  75. package/dist/types/types.barrel.js.map +1 -1
  76. package/dist/types/types.changelog.d.ts +28 -0
  77. package/dist/types/types.changelog.d.ts.map +1 -1
  78. package/dist/types/types.changelog.js +9 -0
  79. package/dist/types/types.changelog.js.map +1 -1
  80. package/dist/types/types.cleanup.d.ts +19 -0
  81. package/dist/types/types.cleanup.d.ts.map +1 -1
  82. package/dist/types/types.cleanup.js.map +1 -1
  83. package/dist/types/types.code.d.ts +36 -0
  84. package/dist/types/types.code.d.ts.map +1 -1
  85. package/dist/types/types.code.js.map +1 -1
  86. package/dist/types/types.deps.d.ts +27 -0
  87. package/dist/types/types.deps.d.ts.map +1 -1
  88. package/dist/types/types.deps.js +10 -0
  89. package/dist/types/types.deps.js.map +1 -1
  90. package/dist/types/types.documents.d.ts +9 -0
  91. package/dist/types/types.documents.d.ts.map +1 -1
  92. package/dist/types/types.documents.js.map +1 -1
  93. package/dist/types/types.git.d.ts +25 -0
  94. package/dist/types/types.git.d.ts.map +1 -1
  95. package/dist/types/types.git.js.map +1 -1
  96. package/dist/types/types.npm.d.ts +7 -0
  97. package/dist/types/types.npm.d.ts.map +1 -1
  98. package/dist/types/types.npm.js.map +1 -1
  99. package/dist/types/types.os.d.ts +8 -0
  100. package/dist/types/types.os.d.ts.map +1 -1
  101. package/dist/types/types.os.js.map +1 -1
  102. package/dist/types/types.package.d.ts +48 -0
  103. package/dist/types/types.package.d.ts.map +1 -1
  104. package/dist/types/types.package.js.map +1 -1
  105. package/dist/types/types.run.d.ts +4 -0
  106. package/dist/types/types.run.d.ts.map +1 -1
  107. package/dist/types/types.run.js.map +1 -1
  108. package/dist/types/types.vscode.d.ts +46 -0
  109. package/dist/types/types.vscode.d.ts.map +1 -1
  110. package/dist/types/types.vscode.js.map +1 -1
  111. package/dist/types/types.workspace.d.ts +18 -0
  112. package/dist/types/types.workspace.d.ts.map +1 -1
  113. package/dist/types/types.workspace.js +6 -0
  114. package/dist/types/types.workspace.js.map +1 -1
  115. package/dist/vscode/vscode.config.d.ts +18 -0
  116. package/dist/vscode/vscode.config.d.ts.map +1 -1
  117. package/dist/vscode/vscode.config.js +18 -0
  118. package/dist/vscode/vscode.config.js.map +1 -1
  119. package/dist/vscode/vscode.profiles.d.ts +37 -0
  120. package/dist/vscode/vscode.profiles.d.ts.map +1 -1
  121. package/dist/vscode/vscode.profiles.js +37 -0
  122. package/dist/vscode/vscode.profiles.js.map +1 -1
  123. package/dist/vscode/vscode.settings.d.ts +26 -1
  124. package/dist/vscode/vscode.settings.d.ts.map +1 -1
  125. package/dist/vscode/vscode.settings.js +26 -1
  126. package/dist/vscode/vscode.settings.js.map +1 -1
  127. package/dist/vscode/vscode.storage.d.ts +21 -1
  128. package/dist/vscode/vscode.storage.d.ts.map +1 -1
  129. package/dist/vscode/vscode.storage.js +21 -1
  130. package/dist/vscode/vscode.storage.js.map +1 -1
  131. package/dist/vscode/vscode.workspace.d.ts +17 -0
  132. package/dist/vscode/vscode.workspace.d.ts.map +1 -1
  133. package/dist/vscode/vscode.workspace.js +17 -0
  134. package/dist/vscode/vscode.workspace.js.map +1 -1
  135. package/dist/workspace/Workspace.d.ts +85 -0
  136. package/dist/workspace/Workspace.d.ts.map +1 -1
  137. package/dist/workspace/Workspace.js +85 -0
  138. package/dist/workspace/Workspace.js.map +1 -1
  139. package/dist/workspace/workspace.common.d.ts +42 -1
  140. package/dist/workspace/workspace.common.d.ts.map +1 -1
  141. package/dist/workspace/workspace.common.js +42 -1
  142. package/dist/workspace/workspace.common.js.map +1 -1
  143. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"code.common.js","sourceRoot":"","sources":["../../src/code/code.common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAmB,EAAgB,EAAE;IACrE,MAAM,OAAO,GAAG,EAAE,CAAC,aAAa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AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAiB,EAAE,EAAE,CACvD,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC;AAErC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAc,EAAU,EAAE;IAC3D,8CAA8C;IAC9C,MAAM,CAAC,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ;QAAE,OAAO,UAAU,CAAC;IACnD,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK;QAAE,OAAO,OAAO,CAAC;IAC7C,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI;QAAE,OAAO,MAAM,CAAC;IAC3C,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW;QAAE,OAAO,WAAW,CAAC;IACvD,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,SAAS;QAAE,OAAO,MAAM,CAAC;IAChD,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,SAAS;QAAE,OAAO,WAAW,CAAC;IACrD,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ;QAAE,OAAO,UAAU,CAAC;IACnD,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK;QAAE,OAAO,OAAO,CAAC;IAC7C,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["import ts from \"typescript\";\nimport { SourceFile } from \"../types/types.code.js\";\n\nexport const createSourceFiles = (filePaths: string[]): SourceFile[] => {\n const program = ts.createProgram(filePaths, {\n target: ts.ScriptTarget.ES2023,\n module: ts.ModuleKind.Node20,\n strict: true,\n });\n const checker = program.getTypeChecker();\n const results: SourceFile[] = [];\n\n for (const filePath of filePaths) {\n const sourceFile = program.getSourceFile(filePath);\n if (!sourceFile) continue;\n results.push({ sourceFile, filePath, checker });\n }\n\n return results;\n};\n\n/**\n * Creates a single ts.Program for all provided file paths and returns a map\n * from filePath → SourceFile. This is much more efficient than calling\n * createSourceFiles() per file because the TypeScript compiler is only\n * instantiated once.\n */\nexport const createSourceFileMap = (\n filePaths: string[],\n): Map<string, SourceFile> => {\n const program = ts.createProgram(filePaths, {\n target: ts.ScriptTarget.ES2023,\n module: ts.ModuleKind.Node20,\n strict: true,\n });\n const checker = program.getTypeChecker();\n const map = new Map<string, SourceFile>();\n for (const filePath of filePaths) {\n const sourceFile = program.getSourceFile(filePath);\n if (!sourceFile) continue;\n map.set(filePath, { sourceFile, filePath, checker });\n }\n return map;\n};\n\nexport const declarationKindName = (d: ts.Declaration) =>\n ts.SyntaxKind[d.kind] ?? \"Unknown\";\n\nexport const guessKindFromFlags = (sym: ts.Symbol): string => {\n // Not perfect, but good enough for reporting.\n const f = sym.getFlags();\n if (f & ts.SymbolFlags.Function) return \"function\";\n if (f & ts.SymbolFlags.Class) return \"class\";\n if (f & ts.SymbolFlags.Enum) return \"enum\";\n if (f & ts.SymbolFlags.ValueModule) return \"namespace\";\n if (f & ts.SymbolFlags.TypeAlias) return \"type\";\n if (f & ts.SymbolFlags.Interface) return \"interface\";\n if (f & ts.SymbolFlags.Variable) return \"variable\";\n if (f & ts.SymbolFlags.Alias) return \"alias\";\n return \"unknown\";\n};\n"]}
1
+ {"version":3,"file":"code.common.js","sourceRoot":"","sources":["../../src/code/code.common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAmB,EAAgB,EAAE;IACrE,MAAM,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,SAAS,EAAE;QAC1C,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM;QAC9B,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM;QAC5B,MAAM,EAAE,IAAI;KACb,C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S,CAAC;AAErC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAc,EAAU,EAAE;IAC3D,8CAA8C;IAC9C,MAAM,CAAC,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ;QAAE,OAAO,UAAU,CAAC;IACnD,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK;QAAE,OAAO,OAAO,CAAC;IAC7C,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI;QAAE,OAAO,MAAM,CAAC;IAC3C,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW;QAAE,OAAO,WAAW,CAAC;IACvD,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,SAAS;QAAE,OAAO,MAAM,CAAC;IAChD,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,SAAS;QAAE,OAAO,WAAW,CAAC;IACrD,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ;QAAE,OAAO,UAAU,CAAC;IACnD,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK;QAAE,OAAO,OAAO,CAAC;IAC7C,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["import ts from \"typescript\";\nimport { SourceFile } from \"../types/types.code.js\";\n\n/**\n * Creates a TypeScript program and returns an array of {@link SourceFile} entries.\n *\n * @remarks\n * A new `ts.Program` is created for every call. When you need to process many\n * files, prefer {@link createSourceFileMap} which is more efficient because the\n * compiler is only instantiated once and results are keyed by path.\n *\n * @param filePaths - Absolute paths to the TypeScript source files to load.\n * @returns An array of successfully parsed {@link SourceFile} entries.\n */\nexport const createSourceFiles = (filePaths: string[]): SourceFile[] => {\n const program = ts.createProgram(filePaths, {\n target: ts.ScriptTarget.ES2023,\n module: ts.ModuleKind.Node20,\n strict: true,\n });\n const checker = program.getTypeChecker();\n const results: SourceFile[] = [];\n\n for (const filePath of filePaths) {\n const sourceFile = program.getSourceFile(filePath);\n if (!sourceFile) continue;\n results.push({ sourceFile, filePath, checker });\n }\n\n return results;\n};\n\n/**\n * Creates a single TypeScript program and returns a map from file path to {@link SourceFile}.\n *\n * @remarks\n * This is more efficient than {@link createSourceFiles} when processing many\n * files, because the TypeScript compiler is only instantiated once and the\n * results are keyed by path for O(1) lookup.\n *\n * @param filePaths - Absolute paths to the TypeScript source files to load.\n * @returns A map keyed by file path whose values are the parsed {@link SourceFile} entries.\n */\nexport const createSourceFileMap = (\n filePaths: string[],\n): Map<string, SourceFile> => {\n const program = ts.createProgram(filePaths, {\n target: ts.ScriptTarget.ES2023,\n module: ts.ModuleKind.Node20,\n strict: true,\n });\n const checker = program.getTypeChecker();\n const map = new Map<string, SourceFile>();\n for (const filePath of filePaths) {\n const sourceFile = program.getSourceFile(filePath);\n if (!sourceFile) continue;\n map.set(filePath, { sourceFile, filePath, checker });\n }\n return map;\n};\n\n/**\n * Returns the human-readable syntax-kind name for a TypeScript declaration node.\n *\n * @param d - The TypeScript declaration node to inspect.\n * @returns The name of the declaration's {@link ts.SyntaxKind}, or `\"Unknown\"` if unmapped.\n */\nexport const declarationKindName = (d: ts.Declaration) =>\n ts.SyntaxKind[d.kind] ?? \"Unknown\";\n\n/**\n * Infers a human-readable kind label from a symbol's flags.\n *\n * @remarks\n * The mapping is approximate — it checks flags in priority order and returns\n * the first match. This is sufficient for reporting purposes but may not\n * capture every nuance of the TypeScript symbol model.\n *\n * @param sym - The TypeScript symbol whose kind should be inferred.\n * @returns A lowercase label such as `\"function\"`, `\"class\"`, or `\"unknown\"`.\n */\nexport const guessKindFromFlags = (sym: ts.Symbol): string => {\n // Not perfect, but good enough for reporting.\n const f = sym.getFlags();\n if (f & ts.SymbolFlags.Function) return \"function\";\n if (f & ts.SymbolFlags.Class) return \"class\";\n if (f & ts.SymbolFlags.Enum) return \"enum\";\n if (f & ts.SymbolFlags.ValueModule) return \"namespace\";\n if (f & ts.SymbolFlags.TypeAlias) return \"type\";\n if (f & ts.SymbolFlags.Interface) return \"interface\";\n if (f & ts.SymbolFlags.Variable) return \"variable\";\n if (f & ts.SymbolFlags.Alias) return \"alias\";\n return \"unknown\";\n};\n"]}
@@ -1,4 +1,29 @@
1
1
  import { FileExportsParams, SourceExport } from "../types/types.code.js";
2
+ /**
3
+ * Extracts exported symbols from a TypeScript file using the compiler API.
4
+ *
5
+ * @remarks
6
+ * Walks the module's export surface (including re-exports) and classifies each
7
+ * symbol by kind, type-only status, and re-export origin. Results are sorted
8
+ * alphabetically by name for stable output. The caller can control which
9
+ * categories of exports are included via {@link FileExportsParams.opts}.
10
+ *
11
+ * @param p - Parameters specifying the file path, optional filter flags, and an
12
+ * optional pre-built source to avoid redundant parsing.
13
+ * @returns A {@link SourceExport} containing the discovered export items and
14
+ * whether the file uses selective (named) exports.
15
+ */
2
16
  export declare const fileExportsCompilerApi: (p: FileExportsParams) => SourceExport;
17
+ /**
18
+ * Non-compiler fallback that always returns an empty export list.
19
+ *
20
+ * @remarks
21
+ * This function exists as a no-op counterpart to {@link fileExportsCompilerApi}
22
+ * and is selected at call-sites that do not require TypeScript Compiler API
23
+ * analysis. It unconditionally reports no named exports.
24
+ *
25
+ * @param p - Parameters specifying the file whose exports would be extracted.
26
+ * @returns A {@link SourceExport} with an empty items array and `selectiveExport` set to `false`.
27
+ */
3
28
  export declare const fileExportsByFile: (p: FileExportsParams) => SourceExport;
4
29
  //# sourceMappingURL=code.exports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code.exports.d.ts","sourceRoot":"","sources":["../../src/code/code.exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAQzE,eAAO,MAAM,sBAAsB,GAAI,GAAG,iBAAiB,KAAG,YA2E7D,CAAC;AAIF,eAAO,MAAM,iBAAiB,GAAI,GAAG,iBAAiB,KAAG,YAGvD,CAAC"}
1
+ {"version":3,"file":"code.exports.d.ts","sourceRoot":"","sources":["../../src/code/code.exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAQzE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,GAAI,GAAG,iBAAiB,KAAG,YA2E7D,CAAC;AAEF;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,iBAAiB,GAAI,GAAG,iBAAiB,KAAG,YAGvD,CAAC"}
@@ -1,6 +1,20 @@
1
1
  import ts from "typescript";
2
2
  import { resolve } from "node:path";
3
3
  import { createSourceFiles, declarationKindName, guessKindFromFlags, } from "./code.common.js";
4
+ /**
5
+ * Extracts exported symbols from a TypeScript file using the compiler API.
6
+ *
7
+ * @remarks
8
+ * Walks the module's export surface (including re-exports) and classifies each
9
+ * symbol by kind, type-only status, and re-export origin. Results are sorted
10
+ * alphabetically by name for stable output. The caller can control which
11
+ * categories of exports are included via {@link FileExportsParams.opts}.
12
+ *
13
+ * @param p - Parameters specifying the file path, optional filter flags, and an
14
+ * optional pre-built source to avoid redundant parsing.
15
+ * @returns A {@link SourceExport} containing the discovered export items and
16
+ * whether the file uses selective (named) exports.
17
+ */
4
18
  export const fileExportsCompilerApi = (p) => {
5
19
  const includeTypeOnly = p.opts?.includeTypeOnly ?? true;
6
20
  const includeReExports = p.opts?.includeReExports ?? true;
@@ -69,7 +83,17 @@ export const fileExportsCompilerApi = (p) => {
69
83
  result.items.sort((a, b) => a.name.localeCompare(b.name));
70
84
  return result;
71
85
  };
72
- //only a dummy function to return force
86
+ /**
87
+ * Non-compiler fallback that always returns an empty export list.
88
+ *
89
+ * @remarks
90
+ * This function exists as a no-op counterpart to {@link fileExportsCompilerApi}
91
+ * and is selected at call-sites that do not require TypeScript Compiler API
92
+ * analysis. It unconditionally reports no named exports.
93
+ *
94
+ * @param p - Parameters specifying the file whose exports would be extracted.
95
+ * @returns A {@link SourceExport} with an empty items array and `selectiveExport` set to `false`.
96
+ */
73
97
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
74
98
  export const fileExportsByFile = (p) => ({
75
99
  items: [],
@@ -1 +1 @@
1
- {"version":3,"file":"code.exports.js","sourceRoot":"","sources":["../../src/code/code.exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAoB,EAAgB,EAAE;IAC3E,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,EAAE,eAAe,IAAI,IAAI,CAAC;IACxD,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,EAAE,gBAAgB,IAAI,IAAI,CAAC;IAC1D,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAEhC,MAAM,KAAK,GAAG,CAAC,CAAC,cAAc;QAC5B,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC;QACpB,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAG,EAAE,CAAC,CAAC;IAE9E,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAEzC,MAAM,MAAM,GAAiB;QAC3B,KAAK,EAAE,EAAE;QACT,eAAe,EAAE,IAAI;KACtB,CAAC;IAEF,MAAM,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAC7D,IAAI,CAAC,YAAY;QAAE,OAAO,MAAM,CAAC;IAEjC,wEAAwE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AAQ,GAAG,OAAO,CAAC;YACrB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,gBAAgB,IAAI,UAAU;YAAE,SAAS;QAE9C,MAAM,KAAK,GAAG,CAAC,QAAQ,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QAE1E,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;YAChB,IAAI;YACJ,IAAI,EAAE,kBAAkB,CAAC,QAAQ,CAAC;YAClC,UAAU;YACV,UAAU;YACV,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;IACL,CAAC;IAED,oBAAoB;IACpB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1D,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,uCAAuC;AACvC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAoB,EAAgB,EAAE,CAAC,CAAC;IACxE,KAAK,EAAE,EAAE;IACT,eAAe,EAAE,KAAK;CACvB,CAAC,CAAC","sourcesContent":["import ts from \"typescript\";\nimport { FileExportsParams, SourceExport } from \"../types/types.code.js\";\nimport { resolve } from \"node:path\";\nimport {\n createSourceFiles,\n declarationKindName,\n guessKindFromFlags,\n} from \"./code.common.js\";\n\nexport const fileExportsCompilerApi = (p: FileExportsParams): SourceExport => {\n const includeTypeOnly = p.opts?.includeTypeOnly ?? true;\n const includeReExports = p.opts?.includeReExports ?? true;\n const abs = resolve(p.filePath);\n\n const files = p.preBuiltSource\n ? [p.preBuiltSource]\n : createSourceFiles([p.filePath]);\n if (files.length === 0) throw new Error(`Could not load source file: ${abs}`);\n\n const { checker, sourceFile } = files[0];\n\n const result: SourceExport = {\n items: [],\n selectiveExport: true,\n };\n\n const moduleSymbol = checker.getSymbolAtLocation(sourceFile);\n if (!moduleSymbol) return result;\n\n // This gives the \"export surface\" of the module (including re-exports).\n const exports = checker.getExportsOfModule(moduleSymbol);\n\n for (const sym of exports) {\n const name = sym.getName();\n if (name === \"default\") {\n result.selectiveExport = false;\n if (!p.opts?.includeDefault) continue;\n } else if (name.startsWith(\"_\")) {\n if (!p.opts?.includePrivate) continue;\n }\n\n // Determine if it's type-only (TypeScript 5.x provides isTypeOnlySymbol).\n // Fallback: approximate using flags.\n const isTypeOnly =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n typeof (checker as any).isTypeOnlySymbol === \"function\"\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ((checker as any).isTypeOnlySymbol(sym) as boolean)\n : !!(\n sym.getFlags() &\n (ts.SymbolFlags.Type |\n ts.SymbolFlags.Interface |\n ts.SymbolFlags.TypeAlias)\n );\n\n if (!includeTypeOnly && isTypeOnly) continue;\n\n // Re-export detection: if symbol is an alias and resolves elsewhere\n let isReExport = false;\n let resolved = sym;\n if (sym.getFlags() & ts.SymbolFlags.Alias) {\n const aliased = checker.getAliasedSymbol(sym);\n if (aliased && aliased !== sym) {\n isReExport = true;\n resolved = aliased;\n }\n }\n\n if (!includeReExports && isReExport) continue;\n\n const decls = (resolved.getDeclarations() ?? []).map(declarationKindName);\n\n result.items.push({\n name,\n kind: guessKindFromFlags(resolved),\n isTypeOnly,\n isReExport,\n declarations: decls,\n });\n }\n\n // stable-ish output\n result.items.sort((a, b) => a.name.localeCompare(b.name));\n return result;\n};\n\n//only a dummy function to return force\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const fileExportsByFile = (p: FileExportsParams): SourceExport => ({\n items: [],\n selectiveExport: false,\n});\n"]}
1
+ {"version":3,"file":"code.exports.js","sourceRoot":"","sources":["../../src/code/code.exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OA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AAE,kBAAkB,CAAC,QAAQ,CAAC;YAClC,UAAU;YACV,UAAU;YACV,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;IACL,CAAC;IAED,oBAAoB;IACpB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1D,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,6DAA6D;AAC7D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAoB,EAAgB,EAAE,CAAC,CAAC;IACxE,KAAK,EAAE,EAAE;IACT,eAAe,EAAE,KAAK;CACvB,CAAC,CAAC","sourcesContent":["import ts from \"typescript\";\nimport { FileExportsParams, SourceExport } from \"../types/types.code.js\";\nimport { resolve } from \"node:path\";\nimport {\n createSourceFiles,\n declarationKindName,\n guessKindFromFlags,\n} from \"./code.common.js\";\n\n/**\n * Extracts exported symbols from a TypeScript file using the compiler API.\n *\n * @remarks\n * Walks the module's export surface (including re-exports) and classifies each\n * symbol by kind, type-only status, and re-export origin. Results are sorted\n * alphabetically by name for stable output. The caller can control which\n * categories of exports are included via {@link FileExportsParams.opts}.\n *\n * @param p - Parameters specifying the file path, optional filter flags, and an\n * optional pre-built source to avoid redundant parsing.\n * @returns A {@link SourceExport} containing the discovered export items and\n * whether the file uses selective (named) exports.\n */\nexport const fileExportsCompilerApi = (p: FileExportsParams): SourceExport => {\n const includeTypeOnly = p.opts?.includeTypeOnly ?? true;\n const includeReExports = p.opts?.includeReExports ?? true;\n const abs = resolve(p.filePath);\n\n const files = p.preBuiltSource\n ? [p.preBuiltSource]\n : createSourceFiles([p.filePath]);\n if (files.length === 0) throw new Error(`Could not load source file: ${abs}`);\n\n const { checker, sourceFile } = files[0];\n\n const result: SourceExport = {\n items: [],\n selectiveExport: true,\n };\n\n const moduleSymbol = checker.getSymbolAtLocation(sourceFile);\n if (!moduleSymbol) return result;\n\n // This gives the \"export surface\" of the module (including re-exports).\n const exports = checker.getExportsOfModule(moduleSymbol);\n\n for (const sym of exports) {\n const name = sym.getName();\n if (name === \"default\") {\n result.selectiveExport = false;\n if (!p.opts?.includeDefault) continue;\n } else if (name.startsWith(\"_\")) {\n if (!p.opts?.includePrivate) continue;\n }\n\n // Determine if it's type-only (TypeScript 5.x provides isTypeOnlySymbol).\n // Fallback: approximate using flags.\n const isTypeOnly =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n typeof (checker as any).isTypeOnlySymbol === \"function\"\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ((checker as any).isTypeOnlySymbol(sym) as boolean)\n : !!(\n sym.getFlags() &\n (ts.SymbolFlags.Type |\n ts.SymbolFlags.Interface |\n ts.SymbolFlags.TypeAlias)\n );\n\n if (!includeTypeOnly && isTypeOnly) continue;\n\n // Re-export detection: if symbol is an alias and resolves elsewhere\n let isReExport = false;\n let resolved = sym;\n if (sym.getFlags() & ts.SymbolFlags.Alias) {\n const aliased = checker.getAliasedSymbol(sym);\n if (aliased && aliased !== sym) {\n isReExport = true;\n resolved = aliased;\n }\n }\n\n if (!includeReExports && isReExport) continue;\n\n const decls = (resolved.getDeclarations() ?? []).map(declarationKindName);\n\n result.items.push({\n name,\n kind: guessKindFromFlags(resolved),\n isTypeOnly,\n isReExport,\n declarations: decls,\n });\n }\n\n // stable-ish output\n result.items.sort((a, b) => a.name.localeCompare(b.name));\n return result;\n};\n\n/**\n * Non-compiler fallback that always returns an empty export list.\n *\n * @remarks\n * This function exists as a no-op counterpart to {@link fileExportsCompilerApi}\n * and is selected at call-sites that do not require TypeScript Compiler API\n * analysis. It unconditionally reports no named exports.\n *\n * @param p - Parameters specifying the file whose exports would be extracted.\n * @returns A {@link SourceExport} with an empty items array and `selectiveExport` set to `false`.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const fileExportsByFile = (p: FileExportsParams): SourceExport => ({\n items: [],\n selectiveExport: false,\n});\n"]}
@@ -1,4 +1,27 @@
1
+ /**
2
+ * Formats TypeScript code using Prettier.
3
+ *
4
+ * @param lines - One or more code strings that are joined with newlines before formatting.
5
+ * @returns The formatted TypeScript source code.
6
+ */
1
7
  export declare const formatCode: (...lines: string[]) => Promise<string>;
8
+ /**
9
+ * Formats a JSON document using Prettier.
10
+ *
11
+ * @param lines - One or more JSON strings that are joined with newlines before formatting.
12
+ * @returns The formatted JSON string.
13
+ */
2
14
  export declare const formatJson: (...lines: string[]) => Promise<string>;
15
+ /**
16
+ * Formats a JSON value using Prettier's `json-stringify` parser.
17
+ *
18
+ * @remarks
19
+ * Unlike {@link formatJson}, this uses the `json-stringify` parser which
20
+ * produces output closer to `JSON.stringify` — for example it does not add a
21
+ * trailing newline after the top-level value.
22
+ *
23
+ * @param lines - One or more JSON strings that are joined with newlines before formatting.
24
+ * @returns The formatted JSON string.
25
+ */
3
26
  export declare const formatJsonStringify: (...lines: string[]) => Promise<string>;
4
27
  //# sourceMappingURL=code.format.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code.format.d.ts","sourceRoot":"","sources":["../../src/code/code.format.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,GAAU,GAAG,OAAO,MAAM,EAAE,KAAG,OAAO,CAAC,MAAM,CAChB,CAAC;AAErD,eAAO,MAAM,UAAU,GAAU,GAAG,OAAO,MAAM,EAAE,KAAG,OAAO,CAAC,MAAM,CACtB,CAAC;AAE/C,eAAO,MAAM,mBAAmB,GAC9B,GAAG,OAAO,MAAM,EAAE,KACjB,OAAO,CAAC,MAAM,CAA2D,CAAC"}
1
+ {"version":3,"file":"code.format.d.ts","sourceRoot":"","sources":["../../src/code/code.format.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAU,GAAG,OAAO,MAAM,EAAE,KAAG,OAAO,CAAC,MAAM,CAChB,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAU,GAAG,OAAO,MAAM,EAAE,KAAG,OAAO,CAAC,MAAM,CACtB,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,GAC9B,GAAG,OAAO,MAAM,EAAE,KACjB,OAAO,CAAC,MAAM,CAA2D,CAAC"}
@@ -1,5 +1,28 @@
1
1
  import { format } from "prettier";
2
+ /**
3
+ * Formats TypeScript code using Prettier.
4
+ *
5
+ * @param lines - One or more code strings that are joined with newlines before formatting.
6
+ * @returns The formatted TypeScript source code.
7
+ */
2
8
  export const formatCode = async (...lines) => format(lines.join("\n"), { parser: "typescript" });
9
+ /**
10
+ * Formats a JSON document using Prettier.
11
+ *
12
+ * @param lines - One or more JSON strings that are joined with newlines before formatting.
13
+ * @returns The formatted JSON string.
14
+ */
3
15
  export const formatJson = async (...lines) => format(lines.join("\n"), { parser: "json" });
16
+ /**
17
+ * Formats a JSON value using Prettier's `json-stringify` parser.
18
+ *
19
+ * @remarks
20
+ * Unlike {@link formatJson}, this uses the `json-stringify` parser which
21
+ * produces output closer to `JSON.stringify` — for example it does not add a
22
+ * trailing newline after the top-level value.
23
+ *
24
+ * @param lines - One or more JSON strings that are joined with newlines before formatting.
25
+ * @returns The formatted JSON string.
26
+ */
4
27
  export const formatJsonStringify = async (...lines) => format(lines.join("\n"), { parser: "json-stringify" });
5
28
  //# sourceMappingURL=code.format.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"code.format.js","sourceRoot":"","sources":["../../src/code/code.format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,GAAG,KAAe,EAAmB,EAAE,CACtE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;AAErD,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,GAAG,KAAe,EAAmB,EAAE,CACtE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,GAAG,KAAe,EACD,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC","sourcesContent":["import { format } from \"prettier\";\n\nexport const formatCode = async (...lines: string[]): Promise<string> =>\n format(lines.join(\"\\n\"), { parser: \"typescript\" });\n\nexport const formatJson = async (...lines: string[]): Promise<string> =>\n format(lines.join(\"\\n\"), { parser: \"json\" });\n\nexport const formatJsonStringify = async (\n ...lines: string[]\n): Promise<string> => format(lines.join(\"\\n\"), { parser: \"json-stringify\" });\n"]}
1
+ {"version":3,"file":"code.format.js","sourceRoot":"","sources":["../../src/code/code.format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,GAAG,KAAe,EAAmB,EAAE,CACtE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;AAErD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,GAAG,KAAe,EAAmB,EAAE,CACtE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,GAAG,KAAe,EACD,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC","sourcesContent":["import { format } from \"prettier\";\n\n/**\n * Formats TypeScript code using Prettier.\n *\n * @param lines - One or more code strings that are joined with newlines before formatting.\n * @returns The formatted TypeScript source code.\n */\nexport const formatCode = async (...lines: string[]): Promise<string> =>\n format(lines.join(\"\\n\"), { parser: \"typescript\" });\n\n/**\n * Formats a JSON document using Prettier.\n *\n * @param lines - One or more JSON strings that are joined with newlines before formatting.\n * @returns The formatted JSON string.\n */\nexport const formatJson = async (...lines: string[]): Promise<string> =>\n format(lines.join(\"\\n\"), { parser: \"json\" });\n\n/**\n * Formats a JSON value using Prettier's `json-stringify` parser.\n *\n * @remarks\n * Unlike {@link formatJson}, this uses the `json-stringify` parser which\n * produces output closer to `JSON.stringify` — for example it does not add a\n * trailing newline after the top-level value.\n *\n * @param lines - One or more JSON strings that are joined with newlines before formatting.\n * @returns The formatted JSON string.\n */\nexport const formatJsonStringify = async (\n ...lines: string[]\n): Promise<string> => format(lines.join(\"\\n\"), { parser: \"json-stringify\" });\n"]}
@@ -1,5 +1,27 @@
1
1
  import { exec as execCb } from "node:child_process";
2
2
  import { PathLike } from "node:fs";
3
+ /**
4
+ * Promise-based wrapper around {@link exec} from `node:child_process`.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * const { stdout } = await execAsync("echo hello");
9
+ * console.log(stdout); // "hello\n"
10
+ * ```
11
+ */
3
12
  export declare const execAsync: typeof execCb.__promisify__;
13
+ /**
14
+ * Checks whether a file or directory exists at the given path.
15
+ *
16
+ * @param path - The file-system path to check.
17
+ * @returns `true` if the path points to an existing file or directory, `false` otherwise.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * if (await existsAsync("package.json")) {
22
+ * console.log("found");
23
+ * }
24
+ * ```
25
+ */
4
26
  export declare const existsAsync: (path: PathLike) => Promise<boolean>;
5
27
  //# sourceMappingURL=common.fs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.fs.d.ts","sourceRoot":"","sources":["../../src/common/common.fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAInC,eAAO,MAAM,SAAS,6BAAoB,CAAC;AAE3C,eAAO,MAAM,WAAW,GAAU,MAAM,QAAQ,KAAG,OAAO,CAAC,OAAO,CAOjE,CAAC"}
1
+ {"version":3,"file":"common.fs.d.ts","sourceRoot":"","sources":["../../src/common/common.fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAInC;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,6BAAoB,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,GAAU,MAAM,QAAQ,KAAG,OAAO,CAAC,OAAO,CAOjE,CAAC"}
@@ -1,7 +1,29 @@
1
1
  import { exec as execCb } from "node:child_process";
2
2
  import { stat } from "node:fs/promises";
3
3
  import { promisify } from "node:util";
4
+ /**
5
+ * Promise-based wrapper around {@link exec} from `node:child_process`.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const { stdout } = await execAsync("echo hello");
10
+ * console.log(stdout); // "hello\n"
11
+ * ```
12
+ */
4
13
  export const execAsync = promisify(execCb);
14
+ /**
15
+ * Checks whether a file or directory exists at the given path.
16
+ *
17
+ * @param path - The file-system path to check.
18
+ * @returns `true` if the path points to an existing file or directory, `false` otherwise.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * if (await existsAsync("package.json")) {
23
+ * console.log("found");
24
+ * }
25
+ * ```
26
+ */
5
27
  export const existsAsync = async (path) => {
6
28
  try {
7
29
  const s = await stat(path);
@@ -1 +1 @@
1
- {"version":3,"file":"common.fs.js","sourceRoot":"","sources":["../../src/common/common.fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,IAAc,EAAoB,EAAE;IACpE,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { exec as execCb } from \"node:child_process\";\nimport { PathLike } from \"node:fs\";\nimport { stat } from \"node:fs/promises\";\nimport { promisify } from \"node:util\";\n\nexport const execAsync = promisify(execCb);\n\nexport const existsAsync = async (path: PathLike): Promise<boolean> => {\n try {\n const s = await stat(path);\n return s.isFile() || s.isDirectory();\n } catch {\n return false;\n }\n};\n"]}
1
+ {"version":3,"file":"common.fs.js","sourceRoot":"","sources":["../../src/common/common.fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,IAAc,EAAoB,EAAE;IACpE,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { exec as execCb } from \"node:child_process\";\nimport { PathLike } from \"node:fs\";\nimport { stat } from \"node:fs/promises\";\nimport { promisify } from \"node:util\";\n\n/**\n * Promise-based wrapper around {@link exec} from `node:child_process`.\n *\n * @example\n * ```ts\n * const { stdout } = await execAsync(\"echo hello\");\n * console.log(stdout); // \"hello\\n\"\n * ```\n */\nexport const execAsync = promisify(execCb);\n\n/**\n * Checks whether a file or directory exists at the given path.\n *\n * @param path - The file-system path to check.\n * @returns `true` if the path points to an existing file or directory, `false` otherwise.\n *\n * @example\n * ```ts\n * if (await existsAsync(\"package.json\")) {\n * console.log(\"found\");\n * }\n * ```\n */\nexport const existsAsync = async (path: PathLike): Promise<boolean> => {\n try {\n const s = await stat(path);\n return s.isFile() || s.isDirectory();\n } catch {\n return false;\n }\n};\n"]}
@@ -1,3 +1,30 @@
1
+ /**
2
+ * Performs a deep-equality comparison of two values.
3
+ *
4
+ * @param a - The first value to compare.
5
+ * @param b - The second value to compare.
6
+ * @returns `true` if `a` and `b` are deeply equal, `false` otherwise.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * jsonEqual({ x: 1 }, { x: 1 }); // true
11
+ * jsonEqual([1, 2], [1, 3]); // false
12
+ * ```
13
+ */
1
14
  export declare const jsonEqual: <T>(a: T, b: T) => boolean;
15
+ /**
16
+ * Creates a deep clone of the given value using the structured clone algorithm.
17
+ *
18
+ * @param value - The value to clone.
19
+ * @returns A deep copy of `value`.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const original = { nested: { key: "value" } };
24
+ * const copy = jsonClone(original);
25
+ * copy.nested.key = "changed";
26
+ * console.log(original.nested.key); // "value"
27
+ * ```
28
+ */
2
29
  export declare const jsonClone: <T>(value: T) => T;
3
30
  //# sourceMappingURL=common.json.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.json.d.ts","sourceRoot":"","sources":["../../src/common/common.json.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,KAAG,OAAkC,CAAC;AAC7E,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,OAAO,CAAC,KAAG,CAA2B,CAAC"}
1
+ {"version":3,"file":"common.json.d.ts","sourceRoot":"","sources":["../../src/common/common.json.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,KAAG,OAAkC,CAAC;AAE7E;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,OAAO,CAAC,KAAG,CAA2B,CAAC"}
@@ -1,4 +1,31 @@
1
1
  import { isDeepStrictEqual } from "node:util";
2
+ /**
3
+ * Performs a deep-equality comparison of two values.
4
+ *
5
+ * @param a - The first value to compare.
6
+ * @param b - The second value to compare.
7
+ * @returns `true` if `a` and `b` are deeply equal, `false` otherwise.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * jsonEqual({ x: 1 }, { x: 1 }); // true
12
+ * jsonEqual([1, 2], [1, 3]); // false
13
+ * ```
14
+ */
2
15
  export const jsonEqual = (a, b) => isDeepStrictEqual(a, b);
16
+ /**
17
+ * Creates a deep clone of the given value using the structured clone algorithm.
18
+ *
19
+ * @param value - The value to clone.
20
+ * @returns A deep copy of `value`.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const original = { nested: { key: "value" } };
25
+ * const copy = jsonClone(original);
26
+ * copy.nested.key = "changed";
27
+ * console.log(original.nested.key); // "value"
28
+ * ```
29
+ */
3
30
  export const jsonClone = (value) => structuredClone(value);
4
31
  //# sourceMappingURL=common.json.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.json.js","sourceRoot":"","sources":["../../src/common/common.json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAI,CAAI,EAAE,CAAI,EAAW,EAAE,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,SAAS,GAAG,CAAI,KAAQ,EAAK,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC","sourcesContent":["import { isDeepStrictEqual } from \"node:util\";\n\nexport const jsonEqual = <T>(a: T, b: T): boolean => isDeepStrictEqual(a, b);\nexport const jsonClone = <T>(value: T): T => structuredClone(value);\n"]}
1
+ {"version":3,"file":"common.json.js","sourceRoot":"","sources":["../../src/common/common.json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAI,CAAI,EAAE,CAAI,EAAW,EAAE,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE7E;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAI,KAAQ,EAAK,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC","sourcesContent":["import { isDeepStrictEqual } from \"node:util\";\n\n/**\n * Performs a deep-equality comparison of two values.\n *\n * @param a - The first value to compare.\n * @param b - The second value to compare.\n * @returns `true` if `a` and `b` are deeply equal, `false` otherwise.\n *\n * @example\n * ```ts\n * jsonEqual({ x: 1 }, { x: 1 }); // true\n * jsonEqual([1, 2], [1, 3]); // false\n * ```\n */\nexport const jsonEqual = <T>(a: T, b: T): boolean => isDeepStrictEqual(a, b);\n\n/**\n * Creates a deep clone of the given value using the structured clone algorithm.\n *\n * @param value - The value to clone.\n * @returns A deep copy of `value`.\n *\n * @example\n * ```ts\n * const original = { nested: { key: \"value\" } };\n * const copy = jsonClone(original);\n * copy.nested.key = \"changed\";\n * console.log(original.nested.key); // \"value\"\n * ```\n */\nexport const jsonClone = <T>(value: T): T => structuredClone(value);\n"]}
@@ -1,27 +1,159 @@
1
1
  import { Pkg } from "../pkg/Pkg.js";
2
2
  import { DepsProcessMode, DepsReplacementMode, FixWorkspaceDepsData, FixWorkspaceDepsMain, FixWorkspaceDepsParams } from "../types/types.deps.js";
3
3
  import { MapEntry } from "../types/types.package.js";
4
+ /**
5
+ * Fix or restore workspace dependency references across all packages.
6
+ *
7
+ * @remarks
8
+ * Initializes the workspace from the given repository root, selects the
9
+ * appropriate replacement strategy ({@link FixWorkspaceDepsVersion} or
10
+ * {@link FixWorkspaceDepsFile}), and executes the full fix/restore run.
11
+ *
12
+ * @param p - Parameters specifying the repo root, processing mode, and replacement strategy.
13
+ * @returns A promise that resolves when all workspace dependencies have been processed and written.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * await runFixDeps({
18
+ * repoRoot: "/path/to/repo",
19
+ * mode: DepsProcessMode.fix,
20
+ * replacement: DepsReplacementMode.version,
21
+ * });
22
+ * ```
23
+ */
4
24
  export declare const runFixDeps: (p: FixWorkspaceDepsParams) => Promise<void>;
25
+ /**
26
+ * Create the appropriate {@link IFixWorkspaceDeps} instance for the given replacement mode.
27
+ *
28
+ * @remarks
29
+ * Acts as a factory function that returns a {@link FixWorkspaceDepsVersion}
30
+ * when the replacement mode is `version`, or a {@link FixWorkspaceDepsFile}
31
+ * when it is `file`.
32
+ *
33
+ * @param p - Object containing the processing mode and replacement strategy.
34
+ * @returns A concrete {@link IFixWorkspaceDeps} subclass ready to execute.
35
+ */
5
36
  export declare const instanceFixDeps: (p: {
6
37
  mode: DepsProcessMode;
7
38
  replacement: DepsReplacementMode;
8
39
  }) => FixWorkspaceDepsVersion | FixWorkspaceDepsFile;
40
+ /**
41
+ * Abstract base class for fixing or restoring workspace dependency references.
42
+ *
43
+ * @remarks
44
+ * Implements the template-method pattern: subclasses provide concrete
45
+ * {@link IFixWorkspaceDeps.fixVersion | fixVersion} and
46
+ * {@link IFixWorkspaceDeps.restoreVersion | restoreVersion} implementations
47
+ * while the base class orchestrates reading, processing, and writing all
48
+ * workspace packages.
49
+ */
9
50
  export declare abstract class IFixWorkspaceDeps {
10
51
  readonly mode: DepsProcessMode;
52
+ /**
53
+ * Create a new workspace dependency fixer.
54
+ *
55
+ * @param mode - Whether to `fix` (replace `workspace:*`) or `restore` (revert to `workspace:*`).
56
+ */
11
57
  constructor(mode: DepsProcessMode);
58
+ /**
59
+ * Compute the replacement version string when fixing a dependency.
60
+ *
61
+ * @param p - Data about the dependency being processed.
62
+ * @returns The replacement version string, or `null` if no replacement is needed.
63
+ */
12
64
  protected abstract fixVersion(p: FixWorkspaceDepsData): string | null;
65
+ /**
66
+ * Compute the original version string when restoring a dependency.
67
+ *
68
+ * @param p - Data about the dependency being processed.
69
+ * @returns The restored version string, or `null` if no restoration is needed.
70
+ */
13
71
  protected abstract restoreVersion(p: FixWorkspaceDepsData): string | null;
72
+ /**
73
+ * Execute the full fix or restore operation across every workspace package.
74
+ *
75
+ * @remarks
76
+ * Reads the workspace, builds a version map and map entries, iterates over
77
+ * each package to apply the appropriate transformation, and writes all
78
+ * modified `package.json` files back to disk.
79
+ *
80
+ * @returns A promise that resolves when all packages have been written.
81
+ */
14
82
  run(): Promise<void>;
83
+ /**
84
+ * Process a single dependency map, replacing matching versions in place.
85
+ *
86
+ * @param deps - The dependency record (e.g. `dependencies`, `devDependencies`) to mutate.
87
+ * @param p - Contextual data for the consuming package and workspace.
88
+ */
15
89
  protected handleDependencies(deps: Record<string, string> | undefined, p: FixWorkspaceDepsMain): void;
90
+ /**
91
+ * Process all dependency groups for a single consuming package.
92
+ *
93
+ * @param p - Contextual data including the consuming package, map entries, and version map.
94
+ */
16
95
  protected runSingle(p: FixWorkspaceDepsMain): void;
96
+ /**
97
+ * Build pairwise mapping entries between all workspace packages.
98
+ *
99
+ * @remarks
100
+ * Produces a cartesian product (excluding self-pairs) of packages, computing
101
+ * the relative filesystem path from each source package to every other
102
+ * target package.
103
+ *
104
+ * @param pkgs - The list of workspace packages.
105
+ * @returns An array of {@link MapEntry} objects describing each package-to-package relationship.
106
+ */
17
107
  protected buildMapEntries(pkgs: Pkg[]): MapEntry[];
18
108
  }
109
+ /**
110
+ * Workspace dependency fixer that replaces `workspace:*` with caret version ranges.
111
+ *
112
+ * @remarks
113
+ * During a `fix` pass, `workspace:*` is replaced with `^{resolved-version}`.
114
+ * During a `restore` pass, caret-prefixed versions that match the workspace
115
+ * version map are reverted back to `workspace:*`.
116
+ */
19
117
  export declare class FixWorkspaceDepsVersion extends IFixWorkspaceDeps {
118
+ /**
119
+ * Replace a `workspace:*` reference with a caret version range.
120
+ *
121
+ * @param p - Data about the dependency being processed.
122
+ * @returns A string like `^1.2.3`, or `null` if the dependency is not `workspace:*`.
123
+ * @throws Error if the package cannot be found in the workspace version map.
124
+ */
20
125
  protected fixVersion(p: FixWorkspaceDepsData): string | null;
126
+ /**
127
+ * Restore a caret version range back to `workspace:*`.
128
+ *
129
+ * @param p - Data about the dependency being processed.
130
+ * @returns The string `workspace:*` if the version matches the expected caret range, or `null` otherwise.
131
+ */
21
132
  protected restoreVersion(p: FixWorkspaceDepsData): string | null;
22
133
  }
134
+ /**
135
+ * Workspace dependency fixer that replaces `workspace:*` with `file:` protocol paths.
136
+ *
137
+ * @remarks
138
+ * During a `fix` pass, `workspace:*` is replaced with a relative `file:` path
139
+ * pointing to the dependency's package directory.
140
+ * During a `restore` pass, any `file:`-prefixed version is reverted to `workspace:*`.
141
+ */
23
142
  export declare class FixWorkspaceDepsFile extends IFixWorkspaceDeps {
143
+ /**
144
+ * Replace a `workspace:*` reference with a relative `file:` path.
145
+ *
146
+ * @param p - Data about the dependency being processed.
147
+ * @returns A string like `file:../sibling-pkg`, or `null` if the dependency is not `workspace:*`.
148
+ * @throws Error if no map entry can be found for the dependency.
149
+ */
24
150
  protected fixVersion(p: FixWorkspaceDepsData): string | null;
151
+ /**
152
+ * Restore a `file:` path reference back to `workspace:*`.
153
+ *
154
+ * @param p - Data about the dependency being processed.
155
+ * @returns The string `workspace:*` if the version uses the `file:` protocol, or `null` otherwise.
156
+ */
25
157
  protected restoreVersion(p: FixWorkspaceDepsData): string | null;
26
158
  }
27
159
  //# sourceMappingURL=FixWorkspaceDeps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FixWorkspaceDeps.d.ts","sourceRoot":"","sources":["../../src/deps/FixWorkspaceDeps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,eAAO,MAAM,UAAU,GAAU,GAAG,sBAAsB,kBAGzD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,GAAG;IACjC,IAAI,EAAE,eAAe,CAAC;IACtB,WAAW,EAAE,mBAAmB,CAAC;CAClC,mDAGqC,CAAC;AAEvC,8BAAsB,iBAAiB;aACF,IAAI,EAAE,eAAe;gBAArB,IAAI,EAAE,eAAe;IAExD,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,oBAAoB,GAAG,MAAM,GAAG,IAAI;IACrE,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,EAAE,oBAAoB,GAAG,MAAM,GAAG,IAAI;IAE5D,GAAG;IA6ChB,SAAS,CAAC,kBAAkB,CAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EACxC,CAAC,EAAE,oBAAoB,GACtB,IAAI;IAaP,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,oBAAoB,GAAG,IAAI;IAOlD,SAAS,CAAC,eAA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