rebuildjs 0.3.1 → 0.3.3

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,6 +1,6 @@
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
- import { app_ctx__be_config } from 'relysjs'
3
+ import { app_ctx__be_config } from '../ctx/index.js'
4
4
  export const [
5
5
  port$_,
6
6
  port_,
@@ -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
  )
@@ -29,46 +29,41 @@ export const [
29
29
  dist_path$_,
30
30
  dist_path_,
31
31
  dist_path__set,
32
- ] = be_sig_triple_((ctx, dist_path$)=>
33
- dist_path$.custom
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
- ] = be_memosig_triple_(ctx=>
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
- ] = be_memosig_triple_(ctx=>
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
- ] = be_memosig_triple_(ctx=>
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
- ] = be_memosig_triple_(ctx=>
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
- ] = be_memosig_triple_(ctx=>
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
- /// <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'
@@ -13,7 +14,7 @@ import {
13
14
  server__input_path__set,
14
15
  server__metafile_,
15
16
  server__metafile__set
16
- } from '../server'
17
+ } from '../server/index.js'
17
18
  /**
18
19
  * @param {Partial<BuildOptions>}config
19
20
  * @returns {Promise<void>}
@@ -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 = ['/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,
@@ -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.1",
3
+ "version": "0.3.3",
4
4
  "description": "Reactive esbuild...simple hackable alternative to vite for Multi Page Apps",
5
5
  "keywords": [
6
6
  "reactive",
@@ -47,6 +47,7 @@
47
47
  "dependencies": {
48
48
  "ctx-core": "^4.15.0",
49
49
  "elysia": "^0.7.30",
50
+ "esbuild": "^0.19.9",
50
51
  "fdir": "^6.1.1",
51
52
  "picomatch": "^3.0.1"
52
53
  },
@@ -67,7 +68,7 @@
67
68
  "clean": ":",
68
69
  "exec": "$@",
69
70
  "test": "pnpm test-unit && check-dts",
70
- "test-unit": "tsx node_modules/uvu/bin.js . '\\\\.test\\\\.(ts|js)$'",
71
+ "test-unit": "tsx node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
71
72
  "test-unit-coverage": "c8 pnpm test-unit"
72
73
  }
73
74
  }