rebuildjs 0.55.2 → 0.56.0

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": "rebuildjs",
3
- "version": "0.55.2",
3
+ "version": "0.56.0",
4
4
  "description": "Reactive esbuild...simple hackable alternative to vite for Multi Page Apps",
5
5
  "keywords": [
6
6
  "reactive",
@@ -1,4 +1,4 @@
1
- import type { ctx__be_T, ctx__get_T, ctx__set_T, nullish, rmemo__wait_ret_T, sig_T } from 'ctx-core/rmemo'
1
+ import type { ctx__be_T, ctx__get_T, ctx__set_T, nullish, rmemo__wait_ret_T, rmemo_T, sig_T } from 'ctx-core/rmemo'
2
2
  import type { BuildContext, BuildOptions, Plugin } from 'esbuild'
3
3
  import type { has_app_T } from '../ctx/index.js'
4
4
  import type { rebuildjs_metafile_T } from '../metafile_l0/index.js'
@@ -10,18 +10,21 @@ export declare const persist__metafile__build_id_:ctx__get_T<string|undefined, '
10
10
  export declare const persist__metafile__ready$_:ctx__be_T<sig_T<boolean>, 'app'>
11
11
  export declare const persist__metafile__ready_:ctx__get_T<boolean, 'app'>
12
12
  export declare function build_id__refresh():string
13
+ export declare const rebuildjs__esbuild__build_id$_:ctx__be_T<sig_T<string>, 'app'>
14
+ export declare const rebuildjs__esbuild__build_id_:ctx__get_T<string, 'app'>
15
+ export declare const rebuildjs__esbuild__build_id__set:ctx__set_T<string, 'app'>
16
+ export declare const rebuildjs__esbuild__done$_:ctx__be_T<sig_T<boolean>, 'app'>
17
+ export declare const rebuildjs__esbuild__done_:ctx__get_T<boolean, 'app'>
18
+ export declare function rebuildjs__esbuild__done__wait(timeout?:number):rmemo__wait_ret_T<unknown>
19
+ export declare const rebuildjs__ready__add__ready$__a1$_:ctx__be_T<sig_T<rebuildjs__ready__add__ready$__T[]>, 'app'>
20
+ export declare const rebuildjs__ready__add__ready$__a1_:ctx__get_T<rebuildjs__ready__add__ready$__T[], 'app'>
21
+ export declare const rebuildjs__ready__add__ready$__a1__set:ctx__set_T<rebuildjs__ready__add__ready$__T[], 'app'>
13
22
  export declare const rebuildjs__build_id$_:ctx__be_T<sig_T<string>, 'app'>
14
23
  export declare const rebuildjs__build_id_:ctx__get_T<string, 'app'>
15
24
  export declare const rebuildjs__build_id__set:ctx__set_T<string, 'app'>
16
- export declare const rebuildjs_core__ready$_:ctx__be_T<sig_T<boolean>, 'app'>
17
- export declare const rebuildjs_core__ready_:ctx__get_T<boolean, 'app'>
18
- export declare function rebuildjs_core__ready__wait(timeout?:number):rmemo__wait_ret_T<unknown>
19
- export declare const rebuildjs__ready__add__ready__a1$_:ctx__be_T<sig_T<rebuildjs__ready__add__ready__T[]>, 'app'>
20
- export declare const rebuildjs__ready__add__ready__a1_:ctx__get_T<rebuildjs__ready__add__ready__T[], 'app'>
21
- export declare const rebuildjs__ready__add__ready__a1__set:ctx__set_T<rebuildjs__ready__add__ready__T[], 'app'>
22
25
  export declare const rebuildjs__ready$_:ctx__be_T<sig_T<boolean>, 'app'>
23
26
  export declare const rebuildjs__ready_:ctx__get_T<boolean, 'app'>
24
- export declare function rebuildjs__ready__add(ready_:rebuildjs__ready__add__ready__T):rebuildjs__ready__add__ready__T[]
27
+ export declare function rebuildjs__ready__add(ready$_:rebuildjs__ready__add__ready$__T):rebuildjs__ready__add__ready$__T[]
25
28
  export declare function rebuildjs__ready__wait(timeout?:number):rmemo__wait_ret_T<unknown>
26
29
  export declare function rebuildjs_browser__build(config?:rebuildjs_build_config_T):Promise<BuildContext>
27
30
  export declare function rebuildjs_server__build(config?:rebuildjs_build_config_T):Promise<BuildContext>
@@ -41,4 +44,4 @@ export type rebuildjs_build_config_T =
41
44
  export type rebuildjs_plugin_config_T = {
42
45
  watch?:boolean
43
46
  }
44
- export type rebuildjs__ready__add__ready__T = (ctx:has_app_T)=>boolean
47
+ export type rebuildjs__ready__add__ready$__T = ctx__be_T<rmemo_T<boolean>, 'app'>
@@ -1,6 +1,6 @@
1
1
  /// <reference types="../metafile_l0/index.d.ts" />
2
- import { file_exists_, file_exists__waitfor } from 'ctx-core/fs'
3
2
  /// <reference types="./index.d.ts" />
3
+ import { file_exists_, file_exists__waitfor } from 'ctx-core/fs'
4
4
  import {
5
5
  be,
6
6
  be_memo_pair_,
@@ -51,9 +51,9 @@ export const [
51
51
  build_id$_,
52
52
  build_id_,
53
53
  build_id__set,
54
- ] = be_sig_triple_(()=>
55
- undefined,
56
- { id: 'build_id', ns: 'app' })
54
+ ] = be_sig_triple_(
55
+ ()=>undefined,
56
+ { id: 'build_id', ns: 'app' })
57
57
  export function build_id__refresh() {
58
58
  const build_id = Date.now() + '-' + short_uuid_()
59
59
  build_id__set(app_ctx, build_id)
@@ -121,52 +121,59 @@ export const [
121
121
  !!(build_id && build_id === persist__metafile__build_id)),
122
122
  { id: 'persist__metafile__ready', ns: 'app' })
123
123
  export const [
124
- rebuildjs__build_id$_,
125
- rebuildjs__build_id_,
126
- rebuildjs__build_id__set,
124
+ rebuildjs__esbuild__build_id$_,
125
+ rebuildjs__esbuild__build_id_,
126
+ rebuildjs__esbuild__build_id__set,
127
127
  ] = be_sig_triple_(()=>undefined,
128
- { id: 'rebuildjs_plugin__build_id', ns: 'app' })
128
+ { id: 'rebuildjs__esbuild__build_id', ns: 'app' })
129
129
  export const [
130
- rebuildjs_core__ready$_,
131
- rebuildjs_core__ready_,
130
+ rebuildjs__esbuild__done$_,
131
+ rebuildjs__esbuild__done_,
132
132
  ] = be_memo_pair_(ctx=>
133
133
  !!(
134
134
  build_id_(ctx)
135
135
  && build_id_(ctx) === metafile__build_id_(ctx)
136
- && build_id_(ctx) === rebuildjs__build_id_(ctx)),
137
- { id: 'rebuildjs_core__ready', ns: 'app' })
136
+ && build_id_(ctx) === rebuildjs__esbuild__build_id_(ctx)),
137
+ { id: 'rebuildjs__esbuild__done', ns: 'app' })
138
138
  /**
139
139
  * @param {number}[timeout]
140
140
  * @returns {Promise<void>}}
141
141
  */
142
- export function rebuildjs_core__ready__wait(timeout) {
142
+ export function rebuildjs__esbuild__done__wait(timeout) {
143
143
  return rmemo__wait(
144
- rebuildjs_core__ready$_(app_ctx),
144
+ rebuildjs__esbuild__done$_(app_ctx),
145
145
  ready=>ready,
146
146
  timeout ?? 5000)
147
147
  }
148
148
  export const [
149
- rebuildjs__ready__add__ready__a1$_,
150
- rebuildjs__ready__add__ready__a1_,
151
- rebuildjs__ready__add__ready__a1__set,
149
+ rebuildjs__ready__add__ready$__a1$_,
150
+ rebuildjs__ready__add__ready$__a1_,
151
+ rebuildjs__ready__add__ready$__a1__set,
152
152
  ] = be_sig_triple_(
153
153
  ()=>[],
154
- { id: 'Uc', ns: 'app' })
155
- export function rebuildjs__ready__add(ready_) {
156
- let rebuildjs__ready__add_a1 = rebuildjs__ready__add__ready__a1_(app_ctx)
157
- if (!rebuildjs__ready__add_a1.includes(ready_)) {
158
- rebuildjs__ready__add_a1 = [...rebuildjs__ready__add_a1, ready_]
159
- rebuildjs__ready__add__ready__a1__set(app_ctx, rebuildjs__ready__add_a1)
154
+ { id: 'rebuildjs__ready__add__ready__a1', ns: 'app' })
155
+ export function rebuildjs__ready__add(ready$_) {
156
+ let rebuildjs__ready__add_a1 = rebuildjs__ready__add__ready$__a1_(app_ctx)
157
+ if (!rebuildjs__ready__add_a1.includes(ready$_)) {
158
+ rebuildjs__ready__add_a1 = [...rebuildjs__ready__add_a1, ready$_]
159
+ rebuildjs__ready__add__ready$__a1__set(app_ctx, rebuildjs__ready__add_a1)
160
160
  }
161
161
  return rebuildjs__ready__add_a1
162
162
  }
163
+ export const [
164
+ rebuildjs__build_id$_,
165
+ rebuildjs__build_id_,
166
+ rebuildjs__build_id__set,
167
+ ] = be_sig_triple_(()=>undefined,
168
+ { id: 'rebuildjs__build_id', ns: 'app' })
163
169
  export const [
164
170
  rebuildjs__ready$_,
165
171
  rebuildjs__ready_,
166
172
  ] = be_memo_pair_(ctx=>
167
173
  !!(
168
- rebuildjs_core__ready_(ctx)
169
- && rebuildjs__ready__add__ready__a1_(ctx).every(ready_=>ready_(ctx))),
174
+ rebuildjs__esbuild__done_(ctx)
175
+ && rebuildjs__build_id_(ctx) === build_id_(ctx)
176
+ && rebuildjs__ready__add__ready$__a1_(ctx).every(ready$_=>ready$_(ctx)())),
170
177
  { id: 'rebuildjs__ready', ns: 'app' })
171
178
  /**
172
179
  * @param {number}[timeout]
@@ -361,6 +368,7 @@ export function rebuildjs_plugin_() {
361
368
  }
362
369
  }
363
370
  }
371
+ rebuildjs__esbuild__build_id__set(app_ctx, build_id_(app_ctx))
364
372
  })
365
373
  }
366
374
  // Prevent GC
@@ -400,12 +408,18 @@ export function rebuildjs_plugin_() {
400
408
  run(async ()=>{
401
409
  try {
402
410
  await esbuild_cssBundle__cp()
411
+ await Promise.all(
412
+ rebuildjs__ready__add__ready$__a1_(ctx).map(ready$_=>
413
+ cmd(rmemo__wait(
414
+ ready$_(ctx),
415
+ ready=>ready,
416
+ 5_000))))
403
417
  await rebuildjs__assets__link()
418
+ rebuildjs__build_id__set(ctx, build_id)
404
419
  } catch (err) {
405
420
  if (err instanceof Cancel) return
406
421
  throw err
407
422
  }
408
- rebuildjs__build_id__set(ctx, build_id)
409
423
  })
410
424
  }
411
425
  async function esbuild_cssBundle__cp() {
@@ -418,7 +432,9 @@ export function rebuildjs_plugin_() {
418
432
  ({ cssBundle, esbuild_cssBundle } = metafile.outputs[output__relative_path])
419
433
  if (cssBundle && esbuild_cssBundle) {
420
434
  const cssBundle_path = join(cwd_(ctx), cssBundle)
435
+ const cssBundle_map_path = cssBundle_path + '.map'
421
436
  const esbuild_cssBundle_path = join(cwd_(ctx), esbuild_cssBundle)
437
+ const esbuild_cssBundle_map_path = esbuild_cssBundle_path + '.map'
422
438
  if (!await file_exists_(esbuild_cssBundle_path)) {
423
439
  await file_exists__waitfor(async ()=>{
424
440
  await cmd(
@@ -426,12 +442,12 @@ export function rebuildjs_plugin_() {
426
442
  return true
427
443
  })
428
444
  }
429
- if (!await file_exists_(esbuild_cssBundle_path + '.map')) {
445
+ if (!await file_exists_(esbuild_cssBundle_map_path)) {
430
446
  await file_exists__waitfor(async ()=>{
431
447
  await cmd(
432
448
  cp(
433
- cssBundle_path + '.map',
434
- esbuild_cssBundle_path + '.map'))
449
+ cssBundle_map_path,
450
+ esbuild_cssBundle_map_path))
435
451
  return true
436
452
  })
437
453
  }
@@ -447,9 +463,9 @@ export function rebuildjs_plugin_() {
447
463
  const _basename = basename(output__relative_path)
448
464
  if (
449
465
  _basename.endsWith('.js')
450
- || _basename.endsWith('.mjs')
451
- || _basename.endsWith('.js.map')
452
- || _basename.endsWith('.mjs.map')
466
+ || _basename.endsWith('.mjs')
467
+ || _basename.endsWith('.js.map')
468
+ || _basename.endsWith('.mjs.map')
453
469
  ) continue
454
470
  const server_asset_path = join(cwd, output__relative_path)
455
471
  const browser_asset_path = join(
@@ -1,8 +1,8 @@
1
- import { ctx_ } from 'ctx-core/be'
1
+ import { be_, ctx_ } from 'ctx-core/be'
2
2
  import { file_exists_ } from 'ctx-core/fs'
3
3
  import { sleep } from 'ctx-core/function'
4
- import { ns_be_sig_triple_ } from 'ctx-core/rmemo'
5
- import { BuildContext } from 'esbuild'
4
+ import { memo_, type memo_T, ns_be_sig_triple_ } from 'ctx-core/rmemo'
5
+ import { type BuildContext } from 'esbuild'
6
6
  import { readFile, rm } from 'node:fs/promises'
7
7
  import { basename, dirname, join } from 'node:path'
8
8
  import { test } from 'uvu'
@@ -14,7 +14,7 @@ import {
14
14
  server__metafile1
15
15
  } from '../../_fixtures/metafiles.js'
16
16
  import { cwd_, cwd__set } from '../app/index.js'
17
- import { app_ctx, has_app_T } from '../ctx/index.js'
17
+ import { app_ctx } from '../ctx/index.js'
18
18
  import { browser__metafile_, browser__metafile__set } from '../rebuildjs_browser/index.js'
19
19
  import { server__metafile_, server__metafile__set } from '../rebuildjs_server/index.js'
20
20
  import {
@@ -22,20 +22,20 @@ import {
22
22
  build_id_,
23
23
  build_id__refresh,
24
24
  build_id__set,
25
- rebuildjs__build_id$_,
26
- rebuildjs__build_id_,
27
25
  rebuildjs__build_id__set,
26
+ rebuildjs__esbuild__build_id$_,
27
+ rebuildjs__esbuild__build_id_,
28
+ rebuildjs__esbuild__build_id__set,
29
+ rebuildjs__esbuild__done$_,
30
+ rebuildjs__esbuild__done_,
28
31
  rebuildjs__ready$_,
29
32
  rebuildjs__ready_,
30
33
  rebuildjs__ready__add,
31
- rebuildjs__ready__add__ready__a1$_,
32
- rebuildjs__ready__add__ready__a1_,
33
- rebuildjs__ready__add__ready__a1__set,
34
+ rebuildjs__ready__add__ready$__a1$_,
35
+ rebuildjs__ready__add__ready$__a1_,
36
+ rebuildjs__ready__add__ready$__a1__set,
34
37
  rebuildjs__ready__wait,
35
38
  rebuildjs_browser__build,
36
- rebuildjs_core__ready$_,
37
- rebuildjs_core__ready_,
38
- rebuildjs_core__ready__wait,
39
39
  rebuildjs_server__build
40
40
  } from './index.js'
41
41
  test.after.each(()=>{
@@ -64,64 +64,69 @@ test('build_id__refresh', ()=>{
64
64
  true)
65
65
  })
66
66
  test('rebuildjs__build_id', ()=>{
67
- equal(rebuildjs__build_id$_(app_ctx)(), undefined)
68
- equal(rebuildjs__build_id_(app_ctx), undefined)
67
+ equal(rebuildjs__esbuild__build_id$_(app_ctx)(), undefined)
68
+ equal(rebuildjs__esbuild__build_id_(app_ctx), undefined)
69
69
  build_id__refresh()
70
70
  equal(typeof build_id_(app_ctx), 'string')
71
- rebuildjs__build_id__set(app_ctx, build_id_(app_ctx)!)
72
- equal(rebuildjs__build_id$_(app_ctx)(), build_id_(app_ctx)!)
73
- equal(rebuildjs__build_id_(app_ctx), build_id_(app_ctx)!)
71
+ rebuildjs__esbuild__build_id__set(app_ctx, build_id_(app_ctx)!)
72
+ equal(rebuildjs__esbuild__build_id$_(app_ctx)(), build_id_(app_ctx)!)
73
+ equal(rebuildjs__esbuild__build_id_(app_ctx), build_id_(app_ctx)!)
74
74
  // @ts-expect-error TS2345
75
- throws(()=>rebuildjs__build_id$_(ctx_()))
75
+ throws(()=>rebuildjs__esbuild__build_id$_(ctx_()))
76
76
  // @ts-expect-error TS2345
77
- throws(()=>rebuildjs__build_id_(ctx_()))
77
+ throws(()=>rebuildjs__esbuild__build_id_(ctx_()))
78
78
  })
79
79
  test('rebuildjs_core__ready', async ()=>{
80
- equal(rebuildjs_core__ready$_(app_ctx)(), false)
81
- equal(rebuildjs_core__ready_(app_ctx), false)
80
+ equal(rebuildjs__esbuild__done$_(app_ctx)(), false)
81
+ equal(rebuildjs__esbuild__done_(app_ctx), false)
82
82
  const build_id = server__metafile0.build_id!
83
83
  build_id__set(app_ctx, build_id)
84
- equal(rebuildjs_core__ready$_(app_ctx)(), false)
85
- equal(rebuildjs_core__ready_(app_ctx), false)
84
+ equal(rebuildjs__esbuild__done$_(app_ctx)(), false)
85
+ equal(rebuildjs__esbuild__done_(app_ctx), false)
86
86
  server__metafile__set(app_ctx, server__metafile0)
87
- equal(rebuildjs_core__ready$_(app_ctx)(), false)
88
- equal(rebuildjs_core__ready_(app_ctx), false)
87
+ equal(rebuildjs__esbuild__done$_(app_ctx)(), false)
88
+ equal(rebuildjs__esbuild__done_(app_ctx), false)
89
89
  browser__metafile__set(app_ctx, browser__metafile0)
90
- equal(rebuildjs_core__ready$_(app_ctx)(), false)
91
- equal(rebuildjs_core__ready_(app_ctx), false)
92
- rebuildjs__build_id__set(app_ctx, build_id)
93
- equal(rebuildjs_core__ready$_(app_ctx)(), true)
94
- equal(rebuildjs_core__ready_(app_ctx), true)
90
+ equal(rebuildjs__esbuild__done$_(app_ctx)(), false)
91
+ equal(rebuildjs__esbuild__done_(app_ctx), false)
92
+ rebuildjs__esbuild__build_id__set(app_ctx, build_id)
93
+ equal(rebuildjs__esbuild__done$_(app_ctx)(), true)
94
+ equal(rebuildjs__esbuild__done_(app_ctx), true)
95
95
  // @ts-expect-error TS2345
96
- throws(()=>rebuildjs_core__ready$_(ctx_()))
96
+ throws(()=>rebuildjs__esbuild__done$_(ctx_()))
97
97
  // @ts-expect-error TS2345
98
- throws(()=>rebuildjs_core__ready_(ctx_()))
98
+ throws(()=>rebuildjs__esbuild__done_(ctx_()))
99
99
  })
100
100
  test('rebuildjs__ready__add__ready__a1,rebuildjs__ready__add', async ()=>{
101
- equal(rebuildjs__ready__add__ready__a1$_(app_ctx)(), [])
102
- equal(rebuildjs__ready__add__ready__a1_(app_ctx), [])
103
- const ready1_ = (ctx:has_app_T)=>!!ctx
104
- rebuildjs__ready__add__ready__a1__set(app_ctx, [ready1_])
105
- equal(rebuildjs__ready__add__ready__a1$_(app_ctx)(), [ready1_])
106
- equal(rebuildjs__ready__add__ready__a1_(app_ctx), [ready1_])
107
- const ready2_ = (ctx:has_app_T)=>!!ctx
108
- rebuildjs__ready__add(ready2_)
109
- equal(rebuildjs__ready__add__ready__a1$_(app_ctx)(), [ready1_, ready2_])
110
- equal(rebuildjs__ready__add__ready__a1_(app_ctx), [ready1_, ready2_])
101
+ equal(rebuildjs__ready__add__ready$__a1$_(app_ctx)(), [])
102
+ equal(rebuildjs__ready__add__ready$__a1_(app_ctx), [])
103
+ const ready1$_ = be_<memo_T<boolean>, 'app'>(
104
+ ()=>memo_(()=>true),
105
+ { ns: 'app' })
106
+ rebuildjs__ready__add__ready$__a1__set(app_ctx, [ready1$_])
107
+ equal(rebuildjs__ready__add__ready$__a1$_(app_ctx)(), [ready1$_])
108
+ equal(rebuildjs__ready__add__ready$__a1_(app_ctx), [ready1$_])
109
+
110
+ const ready2$_ = be_<memo_T<boolean>, 'app'>(
111
+ ()=>memo_(()=>true),
112
+ { ns: 'app' })
113
+ rebuildjs__ready__add(ready2$_)
114
+ equal(rebuildjs__ready__add__ready$__a1$_(app_ctx)(), [ready1$_, ready2$_])
115
+ equal(rebuildjs__ready__add__ready$__a1_(app_ctx), [ready1$_, ready2$_])
111
116
  // @ts-expect-error TS2345
112
- throws(()=>rebuildjs__ready__add__ready__a1$_(ctx_()))
117
+ throws(()=>rebuildjs__ready__add__ready$__a1$_(ctx_()))
113
118
  // @ts-expect-error TS2345
114
- throws(()=>rebuildjs__ready__add__ready__a1_(ctx_()))
119
+ throws(()=>rebuildjs__ready__add__ready$__a1_(ctx_()))
115
120
  })
116
121
  test('rebuildjs__ready', async ()=>{
117
122
  const [
123
+ plugin__ready$_,
118
124
  ,
119
- plugin__ready_,
120
125
  plugin__ready__set
121
126
  ] = ns_be_sig_triple_(
122
127
  'app',
123
128
  ()=>false)
124
- rebuildjs__ready__add(plugin__ready_)
129
+ rebuildjs__ready__add(plugin__ready$_)
125
130
  equal(rebuildjs__ready$_(app_ctx)(), false)
126
131
  equal(rebuildjs__ready_(app_ctx), false)
127
132
  const build_id = server__metafile0.build_id!
@@ -134,10 +139,13 @@ test('rebuildjs__ready', async ()=>{
134
139
  browser__metafile__set(app_ctx, browser__metafile0)
135
140
  equal(rebuildjs__ready$_(app_ctx)(), false)
136
141
  equal(rebuildjs__ready_(app_ctx), false)
137
- rebuildjs__build_id__set(app_ctx, build_id)
142
+ rebuildjs__esbuild__build_id__set(app_ctx, build_id)
138
143
  equal(rebuildjs__ready$_(app_ctx)(), false)
139
144
  equal(rebuildjs__ready_(app_ctx), false)
140
145
  plugin__ready__set(app_ctx, true)
146
+ equal(rebuildjs__ready$_(app_ctx)(), false)
147
+ equal(rebuildjs__ready_(app_ctx), false)
148
+ rebuildjs__build_id__set(app_ctx, build_id)
141
149
  equal(rebuildjs__ready$_(app_ctx)(), true)
142
150
  equal(rebuildjs__ready_(app_ctx), true)
143
151
  // @ts-expect-error TS2345
@@ -148,14 +156,14 @@ test('rebuildjs__ready', async ()=>{
148
156
  test('rebuildjs_core__ready__wait', async ()=>{
149
157
  let done = false
150
158
  const [
159
+ plugin__ready$_,
151
160
  ,
152
- plugin__ready_,
153
161
  plugin__ready__set
154
162
  ] = ns_be_sig_triple_(
155
163
  'app',
156
164
  ()=>false)
157
- rebuildjs__ready__add(plugin__ready_)
158
- const promise = rebuildjs_core__ready__wait()
165
+ rebuildjs__ready__add(plugin__ready$_)
166
+ const promise = rebuildjs__ready__wait()
159
167
  promise.then(()=>done = true)
160
168
  try {
161
169
  equal(done, false)
@@ -169,11 +177,14 @@ test('rebuildjs_core__ready__wait', async ()=>{
169
177
  browser__metafile__set(app_ctx, browser__metafile1)
170
178
  await sleep(0)
171
179
  equal(done, false)
172
- rebuildjs__build_id__set(app_ctx, build_id)
180
+ rebuildjs__esbuild__build_id__set(app_ctx, build_id)
173
181
  await sleep(0)
174
- equal(done, true)
182
+ equal(done, false)
175
183
  plugin__ready__set(app_ctx, true)
176
184
  await sleep(0)
185
+ equal(done, false)
186
+ rebuildjs__build_id__set(app_ctx, build_id)
187
+ await sleep(0)
177
188
  equal(done, true)
178
189
  } finally {
179
190
  await promise.cancel()
@@ -182,13 +193,13 @@ test('rebuildjs_core__ready__wait', async ()=>{
182
193
  test('rebuildjs__ready__wait', async ()=>{
183
194
  let done = false
184
195
  const [
196
+ plugin__ready$_,
185
197
  ,
186
- plugin__ready_,
187
198
  plugin__ready__set
188
199
  ] = ns_be_sig_triple_(
189
200
  'app',
190
201
  ()=>false)
191
- rebuildjs__ready__add(plugin__ready_)
202
+ rebuildjs__ready__add(plugin__ready$_)
192
203
  const promise = rebuildjs__ready__wait()
193
204
  promise.then(()=>done = true)
194
205
  try {
@@ -203,11 +214,14 @@ test('rebuildjs__ready__wait', async ()=>{
203
214
  browser__metafile__set(app_ctx, browser__metafile1)
204
215
  await sleep(0)
205
216
  equal(done, false)
206
- rebuildjs__build_id__set(app_ctx, build_id)
217
+ rebuildjs__esbuild__build_id__set(app_ctx, build_id)
207
218
  await sleep(0)
208
219
  equal(done, false)
209
220
  plugin__ready__set(app_ctx, true)
210
221
  await sleep(0)
222
+ equal(done, false)
223
+ rebuildjs__build_id__set(app_ctx, build_id)
224
+ await sleep(0)
211
225
  equal(done, true)
212
226
  } finally {
213
227
  await promise.cancel()