@rangular-framework/cli 0.0.0-stage → 1.0.1
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/cli/src/cli.js +1229 -0
- package/dist/compiler/src/catalog.js +198 -0
- package/dist/compiler/src/class/formInit.js +370 -0
- package/dist/compiler/src/class/parseComponent.js +430 -0
- package/dist/compiler/src/class/parseDirective.js +227 -0
- package/dist/compiler/src/class/parseRoutes.js +163 -0
- package/dist/compiler/src/codegen/generate.js +3466 -0
- package/dist/compiler/src/codegen/methods.js +975 -0
- package/dist/compiler/src/codegen/sourceMap.js +77 -0
- package/dist/compiler/src/compile.js +775 -0
- package/dist/compiler/src/diagnostics.js +113 -0
- package/dist/compiler/src/doctor.js +144 -0
- package/dist/compiler/src/fix.js +44 -0
- package/dist/compiler/src/index.js +38 -0
- package/dist/compiler/src/preview/renderPreview.js +7158 -0
- package/dist/compiler/src/preview/styleSnapshot.js +268 -0
- package/dist/compiler/src/propTable.js +107 -0
- package/dist/compiler/src/style/css.js +161 -0
- package/dist/compiler/src/template/ast.js +19 -0
- package/dist/compiler/src/template/evaluate.js +151 -0
- package/dist/compiler/src/template/expr.js +360 -0
- package/dist/compiler/src/template/forms.js +80 -0
- package/dist/compiler/src/template/literal.js +248 -0
- package/dist/compiler/src/template/parser.js +230 -0
- package/dist/compiler/src/template/pipes.js +225 -0
- package/dist/compiler/src/template/printAst.js +38 -0
- package/dist/compiler/src/template/structural.js +51 -0
- package/dist/runtime/src/index.js +1197 -0
- package/dist/ui/src/chart.js +196 -0
- package/dist/ui/src/datetime.js +240 -0
- package/dist/ui/src/icons.js +310 -0
- package/dist/ui/src/mask.js +103 -0
- package/dist/ui/src/palette.js +141 -0
- package/dist/ui/src/tokens.js +173 -0
- package/package.json +28 -4
- package/README.md +0 -3
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Source maps (Stage 5, M7): a small hand-written base64 VLQ encoder and
|
|
4
|
+
* a mappings builder, no dependencies. Granularity is deliberately block
|
|
5
|
+
* level in v1: the generated component function start maps back to the
|
|
6
|
+
* class declaration in the .ts file, and each top level template
|
|
7
|
+
* element's generated JSX start maps back to that element's position in
|
|
8
|
+
* the template file. Per-expression mappings are post-v1.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.encodeVlq = encodeVlq;
|
|
12
|
+
exports.buildMappings = buildMappings;
|
|
13
|
+
exports.makeSourceMap = makeSourceMap;
|
|
14
|
+
const B64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
15
|
+
/** Encode one signed integer as base64 VLQ. */
|
|
16
|
+
function encodeVlq(value) {
|
|
17
|
+
let v = value < 0 ? ((-value) << 1) | 1 : value << 1;
|
|
18
|
+
let out = '';
|
|
19
|
+
do {
|
|
20
|
+
let digit = v & 31;
|
|
21
|
+
v >>>= 5;
|
|
22
|
+
if (v > 0)
|
|
23
|
+
digit |= 32; // continuation bit
|
|
24
|
+
out += B64[digit];
|
|
25
|
+
} while (v > 0);
|
|
26
|
+
return out;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Build the mappings string from raw segments. Segments are sorted by
|
|
30
|
+
* generated position, duplicates at the same generated position are
|
|
31
|
+
* dropped (first wins), and every field is encoded relative to the
|
|
32
|
+
* previous segment, with the generated column resetting per line.
|
|
33
|
+
*/
|
|
34
|
+
function buildMappings(segments) {
|
|
35
|
+
const sorted = [...segments].sort((a, b) => a.generatedLine - b.generatedLine || a.generatedColumn - b.generatedColumn);
|
|
36
|
+
const lines = [];
|
|
37
|
+
let prevSource = 0;
|
|
38
|
+
let prevSourceLine = 0;
|
|
39
|
+
let prevSourceColumn = 0;
|
|
40
|
+
let currentLine = 0;
|
|
41
|
+
let prevGenColumn = 0;
|
|
42
|
+
let lineBuf = '';
|
|
43
|
+
const flush = () => { lines.push(lineBuf); lineBuf = ''; };
|
|
44
|
+
for (const seg of sorted) {
|
|
45
|
+
while (currentLine < seg.generatedLine) {
|
|
46
|
+
flush();
|
|
47
|
+
currentLine++;
|
|
48
|
+
prevGenColumn = 0;
|
|
49
|
+
}
|
|
50
|
+
if (lineBuf)
|
|
51
|
+
lineBuf += ',';
|
|
52
|
+
lineBuf += encodeVlq(seg.generatedColumn - prevGenColumn)
|
|
53
|
+
+ encodeVlq(seg.sourceIndex - prevSource)
|
|
54
|
+
+ encodeVlq(seg.sourceLine - prevSourceLine)
|
|
55
|
+
+ encodeVlq(seg.sourceColumn - prevSourceColumn);
|
|
56
|
+
prevGenColumn = seg.generatedColumn;
|
|
57
|
+
prevSource = seg.sourceIndex;
|
|
58
|
+
prevSourceLine = seg.sourceLine;
|
|
59
|
+
prevSourceColumn = seg.sourceColumn;
|
|
60
|
+
}
|
|
61
|
+
flush();
|
|
62
|
+
return lines.join(';');
|
|
63
|
+
}
|
|
64
|
+
/** Assemble a complete source map v3 object. */
|
|
65
|
+
function makeSourceMap(sources, segments, opts = {}) {
|
|
66
|
+
const map = {
|
|
67
|
+
version: 3,
|
|
68
|
+
sources,
|
|
69
|
+
names: [],
|
|
70
|
+
mappings: buildMappings(segments),
|
|
71
|
+
};
|
|
72
|
+
if (opts.file)
|
|
73
|
+
map.file = opts.file;
|
|
74
|
+
if (opts.sourcesContent)
|
|
75
|
+
map.sourcesContent = opts.sourcesContent;
|
|
76
|
+
return map;
|
|
77
|
+
}
|