Skip to content

Commit 4a74fe6

Browse files
committed
chore: init
0 parents  commit 4a74fe6

36 files changed

+30289
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# 忽略目录
2+
dist/
3+
tests/
4+
demo/
5+
renderer/.ice/
6+
release/
7+
**/node_modules
8+
# node 覆盖率文件
9+
coverage/
10+
11+
# 忽略文件
12+
**/*-min.js
13+
**/*.min.js
14+
15+
package-lock.json
16+
yarn.lock

.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const { getESLintConfig } = require('@iceworks/spec');
2+
3+
module.exports = getESLintConfig('react-ts', {
4+
rules: {
5+
'react/jsx-filename-extension': 0,
6+
'@typescript-eslint/explicit-function-return-type': 0,
7+
},
8+
});

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules/
5+
6+
# production
7+
dist/
8+
release/
9+
10+
# misc
11+
.idea/
12+
.happypack
13+
.DS_Store
14+
*.swp
15+
*.dia~
16+
.ice
17+
.vscode
18+
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*
22+

.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
build/
2+
tests/
3+
demo/
4+
.ice/
5+
coverage/
6+
**/*-min.js
7+
**/*.min.js
8+
package-lock.json
9+
yarn.lock

.prettierrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const { getPrettierConfig } = require('@iceworks/spec');
2+
3+
module.exports = getPrettierConfig('react');

.stylelintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# 忽略目录
2+
dist/
3+
release/
4+
demo/
5+
tests/
6+
__test__
7+
8+
# node 覆盖率文件
9+
coverage/

.stylelintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const { getStylelintConfig } = require('@iceworks/spec');
2+
3+
module.exports = getStylelintConfig('react');

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# iceworks-toolkit
2+

main/index.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// @ts-nocheck
2+
import * as isDev from 'electron-is-dev';
3+
import { app, BrowserWindow } from 'electron';
4+
// Modules to control application life and create native browser window
5+
import * as path from 'path';
6+
7+
function createWindow(): BrowserWindow {
8+
// Create the browser window.
9+
const mainWindow = new BrowserWindow({
10+
width: 800,
11+
height: 600,
12+
webPreferences: {
13+
preload: path.join(__dirname, 'preload.js'),
14+
nodeIntegration: true,
15+
contextIsolation: false,
16+
},
17+
});
18+
19+
// and load the index.html of the app.
20+
if (isDev) {
21+
// eslint-disable-next-line @iceworks/best-practices/no-http-url
22+
mainWindow.loadURL('http://localhost:3000');
23+
} else {
24+
mainWindow.loadFile(path.resolve(__dirname, './assets/index.html'));
25+
}
26+
27+
// mainWindow.webContents.openDevTools()
28+
}
29+
30+
// This method will be called when Electron has finished
31+
// initialization and is ready to create browser windows.
32+
// Some APIs can only be used after this event occurs.
33+
app.on('ready', createWindow);
34+
35+
// Quit when all windows are closed.
36+
app.on('window-all-closed', () => {
37+
// On macOS it is common for applications and their menu bar
38+
// to stay active until the user quits explicitly with Cmd + Q
39+
if (process.platform !== 'darwin') app.quit();
40+
});
41+
42+
app.on('activate', () => {
43+
// On macOS it's common to re-create a window in the app when the
44+
// dock icon is clicked and there are no other windows open.
45+
if (BrowserWindow.getAllWindows().length === 0) createWindow();
46+
});
47+
48+
// In this file you can include the rest of your app's specific main process
49+
// code. You can also put them in separate files and require them here.

0 commit comments

Comments
 (0)