Skip to content

Commit bc2032a

Browse files
authored
Merge pull request #85 from alexwkleung/v0.2.0-dev-6.0
v0.2.0-dev-6.0
2 parents 7690a37 + 8902a39 commit bc2032a

File tree

175 files changed

+10262
-9296
lines changed

Some content is hidden

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

175 files changed

+10262
-9296
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
**/*.js
21
node_modules
32
dist
43
out

.eslintrc.json

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,30 @@
44
"es2021": true
55
},
66
"extends": [
7-
"eslint:recommended",
8-
"plugin:@typescript-eslint/recommended"
7+
"eslint:recommended"
98
],
10-
"parser": "@typescript-eslint/parser",
11-
"plugins": [
12-
"@typescript-eslint"
13-
],
14-
"rules": {
15-
"@typescript-eslint/explicit-function-return-type": "error",
16-
"@typescript-eslint/no-inferrable-types": "off",
17-
"@typescript-eslint/no-explicit-any": "warn",
18-
"@typescript-eslint/no-namespace": "off"
19-
},
209
"parserOptions": {
2110
"ecmaVersion": "latest",
2211
"sourceType": "module"
23-
}
12+
},
13+
"overrides": [{
14+
"files": ["*.ts", "*.mts", "*.d.ts"],
15+
"extends": [
16+
"plugin:@typescript-eslint/recommended",
17+
"prettier"
18+
],
19+
"parser": "@typescript-eslint/parser",
20+
"plugins": [
21+
"@typescript-eslint",
22+
"eslint-plugin-prettier",
23+
"prettier"
24+
],
25+
"rules": {
26+
"@typescript-eslint/explicit-function-return-type": "error",
27+
"@typescript-eslint/no-inferrable-types": "off",
28+
"@typescript-eslint/no-explicit-any": "warn",
29+
"@typescript-eslint/no-namespace": "off",
30+
"prettier/prettier": "error"
31+
}
32+
}]
2433
}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
node_modules
33
dist
44
out
5-
*.log*
5+
*.log*
6+
.hmr_pid.txt

.prettierignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
**/*.json
2+
**/*.
3+
**/*.md
4+
**/*.js
5+
**/*.html
6+
**/*.css
7+
**/*.yml
8+
vite.config.ts
9+
src/vite.d.ts
10+
out
11+
dist
12+
build
13+
node_modules
14+
resources
15+
screenshots
16+
test
17+
fs-mod

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 4,
4+
"semi": true,
5+
"singleQuote": false,
6+
"printWidth": 120
7+
}

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ The app is currently in early development and may not be 100% stable for daily u
3131

3232
Only macOS installers are supplied in the early development phase. Other platforms will be supported in the official release.
3333

34-
v0.2.0 will mark the first official build for Iris. There will be a handful of dev builds that users can install to get a feel of the application before release.
35-
3634
You can use the [GitHub Discussions](https://github.com/alexwkleung/Iris/discussions) for communication. Other mediums will be created in the near future.
3735

3836
# Installation
@@ -43,6 +41,8 @@ If you want to build the app directly from source, follow the instructions in [D
4341

4442
# Development
4543

44+
The recommended editor for development is [VS Code](https://code.visualstudio.com/)
45+
4646
Install [Node.js](https://nodejs.org/en/download)
4747

4848
Install [Rust](https://www.rust-lang.org/tools/install)
@@ -88,6 +88,16 @@ Install npm dependencies. Only do this in the *root* of the project. Do not `npm
8888
npm install
8989
```
9090

91+
It recommended to add these to your VS Code `settings.json`:
92+
93+
```json
94+
"editor.codeActionsOnSave": {
95+
"source.fixAll.eslint": "always",
96+
"editor.formatOnSave": "always",
97+
},
98+
"prettier.enable": true,
99+
```
100+
91101
Build native modules
92102

93103
```bash
@@ -149,7 +159,7 @@ npm run build:linux
149159

150160
Here are a list of ways you can contribute to Iris:
151161

152-
1. [Submit a Pull Request](https://github.com/alexwkleung/Iris/pulls)
162+
1. [Submit a pull request](https://github.com/alexwkleung/Iris/pulls)
153163
2. [Create or answer issues](https://github.com/alexwkleung/Iris/issues)
154164
3. [Create or answer discussion posts](https://github.com/alexwkleung/Iris/discussions)
155165
4. Show your interest by sharing Iris to others :)

build/notarize.js

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

cli.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env node
2+
3+
import chokidar from 'chokidar'
4+
import { exec } from 'child_process'
5+
import * as fs from 'fs'
6+
import process from 'process'
7+
8+
const chokidarPaths = [
9+
'index.html',
10+
'src/is-main.mts',
11+
'src/main.ts',
12+
'src/preload/**/*.mts',
13+
'src/renderer/**/*.ts',
14+
'src/renderer/**/*.mts',
15+
'src/**/*'
16+
];
17+
18+
const chokidarPathsIgnore = [
19+
'src/**/*.css'
20+
]
21+
22+
const chokidarDev = () => {
23+
fs.open('.hmr_pid.txt', 'w', (err, fd) => {
24+
if(!err) {
25+
fs.close(fd, (err) => {
26+
if(err) {
27+
throw console.error(err);
28+
}
29+
})
30+
} else {
31+
throw console.error(err);
32+
}
33+
})
34+
35+
console.log("HMR is active");
36+
37+
chokidar.watch(chokidarPaths, { ignored: chokidarPathsIgnore }).on('all', (event, path) => {
38+
if(event === 'change' && path !== null && path !== undefined) {
39+
console.log("File changed: " + path);
40+
41+
console.log("Rebuilding files...");
42+
43+
try {
44+
exec('npm run build').on('exit', () => {
45+
fs.readFile('.hmr_pid.txt', { encoding: 'utf-8' }, (err, data) => {
46+
if(!err) {
47+
process.kill(data);
48+
} else {
49+
throw console.error(err);
50+
}
51+
})
52+
53+
console.log("Restarting Electron process...");
54+
exec('npm run electron');
55+
});
56+
} catch(e) {
57+
throw console.error(e);
58+
}
59+
}
60+
})
61+
}
62+
chokidarDev();

electron-builder.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ directories:
55
files:
66
- '!**/.vscode/*'
77
- '!src/*'
8-
- '!electron.vite.config.{js,ts,mjs,cjs}'
98
- '!{.eslintignore,.eslintrc.js,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
109
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
1110
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}'
@@ -19,9 +18,18 @@ files:
1918
- '!**/fs-mod/src/*'
2019
- '!node_modules/*'
2120
- '!dist/*'
21+
- './out/**/*'
22+
- 'out/**/*'
23+
- 'out/index.html'
24+
- 'out/assets/*'
25+
- 'out/assets/**/*'
26+
- './out/main.js'
27+
- 'out/renderer/renderer.js'
28+
- 'out/renderer/**/*.js'
29+
- 'out/preload/preload.mjs'
30+
- 'out/preload/**/*.mjs'
2231
asarUnpack:
2332
- resources/**
24-
afterSign: build/notarize.js
2533
win:
2634
executableName: Iris
2735
nsis:
@@ -47,4 +55,4 @@ appImage:
4755
npmRebuild: false
4856
publish:
4957
provider: generic
50-
url: https://example.com/auto-updates
58+
url: https://example.com/auto-updates

electron.vite.config.ts

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

src/renderer/index.html renamed to index.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; style-src-elem data: 'self' 'unsafe-inline'; img-src https: data: 'self' local: data: 'self'; font-src data: 'self' 'unsafe-inline'">
88
</head>
99
<body>
10-
<link rel="stylesheet" href="./assets/global.css">
10+
<link rel="stylesheet" href="./src/assets/global.css">
1111

12-
<script type="module" src="./app.ts"></script>
13-
<script type="module" src="./src/renderer.ts"></script>
14-
<script async="false" type="module" src="./listener-main.ts"></script>
12+
<script type="module" src="./src/renderer/renderer.ts"></script>
1513
</body>
1614
</html>

0 commit comments

Comments
 (0)