Skip to content

Commit

Permalink
chore: add granular exports, esm-only (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito authored May 30, 2024
1 parent fa29e1b commit e6854cd
Show file tree
Hide file tree
Showing 54 changed files with 134 additions and 739 deletions.
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
extends: ['@commitlint/config-conventional'],
rules: {
'body-max-line-length': [0, 'always', Infinity],
Expand Down
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"type": "module",
"name": "@mswjs/source",
"version": "0.0.0",
"description": "Generate MSW request handlers from OpenAPI documents, HAR archives, and other sources.",
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.mjs",
"types": "./lib/cjs/index.d.ts",
"exports": {
".": {
"require": "./lib/cjs/index.cjs",
"import": "./lib/esm/index.mjs",
"default": "./lib/cjs/index.js"
}
"./open-api": {
"types": "./lib/open-api/from-open-api.d.ts",
"default": "./lib/open-api/from-open-api.js"
},
"./traffic": {
"types": "./lib/traffic/from-traffic.d.ts",
"default": "./lib/traffic/from-traffic.js"
},
"./package.json": "./package.json"
},
"files": [
"lib"
Expand All @@ -22,9 +24,9 @@
"har:fixture": "ts-node ./test/traffic/fixtures/requests/command.ts",
"prepare": "pnpm simple-git-hooks init",
"prebuild": "pnpm lint",
"build": "tsup",
"build": "tsc -p ./tsconfig.build.json",
"test": "vitest",
"prepublishOnly": "pnpm test && pnpm build"
"prepack": "pnpm test && pnpm build"
},
"lint-staged": {
"*.ts": [
Expand Down Expand Up @@ -58,7 +60,6 @@
"simple-git-hooks": "^2.8.1",
"ts-node": "^10.9.1",
"tslib": "^2.3.1",
"tsup": "^8.0.2",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
},
Expand Down
Loading

0 comments on commit e6854cd

Please sign in to comment.