rebuildjs 0.3.1 → 0.3.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/app/index.d.ts +8 -8
- package/app/index.js +9 -14
- package/build/index.js +15 -2
- package/package.json +1 -1
package/app/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { be_lock_memosig_triple_T, be_sig_triple_T } from 'ctx-core/rmemo'
|
|
2
2
|
export const [
|
|
3
3
|
port$_,
|
|
4
4
|
port_,
|
|
@@ -13,34 +13,34 @@ export const [
|
|
|
13
13
|
is_prod$_,
|
|
14
14
|
is_prod_,
|
|
15
15
|
is_prod__set,
|
|
16
|
-
]:
|
|
16
|
+
]: be_lock_memosig_triple_T<string>
|
|
17
17
|
export const [
|
|
18
18
|
dist_path$_,
|
|
19
19
|
dist_path_,
|
|
20
20
|
dist_path__set,
|
|
21
|
-
]:
|
|
21
|
+
]:be_lock_memosig_triple_T<string>
|
|
22
22
|
export const [
|
|
23
23
|
public_path$_,
|
|
24
24
|
public_path_,
|
|
25
25
|
public_path__set,
|
|
26
|
-
]:
|
|
26
|
+
]:be_lock_memosig_triple_T<string>
|
|
27
27
|
export const [
|
|
28
28
|
src_path$_,
|
|
29
29
|
src_path_,
|
|
30
30
|
src_path__set,
|
|
31
|
-
]:
|
|
31
|
+
]:be_lock_memosig_triple_T<string>
|
|
32
32
|
export const [
|
|
33
33
|
app_path$_,
|
|
34
34
|
app_path_,
|
|
35
35
|
app_path__set,
|
|
36
|
-
]:
|
|
36
|
+
]:be_lock_memosig_triple_T<string>
|
|
37
37
|
export const [
|
|
38
38
|
browser_path$_,
|
|
39
39
|
browser_path_,
|
|
40
40
|
browser_path__set,
|
|
41
|
-
]:
|
|
41
|
+
]:be_lock_memosig_triple_T<string>
|
|
42
42
|
export const [
|
|
43
43
|
server_path$_,
|
|
44
44
|
server_path_,
|
|
45
45
|
server_path__set,
|
|
46
|
-
]:
|
|
46
|
+
]:be_lock_memosig_triple_T<string>
|
package/app/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { be_memosig_triple_, be_sig_triple_ } from 'ctx-core/rmemo'
|
|
1
|
+
import { be_lock_memosig_triple_, be_memosig_triple_, be_sig_triple_ } from 'ctx-core/rmemo'
|
|
2
2
|
import { join, resolve } from 'path'
|
|
3
3
|
import { app_ctx__be_config } from 'relysjs'
|
|
4
4
|
export const [
|
|
@@ -21,7 +21,7 @@ export const [
|
|
|
21
21
|
is_prod$_,
|
|
22
22
|
is_prod_,
|
|
23
23
|
is_prod__set,
|
|
24
|
-
] =
|
|
24
|
+
] = be_lock_memosig_triple_(()=>
|
|
25
25
|
process.env.NODE_ENV === 'production',
|
|
26
26
|
app_ctx__be_config
|
|
27
27
|
)
|
|
@@ -29,46 +29,41 @@ export const [
|
|
|
29
29
|
dist_path$_,
|
|
30
30
|
dist_path_,
|
|
31
31
|
dist_path__set,
|
|
32
|
-
] =
|
|
33
|
-
|
|
34
|
-
? dist_path$._
|
|
35
|
-
: join(cwd_(ctx), 'dist'),
|
|
36
|
-
async dist_path$=>{
|
|
37
|
-
if (dist_path$._ != join(cwd_(ctx), 'dist')) dist_path$.custom = 1
|
|
38
|
-
},
|
|
32
|
+
] = be_memosig_triple_(ctx=>
|
|
33
|
+
join(cwd_(ctx), 'dist'),
|
|
39
34
|
app_ctx__be_config)
|
|
40
35
|
export const [
|
|
41
36
|
public_path$_,
|
|
42
37
|
public_path_,
|
|
43
38
|
public_path__set,
|
|
44
|
-
] =
|
|
39
|
+
] = be_lock_memosig_triple_(ctx=>
|
|
45
40
|
join(cwd_(ctx), 'public'),
|
|
46
41
|
app_ctx__be_config)
|
|
47
42
|
export const [
|
|
48
43
|
src_path$_,
|
|
49
44
|
src_path_,
|
|
50
45
|
src_path__set,
|
|
51
|
-
] =
|
|
46
|
+
] = be_lock_memosig_triple_(ctx=>
|
|
52
47
|
join(cwd_(ctx), 'src'),
|
|
53
48
|
app_ctx__be_config)
|
|
54
49
|
export const [
|
|
55
50
|
app_path$_,
|
|
56
51
|
app_path_,
|
|
57
52
|
app_path__set,
|
|
58
|
-
] =
|
|
53
|
+
] = be_lock_memosig_triple_(ctx=>
|
|
59
54
|
join(src_path_(ctx), 'app'),
|
|
60
55
|
app_ctx__be_config)
|
|
61
56
|
export const [
|
|
62
57
|
browser_path$_,
|
|
63
58
|
browser_path_,
|
|
64
59
|
browser_path__set,
|
|
65
|
-
] =
|
|
60
|
+
] = be_lock_memosig_triple_(ctx=>
|
|
66
61
|
join(dist_path_(ctx), is_prod_(ctx) ? 'browser' : 'dev-browser'),
|
|
67
62
|
app_ctx__be_config)
|
|
68
63
|
export const [
|
|
69
64
|
server_path$_,
|
|
70
65
|
server_path_,
|
|
71
66
|
server_path__set,
|
|
72
|
-
] =
|
|
67
|
+
] = be_lock_memosig_triple_(ctx=>
|
|
73
68
|
join(dist_path_(ctx), is_prod_(ctx) ? 'server' : 'dev-server'),
|
|
74
69
|
app_ctx__be_config)
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** @typedef {import('esbuild').BuildOptions}BuildOptions */
|
|
2
|
+
/** @typedef {import('esbuild').Plugin}Plugin */
|
|
2
3
|
import { writeFile } from '@ctx-core/monorepo'
|
|
3
4
|
import { build, context } from 'esbuild'
|
|
4
5
|
import { fdir } from 'fdir'
|
|
@@ -30,7 +31,7 @@ export async function server__build(config = {}) {
|
|
|
30
31
|
for (const path of path_a) {
|
|
31
32
|
entryPoints.push(path)
|
|
32
33
|
}
|
|
33
|
-
const external = ['
|
|
34
|
+
const external = ['bun', 'node_modules/*', ...(config.external || [])]
|
|
34
35
|
const plugins = [rebuildjs_plugin_(), ...(config.plugins || [])]
|
|
35
36
|
const esbuild_config = {
|
|
36
37
|
entryPoints,
|
|
@@ -57,6 +58,11 @@ export async function server__build(config = {}) {
|
|
|
57
58
|
await esbuild_ctx.watch()
|
|
58
59
|
}
|
|
59
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* @param {Plugin}config
|
|
63
|
+
* @returns {Promise<void>}
|
|
64
|
+
* @private
|
|
65
|
+
*/
|
|
60
66
|
export async function browser__build(config = {}) {
|
|
61
67
|
await rm(browser_path_(app_ctx), { recursive: true, force: true })
|
|
62
68
|
await mkdir(browser_path_(app_ctx), { recursive: true })
|
|
@@ -98,6 +104,10 @@ export async function browser__build(config = {}) {
|
|
|
98
104
|
}
|
|
99
105
|
await public__cp()
|
|
100
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* @returns {Plugin}
|
|
109
|
+
* @private
|
|
110
|
+
*/
|
|
101
111
|
export function rebuildjs_plugin_() {
|
|
102
112
|
return {
|
|
103
113
|
name: 'rebuildjs_plugin',
|
|
@@ -133,6 +143,9 @@ export function rebuildjs_plugin_() {
|
|
|
133
143
|
}
|
|
134
144
|
}
|
|
135
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* @returns {Promise<void>}
|
|
148
|
+
*/
|
|
136
149
|
async function public__cp() {
|
|
137
150
|
const path_a = new fdir()
|
|
138
151
|
.withFullPaths()
|