Skip to content

Commit

Permalink
Merge pull request #286 from lishaduck/better-bundles
Browse files Browse the repository at this point in the history
Better bundles
  • Loading branch information
AndreaPontrandolfo authored Jan 1, 2025
2 parents 3c90e30 + c738c5f commit b15d071
Show file tree
Hide file tree
Showing 7 changed files with 349 additions and 42 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/merge-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ on:

jobs:
merge-checks:
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest

runs-on: ${{ matrix.os }}
if: '!github.event.pull_request.draft'
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"typecheck": "turbo run typecheck",
"knip": "knip",
"validate-config": "turbo run validate-config",
"merge-checks": "pnpm build && turbo run publint manypkg typesync knip typecheck lint validate-config check-deduped-deps are-the-types-wrong",
"merge-checks": "pnpm build && turbo run publint manypkg typesync knip typecheck lint validate-config are-the-types-wrong && turbo run check-deduped-deps",
"check-deduped-deps": "pnpm dedupe --check",
"clean": "turbo run clean && rm -rf .turbo",
"delete-node-modules": "pnpm exec rm -rf node_modules && pnpm -r exec rm -rf node_modules",
Expand Down
12 changes: 12 additions & 0 deletions packages/eslint-config-sheriff/dts-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"entries": [
{
"filePath": "./dist/index.d.ts",
"outFile": "./dist/index.d.ts",

"libraries": {
"inlinedLibraries": ["@sherifforg/types", "@sherifforg/constants"]
}
}
]
}
4 changes: 3 additions & 1 deletion packages/eslint-config-sheriff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"scripts": {
"preinstall": "npx only-allow pnpm",
"clean": "rm -rf .turbo dist node_modules/.cache",
"re-bundle-types": "dts-bundle-generator -out-file=dist/index.d.ts ./dist/index.d.ts",
"re-bundle-types": "dts-bundle-generator --config dts-config.json",
"are-the-types-wrong": "attw --pack --profile=esm-only",
"build": "tsup && pnpm re-bundle-types",
"build-watch": "tsup && pnpm re-bundle-types",
"typecheck": "tsc --noEmit",
Expand All @@ -55,6 +56,7 @@
"typesync": "typesync --dry=fail"
},
"dependencies": {
"@arethetypeswrong/cli": "^0.17.2",
"@eslint-react/eslint-plugin": "^1.10.1",
"@eslint/compat": "^1.2.4",
"@eslint/js": "^9.17.0",
Expand Down
19 changes: 8 additions & 11 deletions packages/eslint-config-sheriff/tsup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ export default defineConfig({
clean: true,
noExternal: ['@sherifforg/constants', '@sherifforg/types'],
skipNodeModulesBundle: true,
dts: {
entry: 'src/index.ts',
resolve: true,
},
banner: ({ format }) => {
if (format === 'esm')
return {
js: `import { createRequire } from 'module'; const require = createRequire(import.meta.url);`,
};
return {};
},
dts: { entry: 'src/index.ts' },
// banner: ({ format }) => {
// return format === 'esm'
// ? {
// js: `import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);`,
// }
// : {};
// },
});
Loading

0 comments on commit b15d071

Please sign in to comment.