@pacaf/wizard-ux 3.0.7 → 3.0.8

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.0.7",
3
+ "version": "3.0.8",
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).",
@@ -90,27 +90,51 @@ export default {
90
90
  }
91
91
 
92
92
  // Python 3 (used by Dataverse-skills plugin)
93
+ // On Windows, `python3` may resolve to the Microsoft Store App Execution Alias stub
94
+ // (%LOCALAPPDATA%\Microsoft\WindowsApps\python3.exe) which exits non-zero and prints
95
+ // "Python was not found; run without arguments to install from the Microsoft Store..."
96
+ // We treat any command whose --version output doesn't start with "Python 3" as absent
97
+ // and fall through to the next candidate. Priority order:
98
+ // python3 → python → py -3 (py launcher is Windows-only)
99
+ function tryPythonCmd(cmd) {
100
+ const raw = tryRun(`${cmd} --version`) || '';
101
+ // Store stub returns empty (non-zero exit trapped by tryRun) or the "not found" message
102
+ if (!raw.startsWith('Python 3')) return null;
103
+ return raw.replace('Python ', '').trim();
104
+ }
105
+
93
106
  let pythonCmd = null;
94
- if (hasCommand('python3')) pythonCmd = 'python3';
95
- else if (hasCommand('python')) pythonCmd = 'python';
107
+ let pythonVersion = null;
108
+
109
+ const candidates = ['python3', 'python'];
110
+ if (platform() === 'win32') candidates.push('py');
111
+
112
+ for (const candidate of candidates) {
113
+ if (!hasCommand(candidate)) continue;
114
+ const ver = candidate === 'py' ? tryRun('py -3 --version')?.replace('Python ', '').trim() || null
115
+ : tryPythonCmd(candidate);
116
+ if (ver) {
117
+ pythonCmd = candidate === 'py' ? 'py' : candidate;
118
+ pythonVersion = ver;
119
+ break;
120
+ }
121
+ }
96
122
 
97
123
  if (pythonCmd) {
98
- const pyVer = tryRun(`${pythonCmd} --version`)?.replace('Python ', '') || '';
99
- const pyMajor = parseInt(pyVer, 10);
100
- if (pyMajor >= 3) {
101
- checks.push({ name: 'Python', ok: true, value: pyVer, hint: null });
102
- log.ok(`Python ${pyVer}`);
124
+ checks.push({ name: 'Python', ok: true, value: pythonVersion, hint: null });
125
+ log.ok(`Python ${pythonVersion}${pythonCmd === 'py' ? ' (via py launcher)' : ''}`);
126
+ } else {
127
+ const winHint = platform() === 'win32'
128
+ ? ' On Windows, ensure "Add python.exe to PATH" was checked during install, or disable the Microsoft Store python3 alias in Settings → Apps → Advanced app settings → App execution aliases.'
129
+ : '';
130
+ checks.push({ name: 'Python', ok: false, value: null, hint: `Required for Dataverse-skills plugin (https://www.python.org/downloads/).${winHint}` });
131
+ log.warn('Python 3 — not found (required for Dataverse-skills plugin)');
132
+ if (platform() === 'win32') {
133
+ log.info(' → Install Python 3 from https://www.python.org/downloads/ — check "Add python.exe to PATH"');
134
+ log.info(' → Or disable the Store stub: Settings → Apps → Advanced app settings → App execution aliases → turn off python3.exe');
103
135
  } else {
104
- checks.push({ name: 'Python', ok: false, value: pyVer, hint: 'Python 3+ required for Dataverse-skills plugin (https://www.python.org/downloads/)' });
105
- log.warn(`Python ${pyVer} — Python 3+ required for Dataverse-skills plugin`);
106
136
  log.info(' → Install Python 3: https://www.python.org/downloads/');
107
- log.info(' → Then re-run this step to verify');
108
- pythonCmd = null;
109
137
  }
110
- } else {
111
- checks.push({ name: 'Python', ok: false, value: null, hint: 'Required for Dataverse-skills plugin (https://www.python.org/downloads/)' });
112
- log.warn('Python 3 — not found (required for Dataverse-skills plugin)');
113
- log.info(' → Install Python 3: https://www.python.org/downloads/');
114
138
  log.info(' → Then re-run this step to verify');
115
139
  }
116
140