Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
SSmJaE committed Apr 19, 2021
0 parents commit 10869ee
Show file tree
Hide file tree
Showing 35 changed files with 11,745 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"parser": "@typescript-eslint/parser"
}
92 changes: 92 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock
.DS_Store

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Webpack
.webpack/

# Electron-Forge
out/

private
db.json
14 changes: 14 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-typescript"
],
"plugins": [
[
"@babel/plugin-transform-runtime",
{
"useESModules": true
}
]
]
}
121 changes: 121 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"name": "xue-xi-tong-sign-electron",
"productName": "xue-xi-tong-sign-electron",
"version": "1.0.0",
"description": "A XueXiTong Sign Application, powered by Electron",
"main": ".webpack/main/index",
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "eslint --ext .ts .",
"devtool": "vue-devtools"
},
"keywords": [],
"author": {
"name": "EdIfiMr",
"email": "[email protected]"
},
"license": "GPL-3.0",
"config": {
"forge": {
"packagerConfig": {},
"makers": [
{
"name": "@electron-forge/maker-squirrel",
"config": {
"name": "my_new_app"
}
},
{
"name": "@electron-forge/maker-zip",
"platforms": [
"darwin"
]
},
{
"name": "@electron-forge/maker-deb",
"config": {}
},
{
"name": "@electron-forge/maker-rpm",
"config": {}
}
],
"plugins": [
[
"@electron-forge/plugin-webpack",
{
"mainConfig": "./webpack.main.config.js",
"renderer": {
"config": "./webpack.renderer.config.js",
"entryPoints": [
{
"html": "./src/renderer/index.html",
"js": "./src/renderer/index.ts",
"name": "main_window"
}
]
}
}
]
]
}
},
"devDependencies": {
"@babel/core": "^7.13.15",
"@babel/plugin-transform-runtime": "^7.13.15",
"@babel/preset-env": "^7.13.15",
"@babel/preset-typescript": "^7.13.0",
"@electron-forge/cli": "^6.0.0-beta.54",
"@electron-forge/maker-deb": "^6.0.0-beta.54",
"@electron-forge/maker-rpm": "^6.0.0-beta.54",
"@electron-forge/maker-squirrel": "^6.0.0-beta.54",
"@electron-forge/maker-zip": "^6.0.0-beta.54",
"@electron-forge/plugin-webpack": "6.0.0-beta.54",
"@marshallofsound/webpack-asset-relocator-loader": "^0.5.0",
"@types/electron-devtools-installer": "^2.2.0",
"@types/lodash": "^4.14.168",
"@types/lowdb": "^1.0.9",
"@types/query-string": "^6.3.0",
"@types/tough-cookie": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"autoprefixer": "^10.2.5",
"babel-loader": "^8.2.2",
"css-loader": "^4.2.1",
"electron": "^12.0.2",
"electron-devtools-installer": "^3.1.1",
"eslint": "^7.6.0",
"eslint-plugin-import": "^2.20.0",
"fork-ts-checker-webpack-plugin": "^5.0.14",
"node-loader": "^1.0.1",
"postcss": "^8.2.9",
"postcss-loader": "4",
"precss": "^4.0.0",
"style-loader": "^1.2.1",
"ts-loader": "^8.0.2",
"typescript": "^4.0.2",
"url-loader": "^4.1.1",
"vue-loader": "^15.9.6"
},
"dependencies": {
"axios": "^0.21.1",
"axios-cookiejar-support": "^1.0.1",
"dayjs": "^1.10.4",
"electron-squirrel-startup": "^1.0.0",
"element-ui": "^2.15.1",
"lodash": "^4.17.21",
"lowdb": "^1.0.0",
"query-string": "^7.0.0",
"reflect-metadata": "^0.1.13",
"tough-cookie": "^4.0.0",
"vue": "^2.6.12",
"vue-class-component": "^7.2.6",
"vue-property-decorator": "^9.1.2",
"vue-template-compiler": "^2.6.12",
"vuex": "^3.6.2",
"vuex-module-decorators": "^1.0.1"
}
}
3 changes: 3 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: [require("precss"), require("autoprefixer")],
};
68 changes: 68 additions & 0 deletions src/main/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { app, BrowserWindow } from "electron";
declare const MAIN_WINDOW_WEBPACK_ENTRY: any;

import installExtension, { VUEJS_DEVTOOLS } from "electron-devtools-installer";

// Handle creating/removing shortcuts on Windows when installing/uninstalling.
if (require("electron-squirrel-startup")) {
// eslint-disable-line global-require
app.quit();
}

const createWindow = (): void => {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 1366,
height: 768,
webPreferences: {
nodeIntegration: true,
webSecurity: false,
enableRemoteModule: true,
contextIsolation: false,
},
});

// and load the index.html of the app.
mainWindow.loadURL(MAIN_WINDOW_WEBPACK_ENTRY);

// Open the DevTools.
mainWindow.webContents.openDevTools({ mode: "undocked" });
};

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on("ready", () => {
createWindow();
// installExtension(VUEJS_DEVTOOLS);
});

if (process.env.NODE_ENV === "development") {
app.whenReady().then(() => {
installExtension(VUEJS_DEVTOOLS)
.then((name) => console.log(`Added Extension: ${name}`))
.catch((err) => console.log("An error occurred: ", err));
});
}

// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on("window-all-closed", () => {
if (process.platform !== "darwin") {
app.quit();
}
});

app.on("activate", () => {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and import them here.

(global as any).remoteRequests = require("./requests");
Loading

0 comments on commit 10869ee

Please sign in to comment.