Skip to content

Commit cb738f7

Browse files
committed
feat: change to electron app
Change to framework Nuxt.js
1 parent 2c0c041 commit cb738f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+17420
-6880
lines changed

Diff for: .babelrc

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"env": {
3+
"test": {
4+
"presets": [
5+
[
6+
"@babel/preset-env",
7+
{
8+
"targets": {
9+
"node": "current"
10+
}
11+
}
12+
]
13+
]
14+
}
15+
}
16+
}

Diff for: .editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

Diff for: .eslintrc.js

+8-20
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
1-
// https://eslint.org/docs/user-guide/configuring
2-
31
module.exports = {
42
root: true,
5-
parserOptions: {
6-
parser: 'typescript-eslint-parser'
7-
},
83
env: {
94
browser: true,
5+
node: true,
106
},
117
extends: [
12-
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
13-
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
14-
'plugin:vue/essential',
15-
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
16-
'standard'
17-
],
18-
// required to lint *.vue files
19-
plugins: [
20-
'vue'
8+
'@nuxtjs/eslint-config-typescript',
9+
'prettier',
10+
'prettier/vue',
11+
'plugin:prettier/recommended',
12+
'plugin:nuxt/recommended',
2113
],
14+
plugins: ['prettier'],
2215
// add your custom rules here
23-
rules: {
24-
// allow async-await
25-
'generator-star-spacing': 'off',
26-
// allow debugger during development
27-
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
28-
}
16+
rules: {},
2917
}

Diff for: .gitignore

+29-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Node template
13
# Logs
2-
logs
4+
/logs
35
*.log
46
npm-debug.log*
57
yarn-debug.log*
@@ -57,9 +59,32 @@ typings/
5759
# dotenv environment variables file
5860
.env
5961

62+
# parcel-bundler cache (https://parceljs.org/)
63+
.cache
64+
6065
# next.js build output
6166
.next
6267

63-
#
64-
.cache/
65-
dist/
68+
# nuxt.js build output
69+
.nuxt
70+
71+
# Nuxt generate
72+
dist
73+
74+
# vuepress build output
75+
.vuepress/dist
76+
77+
# Serverless directories
78+
.serverless
79+
80+
# IDE / Editor
81+
.idea
82+
83+
# Service worker
84+
sw.*
85+
86+
# macOS
87+
.DS_Store
88+
89+
# Vim swap files
90+
*.swp

Diff for: .prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true
4+
}

Diff for: .travis.yml

-15
This file was deleted.

Diff for: assets/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# ASSETS
2+
3+
**This directory is not required, you can delete it if you don't want to use it.**
4+
5+
This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
6+
7+
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked).

Diff for: commitlint.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
}

Diff for: components/DbTableInfo.vue

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<template>
2+
<div v-show="props.dbColumnNames.length > 0" class="has-text-centered">
3+
<div class="scroll">
4+
<table class="table is-bordered is-striped is-narrow is-fullwidth">
5+
<thead>
6+
<tr>
7+
<th>Column name of CSV</th>
8+
<td v-for="(name, i) in props.csvColumnNames" :key="i">
9+
{{ name }}
10+
</td>
11+
</tr>
12+
</thead>
13+
<tbody>
14+
<th>Column name of DB</th>
15+
<td v-for="(name, i) in props.dbColumnNames" :key="i">{{ name }}</td>
16+
</tbody>
17+
</table>
18+
</div>
19+
<p>TableName: <strong>hoge</strong></p>
20+
</div>
21+
</template>
22+
23+
<script lang="ts">
24+
import { defineComponent } from '@vue/composition-api'
25+
26+
export default defineComponent({
27+
props: {
28+
dbColumnNames: {
29+
type: Array,
30+
required: true,
31+
},
32+
33+
csvColumnNames: {
34+
type: Array,
35+
required: true,
36+
},
37+
},
38+
39+
setup(props: { dbColumnNames: string[]; csvColumnNames: string[] }) {
40+
return { props }
41+
},
42+
})
43+
</script>

Diff for: components/DragAndDrop.vue

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<template>
2+
<div
3+
class="drop-area"
4+
@dragleave.prevent
5+
@dragover.prevent
6+
@drop.prevent="onDrop"
7+
>
8+
<p>Drag and drop file</p>
9+
<div class="modal" :class="{ 'is-active': state.loading }">
10+
<div class="modal-background"></div>
11+
<div class="modal-content">Loading...</div>
12+
</div>
13+
</div>
14+
</template>
15+
16+
<script lang="ts">
17+
import { defineComponent, reactive } from '@vue/composition-api'
18+
import parse from 'csv-parse/lib/sync'
19+
20+
export default defineComponent({
21+
setup(_, ctx) {
22+
const state = reactive<{
23+
loading: boolean
24+
}>({
25+
loading: false,
26+
})
27+
28+
const onDrop = (event: any) => {
29+
state.loading = true
30+
const files = event.dataTransfer.files
31+
setTimeout(() => {
32+
const reader = new FileReader()
33+
reader.onload = (e: any) => {
34+
const rows = parse(e.target.result, { skip_empty_lines: true })
35+
const columnLength = rows[0].length
36+
ctx.emit(
37+
'set',
38+
rows.filter((row: string[]) => row.length === columnLength)
39+
)
40+
state.loading = false
41+
}
42+
reader.readAsText(files[0])
43+
}, 200)
44+
}
45+
46+
return {
47+
state,
48+
onDrop,
49+
}
50+
},
51+
})
52+
</script>
53+
54+
<style scoped>
55+
.drop-area {
56+
display: block;
57+
border: 2px dashed #bbb;
58+
border-radius: 5px;
59+
color: #bbb;
60+
padding: 25px;
61+
text-align: center;
62+
margin: 10px auto 5px;
63+
font-size: 18px;
64+
font-weight: bold;
65+
-khtml-user-drag: element;
66+
width: 80%;
67+
}
68+
</style>

Diff for: components/ErrorMessage.vue

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<template>
2+
<div v-show="props.message && props.message.length > 0">
3+
<article class="message is-danger">
4+
<div class="message-header">
5+
<p>Error</p>
6+
</div>
7+
<div class="message-body">
8+
{{ props.message }}
9+
</div>
10+
</article>
11+
</div>
12+
</template>
13+
14+
<script lang="ts">
15+
import { defineComponent } from '@vue/composition-api'
16+
17+
export default defineComponent({
18+
props: {
19+
message: {
20+
type: String,
21+
required: true,
22+
},
23+
},
24+
25+
setup(props: { message: string }) {
26+
return { props }
27+
},
28+
})
29+
</script>

Diff for: components/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# COMPONENTS
2+
3+
**This directory is not required, you can delete it if you don't want to use it.**
4+
5+
The components directory contains your Vue.js Components.
6+
7+
_Nuxt.js doesn't supercharge these components._

Diff for: components/ResultTable.vue

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<template>
2+
<div class="scroll">
3+
<table class="table is-hoverable is-fullwidth scroll">
4+
<thead>
5+
<tr>
6+
<th v-for="(columnName, i) in props.columnNames" :key="i">
7+
{{ columnName }}
8+
</th>
9+
</tr>
10+
</thead>
11+
<tbody>
12+
<tr v-for="(rows, i) in props.result" :key="i">
13+
<td v-for="(str, j) in rows" :key="j">{{ str }}</td>
14+
</tr>
15+
</tbody>
16+
</table>
17+
</div>
18+
</template>
19+
20+
<script lang="ts">
21+
import { defineComponent } from '@vue/composition-api'
22+
23+
export default defineComponent({
24+
props: {
25+
columnNames: {
26+
type: Array,
27+
required: true,
28+
},
29+
30+
result: {
31+
type: Array,
32+
required: true,
33+
},
34+
},
35+
36+
setup(props: { columnNames: string[]; result: string[][] }) {
37+
return { props }
38+
},
39+
})
40+
</script>

Diff for: index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module 'sql.js'

Diff for: jest.config.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
moduleNameMapper: {
3+
'^@/(.*)$': '<rootDir>/$1',
4+
'^~/(.*)$': '<rootDir>/$1',
5+
'^vue$': 'vue/dist/vue.common.js',
6+
},
7+
moduleFileExtensions: ['ts', 'js', 'vue', 'json'],
8+
transform: {
9+
'^.+\\.ts$': 'ts-jest',
10+
'^.+\\.js$': 'babel-jest',
11+
'.*\\.(vue)$': 'vue-jest',
12+
},
13+
collectCoverage: true,
14+
collectCoverageFrom: [
15+
'<rootDir>/components/**/*.vue',
16+
'<rootDir>/pages/**/*.vue',
17+
],
18+
}

Diff for: layouts/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# LAYOUTS
2+
3+
**This directory is not required, you can delete it if you don't want to use it.**
4+
5+
This directory contains your Application Layouts.
6+
7+
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts).

Diff for: layouts/default.vue

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div class="container">
3+
<nuxt />
4+
</div>
5+
</template>

0 commit comments

Comments
 (0)