Comparing version
@@ -1,1 +0,2 @@ | ||
export * from './dist/types/src/core'; | ||
// Needed for projects with `moduleResolution: 'node'` | ||
export * from './dist/types/core.d.ts'; |
{ | ||
"name": "use-intl", | ||
"version": "0.0.0-canary-e0b74da3ea9d55d9656fc32c52c6b740383f47de", | ||
"version": "0.0.0-canary-fdaddc5", | ||
"sideEffects": false, | ||
@@ -8,3 +8,3 @@ "author": "Jan Amann <jan@amann.work>", | ||
"license": "MIT", | ||
"homepage": "https://next-intl-docs.vercel.app/", | ||
"homepage": "https://next-intl.dev", | ||
"repository": { | ||
@@ -18,30 +18,26 @@ "type": "git", | ||
"lint": "pnpm run lint:source && pnpm run lint:package", | ||
"lint:source": "eslint src test && tsc --noEmit", | ||
"lint:package": "publint && attw --pack", | ||
"lint:source": "eslint src test && tsc --noEmit && pnpm run lint:prettier", | ||
"lint:package": "publint && attw --pack --ignore-rules=cjs-resolves-to-esm", | ||
"lint:prettier": "prettier src --check", | ||
"prepublishOnly": "turbo build", | ||
"size": "size-limit" | ||
}, | ||
"main": "./dist/index.js", | ||
"module": "dist/esm/index.js", | ||
"typings": "./dist/types/src/index.d.ts", | ||
"type": "module", | ||
"main": "./dist/esm/production/index.js", | ||
"typings": "./dist/types/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/types/src/index.d.ts", | ||
"default": "./dist/index.js" | ||
"types": "./dist/types/index.d.ts", | ||
"development": "./dist/esm/development/index.js", | ||
"default": "./dist/esm/production/index.js" | ||
}, | ||
"./core": { | ||
"types": "./core.d.ts", | ||
"default": "./dist/core.js" | ||
"types": "./dist/types/core.d.ts", | ||
"development": "./dist/esm/development/core.js", | ||
"default": "./dist/esm/production/core.js" | ||
}, | ||
"./react": { | ||
"types": "./react.d.ts", | ||
"default": "./dist/react.js" | ||
}, | ||
"./_useLocale": { | ||
"types": "./_useLocale.d.ts", | ||
"default": "./dist/_useLocale.js" | ||
}, | ||
"./_IntlProvider": { | ||
"types": "./_IntlProvider.d.ts", | ||
"default": "./dist/_IntlProvider.js" | ||
"types": "./dist/types/react.d.ts", | ||
"development": "./dist/esm/development/react.js", | ||
"default": "./dist/esm/production/react.js" | ||
} | ||
@@ -52,5 +48,3 @@ }, | ||
"core.d.ts", | ||
"react.d.ts", | ||
"_useLocale.d.ts", | ||
"_IntlProvider.d.ts" | ||
"react.d.ts" | ||
], | ||
@@ -70,8 +64,9 @@ "keywords": [ | ||
"@formatjs/fast-memoize": "^2.2.0", | ||
"@schummar/icu-type-parser": "1.21.5", | ||
"intl-messageformat": "^10.5.14" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0" | ||
"react": "^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0" | ||
}, | ||
"gitHead": "d39954681a8aa4ee1d111d80d981bb4e33d1baa7" | ||
"gitHead": "6d96f5949f7981a407bf978c6675cee7e6a33f79" | ||
} |
@@ -1,1 +0,2 @@ | ||
export * from './dist/types/src/react'; | ||
// Needed for projects with `moduleResolution: 'node'` | ||
export * from './dist/types/react.d.ts'; |
@@ -20,6 +20,6 @@ # 🌐 use-intl | ||
import {useTranslations} from 'use-intl'; | ||
export default function UserProfile({user}) { | ||
const t = useTranslations('UserProfile'); | ||
return ( | ||
@@ -39,3 +39,3 @@ <section> | ||
"UserProfile": { | ||
"title": "{username}'s profile", | ||
"title": "{firstName}'s profile", | ||
"membership": "Member since {memberSince, date, short}", | ||
@@ -61,7 +61,7 @@ "followers": "{count, plural, ↵ | ||
// You can get the messages from anywhere you like. You can also | ||
// fetch them from within a component and then render the provider | ||
// fetch them from within a component and then render the provider | ||
// along with your app once you have the messages. | ||
const messages = { | ||
"App": { | ||
"hello": 'Hello {username}!' | ||
App: { | ||
hello: 'Hello {firstName}!' | ||
} | ||
@@ -73,3 +73,3 @@ }; | ||
<IntlProvider messages={messages} locale="en"> | ||
<App user={{name: 'Jane'}} /> | ||
<App user={{firstName: 'Jane'}} /> | ||
</IntlProvider> | ||
@@ -81,3 +81,3 @@ ); | ||
const t = useTranslations('App'); | ||
return <h1>{t('hello', {username: user.name})}</h1>; | ||
return <h1>{t('hello', {firstName: user.firstName})}</h1>; | ||
} | ||
@@ -88,2 +88,2 @@ ``` | ||
### [→ Read the docs](https://next-intl-docs.vercel.app/docs/environments/core-library) | ||
### [→ Read the docs](https://next-intl.dev/docs/environments/core-library) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 3 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1
-85.71%1
-83.33%Yes
NaN83233
-23.78%4
33.33%55
-39.56%1489
-14.87%1
Infinity%+ Added
+ Added
- Removed
- Removed
- Removed