Skip to content

Commit 0089a37

Browse files
committed
re-structure project
1 parent 9c5b966 commit 0089a37

21 files changed

+579
-1222
lines changed

.circleci/config.yml

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

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
./lib
2+
./jest.config.js

.eslintrc.js

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
1+
'use strict'
2+
13
module.exports = {
24
root: true,
3-
parserOptions: {
4-
parser: 'babel-eslint',
5-
ecmaVersion: 2015,
6-
sourceType: 'module'
5+
globals: {
6+
page: true,
7+
browser: true,
8+
context: true
9+
},
10+
env: {
11+
node: true,
12+
jest: true
713
},
8-
plugins: [
9-
'vue'
10-
],
1114
extends: [
12-
// 'eslint:recommended',
13-
'plugin:vue/essential'
15+
'plugin:vue-libs/recommended',
16+
'plugin:@typescript-eslint/recommended',
17+
'plugin:@typescript-eslint/eslint-recommended',
18+
'prettier/@typescript-eslint',
19+
'plugin:prettier/recommended'
1420
],
21+
plugins: ['@typescript-eslint'],
22+
parser: 'vue-eslint-parser',
23+
parserOptions: {
24+
parser: '@typescript-eslint/parser',
25+
sourceType: 'module'
26+
},
1527
rules: {
16-
'object-curly-spacing': ['error', 'always'],
17-
'no-multiple-empty-lines': ['error', { max: 2, maxBOF: 1 }]
28+
'object-curly-spacing': 'off',
29+
'@typescript-eslint/explicit-function-return-type': 'off',
30+
'@typescript-eslint/member-delimiter-style': 'off',
31+
'@typescript-eslint/no-use-before-define': 'off'
1832
}
1933
}

.github/workflows/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Test
2+
on:
3+
push:
4+
branches-ignore:
5+
- gh-pages
6+
pull_request:
7+
env:
8+
CI: true
9+
10+
jobs:
11+
test:
12+
name: "Test on Node.js ${{ matrix.node }} OS: ${{matrix.os}}"
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest]
17+
node: [10, 12, 14]
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
- name: Setup Node.js ${{ matrix.node }}
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node }}
25+
- name: Install
26+
run: yarn install
27+
- name: Test
28+
run: yarn test

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
__snapshots__
21
coverage
3-
coverage.lcov
42
node_modules
53
.DS_Store
4+
lib
65
*.log
76
*.swp
87
*~

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
*.log
33
*.swp
44
*.yml
5-
test
65
coverage
6+
__snapshots__
7+
test

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lib
2+
coverage
3+
tsconfig.json

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
semi: false
2+
singleQuote: true
3+
printWidth: 80
4+
trailingComma: "none"
5+
endOfLine: "auto"
6+
arrowParens: "avoid"

jest.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use strict'
2+
3+
module.exports = {
4+
preset: 'ts-jest',
5+
testEnvironment: 'node',
6+
coveragePathIgnorePatterns: ['node_modules', '<rootDir>/test/*.*'],
7+
testMatch: ['<rootDir>/test/**/*(*.)@(spec|test).[tj]s?(x)'],
8+
globals: {
9+
'ts-jest': {
10+
diagnostics: false
11+
}
12+
},
13+
watchPlugins: [
14+
'jest-watch-typeahead/filename',
15+
'jest-watch-typeahead/testname'
16+
]
17+
}

package.json

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@intlify/vue-i18n-extensions",
33
"description": "vue-i18n extensions",
4-
"version": "1.0.2",
4+
"version": "2.0.0-alpha.0",
55
"author": {
66
"name": "kazuya kawaguchi",
77
"email": "[email protected]"
@@ -23,45 +23,36 @@
2323
"Type: Documentation": ":pencil: Documentation"
2424
}
2525
},
26-
"dependencies": {
27-
"@babel/parser": "^7.9.6"
28-
},
26+
"dependencies": {},
2927
"devDependencies": {
30-
"@vue/server-test-utils": "^1.0.2",
31-
"@vue/test-utils": "^1.0.2",
32-
"babel-eslint": "^10.0.0",
28+
"@types/jest": "^25.0.0",
29+
"@types/node": "^13.1.4",
30+
"@typescript-eslint/eslint-plugin": "^2.26.0",
31+
"@typescript-eslint/parser": "^2.26.0",
32+
"@typescript-eslint/typescript-estree": "^2.26.0",
33+
"@vue/compiler-core": "^3.0.0-beta.9",
3334
"eslint": "^6.8.0",
34-
"eslint-plugin-vue": "^6.2.2",
35+
"eslint-config-prettier": "^6.10.1",
36+
"eslint-plugin-prettier": "^3.1.2",
37+
"eslint-plugin-vue-libs": "^4.0.0",
3538
"jest": "^26.0.0",
36-
"jest-serializer-vue": "^2.0.2",
39+
"jest-watch-typeahead": "^0.6.0",
3740
"lerna-changelog": "^1.0.0",
41+
"opener": "^1.5.1",
3842
"shipjs": "^0.18.0",
39-
"vue": "^2.6.11",
40-
"vue-i18n": "^8.17.0",
41-
"vue-jest": "^3.0.0",
42-
"vue-server-renderer": "^2.6.11",
43-
"vue-template-compiler": "^2.6.11"
43+
"ts-jest": "^25.3.0",
44+
"typescript": "^3.8.3",
45+
"typescript-eslint-language-service": "^2.0.3",
46+
"vue": "^3.0.0-beta.9",
47+
"vue-i18n": "^9.0.0-alpha.7"
4448
},
4549
"engines": {
4650
"node": ">= 10.0"
4751
},
4852
"files": [
49-
"src"
53+
"lib"
5054
],
5155
"homepage": "https://github.com/intlify/vue-i18n-extensions#readme",
52-
"jest": {
53-
"moduleFileExtensions": [
54-
"js",
55-
"json",
56-
"vue"
57-
],
58-
"transform": {
59-
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest"
60-
},
61-
"snapshotSerializers": [
62-
"<rootDir>/node_modules/jest-serializer-vue"
63-
]
64-
},
6556
"keywords": [
6657
"extensions",
6758
"i18n",
@@ -71,18 +62,26 @@
7162
"vue-i18n"
7263
],
7364
"license": "MIT",
74-
"main": "src/index.js",
65+
"main": "lib/index.js",
7566
"repository": {
7667
"type": "git",
7768
"url": "git+https://github.com/intlify/vue-i18n-extensions.git"
7869
},
7970
"scripts": {
80-
"clean": "rm -rf ./coverage",
81-
"lint": "eslint --fix --ext .js,.vue ./src",
71+
"build": "tsc -p .",
72+
"build:watch": "tsc -p . --watch",
73+
"clean": "rm -rf ./coverage && rm -rf ./lib/*.js*",
74+
"coverage": "opener coverage/lcov-report/index.html",
75+
"fix": "yarn lint:fix && yarn format:fix",
76+
"format": "prettier --config .prettierrc --ignore-path .prettierignore '**/*.{js,json,html}'",
77+
"format:fix": "yarn format --write",
78+
"lint": "eslint ./src ./test --ext .ts",
79+
"lint:fix": "yarn lint --fix",
8280
"release:prepare": "shipjs prepare",
8381
"release:trigger": "shipjs trigger",
84-
"test": "npm run lint && npm run test:cover",
85-
"test:cover": "jest --coverage -u",
86-
"test:unit": "jest -u"
82+
"test": "yarn lint && yarn test:cover",
83+
"test:cover": "yarn test:unit --coverage",
84+
"test:unit": "jest --env node",
85+
"test:watch": "jest --env node --watch"
8786
}
8887
}

0 commit comments

Comments
 (0)