@dazzle-labs/cli 0.5.4 → 0.5.6

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/bin/run.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { execFileSync } = require("child_process");
3
+ const { execFileSync, execSync } = require("child_process");
4
+ const path = require("path");
4
5
 
5
6
  const PLATFORMS = {
6
7
  "darwin-arm64": "@dazzle-labs/cli-darwin-arm64",
@@ -19,15 +20,45 @@ if (!pkg) {
19
20
  }
20
21
 
21
22
  const ext = process.platform === "win32" ? ".exe" : "";
22
- let binPath;
23
- try {
24
- binPath = require.resolve(`${pkg}/bin/dazzle${ext}`);
25
- } catch {
26
- console.error(
27
- `${pkg} is not installed. Make sure optionalDependencies are not disabled.\n` +
28
- `Install with: npm install ${pkg}`
29
- );
30
- process.exit(1);
23
+ const binName = `bin/dazzle${ext}`;
24
+
25
+ function tryResolve() {
26
+ try {
27
+ return require.resolve(`${pkg}/${binName}`);
28
+ } catch {
29
+ return null;
30
+ }
31
+ }
32
+
33
+ let binPath = tryResolve();
34
+
35
+ if (!binPath) {
36
+ // Platform binary not found — install optionalDependencies into this
37
+ // package's directory. This handles npx/pnpx where optional deps are
38
+ // skipped during ephemeral installs (same pattern as turbo).
39
+ const pkgDir = path.resolve(__dirname, "..");
40
+ const env = { ...process.env, npm_config_global: undefined };
41
+ try {
42
+ execSync(
43
+ "npm install --loglevel=error --prefer-offline --no-audit --progress=false",
44
+ { cwd: pkgDir, stdio: "pipe", env }
45
+ );
46
+ } catch {
47
+ console.error(
48
+ `${pkg} is not installed and could not be installed automatically.\n` +
49
+ `Install with: npm install ${pkg}`
50
+ );
51
+ process.exit(1);
52
+ }
53
+
54
+ binPath = tryResolve();
55
+ if (!binPath) {
56
+ console.error(
57
+ `${pkg} is not installed. Make sure optionalDependencies are not disabled.\n` +
58
+ `Install with: npm install ${pkg}`
59
+ );
60
+ process.exit(1);
61
+ }
31
62
  }
32
63
 
33
64
  try {
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "@dazzle-labs/cli",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "description": "Dazzle CLI — cloud stages for AI agents and live streaming",
5
5
  "mcpName": "io.github.dazzle-labs/dazzle",
6
6
  "bin": {
7
7
  "dazzle": "bin/run.js"
8
8
  },
9
+ "files": [
10
+ "bin/run.js"
11
+ ],
9
12
  "license": "Apache-2.0",
10
13
  "repository": {
11
14
  "type": "git",
@@ -20,11 +23,11 @@
20
23
  "cli"
21
24
  ],
22
25
  "optionalDependencies": {
23
- "@dazzle-labs/cli-darwin-arm64": "0.5.4",
24
- "@dazzle-labs/cli-darwin-x64": "0.5.4",
25
- "@dazzle-labs/cli-linux-x64": "0.5.4",
26
- "@dazzle-labs/cli-linux-arm64": "0.5.4",
27
- "@dazzle-labs/cli-win32-x64": "0.5.4",
28
- "@dazzle-labs/cli-win32-arm64": "0.5.4"
26
+ "@dazzle-labs/cli-darwin-arm64": "0.5.6",
27
+ "@dazzle-labs/cli-darwin-x64": "0.5.6",
28
+ "@dazzle-labs/cli-linux-x64": "0.5.6",
29
+ "@dazzle-labs/cli-linux-arm64": "0.5.6",
30
+ "@dazzle-labs/cli-win32-x64": "0.5.6",
31
+ "@dazzle-labs/cli-win32-arm64": "0.5.6"
29
32
  }
30
33
  }
File without changes
@@ -1,16 +0,0 @@
1
- {
2
- "name": "@dazzle-labs/cli-darwin-arm64",
3
- "version": "0.5.4",
4
- "description": "Dazzle CLI binary for macOS ARM64",
5
- "os": [
6
- "darwin"
7
- ],
8
- "cpu": [
9
- "arm64"
10
- ],
11
- "license": "Apache-2.0",
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/dazzle-labs/cli"
15
- }
16
- }
File without changes
@@ -1,16 +0,0 @@
1
- {
2
- "name": "@dazzle-labs/cli-darwin-x64",
3
- "version": "0.5.4",
4
- "description": "Dazzle CLI binary for macOS x64",
5
- "os": [
6
- "darwin"
7
- ],
8
- "cpu": [
9
- "x64"
10
- ],
11
- "license": "Apache-2.0",
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/dazzle-labs/cli"
15
- }
16
- }
File without changes
@@ -1,16 +0,0 @@
1
- {
2
- "name": "@dazzle-labs/cli-linux-arm64",
3
- "version": "0.5.4",
4
- "description": "Dazzle CLI binary for Linux ARM64",
5
- "os": [
6
- "linux"
7
- ],
8
- "cpu": [
9
- "arm64"
10
- ],
11
- "license": "Apache-2.0",
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/dazzle-labs/cli"
15
- }
16
- }
File without changes
@@ -1,16 +0,0 @@
1
- {
2
- "name": "@dazzle-labs/cli-linux-x64",
3
- "version": "0.5.4",
4
- "description": "Dazzle CLI binary for Linux x64",
5
- "os": [
6
- "linux"
7
- ],
8
- "cpu": [
9
- "x64"
10
- ],
11
- "license": "Apache-2.0",
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/dazzle-labs/cli"
15
- }
16
- }
File without changes
@@ -1,16 +0,0 @@
1
- {
2
- "name": "@dazzle-labs/cli-win32-arm64",
3
- "version": "0.5.4",
4
- "description": "Dazzle CLI binary for Windows ARM64",
5
- "os": [
6
- "win32"
7
- ],
8
- "cpu": [
9
- "arm64"
10
- ],
11
- "license": "Apache-2.0",
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/dazzle-labs/cli"
15
- }
16
- }
File without changes
@@ -1,16 +0,0 @@
1
- {
2
- "name": "@dazzle-labs/cli-win32-x64",
3
- "version": "0.5.4",
4
- "description": "Dazzle CLI binary for Windows x64",
5
- "os": [
6
- "win32"
7
- ],
8
- "cpu": [
9
- "x64"
10
- ],
11
- "license": "Apache-2.0",
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/dazzle-labs/cli"
15
- }
16
- }