@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 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`, requires every installed version to be SPFx 1.24+ and match `@microsoft/sp-core-library` exactly, and checks React and React DOM against 18.3.1. It also checks the current Node.js version against Microsoft's documented SPFx 1.24.1 compatibility: Node 22.14.0 or later within 22.x, 24.x, or 26.x. That check is `unknown` for other SPFx releases until their compatibility source is recorded. This is separate from the package's Vite engine range, which permits Node `^20.19.0 || >=22.12.0`; Node versions valid for Vite may still be unsupported by the consumer's Heft toolchain. Missing package metadata is `unknown` and summarized as incomplete. It does not test every SPFx behavior or infer component prop types/API usage.
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spfx-fast/spfx-workbench",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Local SPFx component preview, diagnostics, SharePoint API capture and replay, and Heft debugging tools.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -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
- const ok = name.startsWith('@microsoft/sp-')
72
- ? major === 1 && minor >= 24
73
- : major === 18 && minor === 3 && patch === 1;
74
- return { name, status: ok ? 'supported' : 'unsupported', version, expected: supported };
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.24 or newer'));
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.24 or newer',
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
- : spfxByName['@microsoft/sp-webpart-base'].some((version) => checkVersion('@microsoft/sp-webpart-base', version, 'SPFx 1.24 or newer').status === 'unsupported')
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 supported releases',
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
- /** Checks only the SPFx release for which the current Microsoft compatibility guidance is explicit. */
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' : 'unsupported',
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 not listed by Microsoft for SPFx 1.24.1.',
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
  }