Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ jobs:
with:
node-version: '22'
cache: npm
# runtime's Grep tool shells out to ripgrep; ubuntu runners don't ship it.
- name: Install ripgrep
run: sudo apt-get update && sudo apt-get install -y ripgrep
# runtime's Grep tool shells out to ripgrep. Install only if the runner
# image doesn't already provide it (24.04 hasn't in practice).
- name: Ensure ripgrep
run: command -v rg >/dev/null 2>&1 || { sudo apt-get update && sudo apt-get install -y ripgrep; }
- run: npm ci
- run: npm run build
# build:test skips the renderer bundle (vite); test:dist only consumes
# tsc outputs (dist/main + dist/renderer side-files), never the vite
# bundle. e2e builds its own renderer in a separate job.
- run: npm run build:test
# test:dist runs the suites against the dist just built above. The
# workspace `test` scripts each do `clean && build` first, which would
# throw away this dist and rebuild every package a second time.
Expand All @@ -53,7 +57,7 @@ jobs:
# Electron is a GUI app; on a headless Linux runner it needs a virtual
# display. The suite already runs with show:false, but the process still
# requires an X server to start.
- name: Install xvfb
run: sudo apt-get update && sudo apt-get install -y xvfb
- name: Ensure xvfb
run: command -v xvfb-run >/dev/null 2>&1 || { sudo apt-get update && sudo apt-get install -y xvfb; }
- name: E2E
run: xvfb-run -a npm --workspace @maka/desktop run e2e
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
dist
dist-renderer
storybook-static
.DS_Store
*.log
Expand Down
5 changes: 4 additions & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
"storybook": "storybook dev -p 6006 -c .storybook",
"build-storybook": "storybook build -c .storybook --output-dir storybook-static",
"build": "npm run build:main && npm run build:preload && npm run build:renderer",
"build:test": "npm run build:main && npm run build:preload",
"clean:main": "node ../../scripts/clean-paths.mjs dist/main tsconfig.main.tsbuildinfo",
"build:main": "tsc -p tsconfig.main.json",
"build:preload": "esbuild src/preload/preload.ts --bundle --platform=node --format=cjs --outfile=dist/preload/preload.cjs --external:electron",
"build:renderer": "vite build",
"typecheck": "tsc -p tsconfig.main.json --noEmit && tsc -p tsconfig.renderer.json --noEmit && tsc -p tsconfig.storybook.json --noEmit",
"typecheck:stories": "tsc -p tsconfig.storybook.json --noEmit",
"pretest": "npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/runtime run build && npm --workspace @maka/ui run build && node ../../scripts/check-console.mjs && node ../../scripts/check-a11y.mjs && node ../../scripts/check-copy.mjs",
"pretest": "npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/runtime run build && npm --workspace @maka/ui run build && npm run test:checks",
"test": "npm run clean:main && npm run build:main && node --test \"dist/main/**/*.test.js\"",
"test:checks": "node ../../scripts/check-console.mjs && node ../../scripts/check-a11y.mjs && node ../../scripts/check-copy.mjs",
"test:dist": "npm run test:checks && node --test \"dist/main/**/*.test.js\"",
"e2e": "npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/runtime run build && npm --workspace @maka/ui run build && npm run build && playwright test --config e2e/playwright.config.ts",
"screenshots": "npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/runtime run build && npm --workspace @maka/ui run build && npm run build && node ../../scripts/capture-screenshots.mjs --all",
"screenshots:single": "npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/runtime run build && npm --workspace @maka/ui run build && npm run build && node ../../scripts/capture-screenshots.mjs --scenario",
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/main/main-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export function createMainWindowController(deps: MainWindowControllerDeps): Main
if (process.env.VITE_DEV_SERVER_URL) {
await mainWindow.loadURL(process.env.VITE_DEV_SERVER_URL);
} else {
await mainWindow.loadFile(join(import.meta.dirname, '..', 'renderer', 'index.html'));
await mainWindow.loadFile(join(import.meta.dirname, '..', '..', 'dist-renderer', 'index.html'));
}
if (process.env.MAKA_REAL_WINDOW_SMOKE === '1') {
emitRealWindowSmokeDiagnostic('after-load');
Expand Down
6 changes: 5 additions & 1 deletion apps/desktop/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ export default defineConfig({
],
},
build: {
outDir: '../../dist/renderer',
// Renderer bundle lives in dist-renderer (sibling of dist), separate from
// dist/renderer. dist/renderer holds tsc side-files that build:main emits
// for helpers imported by main/__tests__; emptyOutDir:true clears only
// dist-renderer, leaving those side-files intact. See check-stale-dist.mjs.
outDir: '../../dist-renderer',
emptyOutDir: true,
},
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
"scripts": {
"typecheck": "npm run typecheck --workspaces --if-present",
"test": "npm run test:scripts && npm --workspace @maka/core test && npm --workspace @maka/storage test && npm --workspace @maka/runtime test && npm --workspace @maka/headless test && npm --workspace maka-agent test && npm --workspace @maka/ui test && npm --workspace @maka/desktop test",
"test:dist": "npm run test:scripts && npm exec -w @maka/core -- node --test \"dist/**/*.test.js\" && npm exec -w @maka/storage -- node --test \"dist/**/*.test.js\" && npm exec -w @maka/runtime -- node --test \"dist/**/*.test.js\" && npm exec -w @maka/headless -- node ../../scripts/run-headless-tests.mjs && npm exec -w maka-agent -- node --test \"dist/**/*.test.js\" && npm exec -w @maka/ui -- node --test \"dist/**/*.test.js\" && npm --workspace @maka/desktop run test",
"test:dist": "npm run test:scripts && npm exec -w @maka/core -- node --test \"dist/**/*.test.js\" && npm exec -w @maka/storage -- node --test \"dist/**/*.test.js\" && npm exec -w @maka/runtime -- node --test \"dist/**/*.test.js\" && npm exec -w @maka/headless -- node ../../scripts/run-headless-tests.mjs && npm exec -w maka-agent -- node --test \"dist/**/*.test.js\" && npm exec -w @maka/ui -- node --test \"dist/**/*.test.js\" && npm --workspace @maka/desktop run test:dist",
"test:scripts": "node --test scripts/run-headless-tests.test.mjs",
"dev": "npm --workspace @maka/desktop run dev:hmr --",
"dev:full": "npm run build && npm --workspace @maka/desktop run start",
"build": "npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/runtime run build && npm --workspace @maka/headless run build && npm --workspace maka-agent run build && npm --workspace @maka/ui run build && npm --workspace @maka/desktop run build",
"build:test": "npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/runtime run build && npm --workspace @maka/headless run build && npm --workspace maka-agent run build && npm --workspace @maka/ui run build && npm --workspace @maka/desktop run build:test",
"clean": "node scripts/clean-build.mjs",
"rebuild": "npm run clean && npm run build",
"check:stale": "node scripts/check-stale-dist.mjs",
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-stale-dist.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const pairs = [
{ pkg: '@maka/ui', src: 'packages/ui/src', dist: 'packages/ui/dist' },
{ pkg: '@maka/desktop:main', src: 'apps/desktop/src/main', dist: 'apps/desktop/dist/main' },
{ pkg: '@maka/desktop:preload', src: 'apps/desktop/src/preload', dist: 'apps/desktop/dist/preload' },
{ pkg: '@maka/desktop:renderer', src: 'apps/desktop/src/renderer', dist: 'apps/desktop/dist/renderer' },
{ pkg: '@maka/desktop:renderer', src: 'apps/desktop/src/renderer', dist: 'apps/desktop/dist-renderer' },
];

function walkMaxMtime(dir, predicate) {
Expand Down
Loading