rebuildjs 0.13.2 → 0.15.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/app/index.test.ts +7 -0
- package/asset/index.d.ts +4 -1
- package/asset/index.js +3 -0
- package/asset/index.test.ts +14 -0
- package/css/index.test.ts +7 -0
- package/ctx/index.test.ts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/metafile/index.d.ts +1 -0
- package/metafile/index.js +19 -0
- package/metafile/index.test.ts +7 -0
- package/middleware/index.test.ts +1 -0
- package/package.json +3 -1
package/asset/index.d.ts
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export declare function asset_path_(mod_promise:Promise<{ default:
|
|
1
|
+
export declare function asset_path_(mod_promise:Promise<{ default:string }>):Promise<string>
|
|
2
|
+
export declare function asset_path_a_<
|
|
3
|
+
arg_a_T extends readonly Promise<{ default:string }>[]
|
|
4
|
+
>(...mod_promise_a:arg_a_T):Promise<{ [key:keyof arg_a_T]:arg_a_T[key] }>
|
package/asset/index.js
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { test } from 'uvu'
|
|
2
|
+
import { equal } from 'uvu/assert'
|
|
3
|
+
import { asset_path_ } from './index.js'
|
|
4
|
+
test('asset_path_', async ()=>{
|
|
5
|
+
let in_path:string|undefined
|
|
6
|
+
const mod_ = async (path:string)=>{
|
|
7
|
+
in_path = path
|
|
8
|
+
return { default: './path.png' }
|
|
9
|
+
}
|
|
10
|
+
equal(in_path, undefined)
|
|
11
|
+
equal(await asset_path_(mod_('./path.png')), '/path.png')
|
|
12
|
+
equal(in_path, './path.png')
|
|
13
|
+
})
|
|
14
|
+
test.run()
|
package/ctx/index.test.ts
CHANGED
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function metafile__wait():Promise<void>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { file_exists_ } from '@ctx-core/fs'
|
|
2
|
+
import { neq_ } from 'ctx-core/function'
|
|
3
|
+
import { rmemo__wait } from 'ctx-core/rmemo'
|
|
4
|
+
import { browser__metafile$_, browser__metafile_path_ } from '../browser/index.js'
|
|
5
|
+
import { app_ctx } from '../ctx/index.js'
|
|
6
|
+
import { server__metafile$_, server__metafile_path_ } from '../server/index.js'
|
|
7
|
+
export async function metafile__wait() {
|
|
8
|
+
if (!await file_exists_(server__metafile_path_(app_ctx))) {
|
|
9
|
+
throw new Error(`${server__metafile_path_(app_ctx)} does not exist`)
|
|
10
|
+
}
|
|
11
|
+
if (!await file_exists_(browser__metafile_path_(app_ctx))) {
|
|
12
|
+
throw new Error(`${browser__metafile_path_(app_ctx)} does not exist`)
|
|
13
|
+
}
|
|
14
|
+
const neq_undefined = val=>val !== undefined
|
|
15
|
+
await rmemo__wait(
|
|
16
|
+
server__metafile$_(app_ctx),
|
|
17
|
+
neq_(undefined))
|
|
18
|
+
await rmemo__wait(browser__metafile$_(app_ctx), neq_undefined)
|
|
19
|
+
}
|
package/middleware/index.test.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rebuildjs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Reactive esbuild...simple hackable alternative to vite for Multi Page Apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"reactive",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"build",
|
|
33
33
|
"css",
|
|
34
34
|
"ctx",
|
|
35
|
+
"metafile",
|
|
35
36
|
"middleware",
|
|
36
37
|
"server"
|
|
37
38
|
],
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
"./build": "./build/index.js",
|
|
45
46
|
"./css": "./css/index.js",
|
|
46
47
|
"./ctx": "./ctx/index.js",
|
|
48
|
+
"./metafile": "./metafile/index.js",
|
|
47
49
|
"./middleware": "./middleware/index.js",
|
|
48
50
|
"./server": "./server/index.js",
|
|
49
51
|
"./package.json": "./package.json"
|