@fugood/bricks-project 2.22.0-beta.1 → 2.22.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.22.0-beta.1",
3
+ "version": "2.22.0-beta.2",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "build": "node scripts/build.js"
@@ -13,5 +13,5 @@
13
13
  "lodash": "^4.17.4",
14
14
  "uuid": "^8.3.1"
15
15
  },
16
- "gitHead": "c55f6effe15a6c481e6fc1147f8bff0c747169ef"
16
+ "gitHead": "a230efafdd33bc1dd02ed6397cf5741b318e172f"
17
17
  }
@@ -45,7 +45,9 @@ const previewUrl = previewUrlMap[stage]
45
45
  if (!previewUrl) throw new Error(`Invalid BRICKS_STAGE: ${stage}`)
46
46
 
47
47
  app.on('ready', () => {
48
- const mainWindow = new BrowserWindow({ width: 1280, height: 768 })
48
+ let show = true
49
+ if (takeScreenshotConfig?.headless) show = false
50
+ const mainWindow = new BrowserWindow({ width: 1280, height: 768, show })
49
51
  mainWindow.setBackgroundColor('#333')
50
52
  mainWindow.loadURL(previewUrl)
51
53
 
package/tools/preview.ts CHANGED
@@ -8,11 +8,13 @@ const { values } = parseArgs({
8
8
  options: {
9
9
  'skip-typecheck': { type: 'boolean' },
10
10
  'clear-cache': { type: 'boolean' },
11
+ 'screenshot': { type: 'boolean' },
11
12
  'screenshot-delay': { type: 'string' },
12
13
  'screenshot-width': { type: 'string' },
13
14
  'screenshot-height': { type: 'string' },
14
15
  'screenshot-path': { type: 'string' },
15
16
  'screenshot-close-after': { type: 'boolean' },
17
+ 'screenshot-headless': { type: 'boolean' },
16
18
  },
17
19
  strict: true,
18
20
  allowPositionals: true,
@@ -41,15 +43,16 @@ const app = await Bun.file(`${cwd}/application.json`).json()
41
43
  let args: string[] = []
42
44
  if (values['clear-cache']) args.push('--clear-cache')
43
45
 
44
- if (values['screenshot-delay'] || values['screenshot-close-after']) {
46
+ if (values['screenshot']) {
45
47
  args.push(`--take-screenshot`)
46
48
  args.push(
47
49
  JSON.stringify({
48
- delay: Number(values['take-screenshot-delay']) || 1000,
50
+ delay: Number(values['screenshot-delay']) || 1000,
49
51
  width: Number(values['screenshot-width']) || 1920,
50
52
  height: Number(values['screenshot-height']) || 1080,
51
53
  path: values['screenshot-path'] || `${cwd}/screenshot.png`,
52
- closeAfter: values['take-screenshot-close-after'] ?? true,
54
+ closeAfter: values['screenshot-close-after'] ?? true,
55
+ headless: values['screenshot-headless'] ?? true,
53
56
  }),
54
57
  )
55
58
  }
@@ -221,10 +221,6 @@ export const templateEventPropsMap = {
221
221
  'BRICK_GENERATIVE_MEDIA_ERROR', // type: string
222
222
  ],
223
223
  },
224
- BRICK_CHART_LINE: {},
225
- BRICK_CHART_BAR: {},
226
- BRICK_CHART_PIE: {},
227
- BRICK_CHART_PROGRESS: {},
228
224
  GENERATOR_TICK: {
229
225
  ticking: [
230
226
  'GENERATOR_TICK_COUNTDOWN', // type: number
@@ -332,7 +328,6 @@ export const templateEventPropsMap = {
332
328
  'GENERATOR_FILE_LIST_PATHS', // type: array
333
329
  ],
334
330
  },
335
- GENERATOR_URL_FILE_SYNC: {},
336
331
  GENERATOR_MEDIA_FLOW: {
337
332
  fetchError: [
338
333
  'GENERATOR_MEDIA_FLOW_ERROR', // type: string
@@ -548,11 +543,6 @@ export const templateEventPropsMap = {
548
543
  'GENERATOR_WEBRTC_TEXT_MESSAGE', // type: string
549
544
  ],
550
545
  },
551
- GENERATOR_TENSORFLOW_INFERENCE: {
552
- onError: [
553
- 'GENERATOR_TENSORFLOW_INFERENCE_ERROR_MESSAGE', // type: string
554
- ],
555
- },
556
546
  GENERATOR_WEB_CRAWLER: {},
557
547
  GENERATOR_SOUND_RECORDER: {
558
548
  chunk: [
@@ -563,11 +553,6 @@ export const templateEventPropsMap = {
563
553
  ],
564
554
  },
565
555
  GENERATOR_BLE_PERIPHERAL: {},
566
- GENERATOR_PROMPT: {
567
- onError: [
568
- 'GENERATOR_PROMPT_ERROR_MESSAGE', // type: string
569
- ],
570
- },
571
556
  GENERATOR_QUESTION: {
572
557
  onError: [
573
558
  'GENERATOR_QUESTION_ERROR_MESSAGE', // type: string