@botonic/create-workspace 2.31.1-alpha.0 ā 2.31.1-alpha.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/create-workspace.js +9 -2
- package/package.json +1 -1
package/bin/create-workspace.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const { execSync } = require('child_process')
|
|
4
|
+
const path = require('path')
|
|
4
5
|
const yargs = require('yargs/yargs')
|
|
5
6
|
const { hideBin } = require('yargs/helpers')
|
|
6
7
|
|
|
8
|
+
const ownPkg = require(path.join(__dirname, '..', 'package.json'))
|
|
9
|
+
const ownVersion = ownPkg.version
|
|
10
|
+
const createNxWorkspaceVersion = (
|
|
11
|
+
ownPkg.dependencies?.['create-nx-workspace'] || '21.0.3'
|
|
12
|
+
).replace(/^[\^~]/, '')
|
|
13
|
+
|
|
7
14
|
const argv = yargs(hideBin(process.argv))
|
|
8
15
|
.usage('Usage: $0 <workspace-name> [options]')
|
|
9
16
|
.command('$0 <name>', 'Create a new Botonic workspace', yargs => {
|
|
@@ -55,7 +62,7 @@ if (registry) {
|
|
|
55
62
|
try {
|
|
56
63
|
// Step 1: Create the workspace using create-nx-workspace with TypeScript preset
|
|
57
64
|
const createCommand = [
|
|
58
|
-
|
|
65
|
+
`npx create-nx-workspace@${createNxWorkspaceVersion}`,
|
|
59
66
|
workspaceName,
|
|
60
67
|
'--preset=ts',
|
|
61
68
|
'--packageManager=pnpm',
|
|
@@ -99,7 +106,7 @@ try {
|
|
|
99
106
|
// vitest@^1||^2||^3 as a peer. In a Verdaccio-backed workspace only workspace packages
|
|
100
107
|
// are published, so pnpm can't resolve vitest@3.x and fails. The bot-app itself uses
|
|
101
108
|
// vitest@4; we install the correct version later when the generated package.json lands.
|
|
102
|
-
const installPluginCommand = `pnpm add -D @botonic/nx-plugin --no-strict-peer-dependencies`
|
|
109
|
+
const installPluginCommand = `pnpm add -D @botonic/nx-plugin@${ownVersion} --no-strict-peer-dependencies`
|
|
103
110
|
|
|
104
111
|
console.log(
|
|
105
112
|
`\nš¦ Installing Botonic plugin from ${registry || 'public npm'}: ${installPluginCommand}`
|