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
1 change: 1 addition & 0 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"build": "yarn build:vite && yarn test:build",
"build:dev": "yarn build:vite --mode development",
"build:watch": "yarn build:dev --watch",
"build:browser": "OPEN_BROWSER=true yarn build:dev --watch",
"build:vite": "vite build --configLoader runner --config vite.config.ts",
"changelog:validate": "../../scripts/validate-changelog.sh @ocap/extension",
"clean": "rimraf --glob './*.tsbuildinfo' ./.eslintcache ./coverage ./dist ./.turbo",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ function cleanup() {
# Ensure we always close the ocap cli
trap cleanup EXIT

yarn build:watch
yarn build:browser
5 changes: 3 additions & 2 deletions packages/extension/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const staticCopyTargets: readonly (string | Target)[] = [
export default defineConfig(({ mode }) => {
const isDev = mode === 'development';
const isWatching = process.argv.includes('--watch');
const shouldOpenBrowser = process.env.OPEN_BROWSER === 'true';
if (isWatching && !isDev) {
throw new Error('Cannot watch in non-development mode');
}
Expand Down Expand Up @@ -111,8 +112,8 @@ export default defineConfig(({ mode }) => {
}),
moveHtmlFilesToRoot(),
watchInternalPackages({ rootDir, packages: ['kernel-ui'] }),
// Open the extension in the browser when watching
isWatching && extensionDev({ extensionPath: outDir }),
// Open the extension in the browser when --browser flag is passed
shouldOpenBrowser && extensionDev({ extensionPath: outDir }),
],
};
});
1 change: 1 addition & 0 deletions packages/omnium-gatherum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"build": "yarn build:vite && yarn test:build",
"build:dev": "yarn build:vite --mode development",
"build:watch": "yarn build:dev --watch",
"build:browser": "OPEN_BROWSER=true yarn build:dev --watch",
"build:vite": "vite build --configLoader runner --config vite.config.ts",
"changelog:validate": "../../scripts/validate-changelog.sh @ocap/omnium-gatherum",
"clean": "rimraf --glob './*.tsbuildinfo' ./.eslintcache ./coverage ./dist ./.turbo",
Expand Down
2 changes: 1 addition & 1 deletion packages/omnium-gatherum/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ function cleanup() {
# Ensure we always close the ocap cli
trap cleanup EXIT

yarn build:watch
yarn build:browser
5 changes: 3 additions & 2 deletions packages/omnium-gatherum/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const trustedPreludes: PreludeRecord = {
export default defineConfig(({ mode }) => {
const isDev = mode === 'development';
const isWatching = process.argv.includes('--watch');
const shouldOpenBrowser = process.env.OPEN_BROWSER === 'true';
if (isWatching && !isDev) {
throw new Error('Cannot watch in non-development mode');
}
Expand Down Expand Up @@ -121,8 +122,8 @@ export default defineConfig(({ mode }) => {
}),
moveHtmlFilesToRoot(),
watchInternalPackages({ rootDir, packages: ['kernel-ui'] }),
// Open the extension in the browser when watching
isWatching && extensionDev({ extensionPath: outDir }),
// Open the extension in the browser when --browser flag is passed
shouldOpenBrowser && extensionDev({ extensionPath: outDir }),
],
};
});
2 changes: 1 addition & 1 deletion packages/repo-tools/src/vite-plugins/extension-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export function extensionDev({
args: [
`--disable-extensions-except=${extensionPath}`,
`--load-extension=${extensionPath}`,
'--start-maximized',
],
});

Expand Down Expand Up @@ -89,7 +90,6 @@ export function extensionDev({

// Open the extensions page for our extension
const extensionsPage = await browserContext.newPage();
await extensionsPage.setViewportSize({ width: 1300, height: 700 });
await extensionsPage.goto(`chrome://extensions/?id=${extensionId}`);

// Update state after all checks
Expand Down
Loading