From 63225357adb344472215785dfaeddc621686b09c Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Wed, 20 Aug 2025 16:09:59 +0200 Subject: [PATCH 1/7] feat: Support fdir builder without picomatch Related to #163 --- package.json | 4 + src/builder/builder.ts | 174 +++++++++++++++++++++++++++++++++++++++++ src/builder/index.ts | 166 +-------------------------------------- tsdown.config.ts | 31 +++++--- 4 files changed, 203 insertions(+), 172 deletions(-) create mode 100644 src/builder/builder.ts diff --git a/package.json b/package.json index e229dff..dde25cf 100644 --- a/package.json +++ b/package.json @@ -98,6 +98,10 @@ "import": "./dist/index.mjs", "require": "./dist/index.cjs" }, + "./builder": { + "import": "./dist/builder.mjs", + "require": "./dist/builder.cjs" + }, "./package.json": "./package.json" } } diff --git a/src/builder/builder.ts b/src/builder/builder.ts new file mode 100644 index 0000000..0d0573c --- /dev/null +++ b/src/builder/builder.ts @@ -0,0 +1,174 @@ +import { sep } from "path"; +import { + Output, + OnlyCountsOutput, + GroupOutput, + PathsOutput, + Options, + FilterPredicate, + ExcludePredicate, + GlobFunction, + GlobMatcher, + GlobParams, +} from "../types"; +import { APIBuilder } from "./api-builder"; +import type picomatch from "picomatch"; + +export class Builder< + TReturnType extends Output = PathsOutput, + TGlobFunction = typeof picomatch, +> { + private readonly globCache: Record = {}; + private options: Options = { + maxDepth: Infinity, + suppressErrors: true, + pathSeparator: sep, + filters: [], + }; + private globFunction?: TGlobFunction; + + constructor(options?: Partial>) { + this.options = { ...this.options, ...options }; + this.globFunction = this.options.globFunction; + } + + group(): Builder { + this.options.group = true; + return this as Builder; + } + + withPathSeparator(separator: "/" | "\\") { + this.options.pathSeparator = separator; + return this; + } + + withBasePath() { + this.options.includeBasePath = true; + return this; + } + + withRelativePaths() { + this.options.relativePaths = true; + return this; + } + + withDirs() { + this.options.includeDirs = true; + return this; + } + + withMaxDepth(depth: number) { + this.options.maxDepth = depth; + return this; + } + + withMaxFiles(limit: number) { + this.options.maxFiles = limit; + return this; + } + + withFullPaths() { + this.options.resolvePaths = true; + this.options.includeBasePath = true; + return this; + } + + withErrors() { + this.options.suppressErrors = false; + return this; + } + + withSymlinks({ resolvePaths = true } = {}) { + this.options.resolveSymlinks = true; + this.options.useRealPaths = resolvePaths; + return this.withFullPaths(); + } + + withAbortSignal(signal: AbortSignal) { + this.options.signal = signal; + return this; + } + + normalize() { + this.options.normalizePath = true; + return this; + } + + filter(predicate: FilterPredicate) { + this.options.filters.push(predicate); + return this; + } + + onlyDirs() { + this.options.excludeFiles = true; + this.options.includeDirs = true; + return this; + } + + exclude(predicate: ExcludePredicate) { + this.options.exclude = predicate; + return this; + } + + onlyCounts(): Builder { + this.options.onlyCounts = true; + return this as Builder; + } + + crawl(root?: string) { + return new APIBuilder(root || ".", this.options); + } + + withGlobFunction(fn: TFunc) { + // cast this since we don't have the new type params yet + this.globFunction = fn as unknown as TGlobFunction; + return this as unknown as Builder; + } + + /** + * @deprecated Pass options using the constructor instead: + * ```ts + * new fdir(options).crawl("/path/to/root"); + * ``` + * This method will be removed in v7.0 + */ + /* c8 ignore next 4 */ + crawlWithOptions(root: string, options: Partial>) { + this.options = { ...this.options, ...options }; + return new APIBuilder(root || ".", this.options); + } + + glob(...patterns: string[]) { + if (this.globFunction) { + return this.globWithOptions(patterns); + } + return this.globWithOptions( + patterns, + ...([{ dot: true }] as unknown as GlobParams) + ); + } + + globWithOptions(patterns: string[]): Builder; + globWithOptions( + patterns: string[], + ...options: GlobParams + ): Builder; + globWithOptions( + patterns: string[], + ...options: GlobParams | [] + ) { + const globFn = (this.globFunction) as GlobFunction | null; + /* c8 ignore next 5 */ + if (!globFn) { + throw new Error("Please specify a glob function to use glob matching."); + } + + var isMatch = this.globCache[patterns.join("\0")]; + if (!isMatch) { + isMatch = globFn(patterns, ...options); + this.globCache[patterns.join("\0")] = isMatch; + } + this.options.filters.push((path) => isMatch(path)); + return this; + } +} diff --git a/src/builder/index.ts b/src/builder/index.ts index a0fc4be..27e99f8 100644 --- a/src/builder/index.ts +++ b/src/builder/index.ts @@ -1,18 +1,10 @@ -import { sep } from "path"; import { Output, - OnlyCountsOutput, - GroupOutput, PathsOutput, Options, - FilterPredicate, - ExcludePredicate, - GlobFunction, - GlobMatcher, - GlobParams, } from "../types"; -import { APIBuilder } from "./api-builder"; import type picomatch from "picomatch"; +import { Builder as BuilderBase } from "./builder"; let pm: typeof picomatch | null = null; /* c8 ignore next 6 */ @@ -26,158 +18,8 @@ try { export class Builder< TReturnType extends Output = PathsOutput, TGlobFunction = typeof picomatch, -> { - private readonly globCache: Record = {}; - private options: Options = { - maxDepth: Infinity, - suppressErrors: true, - pathSeparator: sep, - filters: [], - }; - private globFunction?: TGlobFunction; - - constructor(options?: Partial>) { - this.options = { ...this.options, ...options }; - this.globFunction = this.options.globFunction; - } - - group(): Builder { - this.options.group = true; - return this as Builder; - } - - withPathSeparator(separator: "/" | "\\") { - this.options.pathSeparator = separator; - return this; - } - - withBasePath() { - this.options.includeBasePath = true; - return this; - } - - withRelativePaths() { - this.options.relativePaths = true; - return this; - } - - withDirs() { - this.options.includeDirs = true; - return this; - } - - withMaxDepth(depth: number) { - this.options.maxDepth = depth; - return this; - } - - withMaxFiles(limit: number) { - this.options.maxFiles = limit; - return this; - } - - withFullPaths() { - this.options.resolvePaths = true; - this.options.includeBasePath = true; - return this; - } - - withErrors() { - this.options.suppressErrors = false; - return this; - } - - withSymlinks({ resolvePaths = true } = {}) { - this.options.resolveSymlinks = true; - this.options.useRealPaths = resolvePaths; - return this.withFullPaths(); - } - - withAbortSignal(signal: AbortSignal) { - this.options.signal = signal; - return this; - } - - normalize() { - this.options.normalizePath = true; - return this; - } - - filter(predicate: FilterPredicate) { - this.options.filters.push(predicate); - return this; - } - - onlyDirs() { - this.options.excludeFiles = true; - this.options.includeDirs = true; - return this; - } - - exclude(predicate: ExcludePredicate) { - this.options.exclude = predicate; - return this; - } - - onlyCounts(): Builder { - this.options.onlyCounts = true; - return this as Builder; - } - - crawl(root?: string) { - return new APIBuilder(root || ".", this.options); - } - - withGlobFunction(fn: TFunc) { - // cast this since we don't have the new type params yet - this.globFunction = fn as unknown as TGlobFunction; - return this as unknown as Builder; - } - - /** - * @deprecated Pass options using the constructor instead: - * ```ts - * new fdir(options).crawl("/path/to/root"); - * ``` - * This method will be removed in v7.0 - */ - /* c8 ignore next 4 */ - crawlWithOptions(root: string, options: Partial>) { - this.options = { ...this.options, ...options }; - return new APIBuilder(root || ".", this.options); - } - - glob(...patterns: string[]) { - if (this.globFunction) { - return this.globWithOptions(patterns); - } - return this.globWithOptions( - patterns, - ...([{ dot: true }] as unknown as GlobParams) - ); - } - - globWithOptions(patterns: string[]): Builder; - globWithOptions( - patterns: string[], - ...options: GlobParams - ): Builder; - globWithOptions( - patterns: string[], - ...options: GlobParams | [] - ) { - const globFn = (this.globFunction || pm) as GlobFunction | null; - /* c8 ignore next 5 */ - if (!globFn) { - throw new Error("Please specify a glob function to use glob matching."); - } - - var isMatch = this.globCache[patterns.join("\0")]; - if (!isMatch) { - isMatch = globFn(patterns, ...options); - this.globCache[patterns.join("\0")] = isMatch; - } - this.options.filters.push((path) => isMatch(path)); - return this; +> extends BuilderBase { + constructor(options?: Partial>) { + super(pm ? { ...options, globFunction: options?.globFunction || pm as TGlobFunction } : options ); } } diff --git a/tsdown.config.ts b/tsdown.config.ts index aa0ab76..95d5740 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -1,11 +1,22 @@ -import { defineConfig } from 'tsdown/config' +import { defineConfig } from "tsdown/config"; -export default defineConfig({ - entry: 'src/index.ts', - format: ['cjs', 'esm'], - target: 'node12', - removeNodeProtocol: true, - dts: true, - exports: true, - fixedExtension: true -}) \ No newline at end of file +export default defineConfig([ + { + entry: "src/index.ts", + format: ["cjs", "esm"], + target: "node12", + removeNodeProtocol: true, + dts: true, + exports: true, + fixedExtension: true, + }, + { + entry: "src/builder/builder.ts", + format: ["cjs", "esm"], + target: "node12", + removeNodeProtocol: true, + dts: true, + exports: true, + fixedExtension: true, + }, +]) From ce33e7beec0834744373a682305c0be8c922df8f Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Wed, 20 Aug 2025 16:39:47 +0200 Subject: [PATCH 2/7] export top level builder --- src/builder.ts | 1 + src/builder/builder.ts | 5 ++++- src/builder/index.ts | 18 ++++-------------- src/index.ts | 2 +- tsdown.config.ts | 16 +++------------- 5 files changed, 13 insertions(+), 29 deletions(-) create mode 100644 src/builder.ts diff --git a/src/builder.ts b/src/builder.ts new file mode 100644 index 0000000..b86f6a0 --- /dev/null +++ b/src/builder.ts @@ -0,0 +1 @@ +export { Builder } from "./builder/builder"; diff --git a/src/builder/builder.ts b/src/builder/builder.ts index 0d0573c..c5a02aa 100644 --- a/src/builder/builder.ts +++ b/src/builder/builder.ts @@ -157,7 +157,8 @@ export class Builder< patterns: string[], ...options: GlobParams | [] ) { - const globFn = (this.globFunction) as GlobFunction | null; + const globFn = (this.globFunction || + Builder.defaultGlobFunction) as GlobFunction | null; /* c8 ignore next 5 */ if (!globFn) { throw new Error("Please specify a glob function to use glob matching."); @@ -171,4 +172,6 @@ export class Builder< this.options.filters.push((path) => isMatch(path)); return this; } + + static defaultGlobFunction: typeof picomatch | null = null; } diff --git a/src/builder/index.ts b/src/builder/index.ts index 27e99f8..9ac0db5 100644 --- a/src/builder/index.ts +++ b/src/builder/index.ts @@ -1,10 +1,7 @@ -import { - Output, - PathsOutput, - Options, -} from "../types"; import type picomatch from "picomatch"; -import { Builder as BuilderBase } from "./builder"; +import { Builder } from "./builder"; + +export { Builder }; let pm: typeof picomatch | null = null; /* c8 ignore next 6 */ @@ -15,11 +12,4 @@ try { // do nothing } -export class Builder< - TReturnType extends Output = PathsOutput, - TGlobFunction = typeof picomatch, -> extends BuilderBase { - constructor(options?: Partial>) { - super(pm ? { ...options, globFunction: options?.globFunction || pm as TGlobFunction } : options ); - } -} +Builder.defaultGlobFunction = pm || null; diff --git a/src/index.ts b/src/index.ts index fba8ef8..a5a89c8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import { Builder } from "./builder"; +import { Builder } from "./builder/index"; export { Builder as fdir }; export type Fdir = typeof Builder; diff --git a/tsdown.config.ts b/tsdown.config.ts index 95d5740..3f8e607 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -1,22 +1,12 @@ import { defineConfig } from "tsdown/config"; -export default defineConfig([ +export default defineConfig( { - entry: "src/index.ts", + entry: ["src/index.ts", "src/builder.ts"], format: ["cjs", "esm"], target: "node12", removeNodeProtocol: true, dts: true, exports: true, fixedExtension: true, - }, - { - entry: "src/builder/builder.ts", - format: ["cjs", "esm"], - target: "node12", - removeNodeProtocol: true, - dts: true, - exports: true, - fixedExtension: true, - }, -]) + }) From bfbe2fc03b7c3698bbac35174c6fdcae4bc99164 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Wed, 20 Aug 2025 16:45:50 +0200 Subject: [PATCH 3/7] Move builder back to index.ts --- src/builder.ts | 2 +- src/builder/builder.ts | 177 --------------------------------------- src/builder/index.ts | 184 ++++++++++++++++++++++++++++++++++++++--- src/index.ts | 12 +++ 4 files changed, 186 insertions(+), 189 deletions(-) delete mode 100644 src/builder/builder.ts diff --git a/src/builder.ts b/src/builder.ts index b86f6a0..66ea302 100644 --- a/src/builder.ts +++ b/src/builder.ts @@ -1 +1 @@ -export { Builder } from "./builder/builder"; +export { Builder } from "./builder/index"; diff --git a/src/builder/builder.ts b/src/builder/builder.ts deleted file mode 100644 index c5a02aa..0000000 --- a/src/builder/builder.ts +++ /dev/null @@ -1,177 +0,0 @@ -import { sep } from "path"; -import { - Output, - OnlyCountsOutput, - GroupOutput, - PathsOutput, - Options, - FilterPredicate, - ExcludePredicate, - GlobFunction, - GlobMatcher, - GlobParams, -} from "../types"; -import { APIBuilder } from "./api-builder"; -import type picomatch from "picomatch"; - -export class Builder< - TReturnType extends Output = PathsOutput, - TGlobFunction = typeof picomatch, -> { - private readonly globCache: Record = {}; - private options: Options = { - maxDepth: Infinity, - suppressErrors: true, - pathSeparator: sep, - filters: [], - }; - private globFunction?: TGlobFunction; - - constructor(options?: Partial>) { - this.options = { ...this.options, ...options }; - this.globFunction = this.options.globFunction; - } - - group(): Builder { - this.options.group = true; - return this as Builder; - } - - withPathSeparator(separator: "/" | "\\") { - this.options.pathSeparator = separator; - return this; - } - - withBasePath() { - this.options.includeBasePath = true; - return this; - } - - withRelativePaths() { - this.options.relativePaths = true; - return this; - } - - withDirs() { - this.options.includeDirs = true; - return this; - } - - withMaxDepth(depth: number) { - this.options.maxDepth = depth; - return this; - } - - withMaxFiles(limit: number) { - this.options.maxFiles = limit; - return this; - } - - withFullPaths() { - this.options.resolvePaths = true; - this.options.includeBasePath = true; - return this; - } - - withErrors() { - this.options.suppressErrors = false; - return this; - } - - withSymlinks({ resolvePaths = true } = {}) { - this.options.resolveSymlinks = true; - this.options.useRealPaths = resolvePaths; - return this.withFullPaths(); - } - - withAbortSignal(signal: AbortSignal) { - this.options.signal = signal; - return this; - } - - normalize() { - this.options.normalizePath = true; - return this; - } - - filter(predicate: FilterPredicate) { - this.options.filters.push(predicate); - return this; - } - - onlyDirs() { - this.options.excludeFiles = true; - this.options.includeDirs = true; - return this; - } - - exclude(predicate: ExcludePredicate) { - this.options.exclude = predicate; - return this; - } - - onlyCounts(): Builder { - this.options.onlyCounts = true; - return this as Builder; - } - - crawl(root?: string) { - return new APIBuilder(root || ".", this.options); - } - - withGlobFunction(fn: TFunc) { - // cast this since we don't have the new type params yet - this.globFunction = fn as unknown as TGlobFunction; - return this as unknown as Builder; - } - - /** - * @deprecated Pass options using the constructor instead: - * ```ts - * new fdir(options).crawl("/path/to/root"); - * ``` - * This method will be removed in v7.0 - */ - /* c8 ignore next 4 */ - crawlWithOptions(root: string, options: Partial>) { - this.options = { ...this.options, ...options }; - return new APIBuilder(root || ".", this.options); - } - - glob(...patterns: string[]) { - if (this.globFunction) { - return this.globWithOptions(patterns); - } - return this.globWithOptions( - patterns, - ...([{ dot: true }] as unknown as GlobParams) - ); - } - - globWithOptions(patterns: string[]): Builder; - globWithOptions( - patterns: string[], - ...options: GlobParams - ): Builder; - globWithOptions( - patterns: string[], - ...options: GlobParams | [] - ) { - const globFn = (this.globFunction || - Builder.defaultGlobFunction) as GlobFunction | null; - /* c8 ignore next 5 */ - if (!globFn) { - throw new Error("Please specify a glob function to use glob matching."); - } - - var isMatch = this.globCache[patterns.join("\0")]; - if (!isMatch) { - isMatch = globFn(patterns, ...options); - this.globCache[patterns.join("\0")] = isMatch; - } - this.options.filters.push((path) => isMatch(path)); - return this; - } - - static defaultGlobFunction: typeof picomatch | null = null; -} diff --git a/src/builder/index.ts b/src/builder/index.ts index 9ac0db5..c5a02aa 100644 --- a/src/builder/index.ts +++ b/src/builder/index.ts @@ -1,15 +1,177 @@ +import { sep } from "path"; +import { + Output, + OnlyCountsOutput, + GroupOutput, + PathsOutput, + Options, + FilterPredicate, + ExcludePredicate, + GlobFunction, + GlobMatcher, + GlobParams, +} from "../types"; +import { APIBuilder } from "./api-builder"; import type picomatch from "picomatch"; -import { Builder } from "./builder"; -export { Builder }; +export class Builder< + TReturnType extends Output = PathsOutput, + TGlobFunction = typeof picomatch, +> { + private readonly globCache: Record = {}; + private options: Options = { + maxDepth: Infinity, + suppressErrors: true, + pathSeparator: sep, + filters: [], + }; + private globFunction?: TGlobFunction; -let pm: typeof picomatch | null = null; -/* c8 ignore next 6 */ -try { - require.resolve("picomatch"); - pm = require("picomatch"); -} catch { - // do nothing -} + constructor(options?: Partial>) { + this.options = { ...this.options, ...options }; + this.globFunction = this.options.globFunction; + } + + group(): Builder { + this.options.group = true; + return this as Builder; + } + + withPathSeparator(separator: "/" | "\\") { + this.options.pathSeparator = separator; + return this; + } + + withBasePath() { + this.options.includeBasePath = true; + return this; + } + + withRelativePaths() { + this.options.relativePaths = true; + return this; + } + + withDirs() { + this.options.includeDirs = true; + return this; + } + + withMaxDepth(depth: number) { + this.options.maxDepth = depth; + return this; + } + + withMaxFiles(limit: number) { + this.options.maxFiles = limit; + return this; + } + + withFullPaths() { + this.options.resolvePaths = true; + this.options.includeBasePath = true; + return this; + } + + withErrors() { + this.options.suppressErrors = false; + return this; + } + + withSymlinks({ resolvePaths = true } = {}) { + this.options.resolveSymlinks = true; + this.options.useRealPaths = resolvePaths; + return this.withFullPaths(); + } + + withAbortSignal(signal: AbortSignal) { + this.options.signal = signal; + return this; + } -Builder.defaultGlobFunction = pm || null; + normalize() { + this.options.normalizePath = true; + return this; + } + + filter(predicate: FilterPredicate) { + this.options.filters.push(predicate); + return this; + } + + onlyDirs() { + this.options.excludeFiles = true; + this.options.includeDirs = true; + return this; + } + + exclude(predicate: ExcludePredicate) { + this.options.exclude = predicate; + return this; + } + + onlyCounts(): Builder { + this.options.onlyCounts = true; + return this as Builder; + } + + crawl(root?: string) { + return new APIBuilder(root || ".", this.options); + } + + withGlobFunction(fn: TFunc) { + // cast this since we don't have the new type params yet + this.globFunction = fn as unknown as TGlobFunction; + return this as unknown as Builder; + } + + /** + * @deprecated Pass options using the constructor instead: + * ```ts + * new fdir(options).crawl("/path/to/root"); + * ``` + * This method will be removed in v7.0 + */ + /* c8 ignore next 4 */ + crawlWithOptions(root: string, options: Partial>) { + this.options = { ...this.options, ...options }; + return new APIBuilder(root || ".", this.options); + } + + glob(...patterns: string[]) { + if (this.globFunction) { + return this.globWithOptions(patterns); + } + return this.globWithOptions( + patterns, + ...([{ dot: true }] as unknown as GlobParams) + ); + } + + globWithOptions(patterns: string[]): Builder; + globWithOptions( + patterns: string[], + ...options: GlobParams + ): Builder; + globWithOptions( + patterns: string[], + ...options: GlobParams | [] + ) { + const globFn = (this.globFunction || + Builder.defaultGlobFunction) as GlobFunction | null; + /* c8 ignore next 5 */ + if (!globFn) { + throw new Error("Please specify a glob function to use glob matching."); + } + + var isMatch = this.globCache[patterns.join("\0")]; + if (!isMatch) { + isMatch = globFn(patterns, ...options); + this.globCache[patterns.join("\0")] = isMatch; + } + this.options.filters.push((path) => isMatch(path)); + return this; + } + + static defaultGlobFunction: typeof picomatch | null = null; +} diff --git a/src/index.ts b/src/index.ts index a5a89c8..21c9772 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,18 @@ +import type picomatch from "picomatch"; import { Builder } from "./builder/index"; export { Builder as fdir }; export type Fdir = typeof Builder; export * from "./types"; + +let pm: typeof picomatch | null = null; +/* c8 ignore next 6 */ +try { + require.resolve("picomatch"); + pm = require("picomatch"); +} catch { + // do nothing +} + +Builder.defaultGlobFunction = pm || null; From d1594d335c436e910b8b64420158f1b8d70fa7ab Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Wed, 20 Aug 2025 16:48:26 +0200 Subject: [PATCH 4/7] Update tsdown.config.ts --- tsdown.config.ts | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tsdown.config.ts b/tsdown.config.ts index 3f8e607..49a483c 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -1,12 +1,11 @@ -import { defineConfig } from "tsdown/config"; +import { defineConfig } from 'tsdown/config'; -export default defineConfig( - { - entry: ["src/index.ts", "src/builder.ts"], - format: ["cjs", "esm"], - target: "node12", - removeNodeProtocol: true, - dts: true, - exports: true, - fixedExtension: true, - }) +export default defineConfig({ + entry: ["src/index.ts", "src/builder.ts"], + format: ["cjs", "esm"], + target: "node12", + removeNodeProtocol: true, + dts: true, + exports: true, + fixedExtension: true, +}) From 5dbcc050c4287056dbbc6fcdd627240139394745 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Wed, 20 Aug 2025 16:49:16 +0200 Subject: [PATCH 5/7] Update tsdown.config.ts --- tsdown.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tsdown.config.ts b/tsdown.config.ts index 49a483c..718c9e6 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -1,4 +1,4 @@ -import { defineConfig } from 'tsdown/config'; +import { defineConfig } from 'tsdown/config' export default defineConfig({ entry: ["src/index.ts", "src/builder.ts"], @@ -7,5 +7,5 @@ export default defineConfig({ removeNodeProtocol: true, dts: true, exports: true, - fixedExtension: true, + fixedExtension: true }) From 8525f035c890ccbed194780dfb3c119ada8bd320 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Wed, 20 Aug 2025 16:50:03 +0200 Subject: [PATCH 6/7] Update tsdown.config.ts --- tsdown.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tsdown.config.ts b/tsdown.config.ts index 718c9e6..0611b12 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -1,8 +1,8 @@ import { defineConfig } from 'tsdown/config' export default defineConfig({ - entry: ["src/index.ts", "src/builder.ts"], - format: ["cjs", "esm"], + entry: ['src/index.ts', 'src/builder.ts'], + format: ['cjs', 'esm'], target: "node12", removeNodeProtocol: true, dts: true, From bf44990258c77dd454d3cb89e41e4649de818a14 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Wed, 20 Aug 2025 16:50:32 +0200 Subject: [PATCH 7/7] Update tsdown.config.ts --- tsdown.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsdown.config.ts b/tsdown.config.ts index 0611b12..73012df 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -3,7 +3,7 @@ import { defineConfig } from 'tsdown/config' export default defineConfig({ entry: ['src/index.ts', 'src/builder.ts'], format: ['cjs', 'esm'], - target: "node12", + target: 'node12', removeNodeProtocol: true, dts: true, exports: true,