Co-authored-by: Julien Valverdé <julien.valverde@mailo.com> Reviewed-on: https://git.jvalver.de/Thilawyn/traitify-ts/pulls/17
This commit was merged in pull request #17.
This commit is contained in:
@@ -16,8 +16,8 @@ local lint_step = {
|
||||
|
||||
local build_step = {
|
||||
name: "build",
|
||||
image: bun_image,
|
||||
commands: ["bun run build"],
|
||||
image: node_image,
|
||||
commands: ["npm run build"],
|
||||
};
|
||||
|
||||
local pack_step = {
|
||||
|
||||
13
package.json
13
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thilawyn/traitify-ts",
|
||||
"version": "0.1.16",
|
||||
"version": "0.1.17",
|
||||
"type": "module",
|
||||
"publishConfig": {
|
||||
"registry": "https://git.jvalver.de/api/packages/thilawyn/npm/"
|
||||
@@ -11,8 +11,8 @@
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/lib.d.mts",
|
||||
"default": "./dist/lib.mjs"
|
||||
"types": "./dist/lib.d.ts",
|
||||
"default": "./dist/lib.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/lib.d.cts",
|
||||
@@ -21,7 +21,7 @@
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c rollup.config.ts",
|
||||
"build": "tsup",
|
||||
"lint:tsc": "tsc --noEmit",
|
||||
"clean:cache": "rm -f tsconfig.tsbuildinfo",
|
||||
"clean:dist": "rm -rf dist",
|
||||
@@ -32,14 +32,11 @@
|
||||
"type-fest": "^4.13.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"bun-types": "latest",
|
||||
"npm-check-updates": "^16.14.17",
|
||||
"npm-sort": "^0.0.4",
|
||||
"rollup": "^4.13.0",
|
||||
"rollup-plugin-cleanup": "^3.2.1",
|
||||
"rollup-plugin-ts": "^3.4.5",
|
||||
"tsup": "^8.0.2",
|
||||
"tsx": "^4.7.1",
|
||||
"typescript": "^5.4.3"
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
import { nodeResolve } from "@rollup/plugin-node-resolve"
|
||||
import { defineConfig } from "rollup"
|
||||
import cleanup from "rollup-plugin-cleanup"
|
||||
import ts from "rollup-plugin-ts"
|
||||
import pkg from "./package.json" assert { type: "json" }
|
||||
|
||||
|
||||
export const createBundleConfig = (
|
||||
input: string,
|
||||
name: keyof typeof pkg.exports,
|
||||
) => (
|
||||
defineConfig({
|
||||
input,
|
||||
|
||||
output: [
|
||||
{
|
||||
file: pkg.exports[name].import.default,
|
||||
format: "esm",
|
||||
},
|
||||
{
|
||||
file: pkg.exports[name].require.default,
|
||||
format: "cjs",
|
||||
},
|
||||
],
|
||||
|
||||
external: id => !/^[./]/.test(id),
|
||||
|
||||
plugins: [
|
||||
nodeResolve(),
|
||||
ts(),
|
||||
|
||||
cleanup({
|
||||
comments: "jsdoc",
|
||||
extensions: ["ts"],
|
||||
}),
|
||||
],
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
export default [
|
||||
createBundleConfig("src/lib.ts", "."),
|
||||
]
|
||||
@@ -8,7 +8,7 @@
|
||||
// "allowImportingTsExtensions": true,
|
||||
// "noEmit": true,
|
||||
"declaration": true,
|
||||
"composite": true,
|
||||
// "composite": true,
|
||||
"strict": true,
|
||||
"downlevelIteration": true,
|
||||
"skipLibCheck": true,
|
||||
|
||||
11
tsup.config.ts
Normal file
11
tsup.config.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { defineConfig } from "tsup"
|
||||
|
||||
|
||||
export default defineConfig({
|
||||
entry: ["src/lib.ts"],
|
||||
format: ["esm", "cjs"],
|
||||
dts: true,
|
||||
splitting: false,
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
})
|
||||
Reference in New Issue
Block a user