@bun-native/cli 0.33.1 → 0.33.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/README.md +1 -1
- package/bun-native-source.json +22 -26
- package/package.json +7 -9
- package/src/scripts/native/build.ts +1 -1
- package/src/scripts/native/bundle.ts +22 -4
- package/src/{experiments/aot-gpui → scripts/native}/compile.ts +2 -2
- package/src/scripts/solid/transform.ts +0 -16
- /package/src/{experiments/aot-gpui → scripts/native}/inspect-runtime.ts +0 -0
- /package/src/{experiments/aot-gpui → scripts/native}/inspect.ts +0 -0
package/README.md
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
Create, check, run and AOT-build Bun Native desktop applications.
|
|
4
4
|
|
|
5
|
-
Part of [Bun Native](https://github.com/0xPlayerOne/bun-native), an experimental developer preview. Version 0.33.
|
|
5
|
+
Part of [Bun Native](https://github.com/0xPlayerOne/bun-native), an experimental developer preview. Version 0.33.2 was built from [577f6fc5015b](https://github.com/0xPlayerOne/bun-native/tree/577f6fc5015b6eeef956efcc63f97e2a749d74ff) and published from GitHub Actions with npm provenance. Use the Bun revision pinned in that commit's toolchain.json. Start with the [getting-started guide](https://github.com/0xPlayerOne/bun-native/blob/577f6fc5015b6eeef956efcc63f97e2a749d74ff/docs/getting-started.md); `bun-native host install` fetches the matching release host. The license notice is in LICENSE.
|
package/bun-native-source.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"commit": "
|
|
4
|
-
"tree": "
|
|
3
|
+
"commit": "577f6fc5015b6eeef956efcc63f97e2a749d74ff",
|
|
4
|
+
"tree": "c599e781af2ce0749d5e3a6d8700834690e872f4",
|
|
5
5
|
"files": {
|
|
6
6
|
"package.json": {
|
|
7
|
-
"bytes":
|
|
8
|
-
"sha256": "
|
|
7
|
+
"bytes": 2258,
|
|
8
|
+
"sha256": "38e2f0f89b5f6c4ba80b3baefcdf0806dd73c684294153df74ab470fda6bf3f9"
|
|
9
9
|
},
|
|
10
10
|
".oxfmtrc.json": {
|
|
11
11
|
"bytes": 402,
|
|
@@ -15,18 +15,6 @@
|
|
|
15
15
|
"bytes": 297,
|
|
16
16
|
"sha256": "25e27847d6fd50c27314506d50c83a68764489b84bf91f9c35dceb937134e882"
|
|
17
17
|
},
|
|
18
|
-
"experiments/aot-gpui/compile.ts": {
|
|
19
|
-
"bytes": 1947,
|
|
20
|
-
"sha256": "3617b537e53c90759591b2240c94f65aae29ca04d5ce3dcb661ec0e26609cc2a"
|
|
21
|
-
},
|
|
22
|
-
"experiments/aot-gpui/inspect-runtime.ts": {
|
|
23
|
-
"bytes": 12612,
|
|
24
|
-
"sha256": "d1b2bebca588db846fc964177ae8b42fc5ae0474bfa0ebc9ee833a41e240c39d"
|
|
25
|
-
},
|
|
26
|
-
"experiments/aot-gpui/inspect.ts": {
|
|
27
|
-
"bytes": 2504,
|
|
28
|
-
"sha256": "e24851ad70d48df0160ed0ace6d39ebcbf7b7845d793cbd3b0b8a42e9736b499"
|
|
29
|
-
},
|
|
30
18
|
"scripts/native.ts": {
|
|
31
19
|
"bytes": 10591,
|
|
32
20
|
"sha256": "8e100fe4929660a5415571b8ec7658074cfaa3c60d2c54fbbed6fb3b2a19be42"
|
|
@@ -36,12 +24,16 @@
|
|
|
36
24
|
"sha256": "a64e82d74f56b05d01fb9ea954414f39c6a94f4a298515aff9c05b0dd257da4d"
|
|
37
25
|
},
|
|
38
26
|
"scripts/native/build.ts": {
|
|
39
|
-
"bytes":
|
|
40
|
-
"sha256": "
|
|
27
|
+
"bytes": 9479,
|
|
28
|
+
"sha256": "19856dd65bd662f3c89bc8dc775aecaed365a3611366b9a53812379b7dc8099a"
|
|
41
29
|
},
|
|
42
30
|
"scripts/native/bundle.ts": {
|
|
43
|
-
"bytes":
|
|
44
|
-
"sha256": "
|
|
31
|
+
"bytes": 4868,
|
|
32
|
+
"sha256": "ecb0f2d1ab88fe7f9603d690b59cb53a584a26b13a4518b923b9331f930d8627"
|
|
33
|
+
},
|
|
34
|
+
"scripts/native/compile.ts": {
|
|
35
|
+
"bytes": 1953,
|
|
36
|
+
"sha256": "45c6f5ace53022b49a756d472f59ac062e3389691c212aa9185c6dd6660500c8"
|
|
45
37
|
},
|
|
46
38
|
"scripts/native/consumer-files.ts": {
|
|
47
39
|
"bytes": 1599,
|
|
@@ -71,6 +63,14 @@
|
|
|
71
63
|
"bytes": 3783,
|
|
72
64
|
"sha256": "4b817e8c697e64bdf669e072df91dc1ac61400cb45c91fdefd4269f9d1be4b73"
|
|
73
65
|
},
|
|
66
|
+
"scripts/native/inspect-runtime.ts": {
|
|
67
|
+
"bytes": 12612,
|
|
68
|
+
"sha256": "d1b2bebca588db846fc964177ae8b42fc5ae0474bfa0ebc9ee833a41e240c39d"
|
|
69
|
+
},
|
|
70
|
+
"scripts/native/inspect.ts": {
|
|
71
|
+
"bytes": 2504,
|
|
72
|
+
"sha256": "e24851ad70d48df0160ed0ace6d39ebcbf7b7845d793cbd3b0b8a42e9736b499"
|
|
73
|
+
},
|
|
74
74
|
"scripts/native/lint.ts": {
|
|
75
75
|
"bytes": 1842,
|
|
76
76
|
"sha256": "201e66c00c8c1d861c67a2ed686fb71e9f7830356db83701a1ce851d72f41b95"
|
|
@@ -123,10 +123,6 @@
|
|
|
123
123
|
"bytes": 3793,
|
|
124
124
|
"sha256": "b5d7f98516135ae1577823ccd6d4647f53d84df7a0f1fa68d4cad5a2c62cdd0f"
|
|
125
125
|
},
|
|
126
|
-
"scripts/solid/transform.ts": {
|
|
127
|
-
"bytes": 642,
|
|
128
|
-
"sha256": "281fdbd71b10e613d9080e0494320161e51cfaf9a1c7b9966707eba0dd24ef1c"
|
|
129
|
-
},
|
|
130
126
|
"toolchain.json": {
|
|
131
127
|
"bytes": 3234,
|
|
132
128
|
"sha256": "9f4d9362cb4cc38c0f4e705295789a0cbfec46ffdd007e0541b9441a7c3003a7"
|
|
@@ -145,7 +141,7 @@
|
|
|
145
141
|
"sha256": "9f4d9362cb4cc38c0f4e705295789a0cbfec46ffdd007e0541b9441a7c3003a7"
|
|
146
142
|
},
|
|
147
143
|
"dependencyLock": {
|
|
148
|
-
"bytes":
|
|
149
|
-
"sha256": "
|
|
144
|
+
"bytes": 28430,
|
|
145
|
+
"sha256": "9d321f65b9224958ec99286628d652232a16e3242ea9536a396bceaf72892460"
|
|
150
146
|
}
|
|
151
147
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bun-native/cli",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -17,8 +17,6 @@
|
|
|
17
17
|
},
|
|
18
18
|
"description": "Create, check, run and AOT-build Bun Native desktop applications.",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@babel/core": "7.29.7",
|
|
21
|
-
"babel-preset-solid": "1.9.16",
|
|
22
20
|
"oxlint": "1.92.0"
|
|
23
21
|
},
|
|
24
22
|
"repository": {
|
|
@@ -36,24 +34,24 @@
|
|
|
36
34
|
"templates": {
|
|
37
35
|
"solid": {
|
|
38
36
|
"dependencies": {
|
|
39
|
-
"@bun-native/core": "0.33.
|
|
40
|
-
"@bun-native/solid": "0.33.
|
|
37
|
+
"@bun-native/core": "0.33.2",
|
|
38
|
+
"@bun-native/solid": "0.33.2",
|
|
41
39
|
"solid-js": "1.9.18"
|
|
42
40
|
},
|
|
43
41
|
"devDependencies": {
|
|
44
|
-
"@bun-native/cli": "0.33.
|
|
42
|
+
"@bun-native/cli": "0.33.2",
|
|
45
43
|
"@types/bun": "1.4.4",
|
|
46
44
|
"oxlint": "1.92.0"
|
|
47
45
|
}
|
|
48
46
|
},
|
|
49
47
|
"react": {
|
|
50
48
|
"dependencies": {
|
|
51
|
-
"@bun-native/core": "0.33.
|
|
52
|
-
"@bun-native/react": "0.33.
|
|
49
|
+
"@bun-native/core": "0.33.2",
|
|
50
|
+
"@bun-native/react": "0.33.2",
|
|
53
51
|
"react": "19.3.1"
|
|
54
52
|
},
|
|
55
53
|
"devDependencies": {
|
|
56
|
-
"@bun-native/cli": "0.33.
|
|
54
|
+
"@bun-native/cli": "0.33.2",
|
|
57
55
|
"@types/bun": "1.4.4",
|
|
58
56
|
"oxlint": "1.92.0",
|
|
59
57
|
"@types/react": "19.3.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { constants } from 'node:fs'
|
|
2
2
|
import { chmod, copyFile, mkdir, readFile, readdir, writeFile } from 'node:fs/promises'
|
|
3
3
|
import { dirname, isAbsolute, join, relative, resolve } from 'node:path'
|
|
4
|
-
import { compileApplication } from '
|
|
4
|
+
import { compileApplication } from './compile.ts'
|
|
5
5
|
import type { Project } from './project.ts'
|
|
6
6
|
import { bundleApplication } from './bundle.ts'
|
|
7
7
|
import { cachedFileDigest, fileDigest, sha256 } from './artifact.ts'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BuildConfig, BunPlugin } from 'bun'
|
|
2
2
|
import { mkdir, realpath, stat } from 'node:fs/promises'
|
|
3
3
|
import { join, resolve, sep } from 'node:path'
|
|
4
|
+
import { pathToFileURL } from 'node:url'
|
|
4
5
|
|
|
5
6
|
export type Framework = 'solid' | 'react'
|
|
6
7
|
|
|
@@ -35,9 +36,25 @@ export function bundleConfig(
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
type SolidTransform = { transformSolid(source: string, filename: string): string }
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Solid's universal JSX transform as a bundler plugin. It is the Solid adapter's own
|
|
43
|
+
* `@bun-native/solid/build` export, resolved from the project (or, for a checkout
|
|
44
|
+
* fixture outside it, from this CLI), so Babel ships with Solid projects only.
|
|
45
|
+
*/
|
|
46
|
+
async function solidPlugin(cwd: string): Promise<BunPlugin> {
|
|
47
|
+
let transform: string
|
|
48
|
+
try {
|
|
49
|
+
transform = Bun.resolveSync('@bun-native/solid/build', cwd)
|
|
50
|
+
} catch {
|
|
51
|
+
try {
|
|
52
|
+
transform = Bun.resolveSync('@bun-native/solid/build', import.meta.dir)
|
|
53
|
+
} catch {
|
|
54
|
+
throw new Error('A Solid application needs @bun-native/solid installed in its project')
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const { transformSolid } = (await import(pathToFileURL(transform).href)) as SolidTransform
|
|
41
58
|
return {
|
|
42
59
|
name: 'solid-native-universal',
|
|
43
60
|
setup(build) {
|
|
@@ -79,7 +96,8 @@ export async function bundleApplication(options: {
|
|
|
79
96
|
const outdir = resolve(options.outdir)
|
|
80
97
|
await mkdir(outdir, { recursive: true })
|
|
81
98
|
const plugins =
|
|
82
|
-
options.plugins ??
|
|
99
|
+
options.plugins ??
|
|
100
|
+
(options.framework === 'solid' ? [await solidPlugin(options.cwd)] : undefined)
|
|
83
101
|
const previous = process.cwd()
|
|
84
102
|
process.chdir(options.cwd)
|
|
85
103
|
let result: Awaited<ReturnType<typeof Bun.build>>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync } from 'node:fs'
|
|
2
2
|
import { dirname, join } from 'node:path'
|
|
3
|
-
import { inspectBunExecutable } from './inspect'
|
|
4
|
-
import { inspectBunRuntime } from './inspect-runtime'
|
|
3
|
+
import { inspectBunExecutable } from './inspect.ts'
|
|
4
|
+
import { inspectBunRuntime } from './inspect-runtime.ts'
|
|
5
5
|
import toolchain from '../../toolchain.json'
|
|
6
6
|
|
|
7
7
|
/** Shared real AOT compiler and executable checks for fixtures and application tooling. */
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { transformSync } from '@babel/core'
|
|
2
|
-
import solid from 'babel-preset-solid'
|
|
3
|
-
|
|
4
|
-
/** Official Solid universal transform; project/Babel configuration cannot select DOM output. */
|
|
5
|
-
export function transformSolid(source: string, filename: string): string {
|
|
6
|
-
const result = transformSync(source, {
|
|
7
|
-
filename,
|
|
8
|
-
babelrc: false,
|
|
9
|
-
configFile: false,
|
|
10
|
-
sourceMaps: false,
|
|
11
|
-
parserOpts: { plugins: ['typescript', 'jsx'] },
|
|
12
|
-
presets: [[solid, { generate: 'universal', moduleName: '@bun-native/solid', dev: false }]],
|
|
13
|
-
})
|
|
14
|
-
if (!result?.code) throw new Error('Solid JSX transform produced no application code')
|
|
15
|
-
return result.code
|
|
16
|
-
}
|
|
File without changes
|
|
File without changes
|