Skip to content

Commit e73fb38

Browse files
authored
fix: Fix ESM output of use-intl (#754)
1 parent f8cdcf2 commit e73fb38

6 files changed

Lines changed: 263 additions & 20 deletions

File tree

packages/next-intl/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
"scripts": {
2020
"build": "rm -rf dist && rollup -c",
2121
"test": "TZ=Europe/Berlin vitest",
22-
"lint": "eslint src test && tsc --noEmit",
22+
"lint": "pnpm run lint:source && pnpm run lint:package",
23+
"lint:source": "eslint src test && tsc --noEmit",
24+
"lint:package": "publint && attw --pack",
2325
"prepublishOnly": "CI=true turbo test && turbo lint && turbo build && cp ../../README.md .",
2426
"postpublish": "git checkout . && rm ./README.md",
2527
"size": "size-limit"
@@ -87,6 +89,7 @@
8789
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
8890
},
8991
"devDependencies": {
92+
"@arethetypeswrong/cli": "^0.13.5",
9093
"@edge-runtime/vm": "^3.1.3",
9194
"@size-limit/preset-big-lib": "^8.2.6",
9295
"@testing-library/react": "^13.0.0",
@@ -99,6 +102,7 @@
99102
"eslint-plugin-deprecation": "^1.4.1",
100103
"next": "^14.0.4",
101104
"path-to-regexp": "^6.2.1",
105+
"publint": "^0.2.7",
102106
"react": "^18.2.0",
103107
"react-dom": "^18.2.0",
104108
"rollup": "^3.28.1",

packages/use-intl/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
"scripts": {
1414
"build": "rm -rf dist && rollup -c",
1515
"test": "TZ=Europe/Berlin vitest",
16-
"lint": "eslint src test && tsc --noEmit",
16+
"lint": "pnpm run lint:source && pnpm run lint:package",
17+
"lint:source": "eslint src test && tsc --noEmit",
18+
"lint:package": "publint && attw --pack",
1719
"prepublishOnly": "CI=true turbo test && turbo lint && turbo build",
1820
"size": "size-limit"
1921
},
@@ -68,6 +70,7 @@
6870
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
6971
},
7072
"devDependencies": {
73+
"@arethetypeswrong/cli": "^0.13.5",
7174
"@size-limit/preset-big-lib": "^8.2.6",
7275
"@testing-library/react": "^13.0.0",
7376
"@types/node": "^20.1.2",
@@ -76,6 +79,7 @@
7679
"date-fns": "^2.16.1",
7780
"eslint": "^8.54.0",
7881
"eslint-config-molindo": "^7.0.0",
82+
"publint": "^0.2.7",
7983
"react": "^18.2.0",
8084
"react-dom": "^18.2.0",
8185
"rollup": "^3.28.1",

packages/use-intl/rollup.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ const input = {
1111

1212
module.exports = [
1313
getBuildConfig({input, env: 'development'}),
14-
getBuildConfig({input, env: 'esm'}),
14+
getBuildConfig({
15+
input,
16+
env: 'esm',
17+
output: {format: 'es'}
18+
}),
1519
getBuildConfig({input, env: 'production'})
1620
];

packages/use-intl/src/core/IntlConfig.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import type AbstractIntlMessages from './AbstractIntlMessages';
12
import Formats from './Formats';
23
import IntlError from './IntlError';
34
import TimeZone from './TimeZone';
4-
import {AbstractIntlMessages, RichTranslationValues} from '.';
5+
import type {RichTranslationValues} from './TranslationValues';
56

67
/**
78
* Should be used for entry points that configure the library.

0 commit comments

Comments
 (0)