Skip to content

Commit 92514ff

Browse files
committed
refactor: additional named exports
1 parent 1fe0b4d commit 92514ff

File tree

5 files changed

+58
-6
lines changed

5 files changed

+58
-6
lines changed

.changeset/ninety-suits-rush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@actcoding/eslint-config": patch
3+
---
4+
5+
additional exports

bun.lock

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
"@eslint/config-inspector": "^1.1.0",
99
"@types/bun": "^1.2.18",
1010
"@types/eslint": "^9.6.1",
11+
"@types/node": "^24.0.14",
1112
"turbo": "^2.5.5",
1213
"typescript": "^5.8.3",
1314
},
1415
},
1516
"packages/eslint-config": {
1617
"name": "@actcoding/eslint-config",
17-
"version": "0.0.9",
18+
"version": "0.0.10",
1819
"dependencies": {
1920
"@actcoding/eslint-plugin-import-newlines": "workspace:*",
2021
"@next/eslint-plugin-next": "^15.4.1",
@@ -38,7 +39,7 @@
3839
},
3940
"packages/eslint-plugin-import-newlines": {
4041
"name": "@actcoding/eslint-plugin-import-newlines",
41-
"version": "0.1.0",
42+
"version": "0.1.1",
4243
"dependencies": {
4344
"zod": "^3.25.76",
4445
},
@@ -206,7 +207,7 @@
206207

207208
"@types/json5": ["@types/[email protected]", "", {}, "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ=="],
208209

209-
"@types/node": ["@types/node@20.12.14", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-scnD59RpYD91xngrQQLGkE+6UrHUPzeKZWhhjBSa3HSkwjbQc38+q3RoIVEwxQGRw3M+j5hpNAM+lgV3cVormg=="],
210+
"@types/node": ["@types/node@24.0.14", "", { "dependencies": { "undici-types": "~7.8.0" } }, "sha512-4zXMWD91vBLGRtHK3YbIoFMia+1nqEz72coM42C5ETjnNCa/heoj7NT1G67iAfOqMmcfhuCZ4uNpyz8EjlAejw=="],
210211

211212
"@types/react": ["@types/[email protected]", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g=="],
212213

@@ -902,7 +903,7 @@
902903

903904
"uncrypto": ["[email protected]", "", {}, "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q=="],
904905

905-
"undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
906+
"undici-types": ["undici-types@7.8.0", "", {}, "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw=="],
906907

907908
"unicorn-magic": ["[email protected]", "", {}, "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ=="],
908909

@@ -1004,6 +1005,8 @@
10041005

10051006
"arraybuffer.prototype.slice/es-abstract": ["[email protected]", "", { "dependencies": { "array-buffer-byte-length": "^1.0.2", "arraybuffer.prototype.slice": "^1.0.4", "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "call-bound": "^1.0.3", "data-view-buffer": "^1.0.2", "data-view-byte-length": "^1.0.2", "data-view-byte-offset": "^1.0.1", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "es-set-tostringtag": "^2.1.0", "es-to-primitive": "^1.3.0", "function.prototype.name": "^1.1.8", "get-intrinsic": "^1.2.7", "get-proto": "^1.0.0", "get-symbol-description": "^1.1.0", "globalthis": "^1.0.4", "gopd": "^1.2.0", "has-property-descriptors": "^1.0.2", "has-proto": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "internal-slot": "^1.1.0", "is-array-buffer": "^3.0.5", "is-callable": "^1.2.7", "is-data-view": "^1.0.2", "is-regex": "^1.2.1", "is-shared-array-buffer": "^1.0.4", "is-string": "^1.1.1", "is-typed-array": "^1.1.15", "is-weakref": "^1.1.0", "math-intrinsics": "^1.1.0", "object-inspect": "^1.13.3", "object-keys": "^1.1.1", "object.assign": "^4.1.7", "own-keys": "^1.0.1", "regexp.prototype.flags": "^1.5.3", "safe-array-concat": "^1.1.3", "safe-push-apply": "^1.0.0", "safe-regex-test": "^1.1.0", "set-proto": "^1.0.0", "string.prototype.trim": "^1.2.10", "string.prototype.trimend": "^1.0.9", "string.prototype.trimstart": "^1.0.8", "typed-array-buffer": "^1.0.3", "typed-array-byte-length": "^1.0.3", "typed-array-byte-offset": "^1.0.4", "typed-array-length": "^1.0.7", "unbox-primitive": "^1.1.0", "which-typed-array": "^1.1.18" } }, "sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA=="],
10061007

1008+
"bun-types/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-scnD59RpYD91xngrQQLGkE+6UrHUPzeKZWhhjBSa3HSkwjbQc38+q3RoIVEwxQGRw3M+j5hpNAM+lgV3cVormg=="],
1009+
10071010
"define-data-property/es-define-property": ["[email protected]", "", { "dependencies": { "get-intrinsic": "^1.2.4" } }, "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ=="],
10081011

10091012
"define-data-property/gopd": ["[email protected]", "", { "dependencies": { "get-intrinsic": "^1.1.3" } }, "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA=="],
@@ -1324,6 +1327,8 @@
13241327

13251328
"arraybuffer.prototype.slice/es-abstract/object.assign": ["[email protected]", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0", "has-symbols": "^1.1.0", "object-keys": "^1.1.1" } }, "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw=="],
13261329

1330+
"bun-types/@types/node/undici-types": ["[email protected]", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
1331+
13271332
"define-data-property/es-define-property/get-intrinsic": ["[email protected]", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", "hasown": "^2.0.0" } }, "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ=="],
13281333

13291334
"define-data-property/gopd/get-intrinsic": ["[email protected]", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", "hasown": "^2.0.0" } }, "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ=="],

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@eslint/config-inspector": "^1.1.0",
1616
"@types/bun": "^1.2.18",
1717
"@types/eslint": "^9.6.1",
18+
"@types/node": "^24.0.14",
1819
"turbo": "^2.5.5",
1920
"typescript": "^5.8.3"
2021
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { log } from 'node:console'
2+
import { readdir } from 'node:fs/promises'
3+
import { basename, join } from 'node:path'
4+
5+
const files = await readdir('./dist/configs', {
6+
withFileTypes: true,
7+
})
8+
9+
const jsFiles = files.filter(file => file.name.endsWith('.js'))
10+
11+
const exports = jsFiles.map<[string, { default: string, types: string }]>(file => ([
12+
`./${basename(file.name, '.js')}`,
13+
{
14+
default: './' + join(file.parentPath, file.name),
15+
types: './' + join(file.parentPath, basename(file.name, '.js') + '.d.ts'),
16+
},
17+
]))
18+
19+
const entries = Object.fromEntries(exports.sort(([a], [b]) => a.localeCompare(b)))
20+
21+
log(JSON.stringify(entries, null, 4))

packages/eslint-config/package.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,28 @@
1212
"url": "https://github.com/actcoding/eslint-config/issues"
1313
},
1414
"type": "module",
15-
"exports": "./dist/index.js",
16-
"types": "./dist/index.d.ts",
15+
"exports": {
16+
".": {
17+
"default": "./dist/index.js",
18+
"types": "./dist/index.d.ts"
19+
},
20+
"./default": {
21+
"default": "./dist/configs/default.js",
22+
"types": "./dist/configs/default.d.ts"
23+
},
24+
"./next": {
25+
"default": "./dist/configs/next.js",
26+
"types": "./dist/configs/next.d.ts"
27+
},
28+
"./react": {
29+
"default": "./dist/configs/react.js",
30+
"types": "./dist/configs/react.d.ts"
31+
},
32+
"./tailwind": {
33+
"default": "./dist/configs/tailwind.js",
34+
"types": "./dist/configs/tailwind.d.ts"
35+
}
36+
},
1737
"scripts": {
1838
"clean": "rm -rf dist",
1939
"build": "tsc",

0 commit comments

Comments
 (0)