-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add tsup * Fix build * Fix main and module * Fix checks scripts
- Loading branch information
Showing
9 changed files
with
557 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"compilerOptions": { | ||
"skipLibCheck": true, | ||
|
||
"moduleDetection": "force", | ||
"isolatedModules": true, | ||
"resolveJsonModule": true, | ||
"esModuleInterop": true, | ||
"moduleResolution": "Bundler", | ||
"module": "ESNext", | ||
"lib": ["ES2022", "DOM", "DOM.Iterable"], | ||
|
||
"target": "ES2022", | ||
"noEmit": true, | ||
|
||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"allowUnusedLabels": false, | ||
"allowUnreachableCode": false, | ||
// "exactOptionalPropertyTypes": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitOverride": true, | ||
"noImplicitReturns": true, | ||
"noPropertyAccessFromIndexSignature": true, | ||
"noUncheckedIndexedAccess": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true | ||
}, | ||
"include": ["../src"], | ||
"exclude": ["../node_modules", "../lib", "../**/*.ignore.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "./tsconfig.base.json", | ||
"compilerOptions": { | ||
"noEmit": false, | ||
"outDir": "../lib", | ||
"declaration": true, | ||
"emitDeclarationOnly": true, | ||
"removeComments": false | ||
}, | ||
"exclude": ["../node_modules", "../**/*.ignore.ts", "../**/*.test.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {defineConfig} from "tsup" | ||
|
||
export default defineConfig({ | ||
bundle: true, | ||
clean: true, | ||
dts: false, | ||
entry: ["src/index.ts", "src/internal.ts"], | ||
format: ["esm", "cjs"], | ||
keepNames: true, | ||
minify: false, | ||
outDir: "lib", | ||
outExtension({format}) { | ||
if (format === "iife") { | ||
throw new Error("iife is not supported") | ||
} | ||
return { | ||
js: format === "cjs" ? `.${format}` : ".js", | ||
} | ||
}, | ||
platform: "neutral", | ||
sourcemap: false, | ||
splitting: true, | ||
target: "es2022", | ||
treeshake: true, | ||
}) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,17 +2,27 @@ | |
"name": "ruts", | ||
"version": "0.9.0", | ||
"type": "module", | ||
"description": "", | ||
"description": "Type-safe error-handling library for TypeScript", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/bkiac/ruts.git" | ||
}, | ||
"author": "bkiac <[email protected]>", | ||
"license": "MIT", | ||
"main": "./lib/index.cjs", | ||
"module": "./lib/index.js", | ||
"exports": { | ||
".": "./lib/index.js", | ||
"./internal": "./lib/internal.js" | ||
".": { | ||
"types": "./lib/index.d.ts", | ||
"require": "./lib/index.cjs", | ||
"import": "./lib/index.js" | ||
}, | ||
"./internal": { | ||
"types": "./lib/internal.d.ts", | ||
"require": "./lib/internal.cjs", | ||
"import": "./lib/internal.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"types": "./lib/index.d.ts", | ||
"files": [ | ||
|
@@ -25,18 +35,20 @@ | |
"result-type" | ||
], | ||
"scripts": { | ||
"build": "rm -rf lib && tsc --p tsconfig.build.json && prettier --write ./lib --ignore-path ''", | ||
"build": "tsup --config ./cfg/tsup.config.ts && pnpm build:ts", | ||
"build:ts": "tsc --p ./cfg/tsconfig.types.json", | ||
"format": "prettier --write .", | ||
"format:check": "prettier --check .", | ||
"prepublishOnly": "pnpm run build", | ||
"test": "vitest", | ||
"types": "tsc" | ||
"test": "vitest --config ./cfg/vitest.config.ts", | ||
"ts:check": "tsc" | ||
}, | ||
"devDependencies": { | ||
"husky": "^8.0.3", | ||
"lint-staged": "^14.0.1", | ||
"prettier": "^3.0.2", | ||
"prettier-plugin-pkg": "^0.18.0", | ||
"tsup": "^7.2.0", | ||
"tsx": "^3.14.0", | ||
"typescript": "^5.0.4", | ||
"vitest": "^0.34.6" | ||
|
Oops, something went wrong.