Skip to content

Commit

Permalink
feat(prettier-config): switch back to ESM for the bundled config (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusrbrown authored Nov 28, 2024
1 parent 828f96a commit 5627299
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 20 deletions.
6 changes: 6 additions & 0 deletions .changeset/chilled-masks-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@bfra.me/prettier-config": minor
---

Switch back to ESM output for the bundled config

2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* text=auto eol=lf

packages/prettier-config/index.cjs -diff linguist-generated=true
packages/prettier-config/index.js -diff linguist-generated=true
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
packages/api-core/test-utils/sdks/
packages/eslint-config/.eslint-config-inspector
packages/eslint-config/src/*.d.ts
packages/prettier-config/index.cjs
packages/prettier-config/index.js
1 change: 0 additions & 1 deletion packages/prettier-config/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
test/_fixtures
index.cjs.map
2 changes: 1 addition & 1 deletion packages/prettier-config/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
test/fixtures/
index.cjs
index.js
2 changes: 1 addition & 1 deletion packages/prettier-config/eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import config from '../../eslint.config'

export default composeConfig(config, {
name: '@bfra.me/prettier-config/bundled',
ignores: ['index.cjs'],
ignores: ['index.js'],
})
9 changes: 0 additions & 9 deletions packages/prettier-config/index.cjs

This file was deleted.

9 changes: 9 additions & 0 deletions packages/prettier-config/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/prettier-config/index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"index.cjs"
"index.js"
8 changes: 4 additions & 4 deletions packages/prettier-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
".": {
"types": "./lib/index.d.ts",
"source": "./src/index.ts",
"default": "./index.cjs"
"default": "./index.js"
},
"./*": {
"types": "./lib/*.d.ts",
Expand All @@ -38,19 +38,19 @@
"./*/semi": "./lib/*.js?semi=true",
"./package.json": "./package.json"
},
"main": "./index.cjs",
"main": "./index.js",
"module": "./lib/index.js",
"types": "./lib/index.d.ts",
"files": [
"lib",
"src",
"index.json",
"index.cjs",
"index.js",
"!**/*.map"
],
"scripts": {
"build": "tsup",
"postbuild": "prettier --config ./index.cjs --ignore-path .prettierignore --log-level warn --write .",
"postbuild": "prettier --config ./index.js --ignore-path .prettierignore --log-level warn --write .",
"prepack": "pnpm --filter-prod=\"{.}...\" --loglevel error run build",
"test": "pnpm --filter-prod=\"{.}...\" --loglevel error run build && vitest"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/prettier-config/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default defineConfig([
},
{
entry: ['./src/index.ts'],
format: ['cjs'],
format: ['esm'],
minify: true,
// Bundle the config and dependencies into a single file.
noExternal: [/^@bfra.me\//],
Expand Down

0 comments on commit 5627299

Please sign in to comment.