Skip to content

Commit

Permalink
style: Replace prettier to biome (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
bicstone authored Mar 23, 2024
1 parent ed03cba commit b2d11e2
Show file tree
Hide file tree
Showing 16 changed files with 1,326 additions and 1,650 deletions.
110 changes: 47 additions & 63 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,65 +1,49 @@
{
"projectName": "ra-language-japanese",
"projectOwner": "bicstone",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"commitConvention": "eslint",
"contributors": [
{
"login": "bicstone",
"name": "Oishi Takanori",
"avatar_url": "https://avatars.githubusercontent.com/u/47806818?v=4",
"profile": "https://bicstone.me/",
"contributions": [
"code",
"doc",
"maintenance",
"platform",
"review"
]
},
{
"login": "toknsi",
"name": "toknsi",
"avatar_url": "https://avatars.githubusercontent.com/u/26852981?v=4",
"profile": "https://github.com/toknsi",
"contributions": [
"doc"
]
},
{
"login": "yukinobu",
"name": "Yukinobu Nagayasu",
"avatar_url": "https://avatars.githubusercontent.com/u/5938690?v=4",
"profile": "https://www.yukinobu.jp/tdiary/",
"contributions": [
"doc"
]
},
{
"login": "ohbarye",
"name": "Masato Ohba",
"avatar_url": "https://avatars.githubusercontent.com/u/1811616?v=4",
"profile": "https://ohbarye.github.io/",
"contributions": [
"maintenance"
]
},
{
"login": "nerixim",
"name": "Nikita Kamaev",
"avatar_url": "https://avatars.githubusercontent.com/u/26106502?v=4",
"profile": "https://github.com/nerixim",
"contributions": [
"maintenance"
]
}
],
"contributorsPerLine": 7,
"skipCi": true
"commit": false,
"commitConvention": "eslint",
"contributors": [
{
"avatar_url": "https://avatars.githubusercontent.com/u/47806818?v=4",
"contributions": ["code", "doc", "maintenance", "platform", "review"],
"login": "bicstone",
"name": "Oishi Takanori",
"profile": "https://bicstone.me/"
},
{
"avatar_url": "https://avatars.githubusercontent.com/u/26852981?v=4",
"contributions": ["doc"],
"login": "toknsi",
"name": "toknsi",
"profile": "https://github.com/toknsi"
},
{
"avatar_url": "https://avatars.githubusercontent.com/u/5938690?v=4",
"contributions": ["doc"],
"login": "yukinobu",
"name": "Yukinobu Nagayasu",
"profile": "https://www.yukinobu.jp/tdiary/"
},
{
"avatar_url": "https://avatars.githubusercontent.com/u/1811616?v=4",
"contributions": ["maintenance"],
"login": "ohbarye",
"name": "Masato Ohba",
"profile": "https://ohbarye.github.io/"
},
{
"avatar_url": "https://avatars.githubusercontent.com/u/26106502?v=4",
"contributions": ["maintenance"],
"login": "nerixim",
"name": "Nikita Kamaev",
"profile": "https://github.com/nerixim"
}
],
"contributorsPerLine": 7,
"files": ["README.md"],
"imageSize": 100,
"projectName": "ra-language-japanese",
"projectOwner": "bicstone",
"repoHost": "https://github.com",
"repoType": "github",
"skipCi": true
}
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
cache: 'npm'
- run: npm ci
- run: npm audit signatures
- run: npm run build
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm run check
- run: pnpm run build
11 changes: 7 additions & 4 deletions .github/workflows/publish-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- run: npm ci
- run: npm audit signatures
- run: npm publish --provenance --tag=latest
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm publish --tag=latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
11 changes: 7 additions & 4 deletions .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- run: npm ci
- run: npm audit signatures
- run: npm publish --provenance --tag=next
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm publish --tag=next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["biomejs.biome", "esbenp.prettier-vscode"]
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
13 changes: 2 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,13 @@ This repository has adopted the [Contributor Covenant 2.1](https://www.contribut
Pull Requests are always welcome, but please discuss larger changes via issue before your work.

1. Fork the repository.
1. Install the dependencies with npm. `npm ci`
1. Install the dependencies with pnpm. `pnpm ci`
1. Create a new topic branch. `git checkout -b fix/topic`
1. Make changes `/src/index.tx` .
1. **Run format & build.** `npm run build`
1. **Run format & build.** `pnpm run build`
1. Commit and push. `git push -u origin HEAD`
1. Make a Pull Request.

## License

By contributing your code to this repository, you agree to your contribution under the MIT license.

# 翻訳の更新 (owner's memo)

1. dependabotが自動的に依存関係( `ra-language-english` )を最新にする
1. `tsc` で型定義エラーがあれば、React-admin側で更新されている
1. 型定義エラーを参考に、 `/src/index.tx` 翻訳を更新する
1. `npm run build`
1. `npm version <new version>`
1. リリース (パブリッシュは自動)
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ pnpm add @bicstone/ra-language-japanese@3
### version 3 or 4

```jsx
import polyglotI18nProvider from 'ra-i18n-polyglot';
import japaneseMessages from '@bicstone/ra-language-japanese';
import polyglotI18nProvider from "ra-i18n-polyglot";
import japaneseMessages from "@bicstone/ra-language-japanese";

const i18nProvider = polyglotI18nProvider(() => japaneseMessages, 'ja');
const i18nProvider = polyglotI18nProvider(() => japaneseMessages, "ja");

<Admin i18nProvider={i18nProvider}>
...
Expand All @@ -49,7 +49,7 @@ See React-admin [documentation](https://marmelab.com/react-admin/Translation.htm
### version 2

```jsx
import japaneseMessages from '@bicstone/ra-language-japanese';
import japaneseMessages from "@bicstone/ra-language-japanese";

const i18nProvider = () => japaneseMessages;

Expand Down
20 changes: 20 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.1/schema.json",
"files": {
"ignore": ["lib/**/*"]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"organizeImports": {
"enabled": true
},
"vcs": {
"clientKind": "git",
"enabled": true,
"useIgnoreFile": true
}
}
2 changes: 1 addition & 1 deletion lib/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b2d11e2

Please # to comment.