create-react-docs-ui 0.6.2 ā 0.6.3
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/index.js +14 -2
- package/package.json +1 -1
- package/template/package.json +1 -1
package/index.js
CHANGED
|
@@ -48,6 +48,15 @@ function toValidPackageName(projectName) {
|
|
|
48
48
|
.replace(/[^a-z\d\-~]+/g, '-')
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
function getPackageManager() {
|
|
52
|
+
const userAgent = process.env.npm_config_user_agent || ''
|
|
53
|
+
|
|
54
|
+
if (userAgent.includes('pnpm')) return 'pnpm'
|
|
55
|
+
if (userAgent.includes('yarn')) return 'yarn'
|
|
56
|
+
if (userAgent.includes('bun')) return 'bun'
|
|
57
|
+
return 'npm'
|
|
58
|
+
}
|
|
59
|
+
|
|
51
60
|
function findLocalReactLib() {
|
|
52
61
|
// Try to locate the built library in the monorepo for convenience
|
|
53
62
|
const repoRoot = path.resolve(__dirname, '..')
|
|
@@ -115,11 +124,14 @@ async function init() {
|
|
|
115
124
|
|
|
116
125
|
write('package.json', JSON.stringify(pkg, null, 2) + '\n')
|
|
117
126
|
|
|
127
|
+
const pm = getPackageManager()
|
|
128
|
+
const runCmd = pm === 'npm' ? 'npm run' : pm
|
|
129
|
+
|
|
118
130
|
console.log(`\nā
Done! Created ${projectName} at ${root}`)
|
|
119
131
|
console.log('\nš Get started with:')
|
|
120
132
|
console.log(`\n cd ${targetDir}`)
|
|
121
|
-
console.log(
|
|
122
|
-
console.log(
|
|
133
|
+
console.log(` ${pm} install`)
|
|
134
|
+
console.log(` ${runCmd} dev`)
|
|
123
135
|
console.log('\nš Your React Docs UI project is ready!')
|
|
124
136
|
}
|
|
125
137
|
|
package/package.json
CHANGED