Skip to content

Commit

Permalink
chore(all): fix bundling
Browse files Browse the repository at this point in the history
One must have dual types for dual packages.
  • Loading branch information
lishaduck committed Jul 12, 2024
1 parent 67d2482 commit ed55a85
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 26 deletions.
6 changes: 5 additions & 1 deletion packages/create-sheriff-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"version": "5.2.0",
"type": "module",
"description": "CLI/starter to bootstrap a Sheriff config",
"main": "dist/index.js",
"exports": {
".": {
"node": "./dist/index.js"
}
},
"scripts": {
"dev": "tsx ./src/index.ts",
"clean": "rm -rf .turbo dist",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-sheriff-config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"extends": "tsconfig/base.json",
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "node",
"moduleResolution": "Bundler",
"incremental": true,
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
}
Expand Down
13 changes: 8 additions & 5 deletions packages/eslint-config-sheriff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
"name": "eslint-config-sheriff",
"version": "18.7.0",
"description": "A comprehensive and opinionated Typescript-first ESLint configuration.",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.js"
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
}
},
"files": [
Expand Down
20 changes: 15 additions & 5 deletions packages/sheriff-constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,29 @@
"version": "0.0.1",
"private": true,
"type": "module",
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.js"
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
}
},
"files": [
"dist",
"CHANGELOG.md"
],
"scripts": {
"publint": "publint",
"clean": "rm -rf .turb dist",
"typecheck": "tsc --noEmit",
"publint": "publint",
"build": "tsup"
},
"devDependencies": {
Expand All @@ -28,5 +35,8 @@
"tsconfig": "workspace:*",
"tsup": "^8.1.0",
"typescript": "^5.5.3"
},
"engines": {
"node": ">=16"
}
}
18 changes: 10 additions & 8 deletions packages/sheriff-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,29 @@
"license": "MIT",
"type": "module",
"files": [
"src"
"dist"
],
"main": "./src/index.ts",
"types": "./src/index.ts",
"module": "./src/index.ts",
"exports": {
".": {
"types": "./src/index.ts",
"import": "./src/index.ts",
"require": "./src/index.ts"
"import": {
"types": "./dist/index.d.ts"
},
"require": {
"types": "./dist/index.d.cts"
}
}
},
"scripts": {
"clean": "rm -rf .turbo dist",
"typecheck": "tsc --noEmit",
"publint": "publint"
"publint": "publint",
"build": "tsup"
},
"devDependencies": {
"@types/node": "^20.14.10",
"publint": "^0.2.8",
"tsconfig": "workspace:*",
"tsup": "^8.1.0",
"type-fest": "^4.21.0",
"typescript": "^5.5.3"
},
Expand Down
8 changes: 8 additions & 0 deletions packages/sheriff-types/tsup.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"entry": ["./src/index.ts"],
"format": ["esm", "cjs"],
"dts": true,
"splitting": false,
"sourcemap": false,
"clean": true
}
9 changes: 3 additions & 6 deletions packages/sheriff-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,18 @@
"files": [
"src"
],
"main": "./src/index.ts",
"types": "./src/index.ts",
"module": "./src/index.ts",
"exports": {
".": {
"types": "./src/index.ts",
"import": "./src/index.ts",
"require": "./src/index.ts"
"import": "./src/index.ts"
}
},
"scripts": {
"start": "tsx watch ./src/generateRulesDataset.ts",
"rulesgen": "tsx ./src/generateRulesDataset.ts",
"publint": "publint",
"clean": "rm -rf .turb dist"
"clean": "rm -rf .turb dist",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@sherifforg/types": "workspace:*",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ed55a85

Please sign in to comment.