@savvy-web/tsdown-plugins 2.9.3 → 2.10.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 (59) hide show
  1. package/build/build-target-groups.js +1 -2
  2. package/build/cjs-default-interop.js +1 -2
  3. package/build/loose-files.js +1 -2
  4. package/build/node-builtin-default-interop.js +1 -2
  5. package/build/strip-maps.js +1 -2
  6. package/build/sync-public.js +1 -2
  7. package/build/target-groups.js +1 -2
  8. package/catalog/resolve-catalogs.js +1 -2
  9. package/changesets/next-versions.js +1 -2
  10. package/config-validation/ConfigValidator.js +1 -2
  11. package/dts/reexport-stub.js +1 -2
  12. package/dts/relative-imports.js +1 -2
  13. package/dts/resolved-tsconfig.js +1 -2
  14. package/entry/ambient-dts.js +1 -2
  15. package/entry/extract.js +1 -2
  16. package/entry/package-json-entries.js +1 -2
  17. package/errors.js +1 -2
  18. package/exe/build.js +1 -2
  19. package/exe/config.js +1 -2
  20. package/exe/filename.js +1 -2
  21. package/index.d.ts +41 -108
  22. package/index.js +3 -3
  23. package/jsx/config.js +1 -2
  24. package/manifest/emit-manifest.js +1 -2
  25. package/manifest/transform.js +1 -2
  26. package/meta/api-extractor.js +27 -6
  27. package/meta/config.js +1 -2
  28. package/meta/generate.js +11 -3
  29. package/meta/merge-models.js +1 -2
  30. package/meta/message-suppressor.js +1 -2
  31. package/meta/og-image.js +1 -2
  32. package/meta/optimistic.js +1 -2
  33. package/meta/run-pass.js +1 -2
  34. package/meta/tsconfig-resolver.js +1 -2
  35. package/meta/tsdoc-config.js +1 -2
  36. package/meta/tsdoctor-manifest.js +1 -2
  37. package/meta/tsdoctor-source.js +1 -2
  38. package/package.json +14 -14
  39. package/report/collector.js +1 -2
  40. package/report/formatters/ci-annotations.js +1 -2
  41. package/report/formatters/diagnostics.js +1 -2
  42. package/report/formatters/json.js +1 -2
  43. package/report/formatters/markdown.js +1 -2
  44. package/report/formatters/silent.js +1 -2
  45. package/report/formatters/terminal.js +1 -2
  46. package/report/issues-artifact.js +1 -2
  47. package/report/metrics-plugin.js +1 -2
  48. package/report/pipeline.js +1 -2
  49. package/report/schema.js +6 -5
  50. package/report/services/EnvironmentDetector.js +1 -2
  51. package/report/services/ExecutorResolver.js +1 -2
  52. package/report/services/FormatSelector.js +1 -2
  53. package/report/services/OutputRenderer.js +1 -2
  54. package/report/timer.js +1 -2
  55. package/report/tsdown-logger.js +1 -2
  56. package/targets/binding.js +1 -2
  57. package/targets/config.js +12 -3
  58. package/targets/resolve-targets.js +44 -9
  59. package/tsconfig/sync-options.js +1 -2
@@ -12,7 +12,7 @@ import { deriveDeclarationsPassOptions, deriveDtsPassOptions, deriveTargetGroupO
12
12
  import { readFileSync, writeFileSync } from "node:fs";
13
13
  import { dirname, isAbsolute, join } from "node:path";
14
14
 
15
- //#region src/build/build-target-groups.ts
15
+ // src/build/build-target-groups.ts
16
16
  /**
17
17
  * Entry name of the conventional primary (".") export, which `createEntryName` maps to "index". It is
18
18
  * the re-export-stub base: a secondary entry that re-exports a subset of it gets a thin stub pointing
@@ -325,5 +325,4 @@ async function buildTargetGroups(options) {
325
325
  }
326
326
  }
327
327
 
328
- //#endregion
329
328
  export { buildTargetGroups };
@@ -1,4 +1,4 @@
1
- //#region src/build/cjs-default-interop.ts
1
+ // src/build/cjs-default-interop.ts
2
2
  /**
3
3
  * The interop footer appended to a CJS ENTRY chunk that has a default export
4
4
  * alongside named exports. It reassigns `module.exports` to the default value
@@ -95,5 +95,4 @@ function cjsDefaultInterop() {
95
95
  };
96
96
  }
97
97
 
98
- //#endregion
99
98
  export { cjsDefaultInterop };
@@ -1,7 +1,7 @@
1
1
  import { ConfigValidationError } from "../errors.js";
2
2
  import { basename, extname } from "node:path";
3
3
 
4
- //#region src/build/loose-files.ts
4
+ // src/build/loose-files.ts
5
5
  /** Extension to its implied format; `.js` is ambiguous (undefined). */
6
6
  const EXT_FORMAT = {
7
7
  ".mjs": "esm",
@@ -54,5 +54,4 @@ function normalizeLooseFiles(files) {
54
54
  return out;
55
55
  }
56
56
 
57
- //#endregion
58
57
  export { normalizeLooseFiles };
@@ -1,6 +1,6 @@
1
1
  import { builtinModules } from "node:module";
2
2
 
3
- //#region src/build/node-builtin-default-interop.ts
3
+ // src/build/node-builtin-default-interop.ts
4
4
  /**
5
5
  * The set of Node built-in module names (without the `node:` prefix), e.g. `path`,
6
6
  * `process`, `fs`. Used to decide whether a BARE import specifier names a builtin.
@@ -76,5 +76,4 @@ function nodeBuiltinDefaultInterop() {
76
76
  };
77
77
  }
78
78
 
79
- //#endregion
80
79
  export { nodeBuiltinDefaultInterop };
@@ -1,7 +1,7 @@
1
1
  import { readdirSync, rmSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
 
4
- //#region src/build/strip-maps.ts
4
+ // src/build/strip-maps.ts
5
5
  /**
6
6
  * Remove declaration source-map files (`.d.ts.map` / `.d.cts.map`) from a built `pkg`
7
7
  * directory, returning the removed paths.
@@ -37,5 +37,4 @@ function removeDeclarationMaps(pkgDir) {
37
37
  return removed;
38
38
  }
39
39
 
40
- //#endregion
41
40
  export { removeDeclarationMaps };
@@ -3,7 +3,7 @@ import { findRelativeSpecifiers } from "../dts/relative-imports.js";
3
3
  import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, statSync } from "node:fs";
4
4
  import { dirname, join, relative } from "node:path";
5
5
 
6
- //#region src/build/sync-public.ts
6
+ // src/build/sync-public.ts
7
7
  /** Recursively collect every file path under `dir`, relative to `base`. */
8
8
  function listFilesRel(dir, base = dir) {
9
9
  const out = [];
@@ -90,5 +90,4 @@ function copyAmbientDts(options) {
90
90
  }
91
91
  }
92
92
 
93
- //#endregion
94
93
  export { copyAmbientDts, copyPublicDir };
@@ -1,6 +1,6 @@
1
1
  import { join } from "node:path";
2
2
 
3
- //#region src/build/target-groups.ts
3
+ // src/build/target-groups.ts
4
4
  /** The output dir for a group: dev -> dist/dev/pkg, prod -> dist/prod/<group>/pkg. */
5
5
  const outDirFor = (cwd, group) => group === "dev" ? join(cwd, "dist/dev/pkg") : join(cwd, "dist/prod", group, "pkg");
6
6
  /**
@@ -94,5 +94,4 @@ function deriveDeclarationsPassOptions(options) {
94
94
  };
95
95
  }
96
96
 
97
- //#endregion
98
97
  export { declarationsDirFor, deriveDeclarationsPassOptions, deriveDtsPassOptions, deriveTargetGroupOptions, outDirFor };
@@ -4,7 +4,7 @@ import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem";
4
4
  import * as NodePath from "@effect/platform-node/NodePath";
5
5
  import { Workspaces } from "@effected/workspaces";
6
6
 
7
- //#region src/catalog/resolve-catalogs.ts
7
+ // src/catalog/resolve-catalogs.ts
8
8
  /** Bound once: the platform layer is stateless and layers memoize by reference. */
9
9
  const platform = Layer.mergeAll(NodeFileSystem.layer, NodePath.layer);
10
10
  /**
@@ -29,5 +29,4 @@ function resolveManifest(pkg) {
29
29
  return Effect.runPromise(program.pipe(Effect.provide(platform)));
30
30
  }
31
31
 
32
- //#endregion
33
32
  export { resolveManifest };
@@ -4,7 +4,7 @@ import * as NodePath from "@effect/platform-node/NodePath";
4
4
  import { WorkspaceDiscovery, Workspaces } from "@effected/workspaces";
5
5
  import { getReleasePlan } from "@changesets/get-release-plan";
6
6
 
7
- //#region src/changesets/next-versions.ts
7
+ // src/changesets/next-versions.ts
8
8
  /** Bound once: the platform layer is stateless and layers memoize by reference. */
9
9
  const platform = Layer.mergeAll(NodeFileSystem.layer, NodePath.layer);
10
10
  /**
@@ -48,5 +48,4 @@ async function resolveNextVersions(cwd) {
48
48
  }
49
49
  }
50
50
 
51
- //#endregion
52
51
  export { resolveNextVersions };
@@ -5,7 +5,7 @@ import { resolveTargets } from "../targets/resolve-targets.js";
5
5
  import { existsSync, statSync } from "node:fs";
6
6
  import { Context, Effect, Layer } from "effect";
7
7
 
8
- //#region src/config-validation/ConfigValidator.ts
8
+ // src/config-validation/ConfigValidator.ts
9
9
  const VALID_SYNTAX_KINDS = /* @__PURE__ */ new Set([
10
10
  "block",
11
11
  "inline",
@@ -64,5 +64,4 @@ var ConfigValidator = class extends Context.Service()("@savvy-web/tsdown-plugins
64
64
  }) });
65
65
  };
66
66
 
67
- //#endregion
68
67
  export { ConfigValidator };
@@ -1,6 +1,6 @@
1
1
  import ts from "typescript";
2
2
 
3
- //#region src/dts/reexport-stub.ts
3
+ // src/dts/reexport-stub.ts
4
4
  function parse(source, fileName) {
5
5
  return ts.createSourceFile(fileName, source, ts.ScriptTarget.Latest, false, ts.ScriptKind.TS);
6
6
  }
@@ -88,5 +88,4 @@ function renderReexportStub(options) {
88
88
  return lines.length > 0 ? `${lines.join("\n")}\n` : "";
89
89
  }
90
90
 
91
- //#endregion
92
91
  export { analyzeReexportBarrel, collectExportNames, renderReexportStub };
@@ -1,6 +1,6 @@
1
1
  import ts from "typescript";
2
2
 
3
- //#region src/dts/relative-imports.ts
3
+ // src/dts/relative-imports.ts
4
4
  const isRelative = (s) => s.startsWith("./") || s.startsWith("../");
5
5
  /**
6
6
  * Find every relative module specifier in a declaration source: static `import`/`export … from`,
@@ -28,5 +28,4 @@ function findRelativeSpecifiers(source, fileName = "ambient.d.ts") {
28
28
  return [...found];
29
29
  }
30
30
 
31
- //#endregion
32
31
  export { findRelativeSpecifiers };
@@ -4,7 +4,7 @@ import { isAbsolute, join, resolve } from "node:path";
4
4
  import { tmpdir } from "node:os";
5
5
  import { TsconfigLoaderSync } from "@effected/tsconfig-json";
6
6
 
7
- //#region src/dts/resolved-tsconfig.ts
7
+ // src/dts/resolved-tsconfig.ts
8
8
  /**
9
9
  * The dts-pass deltas layered over whatever the package's own tsconfig declares. The shared
10
10
  * `ecma.json` base sets `composite`/`incremental` true and points `tsBuildInfoFile` at a build
@@ -127,5 +127,4 @@ function writeDtsEmitTsconfig(resolvedTsconfigPath) {
127
127
  return path;
128
128
  }
129
129
 
130
- //#endregion
131
130
  export { buildResolvedTsconfig, writeDtsEmitTsconfig, writeResolvedTsconfig };
@@ -1,7 +1,7 @@
1
1
  import { ConfigValidationError } from "../errors.js";
2
2
  import { createEntryName } from "./extract.js";
3
3
 
4
- //#region src/entry/ambient-dts.ts
4
+ // src/entry/ambient-dts.ts
5
5
  const DECLARATION_EXTS = [
6
6
  ".d.ts",
7
7
  ".d.cts",
@@ -98,5 +98,4 @@ function assertNoEntryCollisions(jsEntryNames, ambient) {
98
98
  }
99
99
  }
100
100
 
101
- //#endregion
102
101
  export { ambientOutName, assertNoEntryCollisions, classifyDtsExport, declarationExt, extractAmbientDts, mixedDtsExportError };
package/entry/extract.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/entry/extract.ts
1
+ // src/entry/extract.ts
2
2
  const isDeclarationFile = (p) => p.endsWith(".d.ts") || p.endsWith(".d.cts") || p.endsWith(".d.mts");
3
3
  const isTypeScriptFile = (p) => !isDeclarationFile(p) && (p.endsWith(".ts") || p.endsWith(".tsx"));
4
4
  /** /dist/*.js to /src/*.ts; otherwise unchanged. */
@@ -71,5 +71,4 @@ function extractEntries(pkg, options = {}) {
71
71
  };
72
72
  }
73
73
 
74
- //#endregion
75
74
  export { createEntryName, extractEntries };
@@ -2,7 +2,7 @@ import { extractEntries } from "./extract.js";
2
2
  import { readFileSync } from "node:fs";
3
3
  import { resolve } from "node:path";
4
4
 
5
- //#region src/entry/package-json-entries.ts
5
+ // src/entry/package-json-entries.ts
6
6
  /**
7
7
  * Derive a tsdown `entry` record (name to source path) from a package.json.
8
8
  *
@@ -16,5 +16,4 @@ function packageJsonEntries(options = {}) {
16
16
  }).entries;
17
17
  }
18
18
 
19
- //#endregion
20
19
  export { packageJsonEntries };
package/errors.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Data } from "effect";
2
2
 
3
- //#region src/errors.ts
3
+ // src/errors.ts
4
4
  /** Entry derivation from package.json failed. */
5
5
  var EntryDetectionError = class extends Data.TaggedError("EntryDetectionError") {
6
6
  get message() {
@@ -52,5 +52,4 @@ var TsdoctorEmitError = class extends Data.TaggedError("TsdoctorEmitError") {
52
52
  }
53
53
  };
54
54
 
55
- //#endregion
56
55
  export { ConfigValidationError, MetaGenerationError, TsdoctorEmitError };
package/exe/build.js CHANGED
@@ -5,7 +5,7 @@ import { mkdtempSync, rmSync } from "node:fs";
5
5
  import { join } from "node:path";
6
6
  import { tmpdir } from "node:os";
7
7
 
8
- //#region src/exe/build.ts
8
+ // src/exe/build.ts
9
9
  /**
10
10
  * Compile each SEA binary via tsdown's exe mode. One tsdown build per spec.
11
11
  *
@@ -52,5 +52,4 @@ async function runExeBuild(options) {
52
52
  }
53
53
  }
54
54
 
55
- //#endregion
56
55
  export { runExeBuild };
package/exe/config.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/exe/config.ts
1
+ // src/exe/config.ts
2
2
  /**
3
3
  * Default Node runtime embedded in the SEA (parity with the vitest-agent reference).
4
4
  *
@@ -51,5 +51,4 @@ function normalizeExeOptions(exe, pkg) {
51
51
  });
52
52
  }
53
53
 
54
- //#endregion
55
54
  export { DEFAULT_EXE_NODE_VERSION, normalizeExeOptions };
package/exe/filename.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/exe/filename.ts
1
+ // src/exe/filename.ts
2
2
  /**
3
3
  * The exact filename `@tsdown/exe` emits for a SEA target, mirroring tsdown's
4
4
  * `resolveOutputFileName`: base fileName + `-<platform>-<arch>` + `.exe` on win.
@@ -9,5 +9,4 @@ function computeExeFileName(fileName, target) {
9
9
  return `${fileName}${`-${target.platform}-${target.arch}`}${target.platform === "win" ? ".exe" : ""}`;
10
10
  }
11
11
 
12
- //#endregion
13
12
  export { computeExeFileName };