@opentiny/tiny-robot-cli 0.5.2-alpha.12 → 0.5.2-alpha.13
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/commands/add.js +5 -1
- package/bin/utils.js +6 -2
- package/package.json +2 -2
package/bin/commands/add.js
CHANGED
|
@@ -30,7 +30,7 @@ const DEPENDENCIES = {
|
|
|
30
30
|
'@vueuse/core': VUEUSE_VERSION,
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
async function resolveTargetPackage(cwd) {
|
|
33
|
+
export async function resolveTargetPackage(cwd) {
|
|
34
34
|
const workspaceRoot = findWorkspaceRoot(cwd)
|
|
35
35
|
|
|
36
36
|
if (workspaceRoot) {
|
|
@@ -43,6 +43,10 @@ async function resolveTargetPackage(cwd) {
|
|
|
43
43
|
const workspacePatterns = findWorkspacePackages(workspaceRoot)
|
|
44
44
|
const packageDirs = listPackages(workspaceRoot, workspacePatterns)
|
|
45
45
|
|
|
46
|
+
if (workspacePatterns.length === 0 && fs.existsSync(path.join(workspaceRoot, 'package.json'))) {
|
|
47
|
+
return workspaceRoot
|
|
48
|
+
}
|
|
49
|
+
|
|
46
50
|
invariant(packageDirs.length > 0, 'no packages found in workspace.')
|
|
47
51
|
|
|
48
52
|
return select({
|
package/bin/utils.js
CHANGED
|
@@ -196,8 +196,12 @@ export function findWorkspacePackages(workspaceRoot) {
|
|
|
196
196
|
(pattern) => typeof pattern === 'string' && pattern.length > 0 && !pattern.startsWith('!'),
|
|
197
197
|
)
|
|
198
198
|
: []
|
|
199
|
-
} catch {
|
|
200
|
-
|
|
199
|
+
} catch (error) {
|
|
200
|
+
const reason = error instanceof Error ? error.message : String(error)
|
|
201
|
+
|
|
202
|
+
throw new Error(`Invalid pnpm workspace configuration in ${workspaceFile}: ${reason}`, {
|
|
203
|
+
cause: error,
|
|
204
|
+
})
|
|
201
205
|
}
|
|
202
206
|
}
|
|
203
207
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-robot-cli",
|
|
3
|
-
"version": "0.5.2-alpha.
|
|
3
|
+
"version": "0.5.2-alpha.13",
|
|
4
4
|
"description": "CLI to scaffold TinyRobot product projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"semver": "^7.8.1",
|
|
34
34
|
"yaml": "^2.9.0"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "afeda129637cd33e0771ff9fee90a268a1ff55d5"
|
|
37
37
|
}
|