Skip to content

Commit

Permalink
internal: Improve entry points and exports. (#154)
Browse files Browse the repository at this point in the history
* Start on entry point.

* Add tests.

* Update tests.

* Update docs.

* Update our packages.

* Start on exports.

* Start on exports.

* Add exports.

* Update exports.

* Update docs.

* Fix tests.

* Disable rule.
  • Loading branch information
milesj committed Nov 15, 2022
1 parent 6e71ca3 commit 62dbbc4
Show file tree
Hide file tree
Showing 26 changed files with 799 additions and 782 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ module.exports = {
rules: {
// Doesnt work with `package.json` exports
'import/no-unresolved': 'off',
// Very buggy?
'node/no-unpublished-import': 'off',
},
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"prerelease": "yarn run clean && yarn run setup && yarn run pack && yarn run check",
"release": "yarn prerelease && lerna-release",
"version": "yarn install && git add yarn.lock",
"pack": "NODE_ENV=production yarn run packemon build-workspace --addEngines --addExports --declaration",
"pack": "yarn run packemon build-workspace --addEngines --addExports --declaration",
"packemon": "node ./packages/packemon/cjs/bin.cjs"
},
"workspaces": [
Expand Down
19 changes: 11 additions & 8 deletions packages/babel-plugin-cjs-esm-interop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
"author": "Miles Johnson",
"license": "MIT",
"main": "./lib/index.js",
"types": "./dts/index.d.ts",
"types": "./lib/index.d.ts",
"files": [
"dts/**/*.d.ts",
"lib/**/*.{js,map}",
"src/**/*.{ts,tsx,json}"
"lib/**/*",
"src/**/*"
],
"engines": {
"node": ">=14.15.0",
Expand All @@ -46,13 +45,17 @@
"exports": {
"./package.json": "./package.json",
"./*": {
"types": "./dts/*.d.ts",
"node": "./lib/*.js",
"node": {
"types": "./lib/*.d.ts",
"default": "./lib/*.js"
},
"default": "./lib/*.js"
},
".": {
"types": "./dts/index.d.ts",
"node": "./lib/index.js",
"node": {
"types": "./lib/index.d.ts",
"default": "./lib/index.js"
},
"default": "./lib/index.js"
}
}
Expand Down
19 changes: 11 additions & 8 deletions packages/babel-plugin-conditional-invariant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
"author": "Miles Johnson",
"license": "MIT",
"main": "./lib/index.js",
"types": "./dts/index.d.ts",
"types": "./lib/index.d.ts",
"files": [
"dts/**/*.d.ts",
"lib/**/*.{js,map}",
"src/**/*.{ts,tsx,json}"
"lib/**/*",
"src/**/*"
],
"engines": {
"node": ">=14.15.0",
Expand All @@ -43,13 +42,17 @@
"exports": {
"./package.json": "./package.json",
"./*": {
"types": "./dts/*.d.ts",
"node": "./lib/*.js",
"node": {
"types": "./lib/*.d.ts",
"default": "./lib/*.js"
},
"default": "./lib/*.js"
},
".": {
"types": "./dts/index.d.ts",
"node": "./lib/index.js",
"node": {
"types": "./lib/index.d.ts",
"default": "./lib/index.js"
},
"default": "./lib/index.js"
}
}
Expand Down
19 changes: 11 additions & 8 deletions packages/babel-plugin-env-constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
"author": "Miles Johnson",
"license": "MIT",
"main": "./lib/index.js",
"types": "./dts/index.d.ts",
"types": "./lib/index.d.ts",
"files": [
"dts/**/*.d.ts",
"lib/**/*.{js,map}",
"src/**/*.{ts,tsx,json}"
"lib/**/*",
"src/**/*"
],
"engines": {
"node": ">=14.15.0",
Expand All @@ -43,13 +42,17 @@
"exports": {
"./package.json": "./package.json",
"./*": {
"types": "./dts/*.d.ts",
"node": "./lib/*.js",
"node": {
"types": "./lib/*.d.ts",
"default": "./lib/*.js"
},
"default": "./lib/*.js"
},
".": {
"types": "./dts/index.d.ts",
"node": "./lib/index.js",
"node": {
"types": "./lib/index.d.ts",
"default": "./lib/index.js"
},
"default": "./lib/index.js"
}
}
Expand Down
40 changes: 27 additions & 13 deletions packages/packemon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,49 @@
"author": "Miles Johnson",
"license": "MIT",
"main": "./cjs/index.cjs",
"types": "./dts/index.d.ts",
"types": "./cjs/index.d.ts",
"bin": "./cjs/bin.cjs",
"files": [
"cjs/**/*.{cjs,mjs,map}",
"dts/**/*.d.ts",
"src/**/*.{ts,tsx,json}",
"cjs/**/*",
"src/**/*",
"templates/**/*"
],
"exports": {
"./package.json": "./package.json",
"./babel": {
"types": "./dts/babel.d.ts",
"node": {
"import": "./cjs/babel-wrapper.mjs",
"require": "./cjs/babel.cjs"
"import": {
"types": "./cjs/babel.d.ts",
"default": "./cjs/babel-wrapper.mjs"
},
"require": {
"types": "./cjs/babel.d.ts",
"default": "./cjs/babel.cjs"
}
}
},
"./bin": {
"types": "./dts/bin.d.ts",
"node": {
"import": "./cjs/bin-wrapper.mjs",
"require": "./cjs/bin.cjs"
"import": {
"types": "./cjs/bin.d.ts",
"default": "./cjs/bin-wrapper.mjs"
},
"require": {
"types": "./cjs/bin.d.ts",
"default": "./cjs/bin.cjs"
}
}
},
".": {
"types": "./dts/index.d.ts",
"node": {
"import": "./cjs/index-wrapper.mjs",
"require": "./cjs/index.cjs"
"import": {
"types": "./cjs/index.d.ts",
"default": "./cjs/index-wrapper.mjs"
},
"require": {
"types": "./cjs/index.d.ts",
"default": "./cjs/index.cjs"
}
}
}
},
Expand Down
105 changes: 0 additions & 105 deletions packages/packemon/src-old/CodeArtifact.ts

This file was deleted.

Loading

0 comments on commit 62dbbc4

Please sign in to comment.