@theholocron/tsdown-config 8.4.3 → 8.4.5

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.
@@ -1,3 +1,4 @@
1
+ import { t as resolveEntry } from "../resolve-entry-DDrvshfq.js";
1
2
  import { defineConfig } from "tsdown";
2
3
  //#region presets/cli.ts
3
4
  /**
@@ -6,7 +7,7 @@ import { defineConfig } from "tsdown";
6
7
  * No type declarations — binaries don't need them.
7
8
  */
8
9
  function cli(options = {}) {
9
- return defineConfig({
10
+ const merged = {
10
11
  entry: ["src/cli.ts"],
11
12
  format: "esm",
12
13
  dts: false,
@@ -14,6 +15,10 @@ function cli(options = {}) {
14
15
  sourcemap: true,
15
16
  banner: { js: "#!/usr/bin/env node" },
16
17
  ...options
18
+ };
19
+ return defineConfig({
20
+ ...merged,
21
+ entry: resolveEntry(merged.entry)
17
22
  });
18
23
  }
19
24
  var cli_default = cli();
@@ -1,3 +1,4 @@
1
+ import { t as resolveEntry } from "../resolve-entry-DDrvshfq.js";
1
2
  import { defineConfig } from "tsdown";
2
3
  //#region presets/library.ts
3
4
  /**
@@ -5,13 +6,17 @@ import { defineConfig } from "tsdown";
5
6
  * Single entry point, generates types, does not bundle @theholocron/* peers.
6
7
  */
7
8
  function library(options = {}) {
8
- return defineConfig({
9
+ const merged = {
9
10
  entry: ["src/index.ts"],
10
11
  format: "esm",
11
12
  dts: true,
12
13
  clean: true,
13
14
  deps: { neverBundle: [/^@theholocron\//] },
14
15
  ...options
16
+ };
17
+ return defineConfig({
18
+ ...merged,
19
+ entry: resolveEntry(merged.entry)
15
20
  });
16
21
  }
17
22
  /** Ready-to-use config for packages that need no customisation. */
@@ -0,0 +1,27 @@
1
+ import { resolve } from "node:path";
2
+ //#region presets/resolve-entry.ts
3
+ /**
4
+ * tsdown resolves a config's relative `entry` paths against the config
5
+ * file's own directory, not the invoking `cwd` — fine for a package's own
6
+ * local `tsdown.config.ts` (same directory as `src/`), but wrong the moment
7
+ * `--config` points at this shared preset's own location deep in
8
+ * `node_modules` (astromech's config-resolution mechanism, holocron#749/
9
+ * #750/#680 — that's exactly how this surfaced, migrating a real repo off
10
+ * its local file). An absolute path sidesteps the ambiguity entirely, in
11
+ * both cases: `process.cwd()` is always the actual package directory tsdown
12
+ * was invoked from, regardless of where the config *module* lives on disk.
13
+ *
14
+ * Only `string` and `string[]` are resolved — the only shapes any preset
15
+ * here (or any known consumer's override) actually passes. tsdown's own
16
+ * `entry` type also allows a `Record<string, string | string[]>` (named
17
+ * multi-entry builds) and glob negation patterns (`!foo`); neither is used
18
+ * anywhere in this org today, so both pass through unresolved rather than
19
+ * guessing at a generalization nothing yet exercises.
20
+ */
21
+ function resolveEntry(entry) {
22
+ if (typeof entry === "string") return resolve(process.cwd(), entry);
23
+ if (Array.isArray(entry) && entry.every((e) => typeof e === "string")) return entry.map((e) => resolve(process.cwd(), e));
24
+ return entry;
25
+ }
26
+ //#endregion
27
+ export { resolveEntry as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/tsdown-config",
3
- "version": "8.4.3",
3
+ "version": "8.4.5",
4
4
  "description": "Shared tsdown configurations for @theholocron packages.",
5
5
  "homepage": "https://github.com/theholocron/configs/tree/main/packages/tsdown-config#readme",
6
6
  "bugs": "https://github.com/theholocron/configs/issues",
@@ -25,8 +25,8 @@
25
25
  "tsdown": "^0.22.14",
26
26
  "typescript": "^5.9.3",
27
27
  "vitest": "^4.1.10",
28
- "@theholocron/vitest-config": "8.4.3",
29
- "@theholocron/tsconfig": "8.4.3"
28
+ "@theholocron/tsconfig": "8.4.5",
29
+ "@theholocron/vitest-config": "8.4.5"
30
30
  },
31
31
  "exports": {
32
32
  ".": {