@solidrt/cli 0.0.7 → 0.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidrt/cli",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "license": "MIT",
5
5
  "author": "Antoine van Wel",
6
6
  "type": "module",
@@ -19,12 +19,12 @@
19
19
  "qrcode-generator": "^2.0.4"
20
20
  },
21
21
  "optionalDependencies": {
22
- "@solidrt/darwin-arm64": "0.0.7",
23
- "@solidrt/linux-x64-gnu": "0.0.7",
24
- "@solidrt/win32-x64-msvc": "0.0.7"
22
+ "@solidrt/darwin-arm64": "0.0.8",
23
+ "@solidrt/linux-x64-gnu": "0.0.8",
24
+ "@solidrt/win32-x64-msvc": "0.0.8"
25
25
  },
26
26
  "peerDependencies": {
27
- "@solidrt/core": "0.0.7",
27
+ "@solidrt/core": "0.0.8",
28
28
  "typescript": "^5"
29
29
  },
30
30
  "devDependencies": {
package/src/args.ts CHANGED
@@ -20,16 +20,17 @@ export let command = positionals[0]
20
20
  export let source = positionals[1]
21
21
  export let isTsx = source?.endsWith(".tsx") || source?.endsWith(".jsx")
22
22
  export let isTs = source?.endsWith(".ts") || source?.endsWith(".js")
23
+ export let isSource = isTsx || isTs
23
24
  export let isPrebuilt = source?.endsWith(".srt.js") || source?.endsWith(".srt.bin")
24
25
 
25
26
  export function printUsage() {
26
27
  console.error(`Usage: srt <command> [options] [file]
27
28
 
28
29
  Commands:
29
- run [file.tsx|jsx] Start dev server + local solidrt-go client
30
- server [file.tsx|jsx] Start dev server only
30
+ run [file] Start dev server + local solidrt-go client
31
+ server [file] Start dev server only
31
32
  client Start solidrt-go client only
32
- bundle <file.tsx|jsx> Transpile TSX/JSX to JS or bytecode
33
+ bundle <file> Transpile TS/JS/TSX/JSX to JS or bytecode
33
34
  record <file.tsx|jsx> Capture frames for video generation
34
35
  pack <file.ts|js> Bundle + compile to a standalone executable (experimental, Flux only)
35
36
 
package/src/bundle.ts CHANGED
@@ -20,7 +20,7 @@ export async function bundle(entry = source) {
20
20
  target: "browser",
21
21
  format: "esm",
22
22
  minify: values.minify,
23
- external: ["qjs:*", "flux:*"],
23
+ external: ["flux:*"],
24
24
  define,
25
25
  plugins: [solidPlugin()],
26
26
  })
@@ -86,7 +86,7 @@ export async function runBundleCommand() {
86
86
  process.exit()
87
87
  }
88
88
 
89
- let baseName = values.output ?? source!.replace(/\.[jt]sx$/, "")
89
+ let baseName = values.output ?? source!.replace(/\.[jt]sx?$/, "")
90
90
 
91
91
  if (values.stdout) {
92
92
  let result = await bundle()
package/src/main.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  // srt record examples/hello.tsx - bundle TSX and run with frame capture
14
14
 
15
15
  import pkg from "../package.json"
16
- import { values, command, source, isTsx, isTs, isPrebuilt, printUsage } from "./args"
16
+ import { values, command, source, isTsx, isTs, isSource, isPrebuilt, printUsage } from "./args"
17
17
  import { state, requireBinary, run, shutdown } from "./util"
18
18
  import { bundle, bundleTo, runBundleCommand } from "./bundle"
19
19
  import { runPackCommand } from "./pack"
@@ -33,8 +33,8 @@ if (!command || !COMMANDS.includes(command)) {
33
33
  process.exit(1)
34
34
  }
35
35
 
36
- if (command === "bundle" && (!source || (!isTsx && !isPrebuilt))) {
37
- console.error("Usage: srt bundle [options] <entry.[tsx|jsx|srt.js|srt.bin]>")
36
+ if (command === "bundle" && (!source || (!isSource && !isPrebuilt))) {
37
+ console.error("Usage: srt bundle [options] <entry.[tsx|jsx|ts|js|srt.js|srt.bin]>")
38
38
  process.exit(1)
39
39
  }
40
40
 
@@ -120,7 +120,7 @@ startServer()
120
120
 
121
121
  // Bundle initial code if source file given (after server start so the
122
122
  // dev base URL is available to the bundler).
123
- if (source && isTsx) {
123
+ if (source && isSource) {
124
124
  let initialResult = await bundle()
125
125
  if (initialResult) {
126
126
  for (let output of initialResult.outputs) {
package/src/pack.ts CHANGED
@@ -9,7 +9,7 @@ async function bundleFlux(entry: string): Promise<string> {
9
9
  target: "browser",
10
10
  format: "esm",
11
11
  minify: values.minify,
12
- external: ["qjs:*", "flux:*"],
12
+ external: ["flux:*"],
13
13
  })
14
14
  if (!result.success) {
15
15
  for (let msg of result.logs) console.error(msg)