Skip to content

Commit 4501919

Browse files
committed
Merge branch 'master' into feature/opt-out-overwrite
2 parents fd67919 + 41e2870 commit 4501919

File tree

17 files changed

+2822
-2874
lines changed

17 files changed

+2822
-2874
lines changed

.babelrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"presets": [
33
[
4-
"@babel/preset-env", {
4+
"@babel/preset-env",
5+
{
56
"targets": {
67
"node": "current"
78
}
89
}
910
],
1011
"@babel/preset-flow",
11-
"@babel/preset-react",
12+
"@babel/preset-react"
1213
]
1314
}

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ English/日本語(日本語で入力して大丈夫です。日本語の方が
2121
* [ ] Documentation
2222
* [ ] Tests
2323
* [ ] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->
24-
* [ ] Added myself to contributors table <!-- this is optional, see the contributing guidelines for instructions -->
2524

2625
<!-- feel free to add additional comments. -->

.github/workflows/test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: test
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
node-version: [10.x, 12.x]
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Setup node
14+
uses: actions/setup-node@v1
15+
with:
16+
node-version: ${{ matrix.node }}
17+
- run: yarn install
18+
- run: yarn lint
19+
- run: yarn test

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
**/test/fixtures/**
22
.github
3+
dist
34
package.json

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

cli.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env node
2-
/* eslint-disable no-console, @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */
32
'use strict'
43
const meow = require('meow')
54
const fn = require('./dist').default
@@ -53,17 +52,15 @@ const cli = meow(
5352
default: true
5453
},
5554
// babel-plugin-react-intl boolean options
56-
enforceDescriptions: {
55+
extractSourceLocation: {
5756
type: 'boolean',
5857
default: false
5958
},
60-
enforceDefaultMessage: {
61-
type: 'boolean',
62-
default: true
59+
removeDefaultMessage: {
60+
type: 'boolean'
6361
},
64-
extractSourceLocation: {
65-
type: 'boolean',
66-
default: false
62+
extractFromFormatMessageCall: {
63+
type: 'boolean'
6764
}
6865
}
6966
}

example/i18n/en.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"a": {
3-
"hello": "hello",
4-
"world": "world"
5-
},
62
"App": {
73
"hello": "Hello Button",
84
"submit": "Submit Button"
5+
},
6+
"a": {
7+
"hello": "hello",
8+
"world": "world"
99
}
1010
}

example/i18n/ja.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"a": {
3-
"hello": "",
4-
"world": ""
5-
},
62
"App": {
73
"hello": "",
84
"submit": ""
5+
},
6+
"a": {
7+
"hello": "",
8+
"world": ""
99
}
1010
}

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
preset: 'ts-jest',
77
globals: {
88
'ts-jest': {
9-
diagnostics: false
9+
// diagnostics: false
1010
}
1111
}
1212
}

package.json

Lines changed: 39 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "extract-react-intl-messages",
3-
"version": "2.3.3",
3+
"version": "4.0.0",
44
"description": "Extract react-intl messages",
55
"license": "MIT",
66
"repository": "akameco/extract-react-intl-messages",
@@ -10,17 +10,16 @@
1010
"url": "https://akameco.github.io"
1111
},
1212
"engines": {
13-
"node": ">=8"
13+
"node": ">=10"
1414
},
1515
"main": "dist/index.js",
1616
"scripts": {
17-
"add-contributor": "all-contributors add",
18-
"fmt": "prettier --write '**/*.{json,js,md}'",
17+
"fmt": "prettier --write .",
1918
"example": "./cli.js -l=en,ja -o example/i18n -d en --extractFromFormatMessageCall=true 'example/**/*.{js,tsx}'",
2019
"prepublish": "npm run build",
2120
"build": "tsc",
2221
"lint": "eslint src/**/*.ts --fix --cache",
23-
"test": "npm run lint && jest"
22+
"test": "jest"
2423
},
2524
"bin": {
2625
"extract-react-intl-messages": "cli.js",
@@ -40,64 +39,60 @@
4039
"messages"
4140
],
4241
"dependencies": {
43-
"@babel/core": "^7.5.5",
44-
"babel-plugin-react-intl": "^4.1.16",
45-
"flat": "^4.1.0",
46-
"glob": "^7.1.4",
42+
"@babel/core": "^7.9.0",
43+
"babel-plugin-react-intl": "^7.0.0",
44+
"flat": "^5.0.0",
45+
"glob": "^7.1.6",
4746
"js-yaml": "^3.13.1",
4847
"load-json-file": "^6.2.0",
4948
"lodash.merge": "^4.6.2",
5049
"lodash.mergewith": "^4.6.2",
5150
"lodash.pick": "^4.4.0",
52-
"meow": "^5.0.0",
53-
"mkdirp": "^0.5.1",
54-
"pify": "^4.0.1",
55-
"read-babelrc-up": "^0.4.0",
51+
"meow": "^6.1.0",
52+
"mkdirp": "^1.0.3",
53+
"pify": "^5.0.0",
54+
"read-babelrc-up": "^1.1.0",
5655
"sort-keys": "^4.0.0",
57-
"write-json-file": "^4.1.1"
56+
"write-json-file": "^4.3.0"
5857
},
5958
"devDependencies": {
60-
"@akameco/tsconfig": "^0.3.0",
61-
"@babel/plugin-proposal-class-properties": "^7.5.5",
62-
"@babel/preset-env": "^7.5.5",
63-
"@babel/preset-flow": "^7.0.0",
64-
"@babel/preset-react": "^7.0.0",
65-
"@types/flat": "^0.0.28",
66-
"@types/jest": "^24.0.18",
67-
"@types/js-yaml": "^3.12.1",
59+
"@akameco/tsconfig": "^0.4.0",
60+
"@babel/plugin-proposal-class-properties": "^7.8.3",
61+
"@babel/preset-env": "^7.9.0",
62+
"@babel/preset-flow": "^7.9.0",
63+
"@babel/preset-react": "^7.9.1",
64+
"@types/flat": "^5.0.0",
65+
"@types/glob": "^7.1.1",
66+
"@types/jest": "^25.1.4",
67+
"@types/js-yaml": "^3.12.2",
6868
"@types/lodash.merge": "^4.6.6",
6969
"@types/lodash.mergewith": "^4.6.6",
7070
"@types/lodash.pick": "^4.4.6",
71-
"@types/mkdirp": "^0.5.2",
71+
"@types/mkdirp": "^1.0.0",
7272
"@types/pify": "^3.0.2",
7373
"@types/temp-write": "^4.0.0",
74-
"@types/tempy": "^0.3.0",
75-
"all-contributors-cli": "^6.8.2",
7674
"babel-core": "7.0.0-bridge.0",
77-
"babel-jest": "^24.8.0",
78-
"babel-plugin-react-intl-auto": "^2.2.0",
79-
"eslint": "^6.3.0",
80-
"eslint-config-precure": "^5.0.2",
81-
"husky": "^3.0.5",
82-
"jest": "^24.8.0",
83-
"lint-staged": "^9.2.5",
84-
"prettier": "^1.18.2",
85-
"react": "^16.8.6",
86-
"react-intl": "^3.2.0",
75+
"babel-plugin-react-intl-auto": "^3.2.0",
76+
"eslint": "^6.8.0",
77+
"eslint-config-precure": "^5.3.1",
78+
"husky": "^4.2.3",
79+
"jest": "^25.1.0",
80+
"lint-staged": "^10.0.9",
81+
"prettier": "^2.0.2",
82+
"react": "^16.13.1",
83+
"react-intl": "^4.2.2",
8784
"temp-write": "^4.0.0",
88-
"tempy": "^0.3.0",
89-
"ts-jest": "^24.0.2",
90-
"typescript": "^3.6.2"
85+
"tempy": "^0.5.0",
86+
"ts-jest": "^25.2.1",
87+
"typescript": "^3.8.3"
9188
},
9289
"lint-staged": {
93-
"*.{js}": [
90+
"*.{ts}": [
9491
"prettier --write",
95-
"eslint --fix",
96-
"git add"
92+
"eslint --fix"
9793
],
98-
"*.{json,md}": [
99-
"prettier --write",
100-
"git add"
94+
"*.{js,json,md}": [
95+
"prettier --write"
10196
]
10297
},
10398
"husky": {

0 commit comments

Comments
 (0)