Skip to content

Commit 4e67a75

Browse files
committed
🔨 Refactor(ts): change js -> ts
1 parent 72e6e2a commit 4e67a75

Some content is hidden

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

91 files changed

+8385
-6917
lines changed

.babelrc

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

.eslintrc.js

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
module.exports = {
22
root: true,
3-
parser: 'babel-eslint',
4-
parserOptions: {
5-
sourceType: 'module'
3+
globals: {
4+
__static: 'readonly'
65
},
76
env: {
8-
browser: true,
97
node: true
108
},
11-
extends: 'standard',
12-
globals: {
13-
__static: true
14-
},
15-
plugins: [
16-
'html'
9+
parser: "vue-eslint-parser",
10+
'extends': [
11+
'plugin:vue/essential',
12+
'@vue/standard',
13+
'@vue/typescript'
1714
],
18-
'rules': {
19-
// allow paren-less arrow functions
20-
'arrow-parens': 0,
21-
// allow async-await
22-
'generator-star-spacing': 0,
23-
// allow debugger during development
24-
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
15+
'plugins': ['@typescript-eslint'],
16+
rules: {
17+
'no-console': process.env.NODE_ENV === 'production' ? 'off' : 'off',
18+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
19+
},
20+
parserOptions: {
21+
parser: '@typescript-eslint/parser'
2522
}
2623
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ thumbs.db
1212
!.gitkeep
1313
yarn-error.log
1414
docs/dist/
15+
# local env files
16+
.env.local
17+
.env.*.local
18+
dist_electron/

.vscode/settings.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11
{
22
"eslint.enable": true,
3-
"eslint.autoFixOnSave": true
3+
"eslint.alwaysShowStatus": true,
4+
"eslint.validate": [
5+
"javascript",
6+
"javascriptreact",
7+
"typescript",
8+
"vue",
9+
"typescriptreact"
10+
],
11+
"[stylus]": {
12+
"editor.formatOnSave": true
13+
},
14+
"stylusSupremacy.insertSemicolons": false,
15+
"stylusSupremacy.insertBraces": false,
16+
"stylusSupremacy.insertNewLineBetweenSelectors": true,
17+
"stylusSupremacy.insertParenthesisAroundIfCondition": false,
18+
"stylusSupremacy.alwaysUseNoneOverZero": true,
19+
"stylusSupremacy.alwaysUseZeroWithoutUnit": true,
20+
"stylusSupremacy.sortProperties": "grouped",
21+
"stylusSupremacy.quoteChar": "\"",
22+
"editor.codeActionsOnSave": {
23+
"source.fixAll.eslint": true
24+
}
425
}

LICENSE

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
The 996ICU License (996ICU)
2-
Version 0.1, March 2019
1+
The MIT License (MIT)
32

4-
PACKAGE is distributed under LICENSE with the following restriction:
3+
Copyright (c) 2017-present, Molunerfinn
54

6-
The above license is only granted to entities that act in concordance
7-
with local labor laws. In addition, the following requirements must be
8-
observed:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
911

10-
* The licencee must not, explicitly or implicitly, request or schedule
11-
their employees to work more than 45 hours in any single week.
12-
* The licencee must not, explicitly or implicitly, request or schedule
13-
their employees to be at work consecutively for 10 hours.
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,4 @@ npm run build
121121

122122
[MIT](http://opensource.org/licenses/MIT)
123123

124-
Copyright (c) 2017 - 2019 Molunerfinn
124+
Copyright (c) 2017 - 2019 Molunerfinn

babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

dist/electron/.gitkeep

Whitespace-only changes.

dist/web/.gitkeep

Whitespace-only changes.

package.json

Lines changed: 49 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,20 @@
11
{
22
"name": "picgo",
33
"version": "2.1.2",
4-
"author": "Molunerfinn <[email protected]>",
5-
"description": "Easy to upload your pic & copy to write",
6-
"license": "MIT",
7-
"main": "./dist/electron/main.js",
4+
"private": true,
85
"scripts": {
9-
"render": "webpack-dev-server --hot --colors --config .electron-vue/webpack.renderer.config.js --port 9080 --content-base app/dist",
10-
"build": "node .electron-vue/build.js && electron-builder",
11-
"release": "node .electron-vue/build.js && electron-builder",
12-
"build:dir": "node .electron-vue/build.js && electron-builder --dir",
13-
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
14-
"build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
15-
"dev": "node .electron-vue/dev-runner.js",
16-
"e2e": "npm run pack && mocha test/e2e",
17-
"lint": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src test",
18-
"lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src test",
19-
"pack": "npm run pack:main && npm run pack:renderer",
20-
"pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js",
21-
"pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",
22-
"test": "npm run unit && npm run e2e",
23-
"unit": "karma start test/unit/karma.conf.js",
24-
"postinstall": "npm run lint:fix",
25-
"build:docs": "cross-env NODE_ENV=production webpack -p --config .electron-vue/webpack.docs.config.js",
26-
"docs": "webpack-dev-server --content-base docs/dist --config .electron-vue/webpack.docs.config.js --hot --inline",
27-
"patch": "npm version patch && git push origin master && git push origin --tags",
28-
"minor": "npm version minor && git push origin master && git push origin --tags",
29-
"major": "npm version major && git push origin master && git push origin --tags",
6+
"serve": "vue-cli-service serve",
7+
"build": "vue-cli-service build",
8+
"lint": "vue-cli-service lint",
9+
"electron:build": "vue-cli-service electron:build",
10+
"electron:serve": "vue-cli-service electron:serve",
11+
"postinstall": "electron-builder install-app-deps",
12+
"postuninstall": "electron-builder install-app-deps",
3013
"cz": "git-cz",
31-
"bump": "bump-version"
14+
"bump": "bump-version",
15+
"release": "electron:build"
3216
},
17+
"main": "background.js",
3318
"husky": {
3419
"hooks": {
3520
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
@@ -44,144 +29,53 @@
4429
}
4530
},
4631
"commitlint": {
47-
"extends": [
48-
"./node_modules/@picgo/bump-version/commitlint-picgo"
49-
]
50-
},
51-
"build": {
52-
"productName": "PicGo",
53-
"appId": "com.molunerfinn.picgo",
54-
"directories": {
55-
"output": "build"
56-
},
57-
"files": [
58-
"dist/electron/**/*"
59-
],
60-
"dmg": {
61-
"contents": [
62-
{
63-
"x": 410,
64-
"y": 150,
65-
"type": "link",
66-
"path": "/Applications"
67-
},
68-
{
69-
"x": 130,
70-
"y": 150,
71-
"type": "file"
72-
}
73-
]
74-
},
75-
"mac": {
76-
"icon": "build/icons/icon.icns",
77-
"extendInfo": {
78-
"LSUIElement": 1
79-
}
80-
},
81-
"win": {
82-
"icon": "build/icons/icon.ico",
83-
"target": "nsis"
84-
},
85-
"nsis": {
86-
"oneClick": false,
87-
"allowToChangeInstallationDirectory": true
88-
},
89-
"linux": {
90-
"icon": "build/icons/"
91-
}
32+
"extends": ["./node_modules/@picgo/bump-version/commitlint-picgo"]
9233
},
9334
"dependencies": {
9435
"axios": "^0.19.0",
95-
"dateformat": "^3.0.3",
96-
"element-ui": "^2.4.11",
36+
"core-js": "^3.3.2",
37+
"element-ui": "^2.13.0",
9738
"fix-path": "^2.1.0",
98-
"fs-extra": "^4.0.2",
99-
"image-size": "^0.6.1",
100-
"keycode": "^2.1.9",
39+
"fs-extra": "^8.1.0",
40+
"keycode": "^2.2.0",
10141
"lodash-id": "^0.14.0",
10242
"lowdb": "^1.0.0",
103-
"md5": "^2.2.1",
104-
"melody.css": "^1.0.2",
10543
"picgo": "^1.3.7",
106-
"qiniu": "^7.1.1",
107-
"vue": "^2.3.3",
108-
"vue-electron": "^1.0.6",
109-
"vue-gallery": "^1.2.4",
44+
"vue": "^2.6.10",
45+
"vue-gallery": "^2.0.1",
11046
"vue-lazyload": "^1.2.6",
111-
"vue-router": "^2.5.3",
112-
"vuex": "^2.3.1",
113-
"ws": "3.3.1"
47+
"vue-router": "^3.1.3"
11448
},
11549
"devDependencies": {
116-
"@commitlint/cli": "^7.5.2",
117-
"@picgo/bump-version": "^1.0.2",
118-
"babel-core": "^6.25.0",
119-
"babel-eslint": "^7.2.3",
120-
"babel-loader": "^7.1.1",
121-
"babel-plugin-istanbul": "^4.1.1",
122-
"babel-plugin-transform-runtime": "^6.23.0",
123-
"babel-preset-env": "^1.6.0",
124-
"babel-preset-stage-0": "^6.24.1",
125-
"babel-register": "^6.24.1",
126-
"babili-webpack-plugin": "^0.1.2",
127-
"cfonts": "^1.1.3",
128-
"chai": "^4.0.0",
129-
"chalk": "^2.1.0",
130-
"commitizen": "^3.0.7",
131-
"conventional-changelog": "^3.0.6",
132-
"copy-webpack-plugin": "^4.0.1",
133-
"cross-env": "^5.0.5",
134-
"css-loader": "^0.28.4",
135-
"cz-customizable": "^5.10.0",
136-
"del": "^3.0.0",
137-
"devtron": "^1.4.0",
138-
"electron": "^5.0.1",
139-
"electron-builder": "^20.38.4",
140-
"electron-debug": "^1.4.0",
141-
"electron-devtools-installer": "^2.2.0",
142-
"eslint": "^4.4.1",
143-
"eslint-config-standard": "^10.2.1",
144-
"eslint-friendly-formatter": "^3.0.0",
145-
"eslint-loader": "^2.1.1",
146-
"eslint-plugin-html": "^3.1.1",
147-
"eslint-plugin-import": "^2.7.0",
148-
"eslint-plugin-node": "^5.1.1",
149-
"eslint-plugin-promise": "^3.5.0",
150-
"eslint-plugin-standard": "^3.0.1",
151-
"file-loader": "^3.0.1",
152-
"html-webpack-plugin": "^3.2.0",
153-
"husky": "^1.3.1",
154-
"inject-loader": "^3.0.0",
155-
"inquirer": "^6.3.1",
156-
"karma": "^1.3.0",
157-
"karma-chai": "^0.1.0",
158-
"karma-coverage": "^1.1.1",
159-
"karma-electron": "^5.1.1",
160-
"karma-mocha": "^1.2.0",
161-
"karma-sourcemap-loader": "^0.3.7",
162-
"karma-spec-reporter": "^0.0.31",
163-
"karma-webpack": "^2.0.1",
164-
"mini-css-extract-plugin": "0.4.0",
165-
"mocha": "^3.0.2",
166-
"multispinner": "^0.2.1",
167-
"node-loader": "^0.6.0",
168-
"pug": "^2.0.0-rc.4",
169-
"pug-loader": "^2.3.0",
170-
"pug-plain-loader": "^1.0.0",
171-
"require-dir": "^0.3.0",
172-
"spectron": "^3.7.1",
173-
"style-loader": "^0.23.1",
174-
"stylus": "^0.54.5",
175-
"stylus-loader": "^3.0.1",
176-
"url-loader": "^1.1.2",
177-
"vue-html-loader": "^1.2.4",
178-
"vue-loader": "^15.4.2",
179-
"vue-style-loader": "^4.1.2",
180-
"vue-template-compiler": "^2.4.2",
181-
"webpack": "^4.15.1",
182-
"webpack-cli": "^3.0.8",
183-
"webpack-dev-server": "^3.1.4",
184-
"webpack-hot-middleware": "^2.22.2",
185-
"webpack-merge": "^4.1.3"
50+
"@commitlint/cli": "^8.2.0",
51+
"@picgo/bump-version": "^1.0.3",
52+
"@types/fs-extra": "^8.0.1",
53+
"@types/inquirer": "^6.5.0",
54+
"@types/lowdb": "^1.0.9",
55+
"@types/node": "10.17.6",
56+
"@types/request-promise-native": "^1.0.17",
57+
"@vue/cli-plugin-babel": "^4.0.0",
58+
"@vue/cli-plugin-eslint": "^4.0.0",
59+
"@vue/cli-plugin-router": "^4.0.0",
60+
"@vue/cli-plugin-typescript": "^4.0.0",
61+
"@vue/cli-service": "^4.0.0",
62+
"@vue/eslint-config-standard": "^4.0.0",
63+
"@vue/eslint-config-typescript": "^4.0.0",
64+
"commitizen": "^4.0.3",
65+
"conventional-changelog": "^3.1.18",
66+
"cz-customizable": "^6.2.0",
67+
"electron": "^6.0.0",
68+
"eslint": "^5.16.0",
69+
"eslint-plugin-vue": "^5.0.0",
70+
"husky": "^3.1.0",
71+
"stylus": "^0.54.7",
72+
"stylus-loader": "^3.0.2",
73+
"typescript": "~3.5.3",
74+
"vue-cli-plugin-electron-builder": "^1.4.2",
75+
"vue-property-decorator": "^8.3.0",
76+
"vue-template-compiler": "^2.6.10"
77+
},
78+
"resolutions": {
79+
"**/@types/node": "10.17.6"
18680
}
18781
}

postcss.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
plugins: {
3+
autoprefixer: {}
4+
}
5+
}

public/favicon.ico

4.19 KB
Binary file not shown.

0 commit comments

Comments
 (0)