-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add prettier * fix format * add jest watch * update eslint env * upgrade webpack * add simple example * add e2e * switch to github actions
- Loading branch information
Showing
22 changed files
with
2,186 additions
and
383 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Test | ||
on: | ||
push: | ||
branches-ignore: | ||
- gh-pages | ||
pull_request: | ||
env: | ||
CI: true | ||
|
||
jobs: | ||
test: | ||
name: "Test on Node.js ${{ matrix.node }} OS: ${{matrix.os}}" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [10, 12] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Install | ||
run: yarn install | ||
- name: Test | ||
run: yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
lib | ||
coverage | ||
tsconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
semi: false | ||
singleQuote: true | ||
printWidth: 80 | ||
trailingComma: "none" | ||
endOfLine: "auto" | ||
arrowParens: "avoid" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"eslint.validate": [ | ||
"javascript", | ||
{"language": "typescript", "autoFix": true} | ||
], | ||
"eslint.packageManager": "yarn", | ||
"eslint.enable": true, | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} | ||
"eslint.validate": [ | ||
"javascript", | ||
{ "language": "typescript", "autoFix": true } | ||
], | ||
"eslint.packageManager": "yarn", | ||
"eslint.enable": true, | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
describe('example', () => { | ||
beforeAll(async () => { | ||
await page.goto('http://localhost:8080/') | ||
}) | ||
|
||
test('rendering', async () => { | ||
await expect(page).toMatch('こんにちは、世界!') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<template> | ||
<p>{{ $t('hello') }}</p> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'App' | ||
} | ||
</script> | ||
|
||
<i18n> | ||
{ | ||
"en": { | ||
"hello": "hello, world!" | ||
}, | ||
"ja": { | ||
"hello": "こんにちは、世界!" | ||
} | ||
} | ||
</i18n> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>vue-i18n-loader example</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script src="/dist/bundle.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Vue from 'vue' | ||
import VueI18n from 'vue-i18n' | ||
import App from './App.vue' | ||
|
||
Vue.use(VueI18n) | ||
|
||
const i18n = new VueI18n({ | ||
locale: 'ja', | ||
messages: {} | ||
}) | ||
|
||
new Vue({ | ||
i18n, | ||
el: '#app', | ||
render: h => h(App) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const path = require('path') | ||
const VueLoaderPlugin = require('vue-loader/lib/plugin') | ||
|
||
module.exports = { | ||
mode: 'development', | ||
entry: path.resolve(__dirname, './main.js'), | ||
output: { | ||
path: path.resolve(__dirname, 'dist'), | ||
filename: 'bundle.js', | ||
publicPath: '/dist/' | ||
}, | ||
devServer: { | ||
stats: 'minimal', | ||
contentBase: __dirname | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.vue$/, | ||
loader: 'vue-loader' | ||
}, | ||
{ | ||
test: /\.js$/, | ||
loader: 'babel-loader' | ||
}, | ||
{ | ||
resourceQuery: /blockType=i18n/, | ||
type: 'javascript/auto', | ||
use: [path.resolve(__dirname, '../lib/index.js')] | ||
} | ||
] | ||
}, | ||
plugins: [new VueLoaderPlugin()] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
server: { | ||
port: 8080, | ||
command: | ||
'webpack-dev-server --config example/webpack.config.js --inline --hot' | ||
}, | ||
launch: { | ||
dumpio: false, | ||
headless: process.env.HEADLESS !== 'false' | ||
}, | ||
browser: 'chromium', | ||
browserContext: 'default' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.