From 483f765dcbf0b8167a21b2e79ee6bdf0e1aefebc Mon Sep 17 00:00:00 2001 From: PierreDemailly Date: Mon, 6 Apr 2026 22:26:50 +0200 Subject: [PATCH] chore(build): migrate from tsup to tsdown --- package.json | 2 +- src/agent/package.json | 12 +++++------- src/config/package.json | 12 +++++------- src/discord/package.json | 12 +++++------- src/logql/package.json | 12 +++++------- src/morphix/package.json | 12 +++++------- src/notifiers/package.json | 12 +++++------- src/pattern/package.json | 12 +++++------- src/slack/package.json | 12 +++++------- src/teams/package.json | 12 +++++------- tsdown.config.ts | 8 ++++++++ tsup.config.ts | 5 ----- 12 files changed, 54 insertions(+), 69 deletions(-) create mode 100644 tsdown.config.ts delete mode 100644 tsup.config.ts diff --git a/package.json b/package.json index e103652e..ba7ac1e4 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "fastify": "^5.2.0", "pino-loki": "^3.0.0", "testcontainers": "11.12.0", - "tsup": "^8.3.5", + "tsdown": "^0.21.7", "typescript": "^5.7.2", "vitepress": "^1.5.0" }, diff --git a/src/agent/package.json b/src/agent/package.json index 5390e82f..f4e108a1 100644 --- a/src/agent/package.json +++ b/src/agent/package.json @@ -3,21 +3,19 @@ "version": "4.1.1", "description": "Loki alerting agent", "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "types": "./dist/index.d.ts", + "main": "./dist/index.mjs", + "types": "./dist/index.d.mts", "exports": { ".": { - "types": "./dist/index.d.ts", - "require": "./dist/index.cjs", - "import": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" } }, "engines": { "node": ">=24" }, "scripts": { - "build": "npm exec allow-scripts && tsup src/index.ts --format cjs,esm --dts --clean", + "build": "npm exec allow-scripts && tsdown src/index.ts --format esm --dts --clean", "dev": "npm run build -- --watch", "prepublishOnly": "npm run build", "test": "node --env-file-if-exists=.env --test-concurrency=1 --test ./test/**/*.spec.ts", diff --git a/src/config/package.json b/src/config/package.json index bd3797ec..e6651f12 100644 --- a/src/config/package.json +++ b/src/config/package.json @@ -3,21 +3,19 @@ "version": "4.0.0", "description": "Sigyn configuration manager", "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "types": "./dist/index.d.ts", + "main": "./dist/index.mjs", + "types": "./dist/index.d.mts", "exports": { ".": { - "types": "./dist/index.d.ts", - "require": "./dist/index.cjs", - "import": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" } }, "engines": { "node": ">=24" }, "scripts": { - "build": "tsup src/index.ts --format cjs,esm --dts --clean", + "build": "tsdown src/index.ts --format esm --dts --clean", "prepublishOnly": "npm run build", "test": "node --test ./test/**/*.spec.ts", "coverage": "c8 -r html npm test", diff --git a/src/discord/package.json b/src/discord/package.json index df7c0782..39144a7a 100644 --- a/src/discord/package.json +++ b/src/discord/package.json @@ -3,21 +3,19 @@ "version": "2.0.0", "description": "Send Sigyn alerts to Discord via webhook", "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "types": "./dist/index.d.ts", + "main": "./dist/index.mjs", + "types": "./dist/index.d.mts", "exports": { ".": { - "types": "./dist/index.d.ts", - "require": "./dist/index.cjs", - "import": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" } }, "engines": { "node": ">=24" }, "scripts": { - "build": "tsup src/index.ts --format cjs,esm --dts --clean", + "build": "tsdown src/index.ts --format esm --dts --clean", "prepublishOnly": "npm run build", "test": "node --test ./test/**/*.spec.ts", "coverage": "c8 -r html npm test", diff --git a/src/logql/package.json b/src/logql/package.json index be6ffccf..74f605ba 100644 --- a/src/logql/package.json +++ b/src/logql/package.json @@ -3,21 +3,19 @@ "version": "2.2.0", "description": "Parse and serialize LogQL queries", "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "types": "./dist/index.d.ts", + "main": "./dist/index.mjs", + "types": "./dist/index.d.mts", "exports": { ".": { - "types": "./dist/index.d.ts", - "require": "./dist/index.cjs", - "import": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" } }, "engines": { "node": ">=24" }, "scripts": { - "build": "tsup src/index.ts --format cjs,esm --dts --clean", + "build": "tsdown src/index.ts --format esm --dts --clean", "prepublishOnly": "npm run build", "test": "node --test ./test/**/*.spec.ts", "coverage": "c8 -r html npm test", diff --git a/src/morphix/package.json b/src/morphix/package.json index 7b4c6eeb..16992883 100644 --- a/src/morphix/package.json +++ b/src/morphix/package.json @@ -3,21 +3,19 @@ "version": "1.1.0", "description": "Micro templating with function pipes support", "type": "module", - "main": "./dist/index.js", - "module": "./dist/index.mjs", - "types": "./dist/index.d.ts", + "main": "./dist/index.mjs", + "types": "./dist/index.d.mts", "exports": { ".": { - "types": "./dist/index.d.ts", - "require": "./dist/index.cjs", - "import": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" } }, "engines": { "node": ">=24" }, "scripts": { - "build": "tsup src/index.ts --format cjs,esm --dts --clean", + "build": "tsdown src/index.ts --format esm --dts --clean", "prepublishOnly": "npm run build", "test": "node --test ./test/**/*.spec.ts", "coverage": "c8 -r html npm test", diff --git a/src/notifiers/package.json b/src/notifiers/package.json index 38f2d4fa..065bd756 100644 --- a/src/notifiers/package.json +++ b/src/notifiers/package.json @@ -3,21 +3,19 @@ "version": "1.0.0", "description": "Helpers to build a Sigyn notifier", "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "types": "./dist/index.d.ts", + "main": "./dist/index.mjs", + "types": "./dist/index.d.mts", "exports": { ".": { - "types": "./dist/index.d.ts", - "require": "./dist/index.cjs", - "import": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" } }, "engines": { "node": ">=24" }, "scripts": { - "build": "tsup src/index.ts --format cjs,esm --dts --clean --external @myunisoft/httpie", + "build": "tsdown src/index.ts --format esm --dts --clean", "prepublishOnly": "npm run build", "test": "node --test ./test/**/*.spec.ts", "coverage": "c8 -r html npm test", diff --git a/src/pattern/package.json b/src/pattern/package.json index 3caf4492..282b0b0c 100644 --- a/src/pattern/package.json +++ b/src/pattern/package.json @@ -2,21 +2,19 @@ "name": "@sigyn/pattern", "version": "1.1.0", "description": "Loki pattern in JavaScript", - "main": "./dist/pattern.cjs", - "module": "./dist/pattern.js", - "types": "./dist/pattern.d.ts", + "main": "./dist/pattern.mjs", + "types": "./dist/pattern.d.mts", "exports": { ".": { - "types": "./dist/pattern.d.ts", - "require": "./dist/pattern.cjs", - "import": "./dist/pattern.js" + "types": "./dist/pattern.d.mts", + "default": "./dist/pattern.mjs" } }, "engines": { "node": ">=24" }, "scripts": { - "build": "tsup src/pattern.ts --format cjs,esm --dts --clean", + "build": "tsdown src/pattern.ts --format esm --dts --clean", "prepublishOnly": "npm run build", "test-types": "npm run build && tsd", "test-only": "node --test ./test/**/*.spec.ts", diff --git a/src/slack/package.json b/src/slack/package.json index 42ca0978..1bcb8710 100644 --- a/src/slack/package.json +++ b/src/slack/package.json @@ -3,21 +3,19 @@ "version": "2.0.0", "description": "Send Sigyn alerts to Slack via webhook", "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "types": "./dist/index.d.ts", + "main": "./dist/index.mjs", + "types": "./dist/index.d.mts", "exports": { ".": { - "types": "./dist/index.d.ts", - "require": "./dist/index.cjs", - "import": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" } }, "engines": { "node": ">=24" }, "scripts": { - "build": "tsup src/index.ts --format cjs,esm --dts --clean", + "build": "tsdown src/index.ts --format esm --dts --clean", "prepublishOnly": "npm run build", "test": "node --test ./test/**/*.spec.ts", "coverage": "c8 -r html npm test", diff --git a/src/teams/package.json b/src/teams/package.json index 723f5e96..8f0f7fd7 100644 --- a/src/teams/package.json +++ b/src/teams/package.json @@ -3,21 +3,19 @@ "version": "2.0.0", "description": "Send Sigyn alerts to Teams via webhook", "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "types": "./dist/index.d.ts", + "main": "./dist/index.mjs", + "types": "./dist/index.d.mts", "exports": { ".": { - "types": "./dist/index.d.ts", - "require": "./dist/index.cjs", - "import": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" } }, "engines": { "node": ">=24" }, "scripts": { - "build": "tsup src/index.ts --format cjs,esm --dts --clean", + "build": "tsdown src/index.ts --format esm --dts --clean", "prepublishOnly": "npm run build", "test": "node --test ./test/**/*.spec.ts", "coverage": "c8 -r html npm test", diff --git a/tsdown.config.ts b/tsdown.config.ts new file mode 100644 index 00000000..f4dcc0e6 --- /dev/null +++ b/tsdown.config.ts @@ -0,0 +1,8 @@ +// Import Third-party Dependencies +import { defineConfig } from "tsdown"; + +export default defineConfig({ + deps: { + onlyBundle: false + } +}); diff --git a/tsup.config.ts b/tsup.config.ts deleted file mode 100644 index 398bdb76..00000000 --- a/tsup.config.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - shims: true -});