@lexibase/create-rdx 1.0.0-beta.1 → 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 +4 -5
- package/package.json +2 -1
- package/templates/default/package.json +1 -1
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,8 +37,8 @@ function validateProjectName(projectName) {
|
|
|
37
37
|
|
|
38
38
|
function run(command, args, cwd) {
|
|
39
39
|
return new Promise((resolve, reject) => {
|
|
40
|
-
// Reuse the
|
|
41
|
-
//
|
|
40
|
+
// Reuse the Node entry point when available. Otherwise cross-spawn
|
|
41
|
+
// resolves Windows command shims and escapes their arguments.
|
|
42
42
|
const packageManagerEntry = process.env.npm_execpath
|
|
43
43
|
const useNodeEntry =
|
|
44
44
|
command === getPackageManager() &&
|
|
@@ -49,7 +49,6 @@ function run(command, args, cwd) {
|
|
|
49
49
|
const child = spawn(executable, commandArgs, {
|
|
50
50
|
cwd,
|
|
51
51
|
stdio: 'inherit',
|
|
52
|
-
shell: !useNodeEntry && process.platform === 'win32',
|
|
53
52
|
})
|
|
54
53
|
|
|
55
54
|
child.on('error', reject)
|
|
@@ -125,4 +124,4 @@ if (!skipInstall) {
|
|
|
125
124
|
|
|
126
125
|
console.log(`\nRDX project "${projectName}" created successfully.\n`)
|
|
127
126
|
console.log(` cd ${projectName}`)
|
|
128
|
-
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.
|
|
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
|
}
|