@lexibase/create-rdx 1.0.0-beta.0 → 1.0.0-beta.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/bin/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { spawn } from 'node:child_process'
4
3
  import path from 'node:path'
5
4
  import { fileURLToPath } from 'node:url'
6
5
 
6
+ import spawn from 'cross-spawn'
7
7
  import fs from 'fs-extra'
8
8
  import prompts from 'prompts'
9
9
 
@@ -37,7 +37,19 @@ function validateProjectName(projectName) {
37
37
 
38
38
  function run(command, args, cwd) {
39
39
  return new Promise((resolve, reject) => {
40
- const child = spawn(command, args, { cwd, stdio: 'inherit' })
40
+ // Reuse the Node entry point when available. Otherwise cross-spawn
41
+ // resolves Windows command shims and escapes their arguments.
42
+ const packageManagerEntry = process.env.npm_execpath
43
+ const useNodeEntry =
44
+ command === getPackageManager() &&
45
+ packageManagerEntry &&
46
+ /\.[cm]?js$/i.test(packageManagerEntry)
47
+ const executable = useNodeEntry ? process.execPath : command
48
+ const commandArgs = useNodeEntry ? [packageManagerEntry, ...args] : args
49
+ const child = spawn(executable, commandArgs, {
50
+ cwd,
51
+ stdio: 'inherit',
52
+ })
41
53
 
42
54
  child.on('error', reject)
43
55
  child.on('exit', (code) => {
@@ -112,4 +124,4 @@ if (!skipInstall) {
112
124
 
113
125
  console.log(`\nRDX project "${projectName}" created successfully.\n`)
114
126
  console.log(` cd ${projectName}`)
115
- console.log(` ${packageManager} dev\n`)
127
+ console.log(` ${packageManager === 'npm' ? 'npm run' : packageManager} dev\n`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexibase/create-rdx",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "Create a new RDX documentation project.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -28,6 +28,7 @@
28
28
  },
29
29
  "homepage": "https://github.com/lexibase/rdx#readme",
30
30
  "dependencies": {
31
+ "cross-spawn": "^7.0.6",
31
32
  "fs-extra": "^11.1.1",
32
33
  "prompts": "^2.4.2"
33
34
  }
@@ -9,7 +9,7 @@
9
9
  "start": "rdx start"
10
10
  },
11
11
  "dependencies": {
12
- "@lexibase/rdx-next": "^1.0.0-beta.0",
12
+ "@lexibase/rdx-next": "^1.0.0-beta.3",
13
13
  "next": "^15.5.0",
14
14
  "react": "19.1.0",
15
15
  "react-dom": "19.1.0"