Skip to content

Commit 037a126

Browse files
Merge branch 'dev' into ryan/1924/accelerometer-implementation
2 parents 00a15f2 + 6edaa29 commit 037a126

Some content is hidden

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

42 files changed

+1530
-306
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
.vscode/
33
build/
44
dist/
5+
out/
6+
renderer/
57
*.log
68
.DS_Store
79
*.pkg

fission/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ dist-ssr
2828
*.sw?
2929

3030
yarn.lock
31+
32+
test-results
33+
src/test/**/__screenshots__

fission/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ npm run test
7676

7777
## Packaging
7878

79+
### Web Packaging
80+
7981
We have two packaging commands: one for compiling dev for attachment to the in-development endpoint, and another for the release endpoint.
8082

8183
Release:
@@ -94,6 +96,16 @@ You can alternatively run the default build command for your own hosting:
9496
npm run build
9597
```
9698

99+
### Electron Packaging
100+
101+
We also give you the option to package Synthesis with electron. This will not give a performance boost, but it will allow Synthesis to work offline (make sure to also launch the app and download all the robot/field files you want to use).
102+
103+
To package the app run:
104+
```bash
105+
npm run electron:publish
106+
```
107+
The packaged app will be located at synthesis/fission/out.
108+
97109
## Core Systems
98110

99111
These core systems make up the bulk of the vital technologies to make Synthesis work. The idea is that these systems will serve as a

fission/biome.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.1.2/schema.json",
3-
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
2+
"$schema": "https://biomejs.dev/schemas/2.1.3/schema.json",
3+
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true, "defaultBranch": "dev" },
44
"files": { "ignoreUnknown": false },
55
"formatter": {
66
"enabled": true,
@@ -171,7 +171,7 @@
171171
"attributePosition": "auto",
172172
"bracketSpacing": true
173173
},
174-
"globals": ["COMMIT_HASH"]
174+
"globals": ["COMMIT_HASH", "MAIN_WINDOW_VITE_DEV_SERVER_URL", "MAIN_WINDOW_VITE_NAME"]
175175
},
176176
"html": { "formatter": { "selfCloseVoidElements": "always" } },
177177
"overrides": [

fission/bun.lock

Lines changed: 906 additions & 170 deletions
Large diffs are not rendered by default.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { defineConfig } from "vite"
2+
3+
// https://vitejs.dev/config
4+
export default defineConfig({
5+
build: {
6+
lib: {
7+
entry: "src/main.ts",
8+
formats: ["cjs"],
9+
fileName: () => "main.cjs",
10+
},
11+
rollupOptions: {
12+
external: ["electron"],
13+
},
14+
},
15+
resolve: {
16+
// Some libs that can run in both Web and Node.js, we need to tell Vite to build them in Node.js.
17+
conditions: ["node"],
18+
mainFields: ["module", "jsnext:main", "jsnext"],
19+
},
20+
})
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { defineConfig } from "vite"
2+
3+
// https://vitejs.dev/config
4+
export default defineConfig({
5+
build: {
6+
lib: {
7+
entry: "src/preload.ts",
8+
formats: ["cjs"],
9+
fileName: () => "preload.cjs",
10+
},
11+
rollupOptions: {
12+
external: ["electron"],
13+
},
14+
},
15+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig, mergeConfig } from "vite"
2+
import baseConfig from "../vite.config"
3+
4+
// https://vitejs.dev/config
5+
export default defineConfig((env) => mergeConfig(baseConfig(env), {}))

fission/forge.config.ts

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import type { ForgeConfig } from "@electron-forge/shared-types"
2+
import { MakerSquirrel } from "@electron-forge/maker-squirrel"
3+
import { MakerZIP } from "@electron-forge/maker-zip"
4+
import { VitePlugin } from "@electron-forge/plugin-vite"
5+
import { FusesPlugin } from "@electron-forge/plugin-fuses"
6+
import { FuseV1Options, FuseVersion } from "@electron/fuses"
7+
import path from "path"
8+
9+
const config: ForgeConfig = {
10+
packagerConfig: {
11+
asar: true,
12+
name: "Synthesis",
13+
executableName: "Synthesis",
14+
icon: path.resolve(__dirname, "src/assets/icons/synthesis-logo"),
15+
},
16+
rebuildConfig: {},
17+
makers: [
18+
new MakerSquirrel({
19+
setupIcon: path.resolve(__dirname, "src/assets/icons/synthesis-logo.ico"),
20+
}),
21+
new MakerZIP({}, ["darwin", "linux"]),
22+
],
23+
plugins: [
24+
new VitePlugin({
25+
build: [
26+
{
27+
entry: "src/main.ts",
28+
config: "electron/vite.main.config.ts",
29+
target: "main",
30+
},
31+
{
32+
entry: "src/preload.ts",
33+
config: "electron/vite.preload.config.ts",
34+
target: "preload",
35+
},
36+
],
37+
renderer: [
38+
{
39+
name: "main_window",
40+
config: "electron/vite.renderer.config.ts",
41+
},
42+
],
43+
}),
44+
// Fuses are used to enable/disable various Electron functionality
45+
// at package time, before code signing the application
46+
new FusesPlugin({
47+
version: FuseVersion.V1,
48+
[FuseV1Options.RunAsNode]: false,
49+
[FuseV1Options.EnableCookieEncryption]: true,
50+
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
51+
[FuseV1Options.EnableNodeCliInspectArguments]: false,
52+
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
53+
[FuseV1Options.OnlyLoadAppFromAsar]: true,
54+
}),
55+
],
56+
}
57+
58+
export default config

fission/package.json

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
{
22
"name": "synthesis-fission",
33
"private": false,
4-
"version": "0.0.1",
4+
"version": "7.1.0",
55
"type": "module",
6+
"main": ".vite/build/main.cjs",
7+
"author": "Autodesk",
8+
"description": "Synthesis",
69
"scripts": {
710
"init": "(bun run assetpack && bun run playwright:install) || (npm run assetpack && npm run playwright:install)",
811
"host": "vite --open --host",
912
"dev": "vite --open",
13+
"test": "vitest",
1014
"build": "tsc && vite build",
1115
"build:prod": "tsc && vite build --base=/fission/ --outDir dist/prod",
1216
"build:dev": "tsc && vite build --base=/fission-closed/ --outDir dist/dev",
1317
"preview": "vite preview --base=/fission/",
14-
"test": "vitest",
1518
"lint": "bunx --bun biome lint",
1619
"lint:fix": "bunx --bun biome lint --fix",
1720
"fmt": "bunx --bun biome format src",
1821
"fmt:fix": "bunx --bun biome format src --write",
1922
"style": "bun run fmt && bun run lint",
2023
"style:fix": "bun run fmt:fix && bun run lint:fix",
2124
"assetpack": "git lfs pull && tar -xf public/assetpack.zip -C public/",
22-
"playwright:install": "bun x playwright install"
25+
"playwright:install": "bun x playwright install",
26+
"electron:start": "electron-forge start",
27+
"electron:package": "electron-forge package",
28+
"electron:make": "electron-forge make",
29+
"electron:publish": "electron-forge publish"
2330
},
2431
"dependencies": {
2532
"@azaleacolburn/jolt-physics": "^0.31.2",
@@ -35,8 +42,10 @@
3542
"@xyflow/react": "^12.8.2",
3643
"async-mutex": "^0.5.0",
3744
"colord": "^2.9.3",
45+
"electron-squirrel-startup": "^1.0.1",
3846
"framer-motion": "^10.18.0",
3947
"lygia": "^1.3.3",
48+
"msw": "^2.10.4",
4049
"notistack": "^3.0.2",
4150
"playwright": "^1.54.2",
4251
"postprocessing": "^6.37.6",
@@ -51,6 +60,15 @@
5160
"vitest-browser-react": "^1.0.1"
5261
},
5362
"devDependencies": {
63+
"@electron-forge/cli": "^7.8.1",
64+
"@electron-forge/maker-deb": "^7.8.1",
65+
"@electron-forge/maker-rpm": "^7.8.1",
66+
"@electron-forge/maker-squirrel": "^7.8.1",
67+
"@electron-forge/maker-zip": "^7.8.1",
68+
"@electron-forge/plugin-auto-unpack-natives": "^7.8.1",
69+
"@electron-forge/plugin-fuses": "^7.8.1",
70+
"@electron-forge/plugin-vite": "^7.8.1",
71+
"@electron/fuses": "^1.8.0",
5472
"@emotion/react": "^11.14.0",
5573
"@emotion/styled": "^11.14.1",
5674
"@mui/material": "^5.18.0",
@@ -69,6 +87,7 @@
6987
"@vitejs/plugin-react-swc": "^3.11.0",
7088
"autoprefixer": "^10.4.21",
7189
"cssnano": "^6.1.2",
90+
"electron": "^37.2.4",
7291
"eslint-config-prettier": "^8.10.2",
7392
"eslint-import-resolver-alias": "^1.1.2",
7493
"eslint-plugin-import": "^2.32.0",

0 commit comments

Comments
 (0)