Skip to content

Commit ae4629c

Browse files
BobbieGoedekazupon
andauthored
chore: use pnpm and node 18 (#198)
* refactor: use pnpm * ci: enable corepack * Apply suggestions from code review --------- Co-authored-by: kazuya kawaguchi <[email protected]>
1 parent dded092 commit ae4629c

File tree

12 files changed

+12317
-9720
lines changed

12 files changed

+12317
-9720
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ jobs:
1212
runs-on: Ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
15+
- name: Enable corepack
16+
run: corepack enable
1517
- uses: actions/setup-node@v1
1618
with:
1719
registry-url: "https://registry.npmjs.org"
1820
- run: git switch next
1921
- run: |
20-
if [ -f "yarn.lock" ]; then
21-
yarn install
22+
if [ -f "pnpm-lock.yaml" ]; then
23+
pnpm install
2224
else
2325
npm install
2426
fi

.github/workflows/test.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,20 @@ jobs:
2424
strategy:
2525
matrix:
2626
os: [ubuntu-latest]
27-
node: [14, 16]
27+
node: [18, 20, 22]
2828
steps:
2929
- name: Checkout
30-
uses: actions/checkout@v3
30+
uses: actions/checkout@v4
31+
- name: Enable corepack
32+
run: corepack enable
3133
- name: Setup Node.js ${{ matrix.node }}
32-
uses: actions/setup-node@v3
34+
uses: actions/setup-node@v4
3335
with:
3436
node-version: ${{ matrix.node }}
35-
cache: 'yarn'
37+
cache: 'pnpm'
3638
- name: Install
37-
run: yarn install
39+
run: pnpm install
3840
- name: Build
39-
run: yarn build
41+
run: pnpm build
4042
- name: Test
41-
run: yarn test
43+
run: pnpm test

docs/@intlify/vue-i18n-extensions-api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Transform `v-t` custom directive
1515

1616
**Signature:**
1717
```typescript
18-
export declare function transformVTDirective<Messages = {}, DateTimeFormats = {}, NumberFormats = {}, Legacy extends boolean = true>(options?: TransformVTDirectiveOptions<Messages, DateTimeFormats, NumberFormats, Legacy>): DirectiveTransform;
18+
export declare function transformVTDirective<Messages extends Record<string, unknown> = {}, DateTimeFormats extends Record<string, unknown> = {}, NumberFormats extends Record<string, unknown> = {}, Legacy extends boolean = true>(options?: TransformVTDirectiveOptions<Messages, DateTimeFormats, NumberFormats, Legacy>): DirectiveTransform;
1919
```
2020

2121
#### Parameters
@@ -81,7 +81,7 @@ Transform options for `v-t` custom directive
8181

8282
**Signature:**
8383
```typescript
84-
export interface TransformVTDirectiveOptions<Messages = {}, DateTimeFormats = {}, NumberFormats = {}, Legacy extends boolean = true>
84+
export interface TransformVTDirectiveOptions<Messages extends Record<string, unknown> = {}, DateTimeFormats extends Record<string, unknown> = {}, NumberFormats extends Record<string, unknown> = {}, Legacy extends boolean = true>
8585
```
8686

8787

@@ -98,7 +98,7 @@ i18n?: I18n<Messages, DateTimeFormats, NumberFormats, Legacy>;
9898

9999
#### Remarks
100100

101-
If this option is specified, `v-t` custom diretive transform uses an I18n instance to pre-translate. The translation will use the global resources registered in the I18n instance, that is, `v-t` diretive transform is also a limitation that the resources of each component cannot be used.
101+
If this option is specified, `v-t` custom directive transform uses an I18n instance to pre-translate. The translation will use the global resources registered in the I18n instance, that is, `v-t` directive transform is also a limitation that the resources of each component cannot be used.
102102

103103
##### mode
104104

example/App.vue

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,8 @@
33
<p v-t="{ path: hello, locale: 'en' }"></p>
44
</template>
55

6-
<script>
6+
<script setup>
77
import { ref } from 'vue'
8-
import { useI18n } from 'vue-i18n'
98
10-
export default {
11-
name: 'App',
12-
setup() {
13-
const hello = ref('hello')
14-
return { hello, ...useI18n() }
15-
}
16-
}
9+
const hello = ref('hello')
1710
</script>

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@types/node": "^18.11.17",
3838
"@typescript-eslint/eslint-plugin": "^5.46.1",
3939
"@typescript-eslint/parser": "^5.46.1",
40+
"@vue/compiler-core": "^3.2.45",
4041
"@vue/compiler-sfc": "^3.2.45",
4142
"@vue/compiler-ssr": "^3.2.45",
4243
"@vue/runtime-dom": "^3.2.45",
@@ -106,7 +107,7 @@
106107
"url": "git+https://github.com/intlify/vue-i18n-extensions.git"
107108
},
108109
"scripts": {
109-
"build": "yarn build:transpile && yarn build:extract && yarn build:docs",
110+
"build": "pnpm build:transpile && pnpm build:extract && pnpm build:docs",
110111
"build:docs": "api-docs-gen ./temp/vue-i18n-extensions.api.json -c ./docsgen.config.js -o ./docs",
111112
"build:extract": "api-extractor run -l -c ./api-extractor.json --typescript-compiler-folder node_modules/typescript",
112113
"build:transpile": "tsc -p .",
@@ -119,18 +120,18 @@
119120
"example": "webpack serve --config example/webpack.config.js --inline --hot",
120121
"fix": "npm-run-all --parallel lint:eslint:fix format:fix",
121122
"format": "prettier --config .prettierrc --ignore-path .prettierignore --list-different '**/*.{js,json,html}'",
122-
"format:fix": "yarn format --write",
123+
"format:fix": "pnpm format --write",
123124
"lint": "npm-run-all --parallel lint:eslint lint:secret",
124125
"lint:eslint": "eslint ./src ./test --ext .ts --cache",
125-
"lint:eslint:fix": "yarn lint:eslint --fix",
126+
"lint:eslint:fix": "pnpm lint:eslint --fix",
126127
"lint:secret": "npx secretlint \"**/*\"",
127128
"release:prepare": "shipjs prepare",
128129
"release:trigger": "shipjs trigger",
129-
"test": "yarn lint && yarn test:cover && yarn test:e2e",
130-
"test:cover": "yarn clean:cache:jest && yarn test:unit --coverage",
130+
"test": "pnpm lint && pnpm test:cover && pnpm test:e2e",
131+
"test:cover": "pnpm clean:cache:jest && pnpm test:unit --coverage",
131132
"test:e2e": "jest --runInBand --config ./jest.e2e.config.js",
132-
"test:unit": "yarn clean:cache:jest && jest --env node",
133-
"test:watch": "yarn clean:cache:jest && jest --env node --watch",
133+
"test:unit": "pnpm clean:cache:jest && jest --env node",
134+
"test:watch": "pnpm clean:cache:jest && jest --env node --watch",
134135
"watch": "tsc -p . --watch"
135136
},
136137
"types": "dist/vue-i18n-extensions.d.ts"

0 commit comments

Comments
 (0)