@webjsdev/server 0.8.51 → 0.8.52
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 +1 -1
- package/src/check.js +0 -26
- package/src/component-elision.js +3 -3
package/package.json
CHANGED
package/src/check.js
CHANGED
|
@@ -129,11 +129,6 @@ export const RULES = [
|
|
|
129
129
|
description:
|
|
130
130
|
'A `\'use server\'` action file that declares HTTP-verb config (any of `method` / `cache` / `tags` / `invalidates` / `validate`, #488) must export exactly ONE callable action function. The config is file-level (it applies to the action in the file), so a second exported function would silently inherit the same verb / cache, which is almost never intended and makes the contract ambiguous. Move the extra function to its own `.server.ts` file (the one-function-per-file convention), or, if it is a private helper, do not export it. Files with no verb config are unaffected.',
|
|
131
131
|
},
|
|
132
|
-
{
|
|
133
|
-
name: 'no-scaffold-placeholder',
|
|
134
|
-
description:
|
|
135
|
-
'The one sentinel-based check, and the deliberate exception to the "objectively broken code" framing of the other rules: it flags scaffold example content that has not been replaced, so a delivered app contains only what the user intended and never leftover scaffold code. `webjs create` marks its example/demo files (the example homepage in app/page.ts, the example app chrome in app/layout.ts) with a one-line marker comment carrying the literal token `webjs-scaffold-placeholder`. The rule scans raw source (the marker lives in a comment, which the redacted scan view would hide) and fails for every file that still carries the token. A freshly scaffolded app fails this rule BY DESIGN until its placeholders are addressed: replace the example content, or deliberately keep it, and in either case delete the marker line. No finished app legitimately ships a literal remove-me marker, so this still qualifies as a check rather than a convention. The marker is acknowledge-and-remove, so keeping a piece is a one-line deletion rather than a forced rewrite.',
|
|
136
|
-
},
|
|
137
132
|
{
|
|
138
133
|
name: 'no-redirect-in-api-route',
|
|
139
134
|
description:
|
|
@@ -668,27 +663,6 @@ export async function checkConventions(appDir) {
|
|
|
668
663
|
}
|
|
669
664
|
}
|
|
670
665
|
|
|
671
|
-
// --- Rule: no-scaffold-placeholder ---
|
|
672
|
-
// `webjs create` marks its example/demo files (app/page.ts, app/layout.ts)
|
|
673
|
-
// with a one-line marker comment so a delivered app cannot silently ship
|
|
674
|
-
// leftover scaffold content. Scan RAW `content`: the marker lives in a
|
|
675
|
-
// comment, which the `scan` view redacts to whitespace. One violation per
|
|
676
|
-
// still-marked file. The token is assembled here so this source does not
|
|
677
|
-
// itself carry the contiguous literal.
|
|
678
|
-
{
|
|
679
|
-
const MARKER = 'webjs-scaffold-' + 'placeholder';
|
|
680
|
-
for (const { rel, content } of files) {
|
|
681
|
-
if (!content.includes(MARKER)) continue;
|
|
682
|
-
violations.push({
|
|
683
|
-
rule: 'no-scaffold-placeholder',
|
|
684
|
-
file: rel,
|
|
685
|
-
message:
|
|
686
|
-
'Scaffold placeholder marker still present. This file is unmodified example content from `webjs create`, and the delivered app should contain only what the user intended, not leftover scaffold code.',
|
|
687
|
-
fix: `Replace the example content (or deliberately keep it), then delete the marker comment line carrying the ${MARKER} token.`,
|
|
688
|
-
});
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
|
|
692
666
|
// --- Rule: no-redirect-in-api-route ---
|
|
693
667
|
// `redirect()` from `@webjsdev/core` throws a control-flow signal designed
|
|
694
668
|
// for the SSR page renderer. In a `route.ts` API handler it goes uncaught
|
package/src/component-elision.js
CHANGED
|
@@ -93,7 +93,7 @@ export const REACTIVE_IMPORTS = new Set([
|
|
|
93
93
|
* defines `render`, and the SSR walker calls it directly. `constructor`
|
|
94
94
|
* is absent for the same reason (it runs during SSR to seed first
|
|
95
95
|
* paint). Keep this list in lockstep with the lifecycle table in
|
|
96
|
-
*
|
|
96
|
+
* the skill's references/components.md.
|
|
97
97
|
*
|
|
98
98
|
* @type {readonly string[]}
|
|
99
99
|
*/
|
|
@@ -134,7 +134,7 @@ export const CLIENT_METHOD_CALLS = ['addController', 'removeController', 'reques
|
|
|
134
134
|
* `lifecycle-coverage.test.js` via prototype introspection), there is no
|
|
135
135
|
* enumerable runtime source of "all static conventions", so the contract is
|
|
136
136
|
* a documented one: a new interactivity static field MUST be added here AND
|
|
137
|
-
* to the lifecycle table in
|
|
137
|
+
* to the lifecycle table in the skill's references/components.md. `sigil-coverage.test.js`
|
|
138
138
|
* asserts each entry is honoured as a ship signal.
|
|
139
139
|
*
|
|
140
140
|
* - `shadow`: Declarative Shadow DOM attaches ONLY during HTML parsing, so a
|
|
@@ -448,7 +448,7 @@ function importsClientRouter(src, literals) {
|
|
|
448
448
|
* `customElements.define` at module top level) imported via a binding clause
|
|
449
449
|
* is NOT caught here, so eliding the importer drops that registration and the
|
|
450
450
|
* element silently does not upgrade. This is the cross-module-registration
|
|
451
|
-
* caveat documented in
|
|
451
|
+
* caveat documented in the skill's references/components.md and server AGENTS invariant 7;
|
|
452
452
|
* the fix is `.server.{js,ts}` for genuinely server-only deps, or an
|
|
453
453
|
* interactivity signal on the consumer. (It is not caught by an SSR crash:
|
|
454
454
|
* the SSR `customElements` shim makes `define` a no-op server-side.)
|