rebuildjs 0.20.2 → 0.20.4

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/asset/index.d.ts CHANGED
@@ -12,7 +12,7 @@ export declare const assets__set:ctx__set_T<has_route_T, assets_T>
12
12
  export declare function assets__assign<ctx_T extends has_route_T>(
13
13
  ctx:ctx_T,
14
14
  ..._assets_a:assets_T[]):assets_T
15
- export declare function assets__new(..._assets_a:assets_T[]):assets_T
15
+ export declare function assets__new(..._assets_a:(assets_T|undefined)[]):assets_T
16
16
  export type assets_T = {
17
17
  css_a?:string[]
18
18
  script_a?:string[]
@@ -28,7 +28,9 @@ test('assets', ()=>{
28
28
  /* eslint-disable @typescript-eslint/no-unused-vars */
29
29
  type test_ctx = Expect<Equal<typeof route_ctx, Ctx<''|'app'|'middleware'|'route'>>>
30
30
  /* eslint-enable @typescript-eslint/no-unused-vars */
31
- const assets = assets__new({ css_a: ['/foo.css'], script_a: ['/foo.js'] })
31
+ const assets = assets__new(
32
+ { css_a: ['/foo.css'], script_a: ['/foo.js'] },
33
+ undefined)
32
34
  assets__set(route_ctx, assets)
33
35
  equal(assets_(route_ctx), assets)
34
36
  equal(assets$_(route_ctx)(), assets)
package/browser/index.js CHANGED
@@ -19,13 +19,12 @@ export const [
19
19
  ] = be_lock_memosig_triple_(()=>
20
20
  undefined,
21
21
  async (ctx, browser__metafile$)=>{
22
- browser__metafile$() // ensure the subscriber is run when browser__metafile$ changes
23
- let metafile_path
24
22
  browser__metafile__waitfor_promise?.cancel?.()
23
+ let metafile_path
25
24
  if (!browser__metafile$.lock) {
26
25
  metafile_path = browser__metafile_path_(ctx)
27
26
  browser__metafile__waitfor_promise = waitfor(
28
- ()=>file_exists_(browser__metafile_path_(ctx)),
27
+ ()=>file_exists_(metafile_path),
29
28
  200
30
29
  ).catch(()=>false)
31
30
  if (await browser__metafile__waitfor_promise && metafile_path === browser__metafile_path_(ctx)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rebuildjs",
3
- "version": "0.20.2",
3
+ "version": "0.20.4",
4
4
  "description": "Reactive esbuild...simple hackable alternative to vite for Multi Page Apps",
5
5
  "keywords": [
6
6
  "reactive",
@@ -51,7 +51,7 @@
51
51
  "./package.json": "./package.json"
52
52
  },
53
53
  "dependencies": {
54
- "ctx-core": "^5.4.0",
54
+ "ctx-core": "^5.4.1",
55
55
  "elysia": "^0.7.30",
56
56
  "esbuild": "^0.19.10",
57
57
  "fdir": "^6.1.1",
package/server/index.js CHANGED
@@ -18,17 +18,15 @@ export const [
18
18
  ] = be_lock_memosig_triple_(()=>
19
19
  undefined,
20
20
  async (ctx, server__metafile$)=>{
21
- server__metafile$() // ensure the subscriber is run when server__metafile$ changes
22
21
  server__metafile__waitfor_promise?.cancel?.()
23
22
  let metafile_path
24
23
  if (!server__metafile$.lock) {
25
24
  metafile_path = server__metafile_path_(ctx)
26
25
  server__metafile__waitfor_promise = waitfor(
27
- ()=>file_exists_(server__metafile_path_(ctx)),
26
+ ()=>file_exists_(metafile_path),
28
27
  200
29
28
  ).catch(()=>false)
30
29
  if (await server__metafile__waitfor_promise && metafile_path === server__metafile_path_(ctx)) {
31
- // server__metafile$._ = JSON.parse(await readFile(metafile_path).then(buf=>buf.toString()))
32
30
  server__metafile$._ = await readFile(metafile_path).then(buf=>JSON.parse(buf+''))
33
31
  }
34
32
  }