@pacaf/wizard-ux 3.3.0 → 3.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pacaf/wizard-ux",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Browser-based setup wizard for Power Apps Code Apps (parallel to @pacaf/wizard CLI).",
@@ -38,7 +38,7 @@
38
38
  "react-dom": "^19.0.0",
39
39
  "react-resizable-panels": "^2.1.7",
40
40
  "react-router-dom": "^7.1.0",
41
- "@pacaf/wizard": "3.3.2"
41
+ "@pacaf/wizard": "3.3.4"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/react": "^19.0.0",
@@ -81,14 +81,18 @@ function detectPnpm() {
81
81
  }
82
82
  }
83
83
 
84
- async function runInstall(log, { stage, label, projectDir, pnpm, mode, packages = [] }) {
84
+ async function runInstall(log, { stage, label, projectDir, pnpm, mode, packages = [], workspaceRoot = false }) {
85
85
  log.info('');
86
86
  log.info(`[${stage}] ${label} (typically 30s–3min on a cold cache)…`);
87
87
  const bin = pnpm
88
88
  ? toolCommand('pnpm')
89
89
  : toolCommand('npm');
90
+ // When scaffolding into a pnpm workspace root (pnpm-workspace.yaml present),
91
+ // `pnpm add` aborts with ERR_PNPM_ADDING_TO_ROOT unless -w is passed. See
92
+ // issue #76.
93
+ const rootFlag = pnpm && workspaceRoot ? ['-w'] : [];
90
94
  const baseArgs = pnpm
91
- ? (mode === 'base' ? ['install'] : mode === 'dev' ? ['add', '-D', ...packages] : ['add', ...packages])
95
+ ? (mode === 'base' ? ['install'] : mode === 'dev' ? ['add', '-D', ...rootFlag, ...packages] : ['add', ...rootFlag, ...packages])
92
96
  : (mode === 'base' ? ['install'] : mode === 'dev' ? ['install', '-D', ...packages] : ['install', ...packages]);
93
97
  const noisyArgs = pnpm
94
98
  ? ['--reporter=append-only', ...baseArgs]
@@ -284,21 +288,28 @@ export default {
284
288
  log.info('pnpm not found — using npm. Tip: `corepack enable && corepack prepare pnpm@latest --activate` makes Step 7 noticeably faster.');
285
289
  }
286
290
 
287
- if (await runInstall(log, { stage: '1/3', label: 'Installing base dependencies', projectDir, pnpm, mode: 'base' })) {
291
+ // pnpm refuses `pnpm add` at a workspace root (pnpm-workspace.yaml present)
292
+ // without -w, which would silently fail the runtime/dev installs. See issue #76.
293
+ const workspaceRoot = pnpm && SCAFFOLD.isPnpmWorkspaceRoot(projectDir);
294
+ if (workspaceRoot) {
295
+ log.warn('This is a pnpm workspace root (pnpm-workspace.yaml present) — adding packages with --workspace-root (-w).');
296
+ }
297
+
298
+ if (await runInstall(log, { stage: '1/3', label: 'Installing base dependencies', projectDir, pnpm, mode: 'base', workspaceRoot })) {
288
299
  log.ok('[1/3] Base dependencies installed');
289
300
  } else {
290
301
  log.warn('[1/3] Base dependency install reported errors; continuing to merge required packages.');
291
302
  }
292
303
 
293
304
  const prodPkgs = SCAFFOLD.packageSpecs(SCAFFOLD.REQUIRED_RUNTIME_PACKAGES);
294
- if (await runInstall(log, { stage: '2/3', label: 'Installing runtime packages (React, Fluent UI, TanStack Query, SDK)', projectDir, pnpm, mode: 'prod', packages: prodPkgs })) {
305
+ if (await runInstall(log, { stage: '2/3', label: 'Installing runtime packages (React, Fluent UI, TanStack Query, SDK)', projectDir, pnpm, mode: 'prod', packages: prodPkgs, workspaceRoot })) {
295
306
  log.ok('[2/3] Runtime packages installed');
296
307
  } else {
297
308
  log.warn('[2/3] Some runtime packages failed to install.');
298
309
  }
299
310
 
300
311
  const devPkgs = SCAFFOLD.packageSpecs(SCAFFOLD.REQUIRED_DEV_PACKAGES);
301
- if (await runInstall(log, { stage: '3/3', label: 'Installing dev dependencies (Vitest, ESLint, Playwright, @pacaf/scripts)', projectDir, pnpm, mode: 'dev', packages: devPkgs })) {
312
+ if (await runInstall(log, { stage: '3/3', label: 'Installing dev dependencies (Vitest, ESLint, Playwright, @pacaf/scripts)', projectDir, pnpm, mode: 'dev', packages: devPkgs, workspaceRoot })) {
302
313
  log.ok('[3/3] Dev packages installed');
303
314
  } else {
304
315
  log.warn('[3/3] Some dev packages failed to install.');