Skip to content

Commit

Permalink
replace parcel with vite (electron to start)
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-polinsky committed Dec 11, 2024
1 parent a9a3894 commit 21f5ea9
Show file tree
Hide file tree
Showing 4 changed files with 630 additions and 123 deletions.
10 changes: 4 additions & 6 deletions packages/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"test": "mocha \"./lib/cjs/test/**/*.test.js\"",
"test:integration": "pnpm test:integration:build && pnpm exec playwright test",
"test:integration:start": "pnpm test:integration:build && electron dist/integration-test/test-app/index.js",
"test:integration:build": "pnpm test:integration:parcel && tsc -p ./src/integration-test/",
"test:integration:parcel": "parcel build src/integration-test/test-app/index.html --dist-dir dist/integration-test/test-app --public-url ./",
"test:integration:build": "pnpm test:integration:vite && tsc -p ./src/integration-test/",
"test:integration:vite": "vite build --config vite.config.mts",
"pack": "npm pack",
"rebuild": "npm run clean && npm run build"
},
Expand Down Expand Up @@ -66,13 +66,11 @@
"eslint": "^8.56.0",
"mocha": "^10.2.0",
"nyc": "^17.0.0",
"parcel": "~2.12.0",
"path-browserify": "~1.0.1",
"process": "~0.11.10",
"rimraf": "^3.0.2",
"sinon": "^15.0.1",
"source-map-support": "^0.5.9",
"typescript": "~5.3.3"
"typescript": "~5.3.3",
"vite": "^6.0.3"
},
"peerDependencies": {
"@itwin/core-bentley": "^3.3.0 || ^4.0.0",
Expand Down
34 changes: 17 additions & 17 deletions packages/electron/src/integration-test/test-app/index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'"
/>
<title>Hello World!</title>
<script type="module" src="./renderer.ts"></script>
</head>
<body>
<button data-testid="signIn" id="signIn">Sign In</button>
<button data-testid="signOut" id="signOut">Sign Out</button>
<button data-testid="getStatus" id="getStatus">Get Sign-in Status</button>
<h2 data-testid="status" id="status"></h2>
</body>
</html>

<head>
<meta charset="UTF-8" />
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'" />
<title>Hello World!</title>
<script type="module" src="./renderer.ts"></script>
</head>

<body>
<button data-testid="signIn" id="signIn">Sign In</button>
<button data-testid="signOut" id="signOut">Sign Out</button>
<button data-testid="getStatus" id="getStatus">Get Sign-in Status</button>
<h2 data-testid="status" id="status"></h2>
</body>

</html>
10 changes: 10 additions & 0 deletions packages/electron/vite.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

import { defineConfig } from 'vite';

export default defineConfig({
root: './src/integration-test/test-app',
build: {
outDir: './dist/integration-test/test-app',
emptyOutDir: true,
},
});
Loading

0 comments on commit 21f5ea9

Please sign in to comment.