Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/forty-donkeys-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-enhanced/translate": patch
---

fix: change `getBrowserLang` to function
13 changes: 13 additions & 0 deletions .changeset/kind-comics-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"react-qrcode": patch
"react-qrious": patch
"@react-enhanced/eslint-plugin": patch
"@react-enhanced/hooks": patch
"@react-enhanced/plugins": patch
"@react-enhanced/shared": patch
"@react-enhanced/translate": patch
"@react-enhanced/types": patch
"@react-enhanced/utils": patch
---

fix: add `src` folder into registry for sourcemap
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets)
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/changesets/changesets)

> Make [React][] greater with [RxTS][]

Expand Down Expand Up @@ -87,7 +87,7 @@ Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.m
[MIT][] © [JounQin][]@[1stG.me][]

[1stg.me]: https://www.1stg.me
[changesets]: https://github.com/atlassian/changesets
[changesets]: https://github.com/changesets/changesets
[jounqin]: https://github.com/JounQin
[mit]: http://opensource.org/licenses/MIT
[qrcode]: https://github.com/soldair/node-qrcode
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
"packages/*",
"packages/@react-enhanced/*"
],
"packageManager": "pnpm@7.11.0",
"packageManager": "pnpm@7.13.4",
"scripts": {
"build": "run-p build:*",
"build:r": "r -f cjs --esbuild {jsxFactory:'React.createElement'}",
"build:tsc": "tsc -b",
"clean": "rimraf dist packages/**/*/{lib,*.tsbuildinfo}",
"codesandbox:install": "npx pnpm@7.11.0 i",
"codesandbox:install": "yarn",
"dev": "w -e docs --disableDotRule --publicPath /",
"lint": "run-p lint:*",
"lint:es": "eslint . --cache -f friendly",
"lint:style": "stylelint . --cache",
"lint:ts": "tsc --noEmit",
"postversion": "pnpm i --no-frozen-lockfile",
"prepare": "simple-git-hooks",
"prepare": "simple-git-hooks || exit 0",
"prerelease": "pnpm build",
"prevercel-build": "pnpm build",
"release": "changeset publish",
Expand All @@ -41,13 +41,13 @@
"@mdx-js/react": "^2.1.3",
"@pkgr/webpack": "^3.4.0",
"@pkgr/webpack-mdx": "^2.2.0",
"@react-enhanced/eslint-plugin": "workspace:*",
"@react-enhanced/hooks": "workspace:*",
"@react-enhanced/plugins": "workspace:*",
"@react-enhanced/shared": "workspace:*",
"@react-enhanced/translate": "workspace:*",
"@react-enhanced/types": "workspace:*",
"@react-enhanced/utils": "workspace:*",
"@react-enhanced/eslint-plugin": "link:packages/@react-enhanced/eslint-plugin",
"@react-enhanced/hooks": "link:packages/@react-enhanced/hooks",
"@react-enhanced/plugins": "link:packages/@react-enhanced/plugins",
"@react-enhanced/shared": "link:packages/@react-enhanced/shared",
"@react-enhanced/translate": "link:packages/@react-enhanced/translate",
"@react-enhanced/types": "link:packages/@react-enhanced/types",
"@react-enhanced/utils": "link:packages/@react-enhanced/utils",
"@testing-library/react": "^13.4.0",
"@types/lodash": "^4.14.184",
"@types/node": "^18.7.16",
Expand All @@ -69,8 +69,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hot-loader": "^4.13.0",
"react-qrcode": "workspace:*",
"react-qrious": "workspace:*",
"react-qrcode": "link:packages/react-qrcode",
"react-qrious": "link:packages/react-qrious",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0",
"rimraf": "^3.0.2",
Expand Down
34 changes: 2 additions & 32 deletions packages/@react-enhanced/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,6 @@
"repository": "git@github.com:rx-ts/react.git",
"homepage": "https://github.com/rx-ts/react/blob/master/packages/@react-enhanced/eslint-plugin",
"author": "JounQin (https://www.1stG.me) <admin@1stg.me>",
"donate": {
"recipients": [
{
"name": "unts",
"platform": "opencollective",
"address": "https://opencollective.com/unts",
"weight": 60
},
{
"name": "rxts",
"platform": "opencollective",
"address": "https://opencollective.com/rxts",
"weight": 20
},
{
"name": "1stG",
"email": "i@1stg.me",
"weight": 20,
"platforms": [
{
"platform": "opencollective",
"address": "https://opencollective.com/1stG"
},
{
"platform": "patreon",
"address": "https://www.patreon.com/1stG"
}
]
}
]
},
"funding": "https://opencollective.com/rxts",
"license": "MIT",
"engines": {
Expand All @@ -51,7 +20,8 @@
},
"types": "./lib/index.d.ts",
"files": [
"lib"
"lib",
"src"
],
"keywords": [
"react-enhanced",
Expand Down
34 changes: 2 additions & 32 deletions packages/@react-enhanced/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,6 @@
"repository": "git@github.com:rx-ts/react.git",
"homepage": "https://github.com/rx-ts/react/blob/master/packages/@react-enhanced/hooks",
"author": "JounQin (https://www.1stG.me) <admin@1stg.me>",
"donate": {
"recipients": [
{
"name": "unts",
"platform": "opencollective",
"address": "https://opencollective.com/unts",
"weight": 60
},
{
"name": "rxts",
"platform": "opencollective",
"address": "https://opencollective.com/rxts",
"weight": 20
},
{
"name": "1stG",
"email": "i@1stg.me",
"weight": 20,
"platforms": [
{
"platform": "opencollective",
"address": "https://opencollective.com/1stG"
},
{
"platform": "patreon",
"address": "https://www.patreon.com/1stG"
}
]
}
]
},
"funding": "https://opencollective.com/rxts",
"license": "MIT",
"engines": {
Expand All @@ -51,7 +20,8 @@
},
"types": "./lib/index.d.ts",
"files": [
"lib"
"lib",
"src"
],
"keywords": [
"react-enhanced",
Expand Down
34 changes: 2 additions & 32 deletions packages/@react-enhanced/plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,15 @@
"repository": "git@github.com:rx-ts/react.git",
"homepage": "https://github.com/rx-ts/react/blob/master/packages/@react-enhanced/plugins",
"author": "JounQin (https://www.1stG.me) <admin@1stg.me>",
"donate": {
"recipients": [
{
"name": "unts",
"platform": "opencollective",
"address": "https://opencollective.com/unts",
"weight": 60
},
{
"name": "rxts",
"platform": "opencollective",
"address": "https://opencollective.com/rxts",
"weight": 20
},
{
"name": "1stG",
"email": "i@1stg.me",
"weight": 20,
"platforms": [
{
"platform": "opencollective",
"address": "https://opencollective.com/1stG"
},
{
"platform": "patreon",
"address": "https://www.patreon.com/1stG"
}
]
}
]
},
"funding": "https://opencollective.com/rxts",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.18.0 || >=16.0.0"
},
"main": "./src/index.ts",
"files": [
"lib"
"lib",
"src"
],
"keywords": [
"react-enhanced",
Expand Down
34 changes: 2 additions & 32 deletions packages/@react-enhanced/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,6 @@
"repository": "git@github.com:rx-ts/react.git",
"homepage": "https://github.com/rx-ts/react/blob/master/packages/@react-enhanced/shared",
"author": "JounQin (https://www.1stG.me) <admin@1stg.me>",
"donate": {
"recipients": [
{
"name": "unts",
"platform": "opencollective",
"address": "https://opencollective.com/unts",
"weight": 60
},
{
"name": "rxts",
"platform": "opencollective",
"address": "https://opencollective.com/rxts",
"weight": 20
},
{
"name": "1stG",
"email": "i@1stg.me",
"weight": 20,
"platforms": [
{
"platform": "opencollective",
"address": "https://opencollective.com/1stG"
},
{
"platform": "patreon",
"address": "https://www.patreon.com/1stG"
}
]
}
]
},
"funding": "https://opencollective.com/rxts",
"license": "MIT",
"engines": {
Expand All @@ -51,7 +20,8 @@
},
"types": "./lib/index.d.ts",
"files": [
"lib"
"lib",
"src"
],
"keywords": [
"react-enhanced",
Expand Down
34 changes: 2 additions & 32 deletions packages/@react-enhanced/translate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,15 @@
"repository": "git@github.com:rx-ts/react.git",
"homepage": "https://github.com/rx-ts/react/blob/master/packages/@react-enhanced/translate",
"author": "JounQin (https://www.1stG.me) <admin@1stg.me>",
"donate": {
"recipients": [
{
"name": "unts",
"platform": "opencollective",
"address": "https://opencollective.com/unts",
"weight": 60
},
{
"name": "rxts",
"platform": "opencollective",
"address": "https://opencollective.com/rxts",
"weight": 20
},
{
"name": "1stG",
"email": "i@1stg.me",
"weight": 20,
"platforms": [
{
"platform": "opencollective",
"address": "https://opencollective.com/1stG"
},
{
"platform": "patreon",
"address": "https://www.patreon.com/1stG"
}
]
}
]
},
"funding": "https://opencollective.com/rxts",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.18.0 || >=16.0.0"
},
"main": "./src/index.ts",
"files": [
"lib"
"lib",
"src"
],
"keywords": [
"react-enhanced",
Expand Down
13 changes: 8 additions & 5 deletions packages/@react-enhanced/translate/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ declare global {
}
}

export const getBrowserLang = () =>
navigator.languages[0] ||
navigator.language ||
navigator.browserLanguage ||
navigator.userLanguage
export function getBrowserLang() {
return (
navigator.languages[0] ||
navigator.language ||
navigator.browserLanguage ||
navigator.userLanguage
)
}

export function getLang<T extends string = string>(LOCALES: T[]): T
export function getLang(LOCALES?: []): undefined
Expand Down
Loading