@rangular-framework/compiler 1.0.1 → 1.0.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/dist/compiler/src/catalog.js +2 -2
- package/dist/compiler/src/codegen/generate.js +1 -1
- package/dist/compiler/src/compile.d.ts +1 -1
- package/dist/compiler/src/compile.js +1 -1
- package/dist/compiler/src/diagnostics.js +2 -2
- package/dist/compiler/src/doctor.d.ts +1 -1
- package/dist/compiler/src/fix.js +2 -2
- package/package.json +1 -1
|
@@ -132,7 +132,7 @@ function renderCatalogMarkdown(catalog) {
|
|
|
132
132
|
const lines = [];
|
|
133
133
|
lines.push('# Rangular catalog');
|
|
134
134
|
lines.push('');
|
|
135
|
-
lines.push(`Generated by \`
|
|
135
|
+
lines.push(`Generated by \`rangular catalog\` from the compiler, UI primitives and tokens, do not edit by hand. Version ${catalog.version}.`);
|
|
136
136
|
lines.push('');
|
|
137
137
|
lines.push('## Template tags');
|
|
138
138
|
lines.push('');
|
|
@@ -192,7 +192,7 @@ function renderCatalogMarkdown(catalog) {
|
|
|
192
192
|
for (const d of catalog.diagnostics)
|
|
193
193
|
lines.push(`| ${d.code} | ${d.meaning} |`);
|
|
194
194
|
lines.push('');
|
|
195
|
-
lines.push('Diagnostics also carry a `fix:` suggestion in human output and in `
|
|
195
|
+
lines.push('Diagnostics also carry a `fix:` suggestion in human output and in `rangular build --json`.');
|
|
196
196
|
lines.push('');
|
|
197
197
|
return lines.join('\n');
|
|
198
198
|
}
|
|
@@ -2857,7 +2857,7 @@ class Generator {
|
|
|
2857
2857
|
// the app throws at startup (guardrail test finding,
|
|
2858
2858
|
// 2026-11-29: a root component that injects Router, carries
|
|
2859
2859
|
// a screen and declares routes, but hosts no outlet,
|
|
2860
|
-
// passed
|
|
2860
|
+
// passed rangular verify and crashed with a ReferenceError in
|
|
2861
2861
|
// the web export). Name the shape here, at the read site,
|
|
2862
2862
|
// once per compilation. Child units never reach this
|
|
2863
2863
|
// branch (opts.entry is false), so a routed page component
|
|
@@ -70,7 +70,7 @@ export interface CompileResult {
|
|
|
70
70
|
routes: ResolvedRoute[];
|
|
71
71
|
/**
|
|
72
72
|
* Every source file this compilation read (Stage 5): the entry .ts, the
|
|
73
|
-
* templates, and every resolved relative import. `
|
|
73
|
+
* templates, and every resolved relative import. `rangular watch` watches
|
|
74
74
|
* exactly this set and re-resolves it after each compile.
|
|
75
75
|
*/
|
|
76
76
|
files: string[];
|
|
@@ -501,7 +501,7 @@ function compileComponent(options) {
|
|
|
501
501
|
entryUsage.outlet ? 'a <router-outlet>' : '',
|
|
502
502
|
entryUsage.links ? 'routerLink' : '',
|
|
503
503
|
injectsRouter ? 'a Router/ActivatedRoute injection' : '',
|
|
504
|
-
].filter(Boolean).join(', ')}) but no routes file was found at '${routesSpecifier}'`, undefined, undefined, "Create app.routes.ts next to the root component: export const routes: Routes = [{ path: 'home', component: HomeComponent }]; or pass the routes file explicitly (
|
|
504
|
+
].filter(Boolean).join(', ')}) but no routes file was found at '${routesSpecifier}'`, undefined, undefined, "Create app.routes.ts next to the root component: export const routes: Routes = [{ path: 'home', component: HomeComponent }]; or pass the routes file explicitly (rangular build --routes <file>)"),
|
|
505
505
|
file: entryKey,
|
|
506
506
|
});
|
|
507
507
|
}
|
|
@@ -104,10 +104,10 @@ exports.DIAGNOSTIC_CODES = {
|
|
|
104
104
|
DOC_RAW_TEXT: 'Doctor: loose text sits directly inside a container element instead of a text element.',
|
|
105
105
|
DOC_TAP_TARGET: 'Doctor: an element with a (click) binding is sized below the 44 by 44 minimum tap target.',
|
|
106
106
|
DOC_IMG_SIZE: 'Doctor: an image element has no declared width and height.',
|
|
107
|
-
CLI_INIT_NOT_EMPTY: 'The
|
|
107
|
+
CLI_INIT_NOT_EMPTY: 'The rangular init command was pointed at a directory that is not empty.',
|
|
108
108
|
PIPE_UNKNOWN: 'A template uses a pipe that is neither a built-in pipe nor a @Pipe class resolved in this compilation; the JSON form lists the known pipes in the fix.',
|
|
109
109
|
GEN_VALIDATOR_ARG: 'A static minlength or maxlength attribute value is not a plain number; the validator was dropped instead of emitting the text into generated code.',
|
|
110
110
|
DIR_UNSUPPORTED: 'An attribute directive is outside the supported subset (a bracket selector, @Input fields, an ElementRef, and ngOnInit or setter bodies made only of this.el.nativeElement.style.<prop> assignments), or it is used on a host the subset cannot style; the directive applied no styles.',
|
|
111
111
|
PROJECTION_SELECT_UNSUPPORTED: 'An <ng-content> carries a select attribute; multi-slot projection is not supported yet, so the element behaves as the default slot and receives all projected children.',
|
|
112
|
-
CLI_INIT_UNSAFE: 'The
|
|
112
|
+
CLI_INIT_UNSAFE: 'The rangular init target name is not a safe directory name (letters, digits, dot, underscore and hyphen only, and not . or ..); nothing was written.',
|
|
113
113
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CompileResult } from './compile';
|
|
2
2
|
import { Diagnostic } from './diagnostics';
|
|
3
3
|
/**
|
|
4
|
-
* `
|
|
4
|
+
* `rangular doctor` (Stage 5): the polish linter from docs/UI_POLISH.md
|
|
5
5
|
* part 4. It reads the same compiled artefacts the compiler produced
|
|
6
6
|
* (template ASTs, parsed styles) plus the raw style texts (for line
|
|
7
7
|
* numbers and the suppression comment), and reports findings as ordinary
|
package/dist/compiler/src/fix.js
CHANGED
|
@@ -20,7 +20,7 @@ function fixStyleText(text) {
|
|
|
20
20
|
const bare = /^(\s*)([a-zA-Z-]+)\s*:/.exec(decl);
|
|
21
21
|
if (bare && !css_1.SUPPORTED_STYLE_PROPERTIES.has(camelCase(bare[2]))) {
|
|
22
22
|
fixes.push({ code: 'CSS_UNSUPPORTED', detail: `removed '${bare[2]}' from '${selector.trim()}'` });
|
|
23
|
-
return `${bare[1]}/*
|
|
23
|
+
return `${bare[1]}/* rangular fix: removed '${bare[2]}' (CSS_UNSUPPORTED: not a supported property) */`;
|
|
24
24
|
}
|
|
25
25
|
return decl;
|
|
26
26
|
}
|
|
@@ -28,7 +28,7 @@ function fixStyleText(text) {
|
|
|
28
28
|
const prop = camelCase(rawProp);
|
|
29
29
|
if (!css_1.SUPPORTED_STYLE_PROPERTIES.has(prop)) {
|
|
30
30
|
fixes.push({ code: 'CSS_UNSUPPORTED', detail: `removed '${rawProp}' from '${selector.trim()}'` });
|
|
31
|
-
return `${lead}/*
|
|
31
|
+
return `${lead}/* rangular fix: removed '${rawProp}' (CSS_UNSUPPORTED: not a supported property) */${tail}`;
|
|
32
32
|
}
|
|
33
33
|
const value = Number(numText);
|
|
34
34
|
const snapped = (0, css_1.snapForProp)(prop, value);
|