imxc 0.5.4 → 0.6.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.
- package/dist/compile.d.ts +8 -0
- package/dist/compile.js +285 -25
- package/dist/components.js +597 -45
- package/dist/diagnostics.js +3 -2
- package/dist/emitter.d.ts +6 -3
- package/dist/emitter.js +1454 -322
- package/dist/index.js +34 -7
- package/dist/init.d.ts +7 -1
- package/dist/init.js +43 -455
- package/dist/ir.d.ts +437 -5
- package/dist/lowering.d.ts +4 -3
- package/dist/lowering.js +770 -57
- package/dist/parser.d.ts +1 -0
- package/dist/templates/async.d.ts +1 -0
- package/dist/templates/async.js +228 -0
- package/dist/templates/custom.d.ts +15 -0
- package/dist/templates/custom.js +945 -0
- package/dist/templates/filedialog.d.ts +1 -0
- package/dist/templates/filedialog.js +216 -0
- package/dist/templates/hotreload.d.ts +1 -0
- package/dist/templates/hotreload.js +400 -0
- package/dist/templates/index.d.ts +16 -0
- package/dist/templates/index.js +553 -0
- package/dist/templates/minimal.d.ts +1 -0
- package/dist/templates/minimal.js +165 -0
- package/dist/templates/networking.d.ts +1 -0
- package/dist/templates/networking.js +244 -0
- package/dist/templates/persistence.d.ts +1 -0
- package/dist/templates/persistence.js +238 -0
- package/dist/validator.d.ts +1 -0
- package/dist/validator.js +51 -22
- package/dist/watch.d.ts +2 -1
- package/dist/watch.js +21 -4
- package/package.json +2 -4
package/dist/diagnostics.js
CHANGED
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
export function formatDiagnostic(error, source) {
|
|
5
5
|
const lines = source.split('\n');
|
|
6
6
|
const lineIdx = error.line - 1;
|
|
7
|
-
// Header: file:line:col - error: message
|
|
8
|
-
const
|
|
7
|
+
// Header: file:line:col - error/warning: message
|
|
8
|
+
const level = error.severity ?? 'error';
|
|
9
|
+
const header = `${error.file}:${error.line}:${error.col} - ${level}: ${error.message}`;
|
|
9
10
|
if (lineIdx < 0 || lineIdx >= lines.length) {
|
|
10
11
|
return header;
|
|
11
12
|
}
|
package/dist/emitter.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { IRComponent } from './ir.js';
|
|
2
|
+
import type { FontDeclaration } from './compile.js';
|
|
2
3
|
/**
|
|
3
4
|
* Emit a .gen.h header for a component that has props.
|
|
4
5
|
* Contains the props struct and function forward declaration.
|
|
5
6
|
*/
|
|
6
|
-
export declare function emitComponentHeader(comp: IRComponent, sourceFile?: string, boundProps?: Set<string>): string;
|
|
7
|
+
export declare function emitComponentHeader(comp: IRComponent, sourceFile?: string, boundProps?: Set<string>, sharedPropsType?: string, resolvedBoundTypes?: Map<string, string>): string;
|
|
7
8
|
export interface ImportInfo {
|
|
8
9
|
name: string;
|
|
9
10
|
headerFile: string;
|
|
10
11
|
}
|
|
11
|
-
export declare function emitComponent(comp: IRComponent, imports?: ImportInfo[], sourceFile?: string, boundProps?: Set<string>, boundPropsMap?: Map<string, Set<string
|
|
12
|
-
|
|
12
|
+
export declare function emitComponent(comp: IRComponent, imports?: ImportInfo[], sourceFile?: string, boundProps?: Set<string>, boundPropsMap?: Map<string, Set<string>>, options?: {
|
|
13
|
+
sourceMap?: boolean;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function emitRoot(rootName: string, stateCount: number, bufferCount: number, sourceFile?: string, propsType?: string, namedPropsType?: boolean, fontDeclarations?: FontDeclaration[]): string;
|