Skip to content

Commit

Permalink
fix: make puppeteer external in web-integration (#208)
Browse files Browse the repository at this point in the history
* fix: make puppeteer external in web-integration

* fix: import path of yaml player

* fix: import path of yaml player
  • Loading branch information
yuyutaotao authored Dec 25, 2024
1 parent 05dad23 commit cd00680
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
ScriptPlayerStatusValue,
ScriptPlayerTaskStatus,
} from '@midscene/core';
import { type ScriptPlayer, flowItemBrief } from '@midscene/web';
import { type ScriptPlayer, flowItemBrief } from '@midscene/web/yaml';
import chalk from 'chalk';

export interface MidsceneYamlFileContext {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/yaml-runner.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { readFileSync } from 'node:fs';
import { basename, extname } from 'node:path';
import { ScriptPlayer, parseYamlScript } from '@midscene/web';
import { ScriptPlayer, parseYamlScript } from '@midscene/web/yaml';
import { createServer } from 'http-server';
import {
type MidsceneYamlFileContext,
Expand Down
2 changes: 1 addition & 1 deletion packages/web-integration/modern.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export default defineConfig({
yaml: 'src/yaml/index.ts',
},
target: 'es2018',
externals: ['@midscene/core', '@midscene/shared'],
externals: ['@midscene/core', '@midscene/shared', 'puppeteer'],
},
});
2 changes: 1 addition & 1 deletion packages/web-integration/src/puppeteer/agent-launcher.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import assert from 'node:assert';
import { readFileSync } from 'node:fs';
import puppeteer from 'puppeteer';

import { PuppeteerAgent } from '@/puppeteer';
import type { MidsceneYamlScriptEnv } from '@midscene/core';
Expand Down Expand Up @@ -72,6 +71,7 @@ export async function puppeteerAgentForTarget(
'you are probably running headed mode in CI, this will usually fail.',
);
}
const puppeteer = await import('puppeteer');
const browser = await puppeteer.launch({
headless: !headed,
args: [
Expand Down

0 comments on commit cd00680

Please sign in to comment.