@qt-test/apex-dsl-compiler 0.1.0

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.
@@ -0,0 +1,237 @@
1
+ import { C as ComponentConfig } from './ast-DEVgojMx.mjs';
2
+ export { A as ACSSDeclaration, a as ACSSImport, b as ACSSKeyframe, c as ACSSKeyframesRule, d as ACSSMediaRule, e as ACSSRule, f as ACSSSelector, g as ACSSStyleRule, h as ACSSStylesheet, i as AXMLAttribute, j as AXMLAttributeValue, k as AXMLComment, l as AXMLDirective, m as AXMLElement, n as AXMLEventBinding, o as AXMLExpression, p as AXMLLiteral, q as AXMLNode, r as AXMLTemplate, s as AXMLText, B as BaseNode, t as CompiledUnit, D as DirectiveName, E as EventModifier, P as Position, S as SourceLocation } from './ast-DEVgojMx.mjs';
3
+ import { AXMLCompileResult } from './axml/index.mjs';
4
+ export { AXMLCompileOptions, compileAXML, parseAXML } from './axml/index.mjs';
5
+ import { ACSSCompileResult } from './acss/index.mjs';
6
+ export { ACSSCompileOptions, compileACSS, parseACSS } from './acss/index.mjs';
7
+
8
+ /**
9
+ * Source Map Generator
10
+ *
11
+ * Generates source maps for compiled AXML/ACSS
12
+ */
13
+ /**
14
+ * Source map interface (v3 format)
15
+ */
16
+ interface SourceMap {
17
+ /** Source map version */
18
+ version: 3;
19
+ /** Generated file name */
20
+ file?: string;
21
+ /** Source root for resolving source paths */
22
+ sourceRoot?: string;
23
+ /** Source file names */
24
+ sources: string[];
25
+ /** Source content (optional) */
26
+ sourcesContent?: (string | null)[];
27
+ /** Symbol names */
28
+ names: string[];
29
+ /** Mappings encoded in VLQ */
30
+ mappings: string;
31
+ }
32
+ /**
33
+ * Source map options
34
+ */
35
+ interface SourceMapOptions {
36
+ /** Output file name */
37
+ file?: string;
38
+ /** Source root */
39
+ sourceRoot?: string;
40
+ /** Source file names */
41
+ sources: string[];
42
+ /** Include source content */
43
+ includeContent?: boolean;
44
+ /** Source contents */
45
+ sourcesContent?: string[];
46
+ }
47
+ /**
48
+ * Source map builder
49
+ */
50
+ declare class SourceMapBuilder {
51
+ private file?;
52
+ private sourceRoot?;
53
+ private sources;
54
+ private sourcesContent;
55
+ private names;
56
+ private mappings;
57
+ private currentLine;
58
+ constructor(options?: SourceMapOptions);
59
+ /**
60
+ * Adds a source file
61
+ */
62
+ addSource(source: string, content?: string): number;
63
+ /**
64
+ * Adds a name
65
+ */
66
+ addName(name: string): number;
67
+ /**
68
+ * Adds a mapping
69
+ */
70
+ addMapping(generatedLine: number, generatedColumn: number, sourceIndex?: number, sourceLine?: number, sourceColumn?: number, nameIndex?: number): void;
71
+ /**
72
+ * Starts a new line
73
+ */
74
+ newLine(): void;
75
+ /**
76
+ * Generates the source map
77
+ */
78
+ toSourceMap(): SourceMap;
79
+ /**
80
+ * Encodes mappings to VLQ format
81
+ */
82
+ private encodeMappings;
83
+ /**
84
+ * Returns JSON string
85
+ */
86
+ toString(): string;
87
+ /**
88
+ * Returns data URL
89
+ */
90
+ toDataUrl(): string;
91
+ /**
92
+ * Returns inline comment
93
+ */
94
+ toComment(): string;
95
+ }
96
+ /**
97
+ * Creates a source map from options
98
+ */
99
+ declare function createSourceMap(options: SourceMapOptions): SourceMap;
100
+ /**
101
+ * Merges multiple source maps
102
+ */
103
+ declare function mergeSourceMaps(maps: SourceMap[]): SourceMap;
104
+ /**
105
+ * Applies a source map to generated positions
106
+ */
107
+ declare function applySourceMap(map: SourceMap, line: number, column: number): {
108
+ source: string | null;
109
+ line: number;
110
+ column: number;
111
+ name: string | null;
112
+ } | null;
113
+
114
+ /**
115
+ * Main Compiler
116
+ *
117
+ * Orchestrates the compilation of AXML, ACSS, and config files
118
+ */
119
+
120
+ /**
121
+ * Compile options
122
+ */
123
+ interface CompileOptions {
124
+ /** AXML template source */
125
+ axml?: string;
126
+ /** ACSS style source */
127
+ acss?: string;
128
+ /** JSON config */
129
+ json?: ComponentConfig | string;
130
+ /** JavaScript source (pass through) */
131
+ js?: string;
132
+ /** File name for source maps */
133
+ filename?: string;
134
+ /** Generate source maps */
135
+ sourceMap?: boolean;
136
+ /** Minify output */
137
+ minify?: boolean;
138
+ /** Target environment */
139
+ target?: 'es2015' | 'es2020' | 'esnext';
140
+ /** Component mode (vs page mode) */
141
+ isComponent?: boolean;
142
+ /** Custom components mapping */
143
+ components?: Record<string, string>;
144
+ }
145
+ /**
146
+ * Compile result
147
+ */
148
+ interface CompileResult {
149
+ /** Generated JavaScript code */
150
+ code: string;
151
+ /** Generated CSS */
152
+ css: string;
153
+ /** Processed config */
154
+ config: ComponentConfig;
155
+ /** Source map (if enabled) */
156
+ map?: SourceMap;
157
+ /** Compilation warnings */
158
+ warnings: CompileWarning[];
159
+ /** Compilation errors */
160
+ errors: CompileError[];
161
+ /** Template AST (for debugging) */
162
+ templateAst?: AXMLCompileResult['ast'];
163
+ /** Style AST (for debugging) */
164
+ styleAst?: ACSSCompileResult['ast'];
165
+ }
166
+ interface CompileWarning {
167
+ message: string;
168
+ loc?: {
169
+ line: number;
170
+ column: number;
171
+ };
172
+ source?: string;
173
+ }
174
+ interface CompileError extends CompileWarning {
175
+ code: string;
176
+ }
177
+ /**
178
+ * Compiles APEX mini-app source files
179
+ */
180
+ declare function compile(options: CompileOptions): CompileResult;
181
+ /**
182
+ * Validates a compiled result
183
+ */
184
+ declare function validate(result: CompileResult): boolean;
185
+ /**
186
+ * Formats compilation errors for display
187
+ */
188
+ declare function formatErrors(result: CompileResult): string;
189
+
190
+ /**
191
+ * Code Generator
192
+ *
193
+ * Generates JavaScript code from compiled AXML/ACSS
194
+ */
195
+
196
+ /**
197
+ * Generator options
198
+ */
199
+ interface GeneratorOptions {
200
+ /** Component mode (vs page mode) */
201
+ isComponent: boolean;
202
+ /** Minify output */
203
+ minify: boolean;
204
+ /** Target ES version */
205
+ target: 'es2015' | 'es2020' | 'esnext';
206
+ /** Generate source maps */
207
+ sourceMap: boolean;
208
+ /** Source filename */
209
+ filename?: string;
210
+ }
211
+ /**
212
+ * Generator input
213
+ */
214
+ interface GeneratorInput {
215
+ /** Compiled template */
216
+ template: AXMLCompileResult | null;
217
+ /** Compiled styles */
218
+ styles: ACSSCompileResult | null;
219
+ /** Component config */
220
+ config: ComponentConfig;
221
+ /** JavaScript source (pass through) */
222
+ js?: string;
223
+ }
224
+ /**
225
+ * Generates JavaScript code
226
+ */
227
+ declare function generateCode(input: GeneratorInput, options: GeneratorOptions): string;
228
+
229
+ /**
230
+ * @qt-test/apex-compiler
231
+ *
232
+ * AXML/ACSS compiler for APEX mini-app platform
233
+ */
234
+
235
+ declare const VERSION = "0.1.0";
236
+
237
+ export { ACSSCompileResult, AXMLCompileResult, type CompileError, type CompileOptions, type CompileResult, type CompileWarning, ComponentConfig, type GeneratorInput, type GeneratorOptions, type SourceMap, SourceMapBuilder, type SourceMapOptions, VERSION, applySourceMap, compile, createSourceMap, formatErrors, generateCode, mergeSourceMaps, validate };
@@ -0,0 +1,237 @@
1
+ import { C as ComponentConfig } from './ast-DEVgojMx.js';
2
+ export { A as ACSSDeclaration, a as ACSSImport, b as ACSSKeyframe, c as ACSSKeyframesRule, d as ACSSMediaRule, e as ACSSRule, f as ACSSSelector, g as ACSSStyleRule, h as ACSSStylesheet, i as AXMLAttribute, j as AXMLAttributeValue, k as AXMLComment, l as AXMLDirective, m as AXMLElement, n as AXMLEventBinding, o as AXMLExpression, p as AXMLLiteral, q as AXMLNode, r as AXMLTemplate, s as AXMLText, B as BaseNode, t as CompiledUnit, D as DirectiveName, E as EventModifier, P as Position, S as SourceLocation } from './ast-DEVgojMx.js';
3
+ import { AXMLCompileResult } from './axml/index.js';
4
+ export { AXMLCompileOptions, compileAXML, parseAXML } from './axml/index.js';
5
+ import { ACSSCompileResult } from './acss/index.js';
6
+ export { ACSSCompileOptions, compileACSS, parseACSS } from './acss/index.js';
7
+
8
+ /**
9
+ * Source Map Generator
10
+ *
11
+ * Generates source maps for compiled AXML/ACSS
12
+ */
13
+ /**
14
+ * Source map interface (v3 format)
15
+ */
16
+ interface SourceMap {
17
+ /** Source map version */
18
+ version: 3;
19
+ /** Generated file name */
20
+ file?: string;
21
+ /** Source root for resolving source paths */
22
+ sourceRoot?: string;
23
+ /** Source file names */
24
+ sources: string[];
25
+ /** Source content (optional) */
26
+ sourcesContent?: (string | null)[];
27
+ /** Symbol names */
28
+ names: string[];
29
+ /** Mappings encoded in VLQ */
30
+ mappings: string;
31
+ }
32
+ /**
33
+ * Source map options
34
+ */
35
+ interface SourceMapOptions {
36
+ /** Output file name */
37
+ file?: string;
38
+ /** Source root */
39
+ sourceRoot?: string;
40
+ /** Source file names */
41
+ sources: string[];
42
+ /** Include source content */
43
+ includeContent?: boolean;
44
+ /** Source contents */
45
+ sourcesContent?: string[];
46
+ }
47
+ /**
48
+ * Source map builder
49
+ */
50
+ declare class SourceMapBuilder {
51
+ private file?;
52
+ private sourceRoot?;
53
+ private sources;
54
+ private sourcesContent;
55
+ private names;
56
+ private mappings;
57
+ private currentLine;
58
+ constructor(options?: SourceMapOptions);
59
+ /**
60
+ * Adds a source file
61
+ */
62
+ addSource(source: string, content?: string): number;
63
+ /**
64
+ * Adds a name
65
+ */
66
+ addName(name: string): number;
67
+ /**
68
+ * Adds a mapping
69
+ */
70
+ addMapping(generatedLine: number, generatedColumn: number, sourceIndex?: number, sourceLine?: number, sourceColumn?: number, nameIndex?: number): void;
71
+ /**
72
+ * Starts a new line
73
+ */
74
+ newLine(): void;
75
+ /**
76
+ * Generates the source map
77
+ */
78
+ toSourceMap(): SourceMap;
79
+ /**
80
+ * Encodes mappings to VLQ format
81
+ */
82
+ private encodeMappings;
83
+ /**
84
+ * Returns JSON string
85
+ */
86
+ toString(): string;
87
+ /**
88
+ * Returns data URL
89
+ */
90
+ toDataUrl(): string;
91
+ /**
92
+ * Returns inline comment
93
+ */
94
+ toComment(): string;
95
+ }
96
+ /**
97
+ * Creates a source map from options
98
+ */
99
+ declare function createSourceMap(options: SourceMapOptions): SourceMap;
100
+ /**
101
+ * Merges multiple source maps
102
+ */
103
+ declare function mergeSourceMaps(maps: SourceMap[]): SourceMap;
104
+ /**
105
+ * Applies a source map to generated positions
106
+ */
107
+ declare function applySourceMap(map: SourceMap, line: number, column: number): {
108
+ source: string | null;
109
+ line: number;
110
+ column: number;
111
+ name: string | null;
112
+ } | null;
113
+
114
+ /**
115
+ * Main Compiler
116
+ *
117
+ * Orchestrates the compilation of AXML, ACSS, and config files
118
+ */
119
+
120
+ /**
121
+ * Compile options
122
+ */
123
+ interface CompileOptions {
124
+ /** AXML template source */
125
+ axml?: string;
126
+ /** ACSS style source */
127
+ acss?: string;
128
+ /** JSON config */
129
+ json?: ComponentConfig | string;
130
+ /** JavaScript source (pass through) */
131
+ js?: string;
132
+ /** File name for source maps */
133
+ filename?: string;
134
+ /** Generate source maps */
135
+ sourceMap?: boolean;
136
+ /** Minify output */
137
+ minify?: boolean;
138
+ /** Target environment */
139
+ target?: 'es2015' | 'es2020' | 'esnext';
140
+ /** Component mode (vs page mode) */
141
+ isComponent?: boolean;
142
+ /** Custom components mapping */
143
+ components?: Record<string, string>;
144
+ }
145
+ /**
146
+ * Compile result
147
+ */
148
+ interface CompileResult {
149
+ /** Generated JavaScript code */
150
+ code: string;
151
+ /** Generated CSS */
152
+ css: string;
153
+ /** Processed config */
154
+ config: ComponentConfig;
155
+ /** Source map (if enabled) */
156
+ map?: SourceMap;
157
+ /** Compilation warnings */
158
+ warnings: CompileWarning[];
159
+ /** Compilation errors */
160
+ errors: CompileError[];
161
+ /** Template AST (for debugging) */
162
+ templateAst?: AXMLCompileResult['ast'];
163
+ /** Style AST (for debugging) */
164
+ styleAst?: ACSSCompileResult['ast'];
165
+ }
166
+ interface CompileWarning {
167
+ message: string;
168
+ loc?: {
169
+ line: number;
170
+ column: number;
171
+ };
172
+ source?: string;
173
+ }
174
+ interface CompileError extends CompileWarning {
175
+ code: string;
176
+ }
177
+ /**
178
+ * Compiles APEX mini-app source files
179
+ */
180
+ declare function compile(options: CompileOptions): CompileResult;
181
+ /**
182
+ * Validates a compiled result
183
+ */
184
+ declare function validate(result: CompileResult): boolean;
185
+ /**
186
+ * Formats compilation errors for display
187
+ */
188
+ declare function formatErrors(result: CompileResult): string;
189
+
190
+ /**
191
+ * Code Generator
192
+ *
193
+ * Generates JavaScript code from compiled AXML/ACSS
194
+ */
195
+
196
+ /**
197
+ * Generator options
198
+ */
199
+ interface GeneratorOptions {
200
+ /** Component mode (vs page mode) */
201
+ isComponent: boolean;
202
+ /** Minify output */
203
+ minify: boolean;
204
+ /** Target ES version */
205
+ target: 'es2015' | 'es2020' | 'esnext';
206
+ /** Generate source maps */
207
+ sourceMap: boolean;
208
+ /** Source filename */
209
+ filename?: string;
210
+ }
211
+ /**
212
+ * Generator input
213
+ */
214
+ interface GeneratorInput {
215
+ /** Compiled template */
216
+ template: AXMLCompileResult | null;
217
+ /** Compiled styles */
218
+ styles: ACSSCompileResult | null;
219
+ /** Component config */
220
+ config: ComponentConfig;
221
+ /** JavaScript source (pass through) */
222
+ js?: string;
223
+ }
224
+ /**
225
+ * Generates JavaScript code
226
+ */
227
+ declare function generateCode(input: GeneratorInput, options: GeneratorOptions): string;
228
+
229
+ /**
230
+ * @qt-test/apex-compiler
231
+ *
232
+ * AXML/ACSS compiler for APEX mini-app platform
233
+ */
234
+
235
+ declare const VERSION = "0.1.0";
236
+
237
+ export { ACSSCompileResult, AXMLCompileResult, type CompileError, type CompileOptions, type CompileResult, type CompileWarning, ComponentConfig, type GeneratorInput, type GeneratorOptions, type SourceMap, SourceMapBuilder, type SourceMapOptions, VERSION, applySourceMap, compile, createSourceMap, formatErrors, generateCode, mergeSourceMaps, validate };