rebuildjs 0.3.0 → 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 CHANGED
@@ -1,4 +1,4 @@
1
- import type { be_memosig_triple_T, be_sig_triple_T } from 'ctx-core/rmemo'
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
- ]: be_sig_triple_T<string>
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
- ]:be_memosig_triple_T<string>
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
- ]:be_memosig_triple_T<string>
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
- ]:be_memosig_triple_T<string>
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
- ]:be_memosig_triple_T<string>
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
- ]:be_memosig_triple_T<string>
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
- ]:be_memosig_triple_T<string>
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
- ] = be_sig_triple_(()=>
24
+ ] = be_lock_memosig_triple_(()=>
25
25
  process.env.NODE_ENV === 'production',
26
26
  app_ctx__be_config
27
27
  )
@@ -36,34 +36,34 @@ export const [
36
36
  public_path$_,
37
37
  public_path_,
38
38
  public_path__set,
39
- ] = be_memosig_triple_(ctx=>
39
+ ] = be_lock_memosig_triple_(ctx=>
40
40
  join(cwd_(ctx), 'public'),
41
41
  app_ctx__be_config)
42
42
  export const [
43
43
  src_path$_,
44
44
  src_path_,
45
45
  src_path__set,
46
- ] = be_memosig_triple_(ctx=>
46
+ ] = be_lock_memosig_triple_(ctx=>
47
47
  join(cwd_(ctx), 'src'),
48
48
  app_ctx__be_config)
49
49
  export const [
50
50
  app_path$_,
51
51
  app_path_,
52
52
  app_path__set,
53
- ] = be_memosig_triple_(ctx=>
53
+ ] = be_lock_memosig_triple_(ctx=>
54
54
  join(src_path_(ctx), 'app'),
55
55
  app_ctx__be_config)
56
56
  export const [
57
57
  browser_path$_,
58
58
  browser_path_,
59
59
  browser_path__set,
60
- ] = be_memosig_triple_(ctx=>
60
+ ] = be_lock_memosig_triple_(ctx=>
61
61
  join(dist_path_(ctx), is_prod_(ctx) ? 'browser' : 'dev-browser'),
62
62
  app_ctx__be_config)
63
63
  export const [
64
64
  server_path$_,
65
65
  server_path_,
66
66
  server_path__set,
67
- ] = be_memosig_triple_(ctx=>
67
+ ] = be_lock_memosig_triple_(ctx=>
68
68
  join(dist_path_(ctx), is_prod_(ctx) ? 'server' : 'dev-server'),
69
69
  app_ctx__be_config)
package/build/index.js CHANGED
@@ -1,4 +1,5 @@
1
- /// <reference types="esbuild" />
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,14 +31,13 @@ export async function server__build(config = {}) {
30
31
  for (const path of path_a) {
31
32
  entryPoints.push(path)
32
33
  }
33
- const external = ['/assets/*', 'bun', 'node_modules/*', ...(config.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,
37
38
  entryNames: '[name]-[hash]',
38
39
  assetNames: '[name]-[hash]',
39
40
  bundle: true,
40
- external,
41
41
  target: 'es2020',
42
42
  treeShaking: true,
43
43
  minify: is_prod_(app_ctx),
@@ -48,6 +48,7 @@ export async function server__build(config = {}) {
48
48
  absWorkingDir: cwd_(app_ctx),
49
49
  metafile: true,
50
50
  outdir: server_path_(app_ctx),
51
+ external,
51
52
  plugins,
52
53
  }
53
54
  if (is_prod_(app_ctx)) {
@@ -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()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rebuildjs",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Reactive esbuild...simple hackable alternative to vite for Multi Page Apps",
5
5
  "keywords": [
6
6
  "reactive",
@@ -45,7 +45,7 @@
45
45
  "./package.json": "./package.json"
46
46
  },
47
47
  "dependencies": {
48
- "ctx-core": "^4.14.1",
48
+ "ctx-core": "^4.15.0",
49
49
  "elysia": "^0.7.30",
50
50
  "fdir": "^6.1.1",
51
51
  "picomatch": "^3.0.1"
package/server/index.js CHANGED
@@ -9,48 +9,48 @@ export const [
9
9
  server__metafile__set
10
10
  ] = be_sig_triple_(()=>
11
11
  undefined,
12
- { ...middleware_ctx__be_config, id: 'server__metafile' })
12
+ { ...middleware_ctx__be_config, id: 'server__metafile' })
13
13
  export const [
14
14
  server__input_path$_,
15
15
  server__input_path_,
16
16
  server__input_path__set
17
17
  ] = be_sig_triple_(()=>
18
18
  undefined,
19
- { ...middleware_ctx__be_config, id: 'server__input_path' })
19
+ { ...middleware_ctx__be_config, id: 'server__input_path' })
20
20
  export const [
21
21
  server__output_path$_,
22
22
  server__output_path_
23
23
  ] = be_memo_pair_(ctx=>
24
- nullish__none_(tup(server__metafile_(ctx), server__input_path_(ctx)),
25
- (server__metafile, input_path)=>{
26
- const { outputs } = server__metafile
27
- for (const output_path in outputs) {
28
- const output = outputs[output_path]
29
- if (output.entryPoint === input_path) return output_path
30
- }
31
- }),
32
- { ...middleware_ctx__be_config, id: 'server__output_path' })
24
+ nullish__none_(tup(server__metafile_(ctx), server__input_path_(ctx)),
25
+ (server__metafile, input_path)=>{
26
+ const { outputs } = server__metafile
27
+ for (const output_path in outputs) {
28
+ const output = outputs[output_path]
29
+ if (output.entryPoint === input_path) return output_path
30
+ }
31
+ }),
32
+ { ...middleware_ctx__be_config, id: 'server__output_path' })
33
33
  export const [
34
34
  server__output$_,
35
35
  server__output_
36
36
  ] = be_memo_pair_(ctx=>
37
- nullish__none_(tup(server__metafile_(ctx), server__output_path_(ctx)),
38
- (server__metafile, output_path)=>
39
- server__metafile.outputs[output_path]),
40
- { ...middleware_ctx__be_config, id: 'server__output' })
37
+ nullish__none_(tup(server__metafile_(ctx), server__output_path_(ctx)),
38
+ (server__metafile, output_path)=>
39
+ server__metafile.outputs[output_path]),
40
+ { ...middleware_ctx__be_config, id: 'server__output' })
41
41
  export const [
42
42
  server__cssBundle$_,
43
43
  server__cssBundle_
44
44
  ] = be_memo_pair_(ctx=>
45
- nullish__none_([server__output_(ctx)?.cssBundle],
46
- cssBundle=>
47
- join(cwd_(ctx), cssBundle)),
48
- { ...middleware_ctx__be_config, id: 'server__cssBundle', })
45
+ nullish__none_([server__output_(ctx)?.cssBundle],
46
+ cssBundle=>
47
+ join(cwd_(ctx), cssBundle)),
48
+ { ...middleware_ctx__be_config, id: 'server__cssBundle', })
49
49
  export const [
50
50
  server__css$_,
51
51
  server__css_
52
52
  ] = be_memo_pair_(ctx=>
53
- nullish__none_([server__cssBundle_(ctx)],
54
- cssBundle=>
55
- cssBundle.replace(server_path_(ctx), '')),
56
- { ...middleware_ctx__be_config, id: 'server__css' })
53
+ nullish__none_([server__cssBundle_(ctx)],
54
+ cssBundle=>
55
+ cssBundle.replace(server_path_(ctx), '')),
56
+ { ...middleware_ctx__be_config, id: 'server__css' })