Skip to content

Commit

Permalink
fix: Fix ESM output of use-intl (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
amannn authored Jan 3, 2024
1 parent f8cdcf2 commit e73fb38
Show file tree
Hide file tree
Showing 6 changed files with 263 additions and 20 deletions.
6 changes: 5 additions & 1 deletion packages/next-intl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"scripts": {
"build": "rm -rf dist && rollup -c",
"test": "TZ=Europe/Berlin vitest",
"lint": "eslint src test && tsc --noEmit",
"lint": "pnpm run lint:source && pnpm run lint:package",
"lint:source": "eslint src test && tsc --noEmit",
"lint:package": "publint && attw --pack",
"prepublishOnly": "CI=true turbo test && turbo lint && turbo build && cp ../../README.md .",
"postpublish": "git checkout . && rm ./README.md",
"size": "size-limit"
Expand Down Expand Up @@ -87,6 +89,7 @@
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.13.5",
"@edge-runtime/vm": "^3.1.3",
"@size-limit/preset-big-lib": "^8.2.6",
"@testing-library/react": "^13.0.0",
Expand All @@ -99,6 +102,7 @@
"eslint-plugin-deprecation": "^1.4.1",
"next": "^14.0.4",
"path-to-regexp": "^6.2.1",
"publint": "^0.2.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^3.28.1",
Expand Down
6 changes: 5 additions & 1 deletion packages/use-intl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"scripts": {
"build": "rm -rf dist && rollup -c",
"test": "TZ=Europe/Berlin vitest",
"lint": "eslint src test && tsc --noEmit",
"lint": "pnpm run lint:source && pnpm run lint:package",
"lint:source": "eslint src test && tsc --noEmit",
"lint:package": "publint && attw --pack",
"prepublishOnly": "CI=true turbo test && turbo lint && turbo build",
"size": "size-limit"
},
Expand Down Expand Up @@ -68,6 +70,7 @@
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.13.5",
"@size-limit/preset-big-lib": "^8.2.6",
"@testing-library/react": "^13.0.0",
"@types/node": "^20.1.2",
Expand All @@ -76,6 +79,7 @@
"date-fns": "^2.16.1",
"eslint": "^8.54.0",
"eslint-config-molindo": "^7.0.0",
"publint": "^0.2.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^3.28.1",
Expand Down
6 changes: 5 additions & 1 deletion packages/use-intl/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const input = {

module.exports = [
getBuildConfig({input, env: 'development'}),
getBuildConfig({input, env: 'esm'}),
getBuildConfig({
input,
env: 'esm',
output: {format: 'es'}
}),
getBuildConfig({input, env: 'production'})
];
3 changes: 2 additions & 1 deletion packages/use-intl/src/core/IntlConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type AbstractIntlMessages from './AbstractIntlMessages';
import Formats from './Formats';
import IntlError from './IntlError';
import TimeZone from './TimeZone';
import {AbstractIntlMessages, RichTranslationValues} from '.';
import type {RichTranslationValues} from './TranslationValues';

/**
* Should be used for entry points that configure the library.
Expand Down
Loading

2 comments on commit e73fb38

@vercel
Copy link

@vercel vercel bot commented on e73fb38 Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on e73fb38 Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

next-intl-docs – ./docs

next-intl-docs.vercel.app
next-intl-docs-next-intl.vercel.app
next-intl-docs-git-main-next-intl.vercel.app

Please sign in to comment.