@spfx-fast/spfx-workbench 0.1.4 → 0.1.5
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/README.md +1 -1
- package/package.json +1 -1
- package/scripts/diagnose-consumer.mjs +8 -10
- package/scripts/spfx-node-runtime.mjs +3 -3
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ Inspect the consumer's installed runtime versions and an optional component entr
|
|
|
75
75
|
npx spfx-workbench-doctor --component src/components/HelloWorld.tsx --props-file .spfx-workbench/preview-props.json
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
The command emits JSON with per-check `supported`, `unsupported`, or `unknown` status plus mock coverage and provenance. For a props file, it reports the project-relative path and property names, never values, and flags a `context` override. It scans installed `@microsoft/sp-*` packages, including nested `node_modules`,
|
|
78
|
+
The command emits JSON with per-check `supported`, `unsupported`, or `unknown` status plus mock coverage and provenance. For a props file, it reports the project-relative path and property names, never values, and flags a `context` override. It scans installed `@microsoft/sp-*` packages, including nested `node_modules`, accepts SPFx 1.x packages and reports package alignment separately. React 17 and 18 are recognized; other versions are flagged for review. Microsoft’s documented SPFx 1.24.1 Node.js range (22.14+ within 22.x, 24.x, or 26.x) is advisory and unknown for other releases. It never blocks Workbench on a consumer Node mismatch. Workbench itself requires Node `^20.19.0 || >=22.12.0` for Vite 8. The Heft launcher uses the consumer’s installed CLI without a version pin and applies to Heft-based SPFx projects (1.22+); older Gulp-era projects can use preview on a best-effort basis. Missing package metadata is `unknown` and summarized as incomplete. It does not test every SPFx behavior or infer component prop types/API usage.
|
|
79
79
|
|
|
80
80
|
This is an early consumer-loader slice. It supports explicit JSON props and the documented read-only simulator context subset; it does not create full SPFx host context or infer an arbitrary TypeScript props contract. Broader SPFx compatibility checks and live SharePoint validation remain incomplete.
|
|
81
81
|
|
package/package.json
CHANGED
|
@@ -68,10 +68,10 @@ function checkVersion(name, version, supported) {
|
|
|
68
68
|
const match = /^(\d+)\.(\d+)\.(\d+)(?:\+.*)?$/.exec(version);
|
|
69
69
|
if (!match) return { name, status: 'unknown', version, expected: supported };
|
|
70
70
|
const [major, minor, patch] = match.slice(1).map(Number);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return { name, status:
|
|
71
|
+
if (name.startsWith('@microsoft/sp-')) {
|
|
72
|
+
return { name, status: major === 1 ? 'supported' : 'unsupported', version, expected: supported };
|
|
73
|
+
}
|
|
74
|
+
return { name, status: major === 17 || major === 18 ? 'supported' : 'unknown', version, expected: supported };
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
async function diagnose() {
|
|
@@ -100,13 +100,13 @@ async function diagnose() {
|
|
|
100
100
|
const results = [
|
|
101
101
|
...spfxPackages.map((name) => {
|
|
102
102
|
const versions = spfxByName[name];
|
|
103
|
-
const checks = versions.map((version) => checkVersion(name, version, 'SPFx 1.
|
|
103
|
+
const checks = versions.map((version) => checkVersion(name, version, 'SPFx 1.x; Heft-based launcher applies from 1.22'));
|
|
104
104
|
return {
|
|
105
105
|
name,
|
|
106
106
|
status: checks.length === 0 ? 'unknown' : checks.every((check) => check.status === 'supported') ? 'supported' : 'unsupported',
|
|
107
107
|
version: versions.length === 1 ? versions[0] : null,
|
|
108
108
|
versions,
|
|
109
|
-
expected: 'SPFx 1.
|
|
109
|
+
expected: 'SPFx 1.x; Heft-based launcher applies from 1.22',
|
|
110
110
|
};
|
|
111
111
|
}),
|
|
112
112
|
checkVersion('react', reactVersion, '18.3.1'),
|
|
@@ -126,12 +126,10 @@ async function diagnose() {
|
|
|
126
126
|
? 'unknown'
|
|
127
127
|
: spfxByName['@microsoft/sp-webpart-base'].every((version) => version === '1.24.1')
|
|
128
128
|
? 'supported'
|
|
129
|
-
:
|
|
130
|
-
? 'unsupported'
|
|
131
|
-
: 'unknown',
|
|
129
|
+
: 'unknown',
|
|
132
130
|
versions: spfxByName['@microsoft/sp-webpart-base'] ?? [],
|
|
133
131
|
sourceVersion: MOCK_COVERAGE.context.version,
|
|
134
|
-
expected: 'context declaration coverage is verified for SPFx 1.24.1; source review is required for other
|
|
132
|
+
expected: 'context declaration coverage is verified for SPFx 1.24.1; source review is required for other releases',
|
|
135
133
|
},
|
|
136
134
|
];
|
|
137
135
|
if (componentArg) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const SOURCE = 'https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment';
|
|
2
2
|
const EXPECTED = 'SPFx 1.24.1 supports Node.js 22.14.0 or later within 22.x, 24.x, and 26.x';
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/** Reports Microsoft runtime guidance without blocking the local Workbench preview. */
|
|
5
5
|
export function checkSPFxNodeRuntime(spfxVersion, nodeVersion) {
|
|
6
6
|
const result = { name: 'spfx-node-runtime', spfxVersion: spfxVersion ?? null, nodeVersion: nodeVersion ?? null, expected: EXPECTED, source: SOURCE };
|
|
7
7
|
if (spfxVersion !== '1.24.1') {
|
|
@@ -13,7 +13,7 @@ export function checkSPFxNodeRuntime(spfxVersion, nodeVersion) {
|
|
|
13
13
|
const supported = (major === 22 && minor >= 14) || major === 24 || major === 26;
|
|
14
14
|
return {
|
|
15
15
|
...result,
|
|
16
|
-
status: supported ? 'supported' : '
|
|
17
|
-
reason: supported ? 'The active Node.js major/minor is listed by Microsoft for SPFx 1.24.1.' : 'The active Node.js major/minor is
|
|
16
|
+
status: supported ? 'supported' : 'unknown',
|
|
17
|
+
reason: supported ? 'The active Node.js major/minor is listed by Microsoft for SPFx 1.24.1.' : 'The active Node.js major/minor is outside Microsoft’s listed range; this advisory does not block Workbench.',
|
|
18
18
|
};
|
|
19
19
|
}
|