diff --git a/docs/by-example/36-reflection.md b/docs/by-example/36-reflection.md new file mode 100644 index 00000000000..b63f91fb49f --- /dev/null +++ b/docs/by-example/36-reflection.md @@ -0,0 +1,66 @@ +--- +title: Type reflection +id: type-reflection +slug: /type-reflection +sidebar_label: Type reflection +description: Type reflection +keywords: [Wing language, Type reflection] +image: /img/wing-by-example.png +--- + +The `@type` intrinsic function returns a reflection of the type passed to it. + +You can access its `.kind` property to get the kind of the type, and use various helper methods like `.asStruct()`, `.asClass()`, `.asInterface()`, etc. to access related properties. + +```js playground example title="main.w" +let generateJsonSchema = (structType: std.reflect.Type): str => { + if let st = structType.asStruct() { + let schema = MutJson { + type: "object", + properties: {}, + required: [] + }; + + for name in st.fields.keys() { + let fieldSchema = MutJson {}; + let var field = st.fields[name].child; + let var required = true; + if let opt = field.asOptional() { + required = false; + field = opt.child; + } + + if field.kind == "str" { + fieldSchema["type"] = "string"; + } else if field.kind == "num" { + fieldSchema["type"] = "number"; + } // ...handle other types + + schema["properties"][name] = fieldSchema; + if required { + // TODO: https://github.com/winglang/wing/issues/6929 + unsafeCast(schema["required"])?.push(name); + } + } + + return Json.stringify(schema); + } + + throw "input must be a struct type"; +}; + +struct User { + name: str; + age: num; + email: str?; +} + +log(generateJsonSchema(@type(User))); +``` + +```bash title="Wing console output" +# Run locally with wing console +{"type":"object","properties":{"age":{"type":"number"},"email":{"type":"string"},"name":{"type":"string"}},"required":["age","name"]} +``` + + diff --git a/packages/@winglang/sdk/src/std/index.ts b/packages/@winglang/sdk/src/std/index.ts index 52451e6243a..07e641004f2 100644 --- a/packages/@winglang/sdk/src/std/index.ts +++ b/packages/@winglang/sdk/src/std/index.ts @@ -16,3 +16,5 @@ export * from "./string"; export * from "./struct"; export * from "./test"; export * from "./test-runner"; + +export * as reflect from "./reflect"; diff --git a/packages/@winglang/sdk/src/std/reflect/index.ts b/packages/@winglang/sdk/src/std/reflect/index.ts new file mode 100644 index 00000000000..b47d9d9e13a --- /dev/null +++ b/packages/@winglang/sdk/src/std/reflect/index.ts @@ -0,0 +1 @@ +export * from "./type"; diff --git a/packages/@winglang/sdk/src/std/reflect/type.ts b/packages/@winglang/sdk/src/std/reflect/type.ts new file mode 100644 index 00000000000..12741fa1887 --- /dev/null +++ b/packages/@winglang/sdk/src/std/reflect/type.ts @@ -0,0 +1,1008 @@ +import { InflightClient } from "../../core/inflight"; +import { normalPath } from "../../shared/misc"; +import { ILiftable } from "../resource"; + +/** + * ITypeElement is a representation of a Wing type element. + */ +export interface ITypeElement extends ILiftable { + /** + * Get the immediate dependencies of this type element. + * @returns The immediate dependencies of this type element. + * @internal + */ + _getDependencies(): Set; + + /** + * Generate inflight code for this type element. + * + * The first return value is the code to initialize the type element + * (leaving fields uninitialized), and the second return value is + * the code to initialize the fields of the type element. + * + * @internal + */ + _toInflightWithContext( + context: Map + ): [string, Array]; +} + +/** + * Type is a representation of a Wing type. + * + * Use the "kind" property to determine what kind of type this is, and use + * one of the "as" methods to extract more specific information. + */ +export class Type implements ITypeElement { + /** @internal */ + public static _toInflightType(): string { + return InflightClient.forType(__filename, this.name); + } + + /** @internal */ + public static _ofClass(cls: ClassType): Type { + return new Type("class", cls); + } + + /** @internal */ + public static _ofInterface(iface: InterfaceType): Type { + return new Type("interface", iface); + } + + /** @internal */ + public static _ofStruct(s: StructType): Type { + return new Type("struct", s); + } + + /** @internal */ + public static _ofEnum(e: EnumType): Type { + return new Type("enum", e); + } + + /** @internal */ + public static _ofNum(): Type { + return new Type("num", undefined); + } + + /** @internal */ + public static _ofStr(): Type { + return new Type("str", undefined); + } + + /** @internal */ + public static _ofDuration(): Type { + return new Type("duration", undefined); + } + + /** @internal */ + public static _ofRegex(): Type { + return new Type("regex", undefined); + } + + /** @internal */ + public static _ofBytes(): Type { + return new Type("bytes", undefined); + } + + /** @internal */ + public static _ofBool(): Type { + return new Type("bool", undefined); + } + + /** @internal */ + public static _ofVoid(): Type { + return new Type("void", undefined); + } + + /** @internal */ + public static _ofJson(): Type { + return new Type("json", undefined); + } + + /** @internal */ + public static _ofMutJson(): Type { + return new Type("mutjson", undefined); + } + + /** @internal */ + public static _ofDatetime(): Type { + return new Type("datetime", undefined); + } + + /** @internal */ + public static _ofAny(): Type { + return new Type("any", undefined); + } + + /** @internal */ + public static _ofOptional(t: Type): Type { + return new Type("optional", new OptionalType(t)); + } + + /** @internal */ + public static _ofArray(t: Type, isMut: boolean): Type { + return new Type(isMut ? "mutarray" : "array", new ArrayType(t, isMut)); + } + + /** @internal */ + public static _ofMap(t: Type, isMut: boolean): Type { + return new Type(isMut ? "mutmap" : "map", new MapType(t, isMut)); + } + + /** @internal */ + public static _ofSet(t: Type, isMut: boolean): Type { + return new Type(isMut ? "mutset" : "set", new SetType(t, isMut)); + } + + /** @internal */ + public static _ofFunction(f: FunctionType): Type { + return new Type("function", f); + } + + /** + * What kind of type this is. + */ + public readonly kind: string; + private readonly data: ITypeElement | undefined; + + private constructor(kind: string, data: ITypeElement | undefined) { + this.kind = kind; + this.data = data; + } + + /** + * Get the ClassType if this is a class. + * @returns The ClassType or undefined if this is not a class. + */ + public asClass(): ClassType | undefined { + if (this.kind === "class") { + return this.data as ClassType; + } + return undefined; + } + + /** + * Get the InterfaceType if this is an interface. + * @returns The InterfaceType or undefined if this is not an interface. + */ + public asInterface(): InterfaceType | undefined { + if (this.kind === "interface") { + return this.data as InterfaceType; + } + return undefined; + } + + /** + * Get the StructType if this is a struct. + * @returns The StructType or undefined if this is not a struct. + */ + public asStruct(): StructType | undefined { + if (this.kind === "struct") { + return this.data as StructType; + } + return undefined; + } + + /** + * Get the EnumType if this is an enum. + * @returns The EnumType or undefined if this is not an enum. + */ + public asEnum(): EnumType | undefined { + if (this.kind === "enum") { + return this.data as EnumType; + } + return undefined; + } + + /** + * Get the FunctionType if this is a function. + * @returns The FunctionType or undefined if this is not a function. + */ + public asFunction(): FunctionType | undefined { + if (this.kind === "function") { + return this.data as FunctionType; + } + return undefined; + } + + /** + * Get the ArrayType if this is an array. + * @returns The ArrayType or undefined if this is not an array. + */ + public asArray(): ArrayType | undefined { + if (this.kind === "array" || this.kind === "mutarray") { + return this.data as ArrayType; + } + return undefined; + } + + /** + * Get the MapType if this is a map. + * @returns The MapType or undefined if this is not a map. + */ + public asMap(): MapType | undefined { + if (this.kind === "map" || this.kind === "mutmap") { + return this.data as MapType; + } + return undefined; + } + + /** + * Get the SetType if this is a set. + * @returns The SetType or undefined if this is not a set. + */ + public asSet(): SetType | undefined { + if (this.kind === "set" || this.kind === "mutset") { + return this.data as SetType; + } + return undefined; + } + + /** + * Get the OptionalType if this is an optional. + * @returns The OptionalType or undefined if this is not an optional. + */ + public asOptional(): OptionalType | undefined { + if (this.kind === "optional") { + return this.data as OptionalType; + } + return undefined; + } + + /** + * Get the string representation of this type. + * @returns The string representation of this type. + */ + public toString(): string { + switch (this.kind) { + case "class": + case "interface": + case "struct": + case "enum": + case "function": + case "array": + case "mutarray": + case "map": + case "mutmap": + case "set": + case "mutset": + case "optional": + return this.data!.toString(); + case "json": + return "Json"; + case "mutjson": + return "MutJson"; + } + return this.kind; + } + + /** @internal */ + public _toInflight(): string { + return toInflightTypeElement(this); + } + + /** @internal */ + public _toInflightWithContext( + context: Map + ): [string, Array] { + const varName = context.get(this)!; + const declaration = `const ${varName} = new (require("${normalPath( + __filename + )}").Type)("${this.kind}", undefined);`; + const initialization: string[] = []; + const dataVarName = context.get(this.data!); + if (dataVarName) { + initialization.push(`${varName}.data = ${dataVarName}`); + } + return [declaration, initialization]; + } + + /** @internal */ + public _getDependencies(): Set { + if (this.data === undefined) { + return new Set(); + } + return new Set([this.data]); + } +} + +/** + * ClassType is a representation of a Wing class type. + */ +export class ClassType implements ITypeElement { + /** The name of the class. */ + public readonly name: string; + /** The fully qualified name of the class. */ + public readonly fqn: string | undefined; + /** The base class of the class. */ + public readonly base: ClassType | undefined; + /** The interfaces that the class implements. */ + public readonly interfaces: ClassType[] = []; + /** The properties of the class. */ + public readonly properties: { [key: string]: Property }; + /** The methods of the class. */ + public readonly methods: { [key: string]: Method }; + + constructor( + name: string, + fqn: string | undefined, + base?: ClassType, + interfaces: ClassType[] = [], + properties: { [key: string]: Property } = {}, + methods: { [key: string]: Method } = {} + ) { + this.name = name; + this.fqn = fqn; + this.base = base; + this.interfaces = interfaces; + this.properties = properties; + this.methods = methods; + } + + /** @internal */ + public _toInflight(): string { + return toInflightTypeElement(this); + } + + /** @internal */ + public _toInflightWithContext( + context: Map + ): [string, Array] { + const varName = context.get(this)!; + const declaration = `const ${varName} = new (require("${normalPath( + __filename + )}").ClassType)("${this.name}", ${ + this.fqn ? `"${this.fqn}"` : "undefined" + });`; + const initialization: string[] = []; + if (this.base) { + const baseVarName = context.get(this.base)!; + initialization.push(`${varName}.base = ${baseVarName};`); + } + for (const iface of this.interfaces) { + const ifaceVarName = context.get(iface)!; + initialization.push(`${varName}.interfaces.push(${ifaceVarName});`); + } + for (const prop of Object.values(this.properties)) { + const propVarName = context.get(prop)!; + initialization.push( + `${varName}.properties["${prop.name}"] = ${propVarName};` + ); + } + for (const method of Object.values(this.methods)) { + const methodVarName = context.get(method)!; + initialization.push( + `${varName}.methods["${method.name}"] = ${methodVarName};` + ); + } + return [declaration, initialization]; + } + + public toString(): string { + return this.name; + } + + /** @internal */ + public _getDependencies(): Set { + const result = new Set(); + if (this.base) { + result.add(this.base); + } + for (const iface of this.interfaces) { + result.add(iface); + } + for (const prop of Object.values(this.properties)) { + result.add(prop); + } + for (const method of Object.values(this.methods)) { + result.add(method); + } + return result; + } +} + +/** + * InterfaceType is a representation of a Wing interface type. + */ +export class InterfaceType implements ITypeElement { + /** The name of the interface. */ + public readonly name: string; + /** The fully qualified name of the interface. */ + public readonly fqn: string | undefined; + /** The interfaces that the interface extends. */ + public readonly bases: InterfaceType[]; + /** The properties of the interface. */ + public readonly properties: { [key: string]: Property }; + /** The methods of the interface. */ + public readonly methods: { [key: string]: Method }; + + constructor( + name: string, + fqn: string | undefined, + bases: InterfaceType[] = [], + properties: { [key: string]: Property } = {}, + methods: { [key: string]: Method } = {} + ) { + this.name = name; + this.fqn = fqn; + this.bases = bases; + this.properties = properties; + this.methods = methods; + } + + /** @internal */ + public _toInflight(): string { + return toInflightTypeElement(this); + } + + /** @internal */ + public _toInflightWithContext( + context: Map + ): [string, Array] { + const varName = context.get(this)!; + const declaration = `const ${varName} = new (require("${normalPath( + __filename + )}").InterfaceType)("${this.name}", ${ + this.fqn ? `"${this.fqn}"` : "undefined" + });`; + const initialization: string[] = []; + for (const base of this.bases) { + const baseVarName = context.get(base)!; + initialization.push(`${varName}.bases.push(${baseVarName});`); + } + for (const prop of Object.values(this.properties)) { + const propVarName = context.get(prop)!; + initialization.push( + `${varName}.properties["${prop.name}"] = ${propVarName};` + ); + } + for (const method of Object.values(this.methods)) { + const methodVarName = context.get(method)!; + initialization.push( + `${varName}.methods["${method.name}"] = ${methodVarName};` + ); + } + return [declaration, initialization]; + } + + public toString(): string { + return this.name; + } + + /** @internal */ + public _getDependencies(): Set { + const result = new Set(); + for (const base of this.bases) { + result.add(base); + } + for (const prop of Object.values(this.properties)) { + result.add(prop); + } + for (const method of Object.values(this.methods)) { + result.add(method); + } + return result; + } +} + +/** + * StructType is a representation of a Wing struct type. + */ +export class StructType implements ITypeElement { + /** The name of the struct. */ + public readonly name: string; + /** The fully qualified name of the struct. */ + public readonly fqn: string | undefined; + /** The structs that the struct extends. */ + public readonly bases: StructType[]; + /** The fields of the struct. */ + public readonly fields: { [key: string]: Property }; + + constructor( + name: string, + fqn: string | undefined, + bases: StructType[] = [], + fields: { [key: string]: Property } = {} + ) { + this.name = name; + this.fqn = fqn; + this.bases = bases; + this.fields = fields; + } + + /** @internal */ + public _toInflight(): string { + return toInflightTypeElement(this); + } + + /** @internal */ + public _toInflightWithContext( + context: Map + ): [string, Array] { + const varName = context.get(this)!; + const declaration = `const ${varName} = new (require("${normalPath( + __filename + )}").StructType)("${this.name}", ${ + this.fqn ? `"${this.fqn}"` : "undefined" + });`; + const initialization: string[] = []; + for (const base of this.bases) { + const baseVarName = context.get(base)!; + initialization.push(`${varName}.bases.push(${baseVarName});`); + } + for (const field of Object.values(this.fields)) { + const fieldVarName = context.get(field)!; + initialization.push( + `${varName}.fields["${field.name}"] = ${fieldVarName};` + ); + } + return [declaration, initialization]; + } + + public toString(): string { + return this.name; + } + + /** @internal */ + public _getDependencies(): Set { + const result = new Set(); + for (const base of this.bases) { + result.add(base); + } + for (const field of Object.values(this.fields)) { + result.add(field); + } + return result; + } +} + +/** + * EnumType is a representation of a Wing enum type. + */ +export class EnumType implements ITypeElement { + /** The name of the enum. */ + public readonly name: string; + /** The fully qualified name of the enum. */ + public readonly fqn: string | undefined; + /** The variants of the enum. */ + public readonly variants: { [key: string]: EnumVariant }; + + constructor( + name: string, + fqn: string | undefined, + variants: { [key: string]: EnumVariant } = {} + ) { + this.name = name; + this.fqn = fqn; + this.variants = variants; + } + + /** @internal */ + public _toInflight(): string { + return toInflightTypeElement(this); + } + + /** @internal */ + public _toInflightWithContext( + context: Map + ): [string, Array] { + const varName = context.get(this)!; + const declaration = `const ${varName} = new (require("${normalPath( + __filename + )}").EnumType)("${this.name}", ${ + this.fqn ? `"${this.fqn}"` : "undefined" + });`; + const initialization: string[] = []; + for (const variant of Object.values(this.variants)) { + const variantVarName = context.get(variant)!; + initialization.push( + `${varName}.variants["${variant.name}"] = ${variantVarName};` + ); + } + return [declaration, initialization]; + } + + public toString(): string { + return this.name; + } + + /** @internal */ + public _getDependencies(): Set { + const result = new Set(); + for (const variant of Object.values(this.variants)) { + result.add(variant); + } + return result; + } +} + +/** + * EnumVariant is a representation of a Wing enum variant. + */ +export class EnumVariant implements ITypeElement { + /** The name of the enum variant. */ + public readonly name: string; + + constructor(name: string) { + this.name = name; + } + + /** @internal */ + public _toInflight(): string { + return toInflightTypeElement(this); + } + + /** @internal */ + public _toInflightWithContext( + context: Map + ): [string, Array] { + const varName = context.get(this)!; + return [ + `const ${varName} = new (require("${normalPath( + __filename + )}").EnumVariant)("${this.name}");`, + [], + ]; + } + + public toString(): string { + return this.name; + } + + /** @internal */ + public _getDependencies(): Set { + return new Set(); + } +} + +/** + * Property is a representation of a Wing property. + */ +export class Property implements ITypeElement { + /** The name of the property. */ + public readonly name: string; + /** The type of the property. */ + public readonly child: Type; + + constructor(name: string, child: Type) { + this.name = name; + this.child = child; + } + + /** @internal */ + public _toInflight(): string { + return toInflightTypeElement(this); + } + + /** @internal */ + public _toInflightWithContext( + context: Map + ): [string, Array] { + const varName = context.get(this)!; + const declaration = `const ${varName} = new (require("${normalPath( + __filename + )}").Property)("${this.name}");`; + const initialization: string[] = []; + const childVarName = context.get(this.child)!; + initialization.push(`${varName}.child = ${childVarName};`); + return [declaration, initialization]; + } + + /** @internal */ + public _getDependencies(): Set { + return new Set([this.child]); + } +} + +/** + * Method is a representation of a Wing method. + */ +export class Method implements ITypeElement { + /** The name of the method. */ + public readonly name: string; + /** Whether the method is static. */ + public readonly isStatic: boolean; + /** The function type of the method. */ + public readonly child: FunctionType; + + constructor(name: string, isStatic: boolean, child: FunctionType) { + this.name = name; + this.isStatic = isStatic; + this.child = child; + } + + /** @internal */ + public _toInflight(): string { + return toInflightTypeElement(this); + } + + /** @internal */ + public _toInflightWithContext( + context: Map + ): [string, Array] { + const varName = context.get(this)!; + const declaration = `const ${varName} = new (require("${normalPath( + __filename + )}").Method)("${this.name}", ${this.isStatic});`; + const initialization: string[] = []; + const childVarName = context.get(this.child)!; + initialization.push(`${varName}.child = ${childVarName};`); + return [declaration, initialization]; + } + + /** @internal */ + public _getDependencies(): Set { + return new Set([this.child]); + } +} + +/** + * ArrayType is a representation of a Wing array or mutarray type. + */ +export class ArrayType implements ITypeElement { + /** The type of the elements in the array. */ + public readonly child: Type; + /** Whether the array is mutable. */ + public readonly isMut: boolean; + + constructor(child: Type, isMut: boolean) { + this.child = child; + this.isMut = isMut; + } + + /** @internal */ + public _toInflight(): string { + return toInflightTypeElement(this); + } + + /** @internal */ + public _toInflightWithContext( + context: Map + ): [string, Array] { + const varName = context.get(this)!; + const declaration = `const ${varName} = new (require("${normalPath( + __filename + )}").ArrayType)(undefined, ${this.isMut});`; + const initialization: string[] = []; + const childVarName = context.get(this.child)!; + initialization.push(`${varName}.child = ${childVarName};`); + return [declaration, initialization]; + } + + public toString(): string { + return `${this.isMut ? "Mut" : ""}Array<${this.child.toString()}>`; + } + + /** @internal */ + public _getDependencies(): Set { + return new Set([this.child]); + } +} + +/** + * MapType is a representation of a Wing map or mutmap type. + */ +export class MapType implements ITypeElement { + /** The type of the elements in the map. */ + public readonly child: Type; + /** Whether the map is mutable. */ + public readonly isMut: boolean; + + constructor(child: Type, isMut: boolean) { + this.child = child; + this.isMut = isMut; + } + + /** @internal */ + public _toInflight(): string { + return toInflightTypeElement(this); + } + + /** @internal */ + public _toInflightWithContext( + context: Map + ): [string, Array] { + const varName = context.get(this)!; + const declaration = `const ${varName} = new (require("${normalPath( + __filename + )}").MapType)(undefined, ${this.isMut});`; + const initialization: string[] = []; + const childVarName = context.get(this.child)!; + initialization.push(`${varName}.child = ${childVarName};`); + return [declaration, initialization]; + } + + public toString(): string { + return `${this.isMut ? "Mut" : ""}Map<${this.child.toString()}>`; + } + + /** @internal */ + public _getDependencies(): Set { + return new Set([this.child]); + } +} + +/** + * SetType is a representation of a Wing set or mutset type. + */ +export class SetType implements ITypeElement { + /** The type of the elements in the set. */ + public readonly child: Type; + /** Whether the set is mutable. */ + public readonly isMut: boolean; + + constructor(child: Type, isMut: boolean) { + this.child = child; + this.isMut = isMut; + } + + /** @internal */ + public _toInflight(): string { + return toInflightTypeElement(this); + } + + /** @internal */ + public _toInflightWithContext( + context: Map + ): [string, Array] { + const varName = context.get(this)!; + const declaration = `const ${varName} = new (require("${normalPath( + __filename + )}").SetType)(undefined, ${this.isMut});`; + const initialization: string[] = []; + const childVarName = context.get(this.child)!; + initialization.push(`${varName}.child = ${childVarName};`); + return [declaration, initialization]; + } + + public toString(): string { + return `${this.isMut ? "Mut" : ""}Set<${this.child.toString()}>`; + } + + /** @internal */ + public _getDependencies(): Set { + return new Set([this.child]); + } +} + +/** + * OptionalType is a representation of a Wing optional type. + */ +export class OptionalType implements ITypeElement { + /** The type of the optional. */ + public readonly child: Type; + + constructor(child: Type) { + this.child = child; + } + + /** @internal */ + public _toInflight(): string { + return toInflightTypeElement(this); + } + + /** @internal */ + public _toInflightWithContext( + context: Map + ): [string, Array] { + const varName = context.get(this)!; + const declaration = `const ${varName} = new (require("${normalPath( + __filename + )}").OptionalType)(undefined);`; + const initialization: string[] = []; + const childVarName = context.get(this.child)!; + initialization.push(`${varName}.child = ${childVarName};`); + return [declaration, initialization]; + } + + public toString(): string { + return `${this.child.toString()}?`; + } + + /** @internal */ + public _getDependencies(): Set { + return new Set([this.child]); + } +} + +/** + * FunctionType is a representation of a Wing function type. + */ +export class FunctionType implements ITypeElement { + /** The phase of the function. */ + public readonly phase: Phase; + /** The parameters of the function. */ + public readonly params: Type[]; + /** The return type of the function. */ + public readonly returns: Type; + + constructor(phase: Phase, params: Type[], returns: Type) { + this.phase = phase; + this.params = params ?? []; + this.returns = returns; + } + + /** @internal */ + public _toInflight(): string { + return toInflightTypeElement(this); + } + + /** @internal */ + public _toInflightWithContext( + context: Map + ): [string, Array] { + const varName = context.get(this)!; + const declaration = `const ${varName} = new (require("${normalPath( + __filename + )}").FunctionType)("${this.phase}", [], undefined);`; + const initialization: string[] = []; + for (const param of this.params) { + const paramVarName = context.get(param)!; + initialization.push(`${varName}.params.push(${paramVarName});`); + } + const returnsVarName = context.get(this.returns)!; + initialization.push(`${varName}.returns = ${returnsVarName};`); + return [declaration, initialization]; + } + + public toString(): string { + let str = ""; + if (this.phase === Phase.INFLIGHT) { + str += "inflight "; + } else if (this.phase === Phase.PREFLIGHT) { + str += "preflight "; + } else if (this.phase === Phase.UNPHASED) { + str += "unphased "; + } + str += `(${this.params.map((p) => p.toString()).join(", ")})`; + str += `: ${this.returns.toString()}`; + return str; + } + + /** @internal */ + public _getDependencies(): Set { + return new Set([this.returns, ...this.params]); + } +} + +/** + * Phase is a representation of a Wing function type phase. + */ +export enum Phase { + /** Inflight phase. */ + INFLIGHT = "inflight", + /** Preflight phase. */ + PREFLIGHT = "preflight", + /** Unphased phase. */ + UNPHASED = "unphased", +} + +function toInflightTypeElement(root: ITypeElement): string { + const context = findAllTypeElements(root); + const declarations: string[] = []; + const initializations: string[] = []; + for (const element of context.keys()) { + const [declaration, initialization] = + element._toInflightWithContext(context); + declarations.push(declaration); + initializations.push(...initialization); + } + return `(function() { + ${declarations.concat(initializations).join("\n")} + return ${context.get(root)}; + })()`; +} + +function findAllTypeElements(root: ITypeElement): Map { + const result = new Map(); + const queue: ITypeElement[] = [root]; + let i = 0; + while (queue.length > 0) { + const current = queue.shift(); + if (current !== undefined && !result.has(current)) { + result.set(current, `t${i++}`); + queue.push(...current._getDependencies()); + } + } + return result; +} diff --git a/packages/@winglang/sdk/test/core/to-inflight-type.test.ts b/packages/@winglang/sdk/test/core/to-inflight-type.test.ts index ae2ec59a7c3..dd3386ad6c7 100644 --- a/packages/@winglang/sdk/test/core/to-inflight-type.test.ts +++ b/packages/@winglang/sdk/test/core/to-inflight-type.test.ts @@ -21,6 +21,8 @@ const skip = [ "std.CONNECTIONS_FILE_PATH", "std.SDK_SOURCE_MODULE", "std.Node", + "std.reflect", + "std.default", "util.RequestCache", // an enum "util.RequestRedirect", // an enum "util.HttpMethod", // an enum diff --git a/packages/@winglang/tree-sitter-wing/grammar.js b/packages/@winglang/tree-sitter-wing/grammar.js index 7a8bdda1494..47a39a99451 100644 --- a/packages/@winglang/tree-sitter-wing/grammar.js +++ b/packages/@winglang/tree-sitter-wing/grammar.js @@ -41,7 +41,6 @@ module.exports = grammar({ // These modifier conflicts should be solved through GLR parsing [$.field_modifiers, $.method_modifiers], - [$.class_modifiers, $.closure_modifiers, $.interface_modifiers], ], supertypes: ($) => [$.expression, $._literal], @@ -378,7 +377,8 @@ module.exports = grammar({ $.json_literal, $.struct_literal, $.optional_unwrap, - $.intrinsic + $.intrinsic, + $.type_intrinsic, ), intrinsic: ($) => @@ -390,6 +390,15 @@ module.exports = grammar({ ), intrinsic_identifier: ($) => /@[A-Za-z_$0-9]*/, + // TODO: is there some way to generalize this + // so we can define other intrinsics or functions that accept types? + type_intrinsic: ($) => seq( + "@type", + "(", + field("type", $._type), + ")" + ), + // Primitives _literal: ($) => choice( @@ -672,7 +681,7 @@ module.exports = grammar({ ); }, - closure_modifiers: ($) => repeat1(choice($.phase_specifier)), + closure_modifiers: ($) => choice($.phase_specifier), closure: ($) => seq( diff --git a/packages/@winglang/tree-sitter-wing/src/grammar.json b/packages/@winglang/tree-sitter-wing/src/grammar.json index fe22450e4ab..df982eaad60 100644 --- a/packages/@winglang/tree-sitter-wing/src/grammar.json +++ b/packages/@winglang/tree-sitter-wing/src/grammar.json @@ -2061,6 +2061,10 @@ { "type": "SYMBOL", "name": "intrinsic" + }, + { + "type": "SYMBOL", + "name": "type_intrinsic" } ] }, @@ -2101,6 +2105,31 @@ "type": "PATTERN", "value": "@[A-Za-z_$0-9]*" }, + "type_intrinsic": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "@type" + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "FIELD", + "name": "type", + "content": { + "type": "SYMBOL", + "name": "_type" + } + }, + { + "type": "STRING", + "value": ")" + } + ] + }, "_literal": { "type": "CHOICE", "members": [ @@ -3958,16 +3987,13 @@ ] }, "closure_modifiers": { - "type": "REPEAT1", - "content": { - "type": "CHOICE", - "members": [ - { - "type": "SYMBOL", - "name": "phase_specifier" - } - ] - } + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "phase_specifier" + } + ] }, "closure": { "type": "SEQ", @@ -4612,11 +4638,6 @@ [ "field_modifiers", "method_modifiers" - ], - [ - "class_modifiers", - "closure_modifiers", - "interface_modifiers" ] ], "precedences": [ diff --git a/packages/@winglang/tree-sitter-wing/test/corpus/expressions.txt b/packages/@winglang/tree-sitter-wing/test/corpus/expressions.txt index c4d11a525b4..7d9d5f4cc59 100644 --- a/packages/@winglang/tree-sitter-wing/test/corpus/expressions.txt +++ b/packages/@winglang/tree-sitter-wing/test/corpus/expressions.txt @@ -610,3 +610,31 @@ Intrinsic (intrinsic (intrinsic_identifier) (argument_list)))) + +================================================================================ +Type Intrinsic +================================================================================ + +@type(Array); +@type(inflight (): num); +@type(foo.bar.Baz); + +-------------------------------------------------------------------------------- + +(source + (expression_statement + (type_intrinsic + (immutable_container_type + (builtin_type)))) + (expression_statement + (type_intrinsic + (function_type + (phase_specifier) + (parameter_type_list) + (builtin_type)))) + (expression_statement + (type_intrinsic + (custom_type + (type_identifier) + (type_identifier) + (type_identifier))))) diff --git a/packages/@winglang/wingc/src/ast.rs b/packages/@winglang/wingc/src/ast.rs index 5ab099cc641..19f3c207547 100644 --- a/packages/@winglang/wingc/src/ast.rs +++ b/packages/@winglang/wingc/src/ast.rs @@ -585,6 +585,11 @@ pub struct Intrinsic { pub kind: IntrinsicKind, } +#[derive(Debug)] +pub struct TypeIntrinsic { + pub type_: TypeAnnotation, +} + #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub enum IntrinsicKind { /// Error state @@ -655,6 +660,7 @@ pub enum ExprKind { }, Reference(Reference), Intrinsic(Intrinsic), + TypeIntrinsic(TypeIntrinsic), Call { callee: CalleeKind, arg_list: ArgList, diff --git a/packages/@winglang/wingc/src/dtsify/snapshots/declarations.snap b/packages/@winglang/wingc/src/dtsify/snapshots/declarations.snap index e0f6734b4a0..0a8f269c7e4 100644 --- a/packages/@winglang/wingc/src/dtsify/snapshots/declarations.snap +++ b/packages/@winglang/wingc/src/dtsify/snapshots/declarations.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/dtsify/mod.rs +source: packages/@winglang/wingc/src/dtsify/mod.rs --- ## Code @@ -104,6 +104,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $preflightTypesMap = {}; Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.lib-1.cjs`, $preflightTypesMap)); module.exports = { ...module.exports, $preflightTypesMap }; @@ -125,6 +126,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; class InflightClass extends $stdlib.std.Resource { constructor($scope, $id, ) { @@ -267,3 +269,11 @@ export class Child$Inflight extends ParentClass$Inflight implements ClassInterfa } ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/dtsify/snapshots/optionals.snap b/packages/@winglang/wingc/src/dtsify/snapshots/optionals.snap index f2453f77781..fef6199a6b3 100644 --- a/packages/@winglang/wingc/src/dtsify/snapshots/optionals.snap +++ b/packages/@winglang/wingc/src/dtsify/snapshots/optionals.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/dtsify/mod.rs +source: packages/@winglang/wingc/src/dtsify/mod.rs --- ## Code @@ -46,6 +46,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $preflightTypesMap = {}; Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.lib-1.cjs`, $preflightTypesMap)); module.exports = { ...module.exports, $preflightTypesMap }; @@ -67,6 +68,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; class ParentClass extends $stdlib.std.Resource { constructor($scope, $id, ) { @@ -125,3 +127,11 @@ export class ParentClass$Inflight implements ClassInterface$Inflight } ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/fold.rs b/packages/@winglang/wingc/src/fold.rs index 261d2550a2b..803d5d8475f 100644 --- a/packages/@winglang/wingc/src/fold.rs +++ b/packages/@winglang/wingc/src/fold.rs @@ -2,7 +2,7 @@ use crate::ast::{ ArgList, BringSource, CalleeKind, CatchBlock, Class, ClassField, ElseIfBlock, ElseIfLetBlock, ElseIfs, Enum, ExplicitLift, Expr, ExprKind, FunctionBody, FunctionDefinition, FunctionParameter, FunctionSignature, IfLet, Interface, InterpolatedString, InterpolatedStringPart, Intrinsic, LiftQualification, Literal, New, Reference, Scope, - Stmt, StmtKind, Struct, StructField, Symbol, TypeAnnotation, TypeAnnotationKind, UserDefinedType, + Stmt, StmtKind, Struct, StructField, Symbol, TypeAnnotation, TypeAnnotationKind, TypeIntrinsic, UserDefinedType, }; /// Similar to the `visit` module in `wingc` except each method takes ownership of an @@ -338,6 +338,9 @@ where name: f.fold_symbol(intrinsic.name), kind: intrinsic.kind, }), + ExprKind::TypeIntrinsic(type_intrinsic) => ExprKind::TypeIntrinsic(TypeIntrinsic { + type_: f.fold_type_annotation(type_intrinsic.type_), + }), ExprKind::Call { callee, arg_list } => ExprKind::Call { callee: match callee { CalleeKind::Expr(expr) => CalleeKind::Expr(Box::new(f.fold_expr(*expr))), diff --git a/packages/@winglang/wingc/src/jsify.rs b/packages/@winglang/wingc/src/jsify.rs index 0ec7e4593cc..5b5160be71c 100644 --- a/packages/@winglang/wingc/src/jsify.rs +++ b/packages/@winglang/wingc/src/jsify.rs @@ -14,7 +14,8 @@ use crate::{ ast::{ AccessModifier, ArgList, AssignmentKind, BinaryOperator, BringSource, CalleeKind, Class as AstClass, ElseIfs, Enum, Expr, ExprKind, FunctionBody, FunctionDefinition, IfLet, InterpolatedStringPart, IntrinsicKind, Literal, New, - Phase, Reference, Scope, Stmt, StmtKind, Symbol, UnaryOperator, UserDefinedType, + Phase, Reference, Scope, Stmt, StmtKind, Symbol, TypeAnnotation, TypeAnnotationKind, TypeIntrinsic, UnaryOperator, + UserDefinedType, }, comp_ctx::{CompilationContext, CompilationPhase}, diagnostic::{report_diagnostic, Diagnostic, DiagnosticSeverity, WingSpan}, @@ -24,9 +25,9 @@ use crate::{ type_check::{ is_udt_struct_type, lifts::{LiftQualification, Liftable, Lifts}, - resolve_super_method, resolve_user_defined_type, + resolve_super_method, resolve_user_defined_type, resolve_user_defined_type_ref, symbol_env::{SymbolEnv, SymbolEnvKind}, - ClassLike, Type, TypeRef, Types, CLASS_INFLIGHT_INIT_NAME, + ClassLike, Type, TypeRef, Types, VariableKind, CLASS_INFLIGHT_INIT_NAME, }, visit_context::{VisitContext, VisitorWithContext}, MACRO_REPLACE_ARGS, MACRO_REPLACE_ARGS_TEXT, MACRO_REPLACE_SELF, WINGSDK_ASSEMBLY_NAME, WINGSDK_AUTOID_RESOURCE, @@ -36,6 +37,7 @@ use crate::{ use self::codemaker::CodeMaker; const PREFLIGHT_FILE_NAME: &str = "preflight.cjs"; +const TYPES_FILE_NAME: &str = "types.cjs"; const STDLIB: &str = "$stdlib"; const STDLIB_CORE: &str = formatcp!("{STDLIB}.core"); @@ -49,6 +51,7 @@ const PLATFORMS_VAR: &str = "$platforms"; const HELPERS_VAR: &str = "$helpers"; const MACROS_VAR: &str = "$macros"; const EXTERN_VAR: &str = "$extern"; +const TYPES_VAR: &str = "$types"; const ROOT_CLASS: &str = "$Root"; const JS_CONSTRUCTOR: &str = "constructor"; @@ -58,7 +61,7 @@ const __DIRNAME: &str = "__dirname"; const SUPER_CLASS_INFLIGHT_INIT_NAME: &str = formatcp!("super_{CLASS_INFLIGHT_INIT_NAME}"); -const PREFLIGHT_TYPES_MAP: &str = "$helpers.nodeof(this).root.$preflightTypesMap"; +const PREFLIGHT_TYPES_MAP: &str = formatcp!("{HELPERS_VAR}.nodeof(this).root.$preflightTypesMap"); const MODULE_PREFLIGHT_TYPES_MAP: &str = "$preflightTypesMap"; const SCOPE_PARAM: &str = "$scope"; @@ -88,9 +91,14 @@ pub struct JSifier<'a> { pub preflight_file_map: RefCell>, source_files: &'a Files, source_file_graph: &'a FileGraph, + /// The path that compilation started at (file or directory) compilation_init_path: &'a Utf8Path, out_dir: &'a Utf8Path, + + /// Map from types to their type reflection code (variable name, initializer code, and post-initialization code) + type_reflection_definitions: RefCell>, + type_variable_counter: RefCell, } impl VisitorWithContext for JSifyContext<'_> { @@ -129,6 +137,8 @@ impl<'a> JSifier<'a> { preflight_file_counter: RefCell::new(0), preflight_file_map: RefCell::new(IndexMap::new()), output_files: RefCell::new(output_files), + type_reflection_definitions: RefCell::new(IndexMap::new()), + type_variable_counter: RefCell::new(0), } } @@ -192,6 +202,7 @@ impl<'a> JSifier<'a> { output.line(format!( "const {EXTERN_VAR} = {HELPERS_VAR}.createExternRequire({__DIRNAME});" )); + output.line(format!("const {TYPES_VAR} = require(\"./{TYPES_FILE_NAME}\");")); if is_entrypoint { output.line(format!( @@ -246,11 +257,11 @@ impl<'a> JSifier<'a> { if file.path.is_dir() { let directory_name = file.path.file_stem().unwrap(); output.line(format!( - "Object.assign(module.exports, {{ get {directory_name}() {{ return $helpers.bringJs(`${{__dirname}}/{preflight_file_name}`, {MODULE_PREFLIGHT_TYPES_MAP}); }} }});" + "Object.assign(module.exports, {{ get {directory_name}() {{ return {HELPERS_VAR}.bringJs(`${{__dirname}}/{preflight_file_name}`, {MODULE_PREFLIGHT_TYPES_MAP}); }} }});" )); } else { output.line(format!( - "Object.assign(module.exports, $helpers.bringJs(`${{__dirname}}/{preflight_file_name}`, {MODULE_PREFLIGHT_TYPES_MAP}));" + "Object.assign(module.exports, {HELPERS_VAR}.bringJs(`${{__dirname}}/{preflight_file_name}`, {MODULE_PREFLIGHT_TYPES_MAP}));" )); } } @@ -323,6 +334,35 @@ impl<'a> JSifier<'a> { Ok(()) => {} Err(err) => report_diagnostic(err.into()), } + + // The entrypoint is the last file we emit, so at this point we can emit the types file + if source_file.path == self.compilation_init_path { + self.emit_types_file(); + } + } + + fn emit_types_file(&self) { + let mut code = CodeMaker::default(); + code.line("const std = require(\"@winglang/sdk\").std;"); + code.line("const $types = {};"); + let type_reflection_definitions = self.type_reflection_definitions.borrow(); + for (_, (_, initializer, _)) in type_reflection_definitions.iter() { + code.add_code(initializer.clone()); + } + for (_, (_, _, rest)) in type_reflection_definitions.iter() { + code.add_code(rest.clone()); + } + code.line("module.exports = $types;"); + + // Emit the type reflection file + match self + .output_files + .borrow_mut() + .add_file(TYPES_FILE_NAME, code.to_string()) + { + Ok(()) => {} + Err(err) => report_diagnostic(err.into()), + } } fn jsify_struct_schemas(&self, source_file: &File) -> CodeMaker { @@ -384,7 +424,8 @@ impl<'a> JSifier<'a> { } Reference::ElementAccess { object, index } => new_code!( &object.span, - "$helpers.lookup(", + HELPERS_VAR, + ".lookup(", self.jsify_expression(object, ctx), ", ", self.jsify_expression(index, ctx), @@ -730,6 +771,7 @@ impl<'a> JSifier<'a> { new_code!(expr_span, "process.env.WING_TARGET") } }, + ExprKind::TypeIntrinsic(TypeIntrinsic { type_ }) => self.jsify_reflection_udt(&type_, &expr_span, ctx), ExprKind::Call { callee, arg_list } => { let function_type = match callee { CalleeKind::Expr(expr) => self.types.get_expr_type(expr), @@ -853,7 +895,7 @@ impl<'a> JSifier<'a> { UnaryOperator::Minus => new_code!(expr_span, "(-", js_exp, ")"), UnaryOperator::Not => new_code!(expr_span, "(!", js_exp, ")"), UnaryOperator::OptionalUnwrap => { - new_code!(expr_span, "$helpers.unwrap(", js_exp, ")") + new_code!(expr_span, HELPERS_VAR, ".unwrap(", js_exp, ")") } } } @@ -1268,7 +1310,8 @@ impl<'a> JSifier<'a> { let index = self.jsify_expression(index, ctx); code.line(new_code!( &statement.span, - "$helpers.assign(", + HELPERS_VAR, + ".assign(", object, ", ", index, @@ -1375,7 +1418,7 @@ impl<'a> JSifier<'a> { let preflight_file_map = self.preflight_file_map.borrow(); let preflight_file_name = preflight_file_map.get(path).unwrap(); code.line(format!( - "const {var_name} = $helpers.bringJs(`${{__dirname}}/{preflight_file_name}`, {MODULE_PREFLIGHT_TYPES_MAP});" + "const {var_name} = {HELPERS_VAR}.bringJs(`${{__dirname}}/{preflight_file_name}`, {MODULE_PREFLIGHT_TYPES_MAP});" )); code } @@ -1755,7 +1798,7 @@ impl<'a> JSifier<'a> { pub fn class_singleton(&self, type_: TypeRef) -> String { let c = type_.as_class().unwrap(); - format!("$helpers.preflightClassSingleton(this, {})", c.uid) + format!("{HELPERS_VAR}.preflightClassSingleton(this, {})", c.uid) } fn jsify_preflight_constructor(&self, class: &AstClass, ctx: &mut JSifyContext) -> CodeMaker { @@ -2149,6 +2192,401 @@ impl<'a> JSifier<'a> { }; format!("inflight.{}-{}.cjs", class.name.name, id) } + + fn jsify_reflection_udt( + &self, + type_annotation: &TypeAnnotation, + expr_span: &WingSpan, + ctx: &JSifyContext<'_>, + ) -> CodeMaker { + match &type_annotation.kind { + TypeAnnotationKind::String => new_code!(expr_span, "std.reflect.Type._ofStr()"), + TypeAnnotationKind::Number => new_code!(expr_span, "std.reflect.Type._ofNum()"), + TypeAnnotationKind::Bool => new_code!(expr_span, "std.reflect.Type._ofBool()"), + TypeAnnotationKind::Duration => new_code!(expr_span, "std.reflect.Type._ofDuration()"), + TypeAnnotationKind::Datetime => new_code!(expr_span, "std.reflect.Type._ofDatetime()"), + TypeAnnotationKind::Regex => new_code!(expr_span, "std.reflect.Type._ofRegex()"), + TypeAnnotationKind::Bytes => new_code!(expr_span, "std.reflect.Type._ofBytes()"), + TypeAnnotationKind::Json => new_code!(expr_span, "std.reflect.Type._ofJson()"), + TypeAnnotationKind::MutJson => new_code!(expr_span, "std.reflect.Type._ofMutJson()"), + TypeAnnotationKind::Inferred => panic!("Unexpected inferred type annotation"), + TypeAnnotationKind::Void => new_code!(expr_span, "std.reflect.Type._ofVoid()"), + TypeAnnotationKind::Optional(t) => new_code!( + expr_span, + "std.reflect.Type._ofOptional(", + self.jsify_reflection_udt(&t, &t.span, ctx), + ")" + ), + TypeAnnotationKind::Array(t) => new_code!( + expr_span, + "std.reflect.Type._ofArray(", + self.jsify_reflection_udt(&t, &t.span, ctx), + ", false)" + ), + TypeAnnotationKind::MutArray(t) => new_code!( + expr_span, + "std.reflect.Type._ofArray(", + self.jsify_reflection_udt(&t, &t.span, ctx), + ", true)" + ), + TypeAnnotationKind::Map(t) => new_code!( + expr_span, + "std.reflect.Type._ofMap(", + self.jsify_reflection_udt(&t, &t.span, ctx), + ", false)" + ), + TypeAnnotationKind::MutMap(t) => new_code!( + expr_span, + "std.reflect.Type._ofMap(", + self.jsify_reflection_udt(&t, &t.span, ctx), + ", true)" + ), + TypeAnnotationKind::Set(t) => new_code!( + expr_span, + "std.reflect.Type._ofSet(", + self.jsify_reflection_udt(&t, &t.span, ctx), + ", false)" + ), + TypeAnnotationKind::MutSet(t) => new_code!( + expr_span, + "std.reflect.Type._ofSet(", + self.jsify_reflection_udt(&t, &t.span, ctx), + ", true)" + ), + TypeAnnotationKind::Function(t) => { + let mut func_code = new_code!(expr_span, "std.reflect.Type._ofFunction(new std.reflect.FunctionType("); + func_code.append(match t.phase { + Phase::Inflight => "std.reflect.Phase.INFLIGHT", + Phase::Preflight => "std.reflect.Phase.PREFLIGHT", + Phase::Independent => "std.reflect.Phase.UNPHASED", + }); + func_code.append(", ["); + for p in &t.parameters { + func_code.append(self.jsify_reflection_udt(&p.type_annotation, &p.type_annotation.span, ctx)); + func_code.append(", "); + } + func_code.append("], "); + func_code.append(self.jsify_reflection_udt(&t.return_type, &t.return_type.span, ctx)); + func_code.append("))"); + func_code + } + TypeAnnotationKind::UserDefined(udt) => { + let type_ = resolve_user_defined_type_ref( + udt, + ctx.visit_ctx.current_env().expect("no current env"), + ctx.visit_ctx.current_stmt_idx(), + ) + .expect("type reference"); + + self.jsify_reflection_type(*type_, expr_span) + } + } + } + + fn jsify_reflection_type(&self, type_: TypeRef, expr_span: &WingSpan) -> CodeMaker { + let type_reflection_definitions = self.type_reflection_definitions.borrow(); + if let Some((variable_name, _, _)) = type_reflection_definitions.get(&type_) { + return new_code!(expr_span, format!("$types.{variable_name}")); + } + std::mem::drop(type_reflection_definitions); + + // Generate a unique name for referring to this type in the $types object + let mut type_variable_counter = self.type_variable_counter.borrow_mut(); + *type_variable_counter += 1; + let friendly_name = type_.short_friendly_name(); + let type_variable_name = format!("t{}_{}", type_variable_counter, friendly_name); + std::mem::drop(type_variable_counter); + + // Insert a placeholder so that recursive references can be resolved + let mut type_reflection_definitions = self.type_reflection_definitions.borrow_mut(); + type_reflection_definitions.insert( + type_, + (type_variable_name.clone(), CodeMaker::default(), CodeMaker::default()), + ); + std::mem::drop(type_reflection_definitions); + + // Generate code for initializing the type, and then for filling in its fields. + // We separate the two to allow definitions to refer to each other. In the end, the generated code + // will be something like: + // + // ``` + // $types.t0 = std.reflect.Type._ofClass(new std.ClassType("MyClass")); + // $types.t1 = std.reflect.Type._ofClass(new std.ClassType("MyOtherClass")); + // + // $types.t0.fields = // ... may refer to $types.t1 + // $types.t1.fields = // ... may refer to $types.t0 + // ``` + let (initializer, rest) = match *type_ { + Type::Anything => ( + new_code!(expr_span, "std.reflect.Type._ofAny()"), + CodeMaker::with_source(expr_span), + ), + Type::Number => ( + new_code!(expr_span, "std.reflect.Type._ofNum()"), + CodeMaker::with_source(expr_span), + ), + Type::String => ( + new_code!(expr_span, "std.reflect.Type._ofStr()"), + CodeMaker::with_source(expr_span), + ), + Type::Duration => ( + new_code!(expr_span, "std.reflect.Type._ofDuration()"), + CodeMaker::with_source(expr_span), + ), + Type::Datetime => ( + new_code!(expr_span, "std.reflect.Type._ofDatetime()"), + CodeMaker::with_source(expr_span), + ), + Type::Regex => ( + new_code!(expr_span, "std.reflect.Type._ofRegex()"), + CodeMaker::with_source(expr_span), + ), + Type::Bytes => ( + new_code!(expr_span, "std.reflect.Type._ofBytes()"), + CodeMaker::with_source(expr_span), + ), + Type::Boolean => ( + new_code!(expr_span, "std.reflect.Type._ofBool()"), + CodeMaker::with_source(expr_span), + ), + Type::Void => ( + new_code!(expr_span, "std.reflect.Type._ofVoid()"), + CodeMaker::with_source(expr_span), + ), + Type::Json(_) => ( + new_code!(expr_span, "std.reflect.Type._ofJson()"), + CodeMaker::with_source(expr_span), + ), + Type::MutJson => ( + new_code!(expr_span, "std.reflect.Type._ofMutJson()"), + CodeMaker::with_source(expr_span), + ), + Type::Optional(t) => { + let initializer = new_code!(expr_span, "std.reflect.Type._ofOptional(undefined)"); + + let mut rest = CodeMaker::with_source(expr_span); + rest.line(format!("$types.{type_variable_name}.data.child = ")); + rest.append(self.jsify_reflection_type(t, &expr_span)); + rest.append(";"); + (initializer, rest) + } + Type::Array(t) => { + let initializer = new_code!(expr_span, "std.reflect.Type._ofArray(undefined, false)"); + + let mut rest = CodeMaker::with_source(expr_span); + rest.line(format!("$types.{type_variable_name}.data.child = ")); + rest.append(self.jsify_reflection_type(t, &expr_span)); + rest.append(";"); + (initializer, rest) + } + Type::MutArray(t) => { + let initializer = new_code!(expr_span, "std.reflect.Type._ofArray(undefined, true)"); + + let mut rest = CodeMaker::with_source(expr_span); + rest.line(format!("$types.{type_variable_name}.data.child = ")); + rest.append(self.jsify_reflection_type(t, &expr_span)); + rest.append(";"); + (initializer, rest) + } + Type::Map(t) => { + let initializer = new_code!(expr_span, "std.reflect.Type._ofMap(undefined, false)"); + + let mut rest = CodeMaker::with_source(expr_span); + rest.line(format!("$types.{type_variable_name}.data.child = ")); + rest.append(self.jsify_reflection_type(t, &expr_span)); + rest.append(";"); + (initializer, rest) + } + Type::MutMap(t) => { + let initializer = new_code!(expr_span, "std.reflect.Type._ofMap(undefined, true)"); + + let mut rest = CodeMaker::with_source(expr_span); + rest.line(format!("$types.{type_variable_name}.data.child = ")); + rest.append(self.jsify_reflection_type(t, &expr_span)); + rest.append(";"); + (initializer, rest) + } + Type::Set(t) => { + let initializer = new_code!(expr_span, "std.reflect.Type._ofSet(undefined, false)"); + + let mut rest = CodeMaker::with_source(expr_span); + rest.line(format!("$types.{type_variable_name}.data.child = ")); + rest.append(self.jsify_reflection_type(t, &expr_span)); + rest.append(";"); + (initializer, rest) + } + Type::MutSet(t) => { + let initializer = new_code!(expr_span, "std.reflect.Type._ofSet(undefined, true)"); + + let mut rest = CodeMaker::with_source(expr_span); + rest.line(format!("$types.{type_variable_name}.data.child = ")); + rest.append(self.jsify_reflection_type(t, &expr_span)); + rest.append(";"); + (initializer, rest) + } + Type::Function(ref function_signature) => { + let mut func_code = new_code!(expr_span, "std.reflect.Type._ofFunction(new std.reflect.FunctionType("); + func_code.append(match function_signature.phase { + Phase::Inflight => "std.reflect.Phase.INFLIGHT", + Phase::Preflight => "std.reflect.Phase.PREFLIGHT", + Phase::Independent => "std.reflect.Phase.UNPHASED", + }); + func_code.append("))"); + + let mut rest = CodeMaker::with_source(expr_span); + for p in &function_signature.parameters { + rest.line(format!("$types.{type_variable_name}.data.params.push(")); + rest.append(self.jsify_reflection_type(p.typeref, &expr_span)); + rest.append(".data);"); + } + rest.line(format!("$types.{type_variable_name}.data.returns = ")); + rest.append(self.jsify_reflection_type(function_signature.return_type, &expr_span)); + rest.append(";"); + + (func_code, rest) + } + Type::Class(ref class) => { + let fqn_string = match &class.fqn { + None => "undefined".to_string(), + Some(fqn) => format!("\"{fqn}\""), + }; + + let initializer = new_code!( + expr_span, + "std.reflect.Type._ofClass(new std.reflect.ClassType(\"", + jsify_symbol(&class.name), + "\", ", + fqn_string, + "))" + ); + + let mut rest = CodeMaker::with_source(expr_span); + if let Some(parent) = class.parent { + let parent_type_var = self.jsify_reflection_type(parent, &expr_span); + rest.line(format!("$types.{type_variable_name}.data.base = ")); + rest.append(parent_type_var); + rest.append(".data;"); + } + for interface in class.implements.iter() { + let interface_type_var = self.jsify_reflection_type(*interface, &expr_span); + rest.line(format!("$types.{type_variable_name}.data.interfaces.push(")); + rest.append(interface_type_var); + rest.append(".data);"); + } + for (name, var_info) in class.fields(true) { + if var_info.access != AccessModifier::Public { + continue; + } + let type_var = self.jsify_reflection_type(var_info.type_, &expr_span); + rest.line(format!( + "$types.{type_variable_name}.data.properties[\"{name}\"] = new std.reflect.Property(\"{name}\", {});", + type_var.to_string() + )); + } + for (name, var_info) in class.methods(true) { + if var_info.access != AccessModifier::Public { + continue; + } + let type_var = self.jsify_reflection_type(var_info.type_, &expr_span); + let is_static = var_info.kind == VariableKind::StaticMember; + rest.line(format!( + "$types.{type_variable_name}.data.methods[\"{name}\"] = new std.reflect.Method(\"{name}\", {}, {}.data);", + is_static, + type_var.to_string() + )); + } + + (initializer, rest) + } + Type::Interface(ref interface) => { + let initializer = new_code!( + expr_span, + "std.reflect.Type._ofInterface(new std.reflect.InterfaceType(\"", + jsify_symbol(&interface.name), + "\", \"", + &interface.fqn, + "\"))" + ); + + let mut rest = CodeMaker::with_source(expr_span); + for base in interface.extends.iter() { + let base_type_var = self.jsify_reflection_type(*base, &expr_span); + rest.line(format!("$types.{type_variable_name}.data.bases.push(")); + rest.append(base_type_var); + rest.append(".data);"); + } + for (name, var_info) in interface.methods(true) { + let method_type_var = self.jsify_reflection_type(var_info.type_, &expr_span); + let is_static = var_info.kind == VariableKind::StaticMember; + rest.line(format!( + "$types.{type_variable_name}.data.methods[\"{name}\"] = new std.reflect.Method(\"{name}\", {}, {}.data);", + is_static, + method_type_var.to_string() + )); + } + + (initializer, rest) + } + Type::Struct(ref st) => { + let mut initializer = new_code!(expr_span, "std.reflect.Type._ofStruct(new std.reflect.StructType(\""); + initializer.append(jsify_symbol(&st.name)); + initializer.append("\", \""); + initializer.append(&st.fqn); + initializer.append("\"))"); + + let mut rest = CodeMaker::with_source(expr_span); + for base in st.extends.iter() { + let base_type_var = self.jsify_reflection_type(*base, &expr_span); + rest.line(format!("$types.{type_variable_name}.data.bases.push(")); + rest.append(base_type_var); + rest.append(".data);"); + } + for (name, var_info) in st.fields(false) { + let type_var = self.jsify_reflection_type(var_info.type_, &expr_span); + rest.line(format!( + "$types.{type_variable_name}.data.fields[\"{name}\"] = new std.reflect.Property(\"{name}\", {});", + type_var.to_string() + )); + } + + (initializer, rest) + } + Type::Enum(ref e) => { + let mut initializer = new_code!(expr_span, "std.reflect.Type._ofEnum(new std.reflect.EnumType(\""); + initializer.append(jsify_symbol(&e.name)); + initializer.append("\", \""); + initializer.append(&e.fqn); + initializer.append("\", {"); + for (name, _docs) in e.values.iter() { + initializer.append("\""); + initializer.append(jsify_symbol(&name)); + initializer.append("\": new std.reflect.EnumVariant(\""); + initializer.append(jsify_symbol(&name)); + initializer.append("\"), "); + } + initializer.append("}));"); + (initializer, CodeMaker::with_source(expr_span)) + } + Type::Nil => panic!("Nil type cannot be used in reflection"), + Type::Unresolved => panic!("Unresolved type cannot be used in reflection"), + Type::Inferred(_) => panic!("Inferred type cannot be used in reflection"), + Type::Stringable => panic!("Stringable type cannot be used in reflection"), + }; + + let mut type_reflection_definitions = self.type_reflection_definitions.borrow_mut(); + type_reflection_definitions.insert( + type_, + ( + type_variable_name.clone(), + new_code!( + expr_span, + format!("$types.{type_variable_name} = {};", initializer.to_string()) + ), + rest, + ), + ); + new_code!(expr_span, "$types.", type_variable_name) + } } fn jsify_function_parameters(func_def: &FunctionDefinition) -> CodeMaker { diff --git a/packages/@winglang/wingc/src/jsify/snapshots/access_methods_and_properties_on_collections.snap b/packages/@winglang/wingc/src/jsify/snapshots/access_methods_and_properties_on_collections.snap index b9ab087b4c5..0da803ba798 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/access_methods_and_properties_on_collections.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/access_methods_and_properties_on_collections.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -51,6 +51,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -95,3 +96,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/access_property_on_primitive.snap b/packages/@winglang/wingc/src/jsify/snapshots/access_property_on_primitive.snap index 784ab53a1b2..245fbde9daf 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/access_property_on_primitive.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/access_property_on_primitive.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -48,6 +48,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -88,3 +89,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/access_property_on_value_returned_from_collection.snap b/packages/@winglang/wingc/src/jsify/snapshots/access_property_on_value_returned_from_collection.snap index 768112c3a44..9140872e725 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/access_property_on_value_returned_from_collection.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/access_property_on_value_returned_from_collection.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -48,6 +48,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -88,3 +89,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/allow_type_def_before_super.snap b/packages/@winglang/wingc/src/jsify/snapshots/allow_type_def_before_super.snap index 4f8a619b5fc..5f0eab1dfe6 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/allow_type_def_before_super.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/allow_type_def_before_super.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -71,6 +71,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -137,3 +138,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/base_class_captures_inflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/base_class_captures_inflight.snap index a163122202d..dd21b03a496 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/base_class_captures_inflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/base_class_captures_inflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -67,6 +67,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -125,3 +126,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/base_class_captures_preflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/base_class_captures_preflight.snap index a4b194d60dd..4c1e059e0e8 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/base_class_captures_preflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/base_class_captures_preflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -61,6 +61,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -117,3 +118,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/base_class_lift_indirect.snap b/packages/@winglang/wingc/src/jsify/snapshots/base_class_lift_indirect.snap index e2f87317c3d..36e498b05d3 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/base_class_lift_indirect.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/base_class_lift_indirect.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -78,6 +78,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -148,3 +149,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_fields_inflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_fields_inflight.snap index 3e346f424db..3d661bf0c5c 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_fields_inflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_fields_inflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -76,6 +76,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -131,3 +132,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_fields_preflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_fields_preflight.snap index 343b88d56fe..e26b5b80fe1 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_fields_preflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_fields_preflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -66,6 +66,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -121,3 +122,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_lifted_field_object.snap b/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_lifted_field_object.snap index 594a3ecf481..ef68231ea60 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_lifted_field_object.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_lifted_field_object.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -70,6 +70,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -131,3 +132,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_lifted_fields.snap b/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_lifted_fields.snap index 8cc56428bca..fb8b8fd673a 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_lifted_fields.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/base_class_with_lifted_fields.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -70,6 +70,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -131,3 +132,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/builtins.snap b/packages/@winglang/wingc/src/jsify/snapshots/builtins.snap index dc51f34b0bd..f8383294f1b 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/builtins.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/builtins.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -46,6 +46,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -82,3 +83,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/call_static_inflight_from_static_inflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/call_static_inflight_from_static_inflight.snap index 5eb00164ae0..cb3ba8251dd 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/call_static_inflight_from_static_inflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/call_static_inflight_from_static_inflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -63,6 +63,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -128,3 +129,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/calls_methods_on_preflight_object.snap b/packages/@winglang/wingc/src/jsify/snapshots/calls_methods_on_preflight_object.snap index f8dd509e1a2..85a2abf4b2a 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/calls_methods_on_preflight_object.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/calls_methods_on_preflight_object.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -51,6 +51,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -92,3 +93,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_from_inside_an_inflight_closure.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_from_inside_an_inflight_closure.snap index b7467be3dbb..3e79b396760 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_from_inside_an_inflight_closure.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_from_inside_an_inflight_closure.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -51,6 +51,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -92,3 +93,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_closure_from_preflight_scope.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_closure_from_preflight_scope.snap index 4b575115bf4..fe8bb5421f3 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_closure_from_preflight_scope.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_closure_from_preflight_scope.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -69,6 +69,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -130,3 +131,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope.snap index 810a19daa3b..4c83770b8d4 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -47,6 +47,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -87,3 +88,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_method_call.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_method_call.snap index 03db6d49527..36ea0e3b63e 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_method_call.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_method_call.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -67,6 +67,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -126,3 +127,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_nested_object.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_nested_object.snap index dfdeb0a4ecd..068fd794419 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_nested_object.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_nested_object.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -70,6 +70,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -129,3 +130,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_property.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_property.snap index 2f2020df92a..830ae55e58a 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_property.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_identifier_from_preflight_scope_with_property.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -47,6 +47,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -87,3 +88,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_in_keyword_args.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_in_keyword_args.snap index 2fb419c9ec8..aa86797d0b3 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_in_keyword_args.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_in_keyword_args.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -52,6 +52,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -96,3 +97,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_object_with_this_in_name.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_object_with_this_in_name.snap index 9d1fa683984..3322e190b04 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_object_with_this_in_name.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_object_with_this_in_name.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -48,6 +48,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -89,3 +90,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_token.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_token.snap index 9d3ca2b35f6..71152c54673 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_token.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_token.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -47,6 +47,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -88,3 +89,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_init.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_init.snap index 5ad831eb855..878527d9be4 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_init.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_init.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -71,6 +71,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -107,3 +108,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_method.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_method.snap index 01743ba47b7..c731d94918e 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_method.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_type_inflight_class_sibling_from_method.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -57,6 +57,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -93,3 +94,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_type_new_inflight_class_inner_no_capture.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_type_new_inflight_class_inner_no_capture.snap index 564467e1375..8f49a9c2617 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_type_new_inflight_class_inner_no_capture.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_type_new_inflight_class_inner_no_capture.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -49,6 +49,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -85,3 +86,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_type_new_inflight_class_outer.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_type_new_inflight_class_outer.snap index d7217cac1af..c02875b45ea 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_type_new_inflight_class_outer.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_type_new_inflight_class_outer.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -62,6 +62,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -120,3 +121,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_type_static_method.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_type_static_method.snap index 03201a7196d..91259d8b2a8 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_type_static_method.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_type_static_method.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -67,6 +67,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -129,3 +130,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_type_static_method_inflight_class.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_type_static_method_inflight_class.snap index dc3fe1e4c44..25602076351 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_type_static_method_inflight_class.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_type_static_method_inflight_class.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -67,6 +67,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -131,3 +132,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/capture_var_from_method_inflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/capture_var_from_method_inflight.snap index b9859789901..832506c248d 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/capture_var_from_method_inflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/capture_var_from_method_inflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -54,6 +54,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -90,3 +91,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/closed_inflight_class_extends_outer_inflight_class.snap b/packages/@winglang/wingc/src/jsify/snapshots/closed_inflight_class_extends_outer_inflight_class.snap index 5555377b22a..eee25a3f431 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/closed_inflight_class_extends_outer_inflight_class.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/closed_inflight_class_extends_outer_inflight_class.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -65,6 +65,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -123,3 +124,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/closure_field.snap b/packages/@winglang/wingc/src/jsify/snapshots/closure_field.snap index 317d2b2c474..e8dcbbb44ff 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/closure_field.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/closure_field.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -113,6 +113,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -207,3 +208,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/entrypoint_this.snap b/packages/@winglang/wingc/src/jsify/snapshots/entrypoint_this.snap index c3f60f633ec..aa9243fa37a 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/entrypoint_this.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/entrypoint_this.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -21,6 +21,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -36,3 +37,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/enum_value.snap b/packages/@winglang/wingc/src/jsify/snapshots/enum_value.snap index b324f494adb..04f5b096375 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/enum_value.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/enum_value.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -51,6 +51,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -101,3 +102,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/free_inflight_obj_from_inflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/free_inflight_obj_from_inflight.snap index 8838d8e955a..3900ec0dd65 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/free_inflight_obj_from_inflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/free_inflight_obj_from_inflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -59,6 +59,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -95,3 +96,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/free_preflight_object_from_preflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/free_preflight_object_from_preflight.snap index b99b9690fd6..f0be9e3bd57 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/free_preflight_object_from_preflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/free_preflight_object_from_preflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -39,6 +39,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -74,3 +75,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/func_returns_func.snap b/packages/@winglang/wingc/src/jsify/snapshots/func_returns_func.snap index 55bdd12b926..c91401f4911 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/func_returns_func.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/func_returns_func.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -56,6 +56,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -92,3 +93,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/identify_field.snap b/packages/@winglang/wingc/src/jsify/snapshots/identify_field.snap index d9dce644779..a99066ddbe1 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/identify_field.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/identify_field.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -51,6 +51,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -94,3 +95,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/implicit_lift_inflight_init.snap b/packages/@winglang/wingc/src/jsify/snapshots/implicit_lift_inflight_init.snap index f8fa90d29d0..2c0a037c46f 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/implicit_lift_inflight_init.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/implicit_lift_inflight_init.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -69,6 +69,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -116,3 +117,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/indirect_capture.snap b/packages/@winglang/wingc/src/jsify/snapshots/indirect_capture.snap index 708ff2aaa55..0c3e5586172 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/indirect_capture.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/indirect_capture.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -83,6 +83,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -151,3 +152,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/inflight_class_extends_both_inside_inflight_closure.snap b/packages/@winglang/wingc/src/jsify/snapshots/inflight_class_extends_both_inside_inflight_closure.snap index 9892befef60..22c87f11661 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/inflight_class_extends_both_inside_inflight_closure.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/inflight_class_extends_both_inside_inflight_closure.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -50,6 +50,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -86,3 +87,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/inflight_class_extends_inflight_class.snap b/packages/@winglang/wingc/src/jsify/snapshots/inflight_class_extends_inflight_class.snap index b48113b551a..ddaad64f24a 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/inflight_class_extends_inflight_class.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/inflight_class_extends_inflight_class.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -50,6 +50,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -103,3 +104,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/inflight_constructor.snap b/packages/@winglang/wingc/src/jsify/snapshots/inflight_constructor.snap index 8960f77b59b..eb3edf6ae8f 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/inflight_constructor.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/inflight_constructor.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -51,6 +51,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -86,3 +87,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/inflight_field.snap b/packages/@winglang/wingc/src/jsify/snapshots/inflight_field.snap index 2090052c7f0..c58d569f0a4 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/inflight_field.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/inflight_field.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -50,6 +50,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -85,3 +86,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/inflight_field_from_inflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/inflight_field_from_inflight.snap index 90805af83ec..cc7b61e0333 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/inflight_field_from_inflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/inflight_field_from_inflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -49,6 +49,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -84,3 +85,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/inflight_field_from_inflight_class.snap b/packages/@winglang/wingc/src/jsify/snapshots/inflight_field_from_inflight_class.snap index 08e354233c8..90481223ac5 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/inflight_field_from_inflight_class.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/inflight_field_from_inflight_class.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -50,6 +50,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -89,3 +90,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/inline_inflight_class.snap b/packages/@winglang/wingc/src/jsify/snapshots/inline_inflight_class.snap index a2cc6584a63..0ff100054d4 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/inline_inflight_class.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/inline_inflight_class.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -71,6 +71,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -131,3 +132,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/json_object.snap b/packages/@winglang/wingc/src/jsify/snapshots/json_object.snap index a8b0e2b466b..b930fdb650d 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/json_object.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/json_object.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -48,6 +48,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -91,3 +92,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/lift_binary_preflight_and_inflight_expression.snap b/packages/@winglang/wingc/src/jsify/snapshots/lift_binary_preflight_and_inflight_expression.snap index 7b8f23c7670..cba0c059935 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/lift_binary_preflight_and_inflight_expression.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/lift_binary_preflight_and_inflight_expression.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -49,6 +49,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -89,3 +90,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/lift_binary_preflight_expression.snap b/packages/@winglang/wingc/src/jsify/snapshots/lift_binary_preflight_expression.snap index 6f4ab0820d8..b02686f1a60 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/lift_binary_preflight_expression.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/lift_binary_preflight_expression.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -48,6 +48,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -92,3 +93,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/lift_element_from_collection_as_field.snap b/packages/@winglang/wingc/src/jsify/snapshots/lift_element_from_collection_as_field.snap index 665c3d61172..b591e4f9b2d 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/lift_element_from_collection_as_field.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/lift_element_from_collection_as_field.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -52,6 +52,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -95,3 +96,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/lift_element_from_collection_of_objects.snap b/packages/@winglang/wingc/src/jsify/snapshots/lift_element_from_collection_of_objects.snap index 8b302e4bb64..c638809adc1 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/lift_element_from_collection_of_objects.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/lift_element_from_collection_of_objects.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -49,6 +49,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -90,3 +91,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/lift_inflight_closure.snap b/packages/@winglang/wingc/src/jsify/snapshots/lift_inflight_closure.snap index 2641cd3dd4e..aac63413be6 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/lift_inflight_closure.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/lift_inflight_closure.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -70,6 +70,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -131,3 +132,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/lift_inside_preflight_method.snap b/packages/@winglang/wingc/src/jsify/snapshots/lift_inside_preflight_method.snap index 815cce8fb42..7fefa869047 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/lift_inside_preflight_method.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/lift_inside_preflight_method.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -72,6 +72,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -134,3 +135,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/lift_self_reference.snap b/packages/@winglang/wingc/src/jsify/snapshots/lift_self_reference.snap index acfd4489063..5a8f02a2cf7 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/lift_self_reference.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/lift_self_reference.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -46,6 +46,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -87,3 +88,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/lift_string.snap b/packages/@winglang/wingc/src/jsify/snapshots/lift_string.snap index 435d1b8bd32..65e40c436da 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/lift_string.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/lift_string.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -47,6 +47,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -87,3 +88,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/lift_this.snap b/packages/@winglang/wingc/src/jsify/snapshots/lift_this.snap index dfa11f88340..edae764e9af 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/lift_this.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/lift_this.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -84,6 +84,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -148,3 +149,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/lift_var_with_this.snap b/packages/@winglang/wingc/src/jsify/snapshots/lift_var_with_this.snap index 0f6489313a7..e6f035b1c0c 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/lift_var_with_this.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/lift_var_with_this.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -67,6 +67,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -130,3 +131,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/lift_via_closure.snap b/packages/@winglang/wingc/src/jsify/snapshots/lift_via_closure.snap index acbbae77885..9f7852f38ed 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/lift_via_closure.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/lift_via_closure.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -77,6 +77,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -143,3 +144,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/lift_via_closure_class_explicit.snap b/packages/@winglang/wingc/src/jsify/snapshots/lift_via_closure_class_explicit.snap index f9ce4c10b98..8365ff15aac 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/lift_via_closure_class_explicit.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/lift_via_closure_class_explicit.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -92,6 +92,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -165,3 +166,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/namespaced_static_from_inflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/namespaced_static_from_inflight.snap index affd902059a..0495c27982c 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/namespaced_static_from_inflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/namespaced_static_from_inflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -47,6 +47,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -87,3 +88,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/nested_inflight_after_preflight_operation.snap b/packages/@winglang/wingc/src/jsify/snapshots/nested_inflight_after_preflight_operation.snap index e19f6ba050c..75f9d8113a0 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/nested_inflight_after_preflight_operation.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/nested_inflight_after_preflight_operation.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -73,6 +73,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -133,3 +134,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/nested_preflight_operation.snap b/packages/@winglang/wingc/src/jsify/snapshots/nested_preflight_operation.snap index cb33323f1b1..c96b36d3141 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/nested_preflight_operation.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/nested_preflight_operation.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -90,6 +90,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -167,3 +168,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/new_inflight_object.snap b/packages/@winglang/wingc/src/jsify/snapshots/new_inflight_object.snap index f796f8d6511..581ca7ec3c3 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/new_inflight_object.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/new_inflight_object.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -62,6 +62,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -120,3 +121,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/no_capture_inside_methods.snap b/packages/@winglang/wingc/src/jsify/snapshots/no_capture_inside_methods.snap index 201531beb82..65990370b70 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/no_capture_inside_methods.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/no_capture_inside_methods.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -52,6 +52,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -88,3 +89,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/no_capture_of_identifier_from_inner_scope.snap b/packages/@winglang/wingc/src/jsify/snapshots/no_capture_of_identifier_from_inner_scope.snap index a20c38648b0..8cabd20d90b 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/no_capture_of_identifier_from_inner_scope.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/no_capture_of_identifier_from_inner_scope.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -52,6 +52,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -88,3 +89,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/no_capture_of_identifier_from_same_scope.snap b/packages/@winglang/wingc/src/jsify/snapshots/no_capture_of_identifier_from_same_scope.snap index 408de7908c9..a41e5ea4661 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/no_capture_of_identifier_from_same_scope.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/no_capture_of_identifier_from_same_scope.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -48,6 +48,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -84,3 +85,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/no_capture_shadow_inside_inner_scopes.snap b/packages/@winglang/wingc/src/jsify/snapshots/no_capture_shadow_inside_inner_scopes.snap index 8053829329f..449c3d3a51e 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/no_capture_shadow_inside_inner_scopes.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/no_capture_shadow_inside_inner_scopes.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -60,6 +60,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -96,3 +97,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/no_lift_shadow_inside_inner_scopes.snap b/packages/@winglang/wingc/src/jsify/snapshots/no_lift_shadow_inside_inner_scopes.snap index 7db532c3466..18e75e02e5a 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/no_lift_shadow_inside_inner_scopes.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/no_lift_shadow_inside_inner_scopes.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -58,6 +58,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -98,3 +99,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/preflight_class_extends_preflight_class.snap b/packages/@winglang/wingc/src/jsify/snapshots/preflight_class_extends_preflight_class.snap index 191c36210e4..f41f5d38829 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/preflight_class_extends_preflight_class.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/preflight_class_extends_preflight_class.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -50,6 +50,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -99,3 +100,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/preflight_collection.snap b/packages/@winglang/wingc/src/jsify/snapshots/preflight_collection.snap index 36457641f09..e3f74639d0c 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/preflight_collection.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/preflight_collection.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -49,6 +49,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -89,3 +90,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/preflight_collection_of_preflight_objects.snap b/packages/@winglang/wingc/src/jsify/snapshots/preflight_collection_of_preflight_objects.snap index 923a4ed76eb..9f0526f1945 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/preflight_collection_of_preflight_objects.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/preflight_collection_of_preflight_objects.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -53,6 +53,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -97,3 +98,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/preflight_nested_object_with_operations.snap b/packages/@winglang/wingc/src/jsify/snapshots/preflight_nested_object_with_operations.snap index 1f621f34dce..a344fc87984 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/preflight_nested_object_with_operations.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/preflight_nested_object_with_operations.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -70,6 +70,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -130,3 +131,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/preflight_object.snap b/packages/@winglang/wingc/src/jsify/snapshots/preflight_object.snap index de0d1b4ea1b..f6ff77dc67d 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/preflight_object.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/preflight_object.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -71,6 +71,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -132,3 +133,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/preflight_object_through_property.snap b/packages/@winglang/wingc/src/jsify/snapshots/preflight_object_through_property.snap index c125d2c61e1..fc76883e8ed 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/preflight_object_through_property.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/preflight_object_through_property.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -71,6 +71,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -130,3 +131,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/preflight_object_with_operations.snap b/packages/@winglang/wingc/src/jsify/snapshots/preflight_object_with_operations.snap index 8f435fb20f4..b2b7b40cafd 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/preflight_object_with_operations.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/preflight_object_with_operations.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -50,6 +50,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -91,3 +92,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/preflight_object_with_operations_multiple_methods.snap b/packages/@winglang/wingc/src/jsify/snapshots/preflight_object_with_operations_multiple_methods.snap index 2bff0214640..3d545beadc7 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/preflight_object_with_operations_multiple_methods.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/preflight_object_with_operations_multiple_methods.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -52,6 +52,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -93,3 +94,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/preflight_value_field.snap b/packages/@winglang/wingc/src/jsify/snapshots/preflight_value_field.snap index e182c19c4be..9035679b7a8 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/preflight_value_field.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/preflight_value_field.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -76,6 +76,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -138,3 +139,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/qualify_inflight_type_refrencing_preflight_instance.snap b/packages/@winglang/wingc/src/jsify/snapshots/qualify_inflight_type_refrencing_preflight_instance.snap index 13d7b7ff180..c69b4d5f524 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/qualify_inflight_type_refrencing_preflight_instance.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/qualify_inflight_type_refrencing_preflight_instance.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -92,6 +92,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -177,3 +178,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/read_primitive_value.snap b/packages/@winglang/wingc/src/jsify/snapshots/read_primitive_value.snap index a9ff8a399d3..37de2b50a97 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/read_primitive_value.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/read_primitive_value.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -48,6 +48,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -88,3 +89,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/reassign_captured_variable.snap b/packages/@winglang/wingc/src/jsify/snapshots/reassign_captured_variable.snap index 308f433ff6d..2556951867d 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/reassign_captured_variable.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/reassign_captured_variable.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -57,6 +57,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -93,3 +94,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/reassigned_captured_variable_preflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/reassigned_captured_variable_preflight.snap index 9ede102b2d4..0cd1f1698fc 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/reassigned_captured_variable_preflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/reassigned_captured_variable_preflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -24,6 +24,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -42,3 +43,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/ref_std_macro.snap b/packages/@winglang/wingc/src/jsify/snapshots/ref_std_macro.snap index 93d0674096f..b8e714663e9 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/ref_std_macro.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/ref_std_macro.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -48,6 +48,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -88,3 +89,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/reference_from_static_inflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/reference_from_static_inflight.snap index 8c8bd36b33d..082c82d8a7c 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/reference_from_static_inflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/reference_from_static_inflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -44,6 +44,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -85,3 +86,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/reference_inflight_class.snap b/packages/@winglang/wingc/src/jsify/snapshots/reference_inflight_class.snap index 6818dc69154..acf5c0e86ad 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/reference_inflight_class.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/reference_inflight_class.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -67,6 +67,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -131,3 +132,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/reference_inflight_field.snap b/packages/@winglang/wingc/src/jsify/snapshots/reference_inflight_field.snap index 3e507b20e0a..2e69d6e83ec 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/reference_inflight_field.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/reference_inflight_field.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -51,6 +51,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -86,3 +87,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/reference_inflight_from_inflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/reference_inflight_from_inflight.snap index 32a555592ff..e5031328177 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/reference_inflight_from_inflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/reference_inflight_from_inflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -79,6 +79,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -143,3 +144,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/reference_lift_of_collection.snap b/packages/@winglang/wingc/src/jsify/snapshots/reference_lift_of_collection.snap index a8669587f5b..db54afa75a3 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/reference_lift_of_collection.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/reference_lift_of_collection.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -48,6 +48,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -88,3 +89,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_field.snap b/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_field.snap index b95275af880..da9b17dddc6 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_field.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_field.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -52,6 +52,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -94,3 +95,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_field_call_independent_method.snap b/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_field_call_independent_method.snap index d2f94d0dba4..5fb81c90315 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_field_call_independent_method.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_field_call_independent_method.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -52,6 +52,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -94,3 +95,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_fields.snap b/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_fields.snap index 63892ff6048..9df2fbe065f 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_fields.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_fields.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -68,6 +68,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -118,3 +119,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_free_variable_with_this_in_the_expression.snap b/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_free_variable_with_this_in_the_expression.snap index afa6ba5025a..0263d362374 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_free_variable_with_this_in_the_expression.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_free_variable_with_this_in_the_expression.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -55,6 +55,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -102,3 +103,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_object_from_static_inflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_object_from_static_inflight.snap index 6398540de01..199316bdc8b 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_object_from_static_inflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/reference_preflight_object_from_static_inflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -46,6 +46,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -88,3 +89,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/reference_static_inflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/reference_static_inflight.snap index 863b83d6e58..b9e5b27763d 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/reference_static_inflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/reference_static_inflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -67,6 +67,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -129,3 +130,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/reference_static_inflight_which_references_preflight_object.snap b/packages/@winglang/wingc/src/jsify/snapshots/reference_static_inflight_which_references_preflight_object.snap index 10aa4550bcf..cf240f8df33 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/reference_static_inflight_which_references_preflight_object.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/reference_static_inflight_which_references_preflight_object.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -75,6 +75,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -142,3 +143,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/static_external_inflight_class.snap b/packages/@winglang/wingc/src/jsify/snapshots/static_external_inflight_class.snap index e12180d0206..0576162ab13 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/static_external_inflight_class.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/static_external_inflight_class.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -78,6 +78,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -142,3 +143,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/static_external_preflight_class.snap b/packages/@winglang/wingc/src/jsify/snapshots/static_external_preflight_class.snap index 5c9e247194a..bcda647afdd 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/static_external_preflight_class.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/static_external_preflight_class.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -75,6 +75,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -137,3 +138,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/static_inflight_operation.snap b/packages/@winglang/wingc/src/jsify/snapshots/static_inflight_operation.snap index 9d40b5a6874..40d909ed605 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/static_inflight_operation.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/static_inflight_operation.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -72,6 +72,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -139,3 +140,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/static_local_inflight_class.snap b/packages/@winglang/wingc/src/jsify/snapshots/static_local_inflight_class.snap index afc04337309..36b3c16d16f 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/static_local_inflight_class.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/static_local_inflight_class.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -68,6 +68,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -104,3 +105,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/static_on_std_type.snap b/packages/@winglang/wingc/src/jsify/snapshots/static_on_std_type.snap index 568e687f7ba..18438249bff 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/static_on_std_type.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/static_on_std_type.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -48,6 +48,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -90,3 +91,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/transitive_reference.snap b/packages/@winglang/wingc/src/jsify/snapshots/transitive_reference.snap index 14af2dc14a4..138b84704b5 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/transitive_reference.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/transitive_reference.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -93,6 +93,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -165,3 +166,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/transitive_reference_via_inflight_class.snap b/packages/@winglang/wingc/src/jsify/snapshots/transitive_reference_via_inflight_class.snap index 1856aa3c091..8d37acc5276 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/transitive_reference_via_inflight_class.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/transitive_reference_via_inflight_class.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -75,6 +75,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -142,3 +143,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/transitive_reference_via_static.snap b/packages/@winglang/wingc/src/jsify/snapshots/transitive_reference_via_static.snap index 6109dd985a0..a8fcf127a30 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/transitive_reference_via_static.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/transitive_reference_via_static.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -97,6 +97,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -187,3 +188,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/two_identical_lifts.snap b/packages/@winglang/wingc/src/jsify/snapshots/two_identical_lifts.snap index dda1ad1371c..8d0c8762e85 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/two_identical_lifts.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/two_identical_lifts.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -56,6 +56,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -97,3 +98,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/use_util_functions.snap b/packages/@winglang/wingc/src/jsify/snapshots/use_util_functions.snap index 421c89e8224..c52f676f93b 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/use_util_functions.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/use_util_functions.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -46,6 +46,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -86,3 +87,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/var_inflight_field_from_inflight.snap b/packages/@winglang/wingc/src/jsify/snapshots/var_inflight_field_from_inflight.snap index d0b44b01769..d6cbd27a34b 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/var_inflight_field_from_inflight.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/var_inflight_field_from_inflight.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -51,6 +51,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -86,3 +87,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/jsify/snapshots/wait_util.snap b/packages/@winglang/wingc/src/jsify/snapshots/wait_util.snap index c30bb2934c7..6cc7321b923 100644 --- a/packages/@winglang/wingc/src/jsify/snapshots/wait_util.snap +++ b/packages/@winglang/wingc/src/jsify/snapshots/wait_util.snap @@ -1,5 +1,5 @@ --- -source: libs/wingc/src/jsify/tests.rs +source: packages/@winglang/wingc/src/jsify/tests.rs --- ## Code @@ -53,6 +53,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -94,3 +95,11 @@ $APP.synth(); //# sourceMappingURL=preflight.cjs.map ``` +## types.cjs + +```js +const std = require("@winglang/sdk").std; +const $types = {}; +module.exports = $types; +``` + diff --git a/packages/@winglang/wingc/src/lib.rs b/packages/@winglang/wingc/src/lib.rs index 4c51a967665..79688ff374d 100644 --- a/packages/@winglang/wingc/src/lib.rs +++ b/packages/@winglang/wingc/src/lib.rs @@ -123,6 +123,7 @@ const WINGSDK_STRUCT: &'static str = "std.Struct"; const WINGSDK_TEST_CLASS_NAME: &'static str = "Test"; const WINGSDK_NODE: &'static str = "std.Node"; const WINGSDK_APP: &'static str = "std.IApp"; +const WINGSDK_REFLECT_TYPE: &'static str = "std.reflect.Type"; const WINGSDK_SIM_IRESOURCE: &'static str = "sim.IResource"; const WINGSDK_SIM_IRESOURCE_FQN: &'static str = formatcp!( diff --git a/packages/@winglang/wingc/src/parser.rs b/packages/@winglang/wingc/src/parser.rs index 88a88c8c6e0..9550d4cf5c8 100644 --- a/packages/@winglang/wingc/src/parser.rs +++ b/packages/@winglang/wingc/src/parser.rs @@ -14,7 +14,7 @@ use crate::ast::{ ElseIfBlock, ElseIfLetBlock, ElseIfs, Enum, ExplicitLift, Expr, ExprKind, FunctionBody, FunctionDefinition, FunctionParameter, FunctionSignature, IfLet, Interface, InterpolatedString, InterpolatedStringPart, Intrinsic, IntrinsicKind, LiftQualification, Literal, New, Phase, Reference, Scope, Spanned, Stmt, StmtKind, Struct, - StructField, Symbol, TypeAnnotation, TypeAnnotationKind, UnaryOperator, UserDefinedType, + StructField, Symbol, TypeAnnotation, TypeAnnotationKind, TypeIntrinsic, UnaryOperator, UserDefinedType, }; use crate::comp_ctx::{CompilationContext, CompilationPhase}; use crate::diagnostic::{ @@ -2301,6 +2301,7 @@ impl<'s> Parser<'s> { "nil_value" => self.build_nil_expression(&expression_node, phase), "bool" => self.build_bool_expression(&expression_node, phase), "intrinsic" => self.build_intrinsic_expression(&expression_node, phase), + "type_intrinsic" => self.build_type_intrinsic_expression(&expression_node, phase), "duration" => self.build_duration(&expression_node), "reference" => self.build_reference(&expression_node, phase), "positional_argument" => self.build_expression(&expression_node.named_child(0).unwrap(), phase), @@ -2536,6 +2537,14 @@ impl<'s> Parser<'s> { )) } + fn build_type_intrinsic_expression(&self, expression_node: &Node, phase: Phase) -> Result { + let type_ = self.build_type_annotation(get_actual_child_by_field_name(*expression_node, "type"), phase)?; + Ok(Expr::new( + ExprKind::TypeIntrinsic(TypeIntrinsic { type_ }), + self.node_span(&expression_node), + )) + } + fn build_call_expression(&self, expression_node: &Node, phase: Phase) -> Result { let caller_node = expression_node.child_by_field_name("caller").unwrap(); let callee = if caller_node.kind() == "super_call" { diff --git a/packages/@winglang/wingc/src/type_check.rs b/packages/@winglang/wingc/src/type_check.rs index 82730b7f243..0679fbc58b9 100644 --- a/packages/@winglang/wingc/src/type_check.rs +++ b/packages/@winglang/wingc/src/type_check.rs @@ -8,7 +8,7 @@ pub(crate) mod type_reference_transform; use crate::ast::{ self, AccessModifier, ArgListId, AssignmentKind, BringSource, CalleeKind, ClassField, ExplicitLift, ExprId, - FunctionDefinition, IfLet, Intrinsic, IntrinsicKind, New, TypeAnnotationKind, + FunctionDefinition, IfLet, Intrinsic, IntrinsicKind, New, TypeAnnotationKind, TypeIntrinsic, }; use crate::ast::{ ArgList, BinaryOperator, Class as AstClass, ElseIfs, Enum as AstEnum, Expr, ExprKind, FunctionBody, @@ -31,14 +31,16 @@ use crate::{ debug, CONSTRUCT_BASE_CLASS, CONSTRUCT_BASE_INTERFACE, CONSTRUCT_NODE_PROPERTY, DEFAULT_PACKAGE_NAME, UTIL_CLASS_NAME, WINGSDK_APP, WINGSDK_ARRAY, WINGSDK_ASSEMBLY_NAME, WINGSDK_BRINGABLE_MODULES, WINGSDK_BYTES, WINGSDK_DATETIME, WINGSDK_DURATION, WINGSDK_GENERIC, WINGSDK_IRESOURCE, WINGSDK_JSON, WINGSDK_MAP, WINGSDK_MUT_ARRAY, - WINGSDK_MUT_JSON, WINGSDK_MUT_MAP, WINGSDK_MUT_SET, WINGSDK_NODE, WINGSDK_REGEX, WINGSDK_RESOURCE, - WINGSDK_RESOURCE_FQN, WINGSDK_SET, WINGSDK_SIM_IRESOURCE_FQN, WINGSDK_STD_MODULE, WINGSDK_STRING, WINGSDK_STRUCT, + WINGSDK_MUT_JSON, WINGSDK_MUT_MAP, WINGSDK_MUT_SET, WINGSDK_NODE, WINGSDK_REFLECT_TYPE, WINGSDK_REGEX, + WINGSDK_RESOURCE, WINGSDK_RESOURCE_FQN, WINGSDK_SET, WINGSDK_SIM_IRESOURCE_FQN, WINGSDK_STD_MODULE, WINGSDK_STRING, + WINGSDK_STRUCT, }; use camino::{Utf8Path, Utf8PathBuf}; use derivative::Derivative; use indexmap::IndexMap; use itertools::{izip, Itertools}; use jsii_importer::JsiiImporter; +use std::hash::{Hash, Hasher}; use std::cmp; use std::collections::{BTreeMap, HashMap, HashSet}; @@ -94,6 +96,24 @@ where pub type TypeRef = UnsafeRef; +// Comparing typerefs may be imprecise because the compiler doesn't do any de-duplication +// of types. For example, it's possible two function types or Array types created from different spans +// will be considered different typerefs, even though they represent the same type. + +impl Hash for TypeRef { + fn hash(&self, state: &mut H) { + self.0.hash(state); + } +} + +impl PartialEq for TypeRef { + fn eq(&self, other: &Self) -> bool { + self.0 == other.0 + } +} + +impl Eq for TypeRef {} + #[derive(Debug)] pub enum SymbolKind { Type(TypeRef), @@ -1404,6 +1424,38 @@ impl TypeRef { _ => self.is_json_legal_value(), } } + + pub fn short_friendly_name(&self) -> String { + match &**self { + Type::Anything => "any".to_string(), + Type::Number => "num".to_string(), + Type::String => "str".to_string(), + Type::Duration => "duration".to_string(), + Type::Datetime => "datetime".to_string(), + Type::Regex => "regex".to_string(), + Type::Bytes => "bytes".to_string(), + Type::Boolean => "bool".to_string(), + Type::Void => "void".to_string(), + Type::Json(_) => "json".to_string(), + Type::MutJson => "mutjson".to_string(), + Type::Nil => "nil".to_string(), + Type::Unresolved => "unresolved".to_string(), + Type::Inferred(_) => "unknown".to_string(), + Type::Optional(t) => format!("opt_{}", t.short_friendly_name()), + Type::Array(t) => format!("array_{}", t.short_friendly_name()), + Type::MutArray(t) => format!("mutarray_{}", t.short_friendly_name()), + Type::Map(t) => format!("map_{}", t.short_friendly_name()), + Type::MutMap(t) => format!("mutmap_{}", t.short_friendly_name()), + Type::Set(t) => format!("set_{}", t.short_friendly_name()), + Type::MutSet(t) => format!("mutset_{}", t.short_friendly_name()), + Type::Function(_) => "fn".to_string(), + Type::Class(class) => format!("class_{}", class.name), + Type::Interface(interface) => format!("interface_{}", interface.name), + Type::Struct(struct_) => format!("struct_{}", struct_.name), + Type::Enum(enum_) => format!("enum_{}", enum_.name), + Type::Stringable => "stringable".to_string(), + } + } } impl Subtype for TypeRef { @@ -1796,6 +1848,17 @@ impl Types { .expect("Construct interface to be a type") } + pub fn std_reflect_type(&self) -> TypeRef { + let std_reflect_type_fqn = format!("{}.{}", WINGSDK_ASSEMBLY_NAME, WINGSDK_REFLECT_TYPE); + self + .libraries + .lookup_nested_str(&std_reflect_type_fqn, None) + .expect("std.reflect.Type to be loaded") + .0 + .as_type() + .expect("std.reflect.Type to be a type") + } + /// Stores the type and phase of a given expression node. pub fn assign_type_to_expr(&mut self, expr: &Expr, type_: TypeRef, phase: Phase) { let expr_idx = expr.id; @@ -2369,6 +2432,7 @@ This value is set by the CLI at compile time and can be used to conditionally co ExprKind::Range { start, end, .. } => self.type_check_range(start, env, end), ExprKind::Reference(_ref) => self.type_check_reference(_ref, env), ExprKind::Intrinsic(intrinsic) => self.type_check_intrinsic(intrinsic, env, exp), + ExprKind::TypeIntrinsic(type_intrinsic) => self.type_check_type_intrinsic(type_intrinsic, env), ExprKind::New(new_expr) => self.type_check_new(new_expr, env, exp), ExprKind::Call { callee, arg_list } => self.type_check_call(arg_list, env, callee, exp), ExprKind::ArrayLiteral { type_, items } => self.type_check_array_lit(type_, env, exp, items), @@ -3010,6 +3074,11 @@ This value is set by the CLI at compile time and can be used to conditionally co (self.types.error(), Phase::Independent) } + fn type_check_type_intrinsic(&mut self, type_intrinsic: &TypeIntrinsic, env: &mut SymbolEnv) -> (TypeRef, Phase) { + _ = self.resolve_type_annotation(&type_intrinsic.type_, env); + (self.types.std_reflect_type(), Phase::Preflight) + } + fn type_check_range(&mut self, start: &Expr, env: &mut SymbolEnv, end: &Expr) -> (TypeRef, Phase) { let (stype, stype_phase) = self.type_check_exp(start, env); let (etype, _) = self.type_check_exp(end, env); diff --git a/packages/@winglang/wingc/src/visit.rs b/packages/@winglang/wingc/src/visit.rs index 97b20a2384e..a99b7b61929 100644 --- a/packages/@winglang/wingc/src/visit.rs +++ b/packages/@winglang/wingc/src/visit.rs @@ -339,6 +339,9 @@ where v.visit_args(arg_list); } } + ExprKind::TypeIntrinsic(type_intrinsic) => { + v.visit_type_annotation(&type_intrinsic.type_); + } ExprKind::Call { callee, arg_list } => { match callee { CalleeKind::Expr(expr) => v.visit_expr(expr), diff --git a/packages/vscode-wing/scripts/dev.mjs b/packages/vscode-wing/scripts/dev.mjs index c732c83fc8a..d6a1b19f667 100644 --- a/packages/vscode-wing/scripts/dev.mjs +++ b/packages/vscode-wing/scripts/dev.mjs @@ -1,12 +1,12 @@ import { fileURLToPath } from "node:url"; import { spawnSync } from "node:child_process"; -const WING_BIN = fileURLToPath(new URL("../../wing/bin/wing", import.meta.url)); +const WING_BIN = fileURLToPath(new URL("../../../packages/winglang/bin/wing", import.meta.url)); const EXTENSION_DEVELOPMENT_PATH = fileURLToPath( new URL("..", import.meta.url) ); const EXAMPLES_PATH = fileURLToPath( - new URL("../../../examples", import.meta.url) + new URL("../../../tests", import.meta.url) ); spawnSync( diff --git a/packages/winglang/src/commands/pack.test.ts b/packages/winglang/src/commands/pack.test.ts index 6ecb69c78d2..4d022c36737 100644 --- a/packages/winglang/src/commands/pack.test.ts +++ b/packages/winglang/src/commands/pack.test.ts @@ -264,6 +264,7 @@ describe("wing pack", () => { "$lib/.wing/preflight.util-2.cjs", "$lib/.wing/preflight.util-2.cjs.map", "$lib/.wing/preflight.util-2.d.cts", + "$lib/.wing/types.cjs", "LICENSE", "README.md", "enums.w", diff --git a/tests/valid/type_intrinsic.test.w b/tests/valid/type_intrinsic.test.w new file mode 100644 index 00000000000..2bf6e415bdd --- /dev/null +++ b/tests/valid/type_intrinsic.test.w @@ -0,0 +1,393 @@ +bring expect; + +// === fixtures === + +interface BaseInterface {} + +interface MyInterface extends BaseInterface { + method1(): void; +} + +class MyClass impl MyInterface { + pub field1: str; + pub method1(): void {} + pub static method2(): void {} + new() { + this.field1 = "hello"; + } +} + +enum MyEnum { + VARIANT1, + VARIANT2, +} + +struct Base1 { + base1: bool; +} + +struct Base2 { + base2: bool; +} + +struct MyStruct extends Base1, Base2 { + field1: num; + field2: Array; +} + +// === tests === + +let t1 = @type(num); +expect.equal(t1.kind, "num"); +expect.equal(t1.toString(), "num"); + +let t2 = @type(str); +expect.equal(t2.kind, "str"); +expect.equal(t2.toString(), "str"); + +let t3 = @type(bool); +expect.equal(t3.kind, "bool"); +expect.equal(t3.toString(), "bool"); + +let t4 = @type(inflight (num): bool); +expect.equal(t4.kind, "function"); +expect.equal(t4.toString(), "inflight (num): bool"); + +if let fn = t4.asFunction() { + expect.equal(fn.params.length, 1); + expect.equal(fn.params[0].kind, "num"); + expect.equal(fn.returns.kind, "bool"); + expect.equal(fn.phase, std.reflect.Phase.INFLIGHT); + expect.equal(fn.toString(), "inflight (num): bool"); +} else { + expect.fail("t4 is not a function"); +} + +let t5 = @type((bool): void); +expect.equal(t5.kind, "function"); +expect.equal(t5.toString(), "preflight (bool): void"); + +if let fn = t5.asFunction() { + expect.equal(fn.params.length, 1); + expect.equal(fn.params[0].kind, "bool"); + expect.equal(fn.returns.kind, "void"); + expect.equal(fn.toString(), "preflight (bool): void"); +} else { + expect.fail("t5 is not a function"); +} + +let t6 = @type(void); +expect.equal(t6.kind, "void"); +expect.equal(t6.toString(), "void"); + +let t7 = @type(str?); +expect.equal(t7.kind, "optional"); +expect.equal(t7.toString(), "str?"); +if let opt = t7.asOptional() { + expect.equal(opt.child.kind, "str"); + expect.equal(opt.toString(), "str?"); +} else { + expect.fail("t7 is not an optional"); +} + +let t8 = @type(Array); +expect.equal(t8.kind, "array"); +expect.equal(t8.toString(), "Array"); +if let arr = t8.asArray() { + expect.equal(arr.isMut, false); + expect.equal(arr.child.kind, "num"); + expect.equal(arr.toString(), "Array"); +} else { + expect.fail("t8 is not an array"); +} + +let t9 = @type(MutMap); +expect.equal(t9.kind, "mutmap"); +expect.equal(t9.toString(), "MutMap"); +if let map = t9.asMap() { + expect.equal(map.isMut, true); + expect.equal(map.child.kind, "bool"); + expect.equal(map.toString(), "MutMap"); +} else { + expect.fail("t9 is not a map"); +} + +let t10 = @type(Json); +expect.equal(t10.kind, "json"); +expect.equal(t10.toString(), "Json"); + +let t11 = @type(MutJson); +expect.equal(t11.kind, "mutjson"); +expect.equal(t11.toString(), "MutJson"); + +let t12 = @type(duration); +expect.equal(t12.kind, "duration"); +expect.equal(t12.toString(), "duration"); + +let t13 = @type(bytes); +expect.equal(t13.kind, "bytes"); +expect.equal(t13.toString(), "bytes"); + +let t14 = @type(datetime); +expect.equal(t14.kind, "datetime"); +expect.equal(t14.toString(), "datetime"); + +let t15 = @type(bytes); +expect.equal(t15.kind, "bytes"); +expect.equal(t15.toString(), "bytes"); + +let t16 = @type(MyInterface); +expect.equal(t16.kind, "interface"); +expect.equal(t16.toString(), "MyInterface"); +if let iface = t16.asInterface() { + expect.equal(iface.name, "MyInterface"); + expect.equal(iface.toString(), "MyInterface"); + + expect.equal(iface.bases.length, 1); + expect.equal(iface.bases[0].name, "BaseInterface"); + + expect.equal(iface.methods.size(), 1); + expect.equal(iface.methods["method1"].name, "method1"); + expect.equal(iface.methods["method1"].child.toString(), "preflight (): void"); +} else { + expect.fail("t16 is not an interface"); +} + +let t17 = @type(MyClass); +expect.equal(t17.kind, "class"); +expect.equal(t17.toString(), "MyClass"); +if let cls = t17.asClass() { + expect.equal(cls.name, "MyClass"); + expect.equal(cls.toString(), "MyClass"); + if let base = cls.base { + expect.equal(base.name, "Resource"); + } else { + expect.fail("t17 does not have a base class"); + } + expect.equal(cls.properties.size(), 1); + expect.equal(cls.properties["field1"].name, "field1"); + expect.equal(cls.properties["field1"].child.kind, "str"); + expect.ok(cls.methods.size() >= 2); // all classes have some base methods + expect.equal(cls.methods["method1"].name, "method1"); + expect.equal(cls.methods["method1"].isStatic, false); + expect.equal(cls.methods["method1"].child.toString(), "preflight (): void"); + expect.equal(cls.methods["method2"].name, "method2"); + expect.equal(cls.methods["method2"].isStatic, true); + expect.equal(cls.methods["method2"].child.toString(), "preflight (): void"); +} else { + expect.fail("t17 is not a class"); +} + +let t18 = @type(MyEnum); +expect.equal(t18.kind, "enum"); +expect.equal(t18.toString(), "MyEnum"); +if let enm = t18.asEnum() { + expect.equal(enm.name, "MyEnum"); + expect.equal(enm.toString(), "MyEnum"); + expect.equal(enm.variants.size(), 2); + expect.equal(enm.variants["VARIANT1"].name, "VARIANT1"); + expect.equal(enm.variants["VARIANT2"].name, "VARIANT2"); +} else { + expect.fail("t18 is not an enum"); +} + +let t19 = @type(MyStruct); +expect.equal(t19.kind, "struct"); +expect.equal(t19.toString(), "MyStruct"); +if let st = t19.asStruct() { + expect.equal(st.name, "MyStruct"); + expect.equal(st.toString(), "MyStruct"); + + expect.equal(st.bases.length, 2); + expect.equal(st.bases[0].name, "Base1"); + expect.equal(st.bases[1].name, "Base2"); + + expect.equal(st.fields.size(), 4); + expect.equal(st.fields["base1"].name, "base1"); + expect.equal(st.fields["base1"].child.kind, "bool"); + expect.equal(st.fields["base2"].name, "base2"); + expect.equal(st.fields["base2"].child.kind, "bool"); + expect.equal(st.fields["field1"].name, "field1"); + expect.equal(st.fields["field1"].child.kind, "num"); + expect.equal(st.fields["field2"].name, "field2"); + expect.equal(st.fields["field2"].child.kind, "array"); + let arr = st.fields["field2"].child.asArray()!; + expect.equal(arr.child.kind, "optional"); + let opt = arr.child.asOptional()!; + expect.equal(opt.child.kind, "json"); +} else { + expect.fail("t19 is not a struct"); +} + +test "@type in inflight" { + let t1 = @type(num); + expect.equal(t1.kind, "num"); + expect.equal(t1.toString(), "num"); + + let t2 = @type(str); + expect.equal(t2.kind, "str"); + expect.equal(t2.toString(), "str"); + + let t3 = @type(bool); + expect.equal(t3.kind, "bool"); + expect.equal(t3.toString(), "bool"); + + let t4 = @type(inflight (num): bool); + expect.equal(t4.kind, "function"); + expect.equal(t4.toString(), "inflight (num): bool"); + + if let fn = t4.asFunction() { + expect.equal(fn.params.length, 1); + expect.equal(fn.params[0].kind, "num"); + expect.equal(fn.returns.kind, "bool"); + expect.equal(fn.phase, std.reflect.Phase.INFLIGHT); + expect.equal(fn.toString(), "inflight (num): bool"); + } else { + expect.fail("t4 is not a function"); + } + + // skip t5 since we don't have a way to represent a preflight function type annotation in inflight + + let t6 = @type(void); + expect.equal(t6.kind, "void"); + expect.equal(t6.toString(), "void"); + + let t7 = @type(str?); + expect.equal(t7.kind, "optional"); + expect.equal(t7.toString(), "str?"); + if let opt = t7.asOptional() { + expect.equal(opt.child.kind, "str"); + expect.equal(opt.toString(), "str?"); + } else { + expect.fail("t7 is not an optional"); + } + + let t8 = @type(Array); + expect.equal(t8.kind, "array"); + expect.equal(t8.toString(), "Array"); + if let arr = t8.asArray() { + expect.equal(arr.child.kind, "num"); + expect.equal(arr.toString(), "Array"); + expect.equal(arr.isMut, false); + } else { + expect.fail("t8 is not an array"); + } + + let t9 = @type(MutMap); + expect.equal(t9.kind, "mutmap"); + expect.equal(t9.toString(), "MutMap"); + if let map = t9.asMap() { + expect.equal(map.child.kind, "bool"); + expect.equal(map.toString(), "MutMap"); + expect.equal(map.isMut, true); + } else { + expect.fail("t9 is not a map"); + } + + let t10 = @type(Json); + expect.equal(t10.kind, "json"); + expect.equal(t10.toString(), "Json"); + + let t11 = @type(MutJson); + expect.equal(t11.kind, "mutjson"); + expect.equal(t11.toString(), "MutJson"); + + let t12 = @type(duration); + expect.equal(t12.kind, "duration"); + expect.equal(t12.toString(), "duration"); + + let t13 = @type(bytes); + expect.equal(t13.kind, "bytes"); + expect.equal(t13.toString(), "bytes"); + + let t14 = @type(datetime); + expect.equal(t14.kind, "datetime"); + expect.equal(t14.toString(), "datetime"); + + let t15 = @type(bytes); + expect.equal(t15.kind, "bytes"); + expect.equal(t15.toString(), "bytes"); + + let t16 = @type(MyInterface); + expect.equal(t16.kind, "interface"); + expect.equal(t16.toString(), "MyInterface"); + if let iface = t16.asInterface() { + expect.equal(iface.name, "MyInterface"); + expect.equal(iface.toString(), "MyInterface"); + + expect.equal(iface.bases.length, 1); + expect.equal(iface.bases[0].name, "BaseInterface"); + + expect.equal(iface.methods.size(), 1); + expect.equal(iface.methods["method1"].name, "method1"); + expect.equal(iface.methods["method1"].child.toString(), "preflight (): void"); + } else { + expect.fail("t16 is not an interface"); + } + + let t17 = @type(MyClass); + expect.equal(t17.kind, "class"); + expect.equal(t17.toString(), "MyClass"); + if let cls = t17.asClass() { + expect.equal(cls.name, "MyClass"); + expect.equal(cls.toString(), "MyClass"); + if let base = cls.base { + expect.equal(base.name, "Resource"); + } else { + expect.fail("t17 does not have a base class"); + } + expect.equal(cls.properties.size(), 1); + expect.equal(cls.properties["field1"].name, "field1"); + expect.equal(cls.properties["field1"].child.kind, "str"); + expect.ok(cls.methods.size() >= 2); // all classes have some base methods + expect.equal(cls.methods["method1"].name, "method1"); + expect.equal(cls.methods["method1"].isStatic, false); + expect.equal(cls.methods["method1"].child.toString(), "preflight (): void"); + expect.equal(cls.methods["method2"].name, "method2"); + expect.equal(cls.methods["method2"].isStatic, true); + expect.equal(cls.methods["method2"].child.toString(), "preflight (): void"); + } else { + expect.fail("t17 is not a class"); + } + + let t18 = @type(MyEnum); + expect.equal(t18.kind, "enum"); + expect.equal(t18.toString(), "MyEnum"); + if let enm = t18.asEnum() { + expect.equal(enm.name, "MyEnum"); + expect.equal(enm.toString(), "MyEnum"); + expect.equal(enm.variants.size(), 2); + expect.equal(enm.variants["VARIANT1"].name, "VARIANT1"); + expect.equal(enm.variants["VARIANT2"].name, "VARIANT2"); + } else { + expect.fail("t18 is not an enum"); + } + + let t19 = @type(MyStruct); + expect.equal(t19.kind, "struct"); + expect.equal(t19.toString(), "MyStruct"); + if let st = t19.asStruct() { + expect.equal(st.name, "MyStruct"); + expect.equal(st.toString(), "MyStruct"); + + expect.equal(st.bases.length, 2); + expect.equal(st.bases[0].name, "Base1"); + expect.equal(st.bases[1].name, "Base2"); + + expect.equal(st.fields.size(), 4); + expect.equal(st.fields["base1"].name, "base1"); + expect.equal(st.fields["base1"].child.kind, "bool"); + expect.equal(st.fields["base2"].name, "base2"); + expect.equal(st.fields["base2"].child.kind, "bool"); + expect.equal(st.fields["field1"].name, "field1"); + expect.equal(st.fields["field1"].child.kind, "num"); + expect.equal(st.fields["field2"].name, "field2"); + expect.equal(st.fields["field2"].child.kind, "array"); + let arr = st.fields["field2"].child.asArray()!; + expect.equal(arr.child.kind, "optional"); + let opt = arr.child.asOptional()!; + expect.equal(opt.child.kind, "json"); + } else { + expect.fail("t19 is not a struct"); + } +} diff --git a/tools/hangar/__snapshots__/test_corpus/valid/anon_function.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/anon_function.test.w_compile_tf-aws.md index c472165aae0..bedfc187639 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/anon_function.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/anon_function.test.w_compile_tf-aws.md @@ -54,6 +54,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/api.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/api.test.w_compile_tf-aws.md index 0dff3e1b741..ee6da86e918 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/api.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/api.test.w_compile_tf-aws.md @@ -488,6 +488,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/api_cors_custom.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/api_cors_custom.test.w_compile_tf-aws.md index c0622079758..643059d3320 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/api_cors_custom.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/api_cors_custom.test.w_compile_tf-aws.md @@ -344,6 +344,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/api_cors_default.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/api_cors_default.test.w_compile_tf-aws.md index 9f426a2814d..1229ccfd57a 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/api_cors_default.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/api_cors_default.test.w_compile_tf-aws.md @@ -317,6 +317,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/api_valid_path.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/api_valid_path.test.w_compile_tf-aws.md index 3ea4da830e1..18061a46d97 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/api_valid_path.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/api_valid_path.test.w_compile_tf-aws.md @@ -559,6 +559,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/app.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/app.test.w_compile_tf-aws.md index fe612ba54de..d83dac6293d 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/app.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/app.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/assert.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/assert.test.w_compile_tf-aws.md index d89e6e6c046..db4bdfb1594 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/assert.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/assert.test.w_compile_tf-aws.md @@ -65,6 +65,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/asynchronous_model_implicit_await_in_functions.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/asynchronous_model_implicit_await_in_functions.test.w_compile_tf-aws.md index bdf1fc709d7..d7b8cdaa69c 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/asynchronous_model_implicit_await_in_functions.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/asynchronous_model_implicit_await_in_functions.test.w_compile_tf-aws.md @@ -280,6 +280,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/baz.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/baz.w_compile_tf-aws.md index 1eb7df29ba1..5b35d155701 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/baz.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/baz.w_compile_tf-aws.md @@ -21,6 +21,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; class Baz extends $stdlib.std.Resource { constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_alias.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_alias.test.w_compile_tf-aws.md index cbada7d8dad..0fe673a0ec6 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_alias.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_alias.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_awscdk.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_awscdk.test.w_compile_tf-aws.md index 96b7a425701..b99c86c550f 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_awscdk.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_awscdk.test.w_compile_tf-aws.md @@ -42,6 +42,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_cdk8s.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_cdk8s.test.w_compile_tf-aws.md index d71b182e5cc..1fcfd29c120 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_cdk8s.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_cdk8s.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_cdktf.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_cdktf.test.w_compile_tf-aws.md index 1f71641fea7..25c796ef310 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_cdktf.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_cdktf.test.w_compile_tf-aws.md @@ -59,6 +59,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_extend_non_entry.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_extend_non_entry.test.w_compile_tf-aws.md index 3576f9bede6..60f25a99b03 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_extend_non_entry.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_extend_non_entry.test.w_compile_tf-aws.md @@ -42,6 +42,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -66,6 +67,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; const cdk8s = require("cdk8s"); class Foo extends (globalThis.$ClassFactory.resolveType("cdk8s.Chart") ?? cdk8s.Chart) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_jsii.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_jsii.test.w_compile_tf-aws.md index ca10a6a8cef..ad97483bef6 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_jsii.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_jsii.test.w_compile_tf-aws.md @@ -66,6 +66,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_local.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_local.test.w_compile_tf-aws.md index 7d577c51d74..3fb007f62d4 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_local.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_local.test.w_compile_tf-aws.md @@ -335,6 +335,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -459,6 +460,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; module.exports = { $preflightTypesMap, }; //# sourceMappingURL=preflight.empty-1.cjs.map @@ -472,6 +474,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; const file3 = $helpers.bringJs(`${__dirname}/preflight.empty-1.cjs`, $preflightTypesMap); const math = $stdlib.math; @@ -567,6 +570,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; const math = $stdlib.math; class Q extends $stdlib.std.Resource { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_local_dir.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_local_dir.test.w_compile_tf-aws.md index f48821e2377..d617eca48ca 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_local_dir.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_local_dir.test.w_compile_tf-aws.md @@ -97,6 +97,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -130,6 +131,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; const blah = $helpers.bringJs(`${__dirname}/preflight.inner-2.cjs`, $preflightTypesMap); const cloud = $stdlib.cloud; @@ -169,6 +171,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; const util = $stdlib.util; class Bar extends $stdlib.std.Resource { @@ -221,6 +224,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; class InflightClass extends $stdlib.std.Resource { constructor($scope, $id, ) { @@ -255,6 +259,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $preflightTypesMap = {}; Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.widget-1.cjs`, $preflightTypesMap)); module.exports = { ...module.exports, $preflightTypesMap }; @@ -269,6 +274,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $preflightTypesMap = {}; Object.assign(module.exports, { get inner() { return $helpers.bringJs(`${__dirname}/preflight.inner-2.cjs`, $preflightTypesMap); } }); Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.inflightclass-5.cjs`, $preflightTypesMap)); @@ -286,6 +292,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; class Widget extends $stdlib.std.Resource { constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_local_normalization.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_local_normalization.test.w_compile_tf-aws.md index c71a5d063c0..9fe11fefa29 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_local_normalization.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_local_normalization.test.w_compile_tf-aws.md @@ -78,6 +78,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; class Bar extends $stdlib.std.Resource { constructor($scope, $id, ) { @@ -136,6 +137,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; class Baz extends $stdlib.std.Resource { constructor($scope, $id, ) { @@ -172,6 +174,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -202,6 +205,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; const bar = $helpers.bringJs(`${__dirname}/preflight.bar-1.cjs`, $preflightTypesMap); const baz = $helpers.bringJs(`${__dirname}/preflight.baz-2.cjs`, $preflightTypesMap); diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_projen.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_projen.test.w_compile_tf-aws.md index 43f15c88072..a5a5b290b56 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_projen.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_projen.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bring_wing_library.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bring_wing_library.test.w_compile_tf-aws.md index 633e5ed597b..d128e52153f 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bring_wing_library.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bring_wing_library.test.w_compile_tf-aws.md @@ -167,6 +167,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -224,6 +225,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; const FavoriteNumbers = (function (tmp) { @@ -251,6 +253,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; const cloud = $stdlib.cloud; const fs = $stdlib.fs; @@ -363,6 +366,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $preflightTypesMap = {}; Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.util-2.cjs`, $preflightTypesMap)); module.exports = { ...module.exports, $preflightTypesMap }; @@ -377,6 +381,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $preflightTypesMap = {}; Object.assign(module.exports, { get subdir() { return $helpers.bringJs(`${__dirname}/preflight.subdir-4.cjs`, $preflightTypesMap); } }); Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.store-3.cjs`, $preflightTypesMap)); @@ -393,6 +398,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; class Util extends $stdlib.std.Resource { constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bucket_keys.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bucket_keys.test.w_compile_tf-aws.md index 27f6ecf74e4..fe05f8afa53 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bucket_keys.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bucket_keys.test.w_compile_tf-aws.md @@ -105,6 +105,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/bypass_return.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/bypass_return.test.w_compile_tf-aws.md index 2fda646670a..f5e11d4ebb5 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/bypass_return.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/bypass_return.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/call_static_of_myself.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/call_static_of_myself.test.w_compile_tf-aws.md index c47f49cf64d..d95f8145acd 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/call_static_of_myself.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/call_static_of_myself.test.w_compile_tf-aws.md @@ -102,6 +102,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/calling_inflight_variants.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/calling_inflight_variants.test.w_compile_tf-aws.md index 3113823bf6d..1b6ff334610 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/calling_inflight_variants.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/calling_inflight_variants.test.w_compile_tf-aws.md @@ -117,6 +117,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_containers.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_containers.test.w_compile_tf-aws.md index a9e00199f7d..71c71a27b08 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_containers.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_containers.test.w_compile_tf-aws.md @@ -59,6 +59,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_in_binary.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_in_binary.test.w_compile_tf-aws.md index 363a88713d7..c008fbc94cb 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_in_binary.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_in_binary.test.w_compile_tf-aws.md @@ -97,6 +97,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_mutables.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_mutables.test.w_compile_tf-aws.md index 107d7b23691..78481dd9e83 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_mutables.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_mutables.test.w_compile_tf-aws.md @@ -76,6 +76,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_primitives.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_primitives.test.w_compile_tf-aws.md index 97370658ac9..c35bf4be464 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_primitives.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_primitives.test.w_compile_tf-aws.md @@ -174,6 +174,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_reassigable_class_field.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_reassigable_class_field.test.w_compile_tf-aws.md index 274dd9d40da..9cb4aaf56ec 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_reassigable_class_field.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_reassigable_class_field.test.w_compile_tf-aws.md @@ -192,6 +192,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_reassignable.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_reassignable.test.w_compile_tf-aws.md index 69dc7743ec7..89082717780 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_reassignable.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_reassignable.test.w_compile_tf-aws.md @@ -73,6 +73,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_and_data.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_and_data.test.w_compile_tf-aws.md index 48be3a9f449..f509a740987 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_and_data.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_and_data.test.w_compile_tf-aws.md @@ -111,6 +111,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_with_no_inflight.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_with_no_inflight.test.w_compile_tf-aws.md index 41b373a4ad4..062195da1ad 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_with_no_inflight.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_resource_with_no_inflight.test.w_compile_tf-aws.md @@ -95,6 +95,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/capture_tokens.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/capture_tokens.test.w_compile_tf-aws.md index 56865ab775e..9a46bd143fb 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/capture_tokens.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/capture_tokens.test.w_compile_tf-aws.md @@ -234,6 +234,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/captures.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/captures.test.w_compile_tf-aws.md index 019ccd430b9..76b0c876e8b 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/captures.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/captures.test.w_compile_tf-aws.md @@ -753,6 +753,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/casting.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/casting.test.w_compile_tf-aws.md index 86887482149..b2cd9f1f045 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/casting.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/casting.test.w_compile_tf-aws.md @@ -78,6 +78,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/chaining_macros.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/chaining_macros.test.w_compile_tf-aws.md index 86f80b848d6..193c987779d 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/chaining_macros.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/chaining_macros.test.w_compile_tf-aws.md @@ -97,6 +97,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/class.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/class.test.w_compile_tf-aws.md index 0221e6a10e9..129d4b4d8ea 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/class.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/class.test.w_compile_tf-aws.md @@ -560,6 +560,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/closure_class.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/closure_class.test.w_compile_tf-aws.md index 7f5927c060f..3c2d6045e8e 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/closure_class.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/closure_class.test.w_compile_tf-aws.md @@ -77,6 +77,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/construct-base.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/construct-base.test.w_compile_tf-aws.md index 62d3cbd51a2..31ba51636ca 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/construct-base.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/construct-base.test.w_compile_tf-aws.md @@ -54,6 +54,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/container_types.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/container_types.test.w_compile_tf-aws.md index a0b7c479352..81176fee720 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/container_types.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/container_types.test.w_compile_tf-aws.md @@ -149,6 +149,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/custom_obj_id.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/custom_obj_id.test.w_compile_tf-aws.md index 0c3230c5d1f..71be0207422 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/custom_obj_id.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/custom_obj_id.test.w_compile_tf-aws.md @@ -42,6 +42,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/deep_equality.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/deep_equality.test.w_compile_tf-aws.md index 34ca3afad5b..1d0bd6110cc 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/deep_equality.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/deep_equality.test.w_compile_tf-aws.md @@ -330,6 +330,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/double_reference.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/double_reference.test.w_compile_tf-aws.md index dba0316f507..4630e1557d7 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/double_reference.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/double_reference.test.w_compile_tf-aws.md @@ -112,6 +112,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/doubler.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/doubler.test.w_compile_tf-aws.md index cc6cf2d9d36..90f09a46590 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/doubler.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/doubler.test.w_compile_tf-aws.md @@ -265,6 +265,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/enums.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/enums.test.w_compile_tf-aws.md index e5e2c25b6f4..2b310fa3142 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/enums.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/enums.test.w_compile_tf-aws.md @@ -76,6 +76,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/explicit_lift_qualification.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/explicit_lift_qualification.test.w_compile_tf-aws.md index a4e52bbf0cb..e656803153a 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/explicit_lift_qualification.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/explicit_lift_qualification.test.w_compile_tf-aws.md @@ -306,6 +306,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/expressions_binary_operators.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/expressions_binary_operators.test.w_compile_tf-aws.md index 384b92cf9ec..ef847de2816 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/expressions_binary_operators.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/expressions_binary_operators.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/expressions_string_interpolation.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/expressions_string_interpolation.test.w_compile_tf-aws.md index c138ac76baa..1e271fad797 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/expressions_string_interpolation.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/expressions_string_interpolation.test.w_compile_tf-aws.md @@ -56,6 +56,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/extend_counter.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/extend_counter.test.w_compile_tf-aws.md index 7bc0b674ee8..3e1c36b1e6c 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/extend_counter.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/extend_counter.test.w_compile_tf-aws.md @@ -129,6 +129,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/extend_non_entrypoint.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/extend_non_entrypoint.w_compile_tf-aws.md index 5de99139137..1af51258cbd 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/extend_non_entrypoint.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/extend_non_entrypoint.w_compile_tf-aws.md @@ -21,6 +21,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; const cdk8s = require("cdk8s"); class Foo extends (globalThis.$ClassFactory.resolveType("cdk8s.Chart") ?? cdk8s.Chart) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/extern_implementation.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/extern_implementation.test.w_compile_tf-aws.md index ae1e028c6e7..3a28074f361 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/extern_implementation.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/extern_implementation.test.w_compile_tf-aws.md @@ -275,6 +275,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/factory.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/factory.test.w_compile_tf-aws.md index 0b7bd2c2337..efdaa81a3fb 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/factory.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/factory.test.w_compile_tf-aws.md @@ -132,6 +132,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/file_counter.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/file_counter.test.w_compile_tf-aws.md index f5ee95fd300..4b9688140c5 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/file_counter.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/file_counter.test.w_compile_tf-aws.md @@ -252,6 +252,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/for_loop.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/for_loop.test.w_compile_tf-aws.md index 8727d369c71..8a186fb4206 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/for_loop.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/for_loop.test.w_compile_tf-aws.md @@ -182,6 +182,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/forward_decl.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/forward_decl.test.w_compile_tf-aws.md index 59083731263..247e7617255 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/forward_decl.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/forward_decl.test.w_compile_tf-aws.md @@ -42,6 +42,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/function_optional_arguments.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/function_optional_arguments.test.w_compile_tf-aws.md index bc8ef3cb379..740b3a9475a 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/function_optional_arguments.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/function_optional_arguments.test.w_compile_tf-aws.md @@ -42,6 +42,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/function_returns_function.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/function_returns_function.test.w_compile_tf-aws.md index ad182fa7f71..e88c6de307a 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/function_returns_function.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/function_returns_function.test.w_compile_tf-aws.md @@ -59,6 +59,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/function_type.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/function_type.test.w_compile_tf-aws.md index 4619766232f..57719b9a51b 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/function_type.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/function_type.test.w_compile_tf-aws.md @@ -109,6 +109,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/function_variadic_arguments.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/function_variadic_arguments.test.w_compile_tf-aws.md index 7f15636961a..42897cedec2 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/function_variadic_arguments.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/function_variadic_arguments.test.w_compile_tf-aws.md @@ -175,6 +175,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/hello.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/hello.test.w_compile_tf-aws.md index b77e2f556bb..8f888c75c6c 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/hello.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/hello.test.w_compile_tf-aws.md @@ -230,6 +230,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/identical_inflights.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/identical_inflights.test.w_compile_tf-aws.md index 98329830bfe..cfb7b24c048 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/identical_inflights.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/identical_inflights.test.w_compile_tf-aws.md @@ -71,6 +71,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/impl_interface.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/impl_interface.test.w_compile_tf-aws.md index 4005f84777c..e1ada1e6758 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/impl_interface.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/impl_interface.test.w_compile_tf-aws.md @@ -248,6 +248,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/implicit_std.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/implicit_std.test.w_compile_tf-aws.md index 8dbd20d7159..29d07164df3 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/implicit_std.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/implicit_std.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/in_scope_construct.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/in_scope_construct.test.w_compile_tf-aws.md index e27aa9be4d3..65e13f47285 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/in_scope_construct.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/in_scope_construct.test.w_compile_tf-aws.md @@ -42,6 +42,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/indexing.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/indexing.test.w_compile_tf-aws.md index f802507058c..d6a26d19a99 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/indexing.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/indexing.test.w_compile_tf-aws.md @@ -42,6 +42,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inference.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inference.test.w_compile_tf-aws.md index 31f29215973..d4e3b08d180 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inference.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inference.test.w_compile_tf-aws.md @@ -259,6 +259,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight-subscribers.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight-subscribers.test.w_compile_tf-aws.md index 4716dfa650c..a58c387ee04 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight-subscribers.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight-subscribers.test.w_compile_tf-aws.md @@ -333,6 +333,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_capture_static.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_capture_static.test.w_compile_tf-aws.md index 56ec4a205d1..04f211e106d 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_capture_static.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_capture_static.test.w_compile_tf-aws.md @@ -163,6 +163,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_as_struct_members.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_as_struct_members.test.w_compile_tf-aws.md index ad0565af1f3..ed38137a24e 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_as_struct_members.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_as_struct_members.test.w_compile_tf-aws.md @@ -90,6 +90,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_const.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_const.test.w_compile_tf-aws.md index c7201d36858..26f4205cfa9 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_const.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_const.test.w_compile_tf-aws.md @@ -68,6 +68,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_preflight_object.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_preflight_object.test.w_compile_tf-aws.md index ba454b2989f..6cb7941bdae 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_preflight_object.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_capture_preflight_object.test.w_compile_tf-aws.md @@ -304,6 +304,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -516,6 +517,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; const blah = $helpers.bringJs(`${__dirname}/preflight.inner-2.cjs`, $preflightTypesMap); const cloud = $stdlib.cloud; @@ -555,6 +557,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; const util = $stdlib.util; class Bar extends $stdlib.std.Resource { @@ -607,6 +610,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; class InflightClass extends $stdlib.std.Resource { constructor($scope, $id, ) { @@ -641,6 +645,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $preflightTypesMap = {}; Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.widget-1.cjs`, $preflightTypesMap)); module.exports = { ...module.exports, $preflightTypesMap }; @@ -655,6 +660,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $preflightTypesMap = {}; Object.assign(module.exports, { get inner() { return $helpers.bringJs(`${__dirname}/preflight.inner-2.cjs`, $preflightTypesMap); } }); Object.assign(module.exports, $helpers.bringJs(`${__dirname}/preflight.inflightclass-5.cjs`, $preflightTypesMap)); @@ -672,6 +678,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; class Widget extends $stdlib.std.Resource { constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_definitions.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_definitions.test.w_compile_tf-aws.md index 8f17f06a059..25c1936a9a8 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_definitions.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_definitions.test.w_compile_tf-aws.md @@ -187,6 +187,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inner_capture_mutable.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inner_capture_mutable.test.w_compile_tf-aws.md index c1e125e362d..c0b7941cd70 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inner_capture_mutable.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inner_capture_mutable.test.w_compile_tf-aws.md @@ -62,6 +62,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inside_inflight_closure.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inside_inflight_closure.test.w_compile_tf-aws.md index e76b2ce4661..d0b7fbc6acd 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inside_inflight_closure.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_inside_inflight_closure.test.w_compile_tf-aws.md @@ -278,6 +278,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_modifiers.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_modifiers.test.w_compile_tf-aws.md index 30c705da89d..a421066e8e4 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_modifiers.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_modifiers.test.w_compile_tf-aws.md @@ -49,6 +49,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_outside_inflight_closure.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_outside_inflight_closure.test.w_compile_tf-aws.md index 66bf78ae278..436c2539eac 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_outside_inflight_closure.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_outside_inflight_closure.test.w_compile_tf-aws.md @@ -74,6 +74,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_structural_interace_handler.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_structural_interace_handler.test.w_compile_tf-aws.md index b24ef813d61..b5a359a5da3 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_structural_interace_handler.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_structural_interace_handler.test.w_compile_tf-aws.md @@ -78,6 +78,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_without_init.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_without_init.test.w_compile_tf-aws.md index 32960082e01..3c6c54daf2d 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_without_init.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_class_without_init.test.w_compile_tf-aws.md @@ -64,6 +64,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_as_super_param.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_as_super_param.test.w_compile_tf-aws.md index 134d5ac8f44..ca578c1e050 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_as_super_param.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_as_super_param.test.w_compile_tf-aws.md @@ -112,6 +112,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_autoid.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_autoid.test.w_compile_tf-aws.md index a61477954b7..ed55ebed33f 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_autoid.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_autoid.test.w_compile_tf-aws.md @@ -75,6 +75,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_inside_preflight_closure.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_inside_preflight_closure.test.w_compile_tf-aws.md index 3d52caae7d3..712c63e97b2 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_inside_preflight_closure.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_closure_inside_preflight_closure.test.w_compile_tf-aws.md @@ -63,6 +63,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_concat.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_concat.test.w_compile_tf-aws.md index 4a1b97d58d4..93217bacbcb 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_concat.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_concat.test.w_compile_tf-aws.md @@ -49,6 +49,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_handler_singleton.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_handler_singleton.test.w_compile_tf-aws.md index 385847fa764..ebc8cb5d9e6 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_handler_singleton.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_handler_singleton.test.w_compile_tf-aws.md @@ -453,6 +453,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflight_init.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflight_init.test.w_compile_tf-aws.md index 0de55355654..c9a330a6895 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflight_init.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflight_init.test.w_compile_tf-aws.md @@ -204,6 +204,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inflights_calling_inflights.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inflights_calling_inflights.test.w_compile_tf-aws.md index 90273bf03f9..f167817d1b4 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inflights_calling_inflights.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inflights_calling_inflights.test.w_compile_tf-aws.md @@ -318,6 +318,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inherit_stdlib_class.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inherit_stdlib_class.test.w_compile_tf-aws.md index 73767664773..38aa22d025e 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inherit_stdlib_class.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inherit_stdlib_class.test.w_compile_tf-aws.md @@ -295,6 +295,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_inflight.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_inflight.test.w_compile_tf-aws.md index fcf966bb32d..5f850d29388 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_inflight.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_inflight.test.w_compile_tf-aws.md @@ -91,6 +91,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_preflight.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_preflight.test.w_compile_tf-aws.md index e268b84a2cb..83acc117916 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_preflight.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inheritance_class_preflight.test.w_compile_tf-aws.md @@ -55,6 +55,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/inheritance_interface.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/inheritance_interface.test.w_compile_tf-aws.md index c26d2c749c0..b852bbcd3fb 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/inheritance_interface.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/inheritance_interface.test.w_compile_tf-aws.md @@ -42,6 +42,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/interface.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/interface.test.w_compile_tf-aws.md index ffbc2d52f53..6231268946b 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/interface.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/interface.test.w_compile_tf-aws.md @@ -55,6 +55,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/intrinsics.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/intrinsics.test.w_compile_tf-aws.md index 8c28992ceed..927a58840f4 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/intrinsics.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/intrinsics.test.w_compile_tf-aws.md @@ -52,6 +52,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; class Bar extends $stdlib.std.Resource { constructor($scope, $id, ) { @@ -113,6 +114,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/issue_2889.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/issue_2889.test.w_compile_tf-aws.md index 773c63013e1..4a0c527c0df 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/issue_2889.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/issue_2889.test.w_compile_tf-aws.md @@ -285,6 +285,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/json-types.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/json-types.test.w_compile_tf-aws.md index ff213ad5c6e..376e2fd5ef3 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/json-types.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/json-types.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/json.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/json.test.w_compile_tf-aws.md index c19559ad465..402ad3a5836 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/json.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/json.test.w_compile_tf-aws.md @@ -124,6 +124,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/json_bucket.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/json_bucket.test.w_compile_tf-aws.md index 0dcb058808c..c1b80e95b60 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/json_bucket.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/json_bucket.test.w_compile_tf-aws.md @@ -225,6 +225,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/json_static.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/json_static.test.w_compile_tf-aws.md index 002a6d76742..1d0fa91c406 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/json_static.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/json_static.test.w_compile_tf-aws.md @@ -76,6 +76,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/json_string_interpolation.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/json_string_interpolation.test.w_compile_tf-aws.md index 75eef758a0b..dbbcdc5a69e 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/json_string_interpolation.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/json_string_interpolation.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_expr_with_this.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_expr_with_this.test.w_compile_tf-aws.md index 7d037f949a3..82ac459de32 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_expr_with_this.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_expr_with_this.test.w_compile_tf-aws.md @@ -65,6 +65,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_collection.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_collection.test.w_compile_tf-aws.md index 8f44fdccea8..62a1a22e520 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_collection.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_collection.test.w_compile_tf-aws.md @@ -728,6 +728,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_returning_object_issue6501.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_returning_object_issue6501.test.w_compile_tf-aws.md index 90cf6eb4a58..c56b782d973 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_returning_object_issue6501.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_inflight_closure_returning_object_issue6501.test.w_compile_tf-aws.md @@ -180,6 +180,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_parent_fields.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_parent_fields.test.w_compile_tf-aws.md index 91b1cc08797..0805cbf67cc 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_parent_fields.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_parent_fields.test.w_compile_tf-aws.md @@ -117,6 +117,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_redefinition.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_redefinition.test.w_compile_tf-aws.md index 1b5dd941946..f33035e894f 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_redefinition.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_redefinition.test.w_compile_tf-aws.md @@ -53,6 +53,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_shared_resource.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_shared_resource.test.w_compile_tf-aws.md index 6c64e7aa3f4..70b3844d272 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_shared_resource.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_shared_resource.test.w_compile_tf-aws.md @@ -345,6 +345,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_this.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_this.test.w_compile_tf-aws.md index 35f7542a34f..95ee079de18 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_this.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_this.test.w_compile_tf-aws.md @@ -74,6 +74,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure.test.w_compile_tf-aws.md index 4fff33d716a..bc02187f44a 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure.test.w_compile_tf-aws.md @@ -212,6 +212,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure_explicit.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure_explicit.test.w_compile_tf-aws.md index 9f1336318e9..ed5d6fc31fe 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure_explicit.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_via_closure_explicit.test.w_compile_tf-aws.md @@ -89,6 +89,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_weird_order.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_weird_order.test.w_compile_tf-aws.md index 110a981cd0e..0d88d04b9a8 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_weird_order.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_weird_order.test.w_compile_tf-aws.md @@ -87,6 +87,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/lift_with_phase_ind.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/lift_with_phase_ind.test.w_compile_tf-aws.md index 6c9ba404d7f..5db0eb038e2 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/lift_with_phase_ind.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/lift_with_phase_ind.test.w_compile_tf-aws.md @@ -58,6 +58,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/map_entries.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/map_entries.test.w_compile_tf-aws.md index 8f5c69bd601..1ce960c22e3 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/map_entries.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/map_entries.test.w_compile_tf-aws.md @@ -124,6 +124,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/mut_container_types.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/mut_container_types.test.w_compile_tf-aws.md index 8fa99708e89..c52c550741f 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/mut_container_types.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/mut_container_types.test.w_compile_tf-aws.md @@ -149,6 +149,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/mutation_after_class_init.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/mutation_after_class_init.test.w_compile_tf-aws.md index 20061a32d0d..49dc8a23e5c 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/mutation_after_class_init.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/mutation_after_class_init.test.w_compile_tf-aws.md @@ -383,6 +383,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/namspaced-expr-in-index-expr.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/namspaced-expr-in-index-expr.test.w_compile_tf-aws.md index 4ca0c27695e..5770b70dae0 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/namspaced-expr-in-index-expr.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/namspaced-expr-in-index-expr.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/new_in_static.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/new_in_static.test.w_compile_tf-aws.md index 47f890b3224..27c4dc55a63 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/new_in_static.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/new_in_static.test.w_compile_tf-aws.md @@ -313,6 +313,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -457,6 +458,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/new_in_static_lib.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/new_in_static_lib.w_compile_tf-aws.md index c77a097b86b..023afa45933 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/new_in_static_lib.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/new_in_static_lib.w_compile_tf-aws.md @@ -34,6 +34,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; class Foo extends $stdlib.std.Resource { constructor($scope, $id, ) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/new_jsii.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/new_jsii.test.w_compile_tf-aws.md index f11628b5cfd..093a1ec9442 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/new_jsii.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/new_jsii.test.w_compile_tf-aws.md @@ -86,6 +86,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/nil.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/nil.test.w_compile_tf-aws.md index 9afc366bb0a..2e2ab876e1d 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/nil.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/nil.test.w_compile_tf-aws.md @@ -106,6 +106,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/on_lift.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/on_lift.test.w_compile_tf-aws.md index 35658f3989c..31fd39871ea 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/on_lift.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/on_lift.test.w_compile_tf-aws.md @@ -73,6 +73,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/optionals.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/optionals.test.w_compile_tf-aws.md index 26a1f124613..dfe57adfa05 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/optionals.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/optionals.test.w_compile_tf-aws.md @@ -150,6 +150,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/parameters/nested/parameters.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/parameters/nested/parameters.test.w_compile_tf-aws.md index 0807cb9385e..78c03e65fa5 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/parameters/nested/parameters.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/parameters/nested/parameters.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/parameters/simple/parameters.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/parameters/simple/parameters.test.w_compile_tf-aws.md index 59ff984abb8..d330bbac75b 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/parameters/simple/parameters.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/parameters/simple/parameters.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/phase_independent_method_on_string.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/phase_independent_method_on_string.test.w_compile_tf-aws.md index 23f833fa3c2..6738f80628e 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/phase_independent_method_on_string.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/phase_independent_method_on_string.test.w_compile_tf-aws.md @@ -139,6 +139,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/primitive_methods.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/primitive_methods.test.w_compile_tf-aws.md index 1961908d111..9c5ed015246 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/primitive_methods.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/primitive_methods.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/print.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/print.test.w_compile_tf-aws.md index 4d600c00889..de7bc7b979f 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/print.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/print.test.w_compile_tf-aws.md @@ -88,6 +88,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/reassignment.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/reassignment.test.w_compile_tf-aws.md index f58d1cb4c43..a98c3f081f8 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/reassignment.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/reassignment.test.w_compile_tf-aws.md @@ -42,6 +42,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/resource.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/resource.test.w_compile_tf-aws.md index 01013f40124..558fb91d634 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/resource.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/resource.test.w_compile_tf-aws.md @@ -818,6 +818,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/resource_call_static.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/resource_call_static.test.w_compile_tf-aws.md index ea49cd0123c..8478d1629c1 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/resource_call_static.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/resource_call_static.test.w_compile_tf-aws.md @@ -88,6 +88,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/resource_captures.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/resource_captures.test.w_compile_tf-aws.md index 239d7f5578d..5f0f18e9738 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/resource_captures.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/resource_captures.test.w_compile_tf-aws.md @@ -329,6 +329,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/resource_captures_globals.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/resource_captures_globals.test.w_compile_tf-aws.md index f2629494306..0c68c612321 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/resource_captures_globals.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/resource_captures_globals.test.w_compile_tf-aws.md @@ -430,6 +430,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/rootid.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/rootid.test.w_compile_tf-aws.md index e573da00c0e..8aec4a2d2ba 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/rootid.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/rootid.test.w_compile_tf-aws.md @@ -51,6 +51,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/service.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/service.test.w_compile_tf-aws.md index d2bd135c08d..61c830080b6 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/service.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/service.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/shadowing.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/shadowing.test.w_compile_tf-aws.md index 586798c2fe3..98fde6e5356 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/shadowing.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/shadowing.test.w_compile_tf-aws.md @@ -85,6 +85,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/sim_resource.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/sim_resource.test.w_compile_tf-aws.md index 5b5cbbdfd81..30669fda3b2 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/sim_resource.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/sim_resource.test.w_compile_tf-aws.md @@ -77,6 +77,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/statements_before_super.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/statements_before_super.w_compile_tf-aws.md index 28b6e489193..3dd38125291 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/statements_before_super.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/statements_before_super.w_compile_tf-aws.md @@ -34,6 +34,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; class A extends $stdlib.std.Resource { constructor($scope, $id, a) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/statements_if.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/statements_if.test.w_compile_tf-aws.md index 1e3aeff9286..c8e52886ad1 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/statements_if.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/statements_if.test.w_compile_tf-aws.md @@ -70,6 +70,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/statements_variable_declarations.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/statements_variable_declarations.test.w_compile_tf-aws.md index e405d1fd7e7..e7b0def966a 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/statements_variable_declarations.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/statements_variable_declarations.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/static_members.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/static_members.test.w_compile_tf-aws.md index 1fb375e75cf..ff91d0007ae 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/static_members.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/static_members.test.w_compile_tf-aws.md @@ -77,6 +77,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/std_containers.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/std_containers.test.w_compile_tf-aws.md index cd4fd839e52..5ea02977f3e 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/std_containers.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/std_containers.test.w_compile_tf-aws.md @@ -68,6 +68,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/std_string.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/std_string.test.w_compile_tf-aws.md index a737e3dbeb0..081d777ff10 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/std_string.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/std_string.test.w_compile_tf-aws.md @@ -53,6 +53,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/std_type_annotation.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/std_type_annotation.test.w_compile_tf-aws.md index ece0b3b6fcd..60023a25040 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/std_type_annotation.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/std_type_annotation.test.w_compile_tf-aws.md @@ -125,6 +125,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/store.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/store.w_compile_tf-aws.md index 360d575c17c..b70152592f2 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/store.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/store.w_compile_tf-aws.md @@ -63,6 +63,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; const file3 = $helpers.bringJs(`${__dirname}/preflight.empty-1.cjs`, $preflightTypesMap); const math = $stdlib.math; @@ -158,6 +159,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; module.exports = { $preflightTypesMap, }; //# sourceMappingURL=preflight.empty-1.cjs.map diff --git a/tools/hangar/__snapshots__/test_corpus/valid/stringify.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/stringify.test.w_compile_tf-aws.md index 51fc2ad6232..a26aeabfcea 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/stringify.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/stringify.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/struct_from_json.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/struct_from_json.test.w_compile_tf-aws.md index 52efefdb3e4..393b3d52ad0 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/struct_from_json.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/struct_from_json.test.w_compile_tf-aws.md @@ -186,6 +186,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { @@ -501,6 +502,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; module.exports = { $preflightTypesMap, }; //# sourceMappingURL=preflight.structs-1.cjs.map @@ -514,6 +516,7 @@ const $macros = require("@winglang/sdk/lib/macros"); const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); let $preflightTypesMap = {}; const SomeStruct = $stdlib.std.Struct._createJsonSchema({$id:"/SomeStruct",type:"object",properties:{foo:{type:"string"},},required:["foo",]}); class UsesStructInImportedFile extends $stdlib.std.Resource { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/structs.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/structs.test.w_compile_tf-aws.md index 19e2db35a9f..d029d1ced7f 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/structs.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/structs.test.w_compile_tf-aws.md @@ -72,6 +72,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/super_call.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/super_call.test.w_compile_tf-aws.md index cf091ad0b35..9e3c5fa04a3 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/super_call.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/super_call.test.w_compile_tf-aws.md @@ -248,6 +248,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/super_inflight_class.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/super_inflight_class.test.w_compile_tf-aws.md index da9545df0b1..58ef12a228d 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/super_inflight_class.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/super_inflight_class.test.w_compile_tf-aws.md @@ -90,6 +90,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/symbol_shadow.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/symbol_shadow.test.w_compile_tf-aws.md index fe033df78ee..3809015b59f 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/symbol_shadow.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/symbol_shadow.test.w_compile_tf-aws.md @@ -131,6 +131,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/test_bucket.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/test_bucket.test.w_compile_tf-aws.md index d82b123452d..ec5ab023e64 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/test_bucket.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/test_bucket.test.w_compile_tf-aws.md @@ -120,6 +120,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/test_without_bring.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/test_without_bring.test.w_compile_tf-aws.md index 6c0cb75913e..c07806fc3fb 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/test_without_bring.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/test_without_bring.test.w_compile_tf-aws.md @@ -51,6 +51,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/to_inflight.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/to_inflight.test.w_compile_tf-aws.md index f06ebb34e95..8ef4b5386a0 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/to_inflight.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/to_inflight.test.w_compile_tf-aws.md @@ -95,6 +95,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/try_catch.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/try_catch.test.w_compile_tf-aws.md index d5b584756b6..16209200c7c 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/try_catch.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/try_catch.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/type_intrinsic.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/type_intrinsic.test.w_compile_tf-aws.md new file mode 100644 index 00000000000..adecc74b7d6 --- /dev/null +++ b/tools/hangar/__snapshots__/test_corpus/valid/type_intrinsic.test.w_compile_tf-aws.md @@ -0,0 +1,587 @@ +# [type_intrinsic.test.w](../../../../../tests/valid/type_intrinsic.test.w) | compile | tf-aws + +## inflight.$Closure1-1.cjs +```cjs +"use strict"; +const $helpers = require("@winglang/sdk/lib/helpers"); +const $macros = require("@winglang/sdk/lib/macros"); +module.exports = function({ $_types_t15_class_MyClass, $_types_t1_interface_MyInterface, $_types_t29_enum_MyEnum, $_types_t30_struct_MyStruct, $expect_Util, $std_reflect_Phase, $std_reflect_Type__ofArray_std_reflect_Type__ofNum____false_, $std_reflect_Type__ofBool__, $std_reflect_Type__ofBytes__, $std_reflect_Type__ofDatetime__, $std_reflect_Type__ofDuration__, $std_reflect_Type__ofFunction_new_std_reflect_FunctionType_std_reflect_Phase_INFLIGHT___std_reflect_Type__ofNum_______std_reflect_Type__ofBool____, $std_reflect_Type__ofJson__, $std_reflect_Type__ofMap_std_reflect_Type__ofBool____true_, $std_reflect_Type__ofMutJson__, $std_reflect_Type__ofNum__, $std_reflect_Type__ofOptional_std_reflect_Type__ofStr___, $std_reflect_Type__ofStr__, $std_reflect_Type__ofVoid__ }) { + class $Closure1 { + constructor($args) { + const { } = $args; + const $obj = (...args) => this.handle(...args); + Object.setPrototypeOf($obj, this); + return $obj; + } + async handle() { + const t1 = $std_reflect_Type__ofNum__; + (await $expect_Util.equal(t1.kind, "num")); + (await $expect_Util.equal((await t1.toString()), "num")); + const t2 = $std_reflect_Type__ofStr__; + (await $expect_Util.equal(t2.kind, "str")); + (await $expect_Util.equal((await t2.toString()), "str")); + const t3 = $std_reflect_Type__ofBool__; + (await $expect_Util.equal(t3.kind, "bool")); + (await $expect_Util.equal((await t3.toString()), "bool")); + const t4 = $std_reflect_Type__ofFunction_new_std_reflect_FunctionType_std_reflect_Phase_INFLIGHT___std_reflect_Type__ofNum_______std_reflect_Type__ofBool____; + (await $expect_Util.equal(t4.kind, "function")); + (await $expect_Util.equal((await t4.toString()), "inflight (num): bool")); + { + const $if_let_value = (await t4.asFunction()); + if ($if_let_value != undefined) { + const fn = $if_let_value; + (await $expect_Util.equal(fn.params.length, 1)); + (await $expect_Util.equal($helpers.lookup(fn.params, 0).kind, "num")); + (await $expect_Util.equal(fn.returns.kind, "bool")); + (await $expect_Util.equal(fn.phase, $std_reflect_Phase.INFLIGHT)); + (await $expect_Util.equal((await fn.toString()), "inflight (num): bool")); + } + else { + (await $expect_Util.fail("t4 is not a function")); + } + } + const t6 = $std_reflect_Type__ofVoid__; + (await $expect_Util.equal(t6.kind, "void")); + (await $expect_Util.equal((await t6.toString()), "void")); + const t7 = $std_reflect_Type__ofOptional_std_reflect_Type__ofStr___; + (await $expect_Util.equal(t7.kind, "optional")); + (await $expect_Util.equal((await t7.toString()), "str?")); + { + const $if_let_value = (await t7.asOptional()); + if ($if_let_value != undefined) { + const opt = $if_let_value; + (await $expect_Util.equal(opt.child.kind, "str")); + (await $expect_Util.equal((await opt.toString()), "str?")); + } + else { + (await $expect_Util.fail("t7 is not an optional")); + } + } + const t8 = $std_reflect_Type__ofArray_std_reflect_Type__ofNum____false_; + (await $expect_Util.equal(t8.kind, "array")); + (await $expect_Util.equal((await t8.toString()), "Array")); + { + const $if_let_value = (await t8.asArray()); + if ($if_let_value != undefined) { + const arr = $if_let_value; + (await $expect_Util.equal(arr.child.kind, "num")); + (await $expect_Util.equal((await arr.toString()), "Array")); + (await $expect_Util.equal(arr.isMut, false)); + } + else { + (await $expect_Util.fail("t8 is not an array")); + } + } + const t9 = $std_reflect_Type__ofMap_std_reflect_Type__ofBool____true_; + (await $expect_Util.equal(t9.kind, "mutmap")); + (await $expect_Util.equal((await t9.toString()), "MutMap")); + { + const $if_let_value = (await t9.asMap()); + if ($if_let_value != undefined) { + const map = $if_let_value; + (await $expect_Util.equal(map.child.kind, "bool")); + (await $expect_Util.equal((await map.toString()), "MutMap")); + (await $expect_Util.equal(map.isMut, true)); + } + else { + (await $expect_Util.fail("t9 is not a map")); + } + } + const t10 = $std_reflect_Type__ofJson__; + (await $expect_Util.equal(t10.kind, "json")); + (await $expect_Util.equal((await t10.toString()), "Json")); + const t11 = $std_reflect_Type__ofMutJson__; + (await $expect_Util.equal(t11.kind, "mutjson")); + (await $expect_Util.equal((await t11.toString()), "MutJson")); + const t12 = $std_reflect_Type__ofDuration__; + (await $expect_Util.equal(t12.kind, "duration")); + (await $expect_Util.equal((await t12.toString()), "duration")); + const t13 = $std_reflect_Type__ofBytes__; + (await $expect_Util.equal(t13.kind, "bytes")); + (await $expect_Util.equal((await t13.toString()), "bytes")); + const t14 = $std_reflect_Type__ofDatetime__; + (await $expect_Util.equal(t14.kind, "datetime")); + (await $expect_Util.equal((await t14.toString()), "datetime")); + const t15 = $std_reflect_Type__ofBytes__; + (await $expect_Util.equal(t15.kind, "bytes")); + (await $expect_Util.equal((await t15.toString()), "bytes")); + const t16 = $_types_t1_interface_MyInterface; + (await $expect_Util.equal(t16.kind, "interface")); + (await $expect_Util.equal((await t16.toString()), "MyInterface")); + { + const $if_let_value = (await t16.asInterface()); + if ($if_let_value != undefined) { + const iface = $if_let_value; + (await $expect_Util.equal(iface.name, "MyInterface")); + (await $expect_Util.equal((await iface.toString()), "MyInterface")); + (await $expect_Util.equal(iface.bases.length, 1)); + (await $expect_Util.equal($helpers.lookup(iface.bases, 0).name, "BaseInterface")); + (await $expect_Util.equal($macros.__Map_size(false, iface.methods, ), 1)); + (await $expect_Util.equal($helpers.lookup(iface.methods, "method1").name, "method1")); + (await $expect_Util.equal((await $helpers.lookup(iface.methods, "method1").child.toString()), "preflight (): void")); + } + else { + (await $expect_Util.fail("t16 is not an interface")); + } + } + const t17 = $_types_t15_class_MyClass; + (await $expect_Util.equal(t17.kind, "class")); + (await $expect_Util.equal((await t17.toString()), "MyClass")); + { + const $if_let_value = (await t17.asClass()); + if ($if_let_value != undefined) { + const cls = $if_let_value; + (await $expect_Util.equal(cls.name, "MyClass")); + (await $expect_Util.equal((await cls.toString()), "MyClass")); + { + const $if_let_value = cls.base; + if ($if_let_value != undefined) { + const base = $if_let_value; + (await $expect_Util.equal(base.name, "Resource")); + } + else { + (await $expect_Util.fail("t17 does not have a base class")); + } + } + (await $expect_Util.equal($macros.__Map_size(false, cls.properties, ), 1)); + (await $expect_Util.equal($helpers.lookup(cls.properties, "field1").name, "field1")); + (await $expect_Util.equal($helpers.lookup(cls.properties, "field1").child.kind, "str")); + (await $expect_Util.ok(($macros.__Map_size(false, cls.methods, ) >= 2))); + (await $expect_Util.equal($helpers.lookup(cls.methods, "method1").name, "method1")); + (await $expect_Util.equal($helpers.lookup(cls.methods, "method1").isStatic, false)); + (await $expect_Util.equal((await $helpers.lookup(cls.methods, "method1").child.toString()), "preflight (): void")); + (await $expect_Util.equal($helpers.lookup(cls.methods, "method2").name, "method2")); + (await $expect_Util.equal($helpers.lookup(cls.methods, "method2").isStatic, true)); + (await $expect_Util.equal((await $helpers.lookup(cls.methods, "method2").child.toString()), "preflight (): void")); + } + else { + (await $expect_Util.fail("t17 is not a class")); + } + } + const t18 = $_types_t29_enum_MyEnum; + (await $expect_Util.equal(t18.kind, "enum")); + (await $expect_Util.equal((await t18.toString()), "MyEnum")); + { + const $if_let_value = (await t18.asEnum()); + if ($if_let_value != undefined) { + const enm = $if_let_value; + (await $expect_Util.equal(enm.name, "MyEnum")); + (await $expect_Util.equal((await enm.toString()), "MyEnum")); + (await $expect_Util.equal($macros.__Map_size(false, enm.variants, ), 2)); + (await $expect_Util.equal($helpers.lookup(enm.variants, "VARIANT1").name, "VARIANT1")); + (await $expect_Util.equal($helpers.lookup(enm.variants, "VARIANT2").name, "VARIANT2")); + } + else { + (await $expect_Util.fail("t18 is not an enum")); + } + } + const t19 = $_types_t30_struct_MyStruct; + (await $expect_Util.equal(t19.kind, "struct")); + (await $expect_Util.equal((await t19.toString()), "MyStruct")); + { + const $if_let_value = (await t19.asStruct()); + if ($if_let_value != undefined) { + const st = $if_let_value; + (await $expect_Util.equal(st.name, "MyStruct")); + (await $expect_Util.equal((await st.toString()), "MyStruct")); + (await $expect_Util.equal(st.bases.length, 2)); + (await $expect_Util.equal($helpers.lookup(st.bases, 0).name, "Base1")); + (await $expect_Util.equal($helpers.lookup(st.bases, 1).name, "Base2")); + (await $expect_Util.equal($macros.__Map_size(false, st.fields, ), 4)); + (await $expect_Util.equal($helpers.lookup(st.fields, "base1").name, "base1")); + (await $expect_Util.equal($helpers.lookup(st.fields, "base1").child.kind, "bool")); + (await $expect_Util.equal($helpers.lookup(st.fields, "base2").name, "base2")); + (await $expect_Util.equal($helpers.lookup(st.fields, "base2").child.kind, "bool")); + (await $expect_Util.equal($helpers.lookup(st.fields, "field1").name, "field1")); + (await $expect_Util.equal($helpers.lookup(st.fields, "field1").child.kind, "num")); + (await $expect_Util.equal($helpers.lookup(st.fields, "field2").name, "field2")); + (await $expect_Util.equal($helpers.lookup(st.fields, "field2").child.kind, "array")); + const arr = $helpers.unwrap((await $helpers.lookup(st.fields, "field2").child.asArray())); + (await $expect_Util.equal(arr.child.kind, "optional")); + const opt = $helpers.unwrap((await arr.child.asOptional())); + (await $expect_Util.equal(opt.child.kind, "json")); + } + else { + (await $expect_Util.fail("t19 is not a struct")); + } + } + } + } + return $Closure1; +} +//# sourceMappingURL=inflight.$Closure1-1.cjs.map +``` + +## inflight.MyClass-1.cjs +```cjs +"use strict"; +const $helpers = require("@winglang/sdk/lib/helpers"); +const $macros = require("@winglang/sdk/lib/macros"); +module.exports = function({ }) { + class MyClass { + } + return MyClass; +} +//# sourceMappingURL=inflight.MyClass-1.cjs.map +``` + +## main.tf.json +```json +{ + "//": { + "metadata": { + "backend": "local", + "stackName": "root" + }, + "outputs": {} + }, + "provider": { + "aws": [ + {} + ] + } +} +``` + +## preflight.cjs +```cjs +"use strict"; +const $stdlib = require('@winglang/sdk'); +const $macros = require("@winglang/sdk/lib/macros"); +const $platforms = ((s) => !s ? [] : s.split(';'))(process.env.WING_PLATFORMS); +const $outdir = process.env.WING_SYNTH_DIR ?? "."; +const $wing_is_test = process.env.WING_IS_TEST === "true"; +const std = $stdlib.std; +const $helpers = $stdlib.helpers; +const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); +const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); +class $Root extends $stdlib.std.Resource { + constructor($scope, $id) { + super($scope, $id); + $helpers.nodeof(this).root.$preflightTypesMap = { }; + let $preflightTypesMap = {}; + const expect = $stdlib.expect; + $helpers.nodeof(this).root.$preflightTypesMap = $preflightTypesMap; + const MyEnum = + (function (tmp) { + tmp["VARIANT1"] = "VARIANT1"; + tmp["VARIANT2"] = "VARIANT2"; + return tmp; + })({}) + ; + class MyClass extends $stdlib.std.Resource { + constructor($scope, $id, ) { + super($scope, $id); + this.field1 = "hello"; + } + method1() { + } + static method2($scope) { + } + static _toInflightType() { + return ` + require("${$helpers.normalPath(__dirname)}/inflight.MyClass-1.cjs")({ + }) + `; + } + get _liftMap() { + return ({ + "$inflight_init": [ + ], + }); + } + } + class $Closure1 extends $stdlib.std.AutoIdResource { + _id = $stdlib.core.closureId(); + constructor($scope, $id, ) { + super($scope, $id); + $helpers.nodeof(this).hidden = true; + } + static _toInflightType() { + return ` + require("${$helpers.normalPath(__dirname)}/inflight.$Closure1-1.cjs")({ + $_types_t15_class_MyClass: ${$stdlib.core.liftObject($types.t15_class_MyClass)}, + $_types_t1_interface_MyInterface: ${$stdlib.core.liftObject($types.t1_interface_MyInterface)}, + $_types_t29_enum_MyEnum: ${$stdlib.core.liftObject($types.t29_enum_MyEnum)}, + $_types_t30_struct_MyStruct: ${$stdlib.core.liftObject($types.t30_struct_MyStruct)}, + $expect_Util: ${$stdlib.core.liftObject($stdlib.core.toLiftableModuleType(globalThis.$ClassFactory.resolveType("@winglang/sdk.expect.Util") ?? expect.Util, "@winglang/sdk/expect", "Util"))}, + $std_reflect_Phase: ${$stdlib.core.liftObject($stdlib.core.toLiftableModuleType(std.reflect.Phase, "@winglang/sdk/std", "reflect.Phase"))}, + $std_reflect_Type__ofArray_std_reflect_Type__ofNum____false_: ${$stdlib.core.liftObject(std.reflect.Type._ofArray(std.reflect.Type._ofNum(), false))}, + $std_reflect_Type__ofBool__: ${$stdlib.core.liftObject(std.reflect.Type._ofBool())}, + $std_reflect_Type__ofBytes__: ${$stdlib.core.liftObject(std.reflect.Type._ofBytes())}, + $std_reflect_Type__ofDatetime__: ${$stdlib.core.liftObject(std.reflect.Type._ofDatetime())}, + $std_reflect_Type__ofDuration__: ${$stdlib.core.liftObject(std.reflect.Type._ofDuration())}, + $std_reflect_Type__ofFunction_new_std_reflect_FunctionType_std_reflect_Phase_INFLIGHT___std_reflect_Type__ofNum_______std_reflect_Type__ofBool____: ${$stdlib.core.liftObject(std.reflect.Type._ofFunction(new std.reflect.FunctionType(std.reflect.Phase.INFLIGHT, [std.reflect.Type._ofNum(), ], std.reflect.Type._ofBool())))}, + $std_reflect_Type__ofJson__: ${$stdlib.core.liftObject(std.reflect.Type._ofJson())}, + $std_reflect_Type__ofMap_std_reflect_Type__ofBool____true_: ${$stdlib.core.liftObject(std.reflect.Type._ofMap(std.reflect.Type._ofBool(), true))}, + $std_reflect_Type__ofMutJson__: ${$stdlib.core.liftObject(std.reflect.Type._ofMutJson())}, + $std_reflect_Type__ofNum__: ${$stdlib.core.liftObject(std.reflect.Type._ofNum())}, + $std_reflect_Type__ofOptional_std_reflect_Type__ofStr___: ${$stdlib.core.liftObject(std.reflect.Type._ofOptional(std.reflect.Type._ofStr()))}, + $std_reflect_Type__ofStr__: ${$stdlib.core.liftObject(std.reflect.Type._ofStr())}, + $std_reflect_Type__ofVoid__: ${$stdlib.core.liftObject(std.reflect.Type._ofVoid())}, + }) + `; + } + get _liftMap() { + return ({ + "handle": [ + [$stdlib.core.toLiftableModuleType(globalThis.$ClassFactory.resolveType("@winglang/sdk.expect.Util") ?? expect.Util, "@winglang/sdk/expect", "Util"), [].concat(["equal"], ["fail"], ["ok"])], + [$stdlib.core.toLiftableModuleType(std.reflect.Phase, "@winglang/sdk/std", "reflect.Phase"), ["INFLIGHT"]], + [$types.t15_class_MyClass, []], + [$types.t1_interface_MyInterface, []], + [$types.t29_enum_MyEnum, []], + [$types.t30_struct_MyStruct, []], + [std.reflect.Type._ofArray(std.reflect.Type._ofNum(), false), []], + [std.reflect.Type._ofBool(), []], + [std.reflect.Type._ofBytes(), []], + [std.reflect.Type._ofDatetime(), []], + [std.reflect.Type._ofDuration(), []], + [std.reflect.Type._ofFunction(new std.reflect.FunctionType(std.reflect.Phase.INFLIGHT, [std.reflect.Type._ofNum(), ], std.reflect.Type._ofBool())), []], + [std.reflect.Type._ofJson(), []], + [std.reflect.Type._ofMap(std.reflect.Type._ofBool(), true), []], + [std.reflect.Type._ofMutJson(), []], + [std.reflect.Type._ofNum(), []], + [std.reflect.Type._ofOptional(std.reflect.Type._ofStr()), []], + [std.reflect.Type._ofStr(), []], + [std.reflect.Type._ofVoid(), []], + ], + "$inflight_init": [ + [$stdlib.core.toLiftableModuleType(globalThis.$ClassFactory.resolveType("@winglang/sdk.expect.Util") ?? expect.Util, "@winglang/sdk/expect", "Util"), []], + [$stdlib.core.toLiftableModuleType(std.reflect.Phase, "@winglang/sdk/std", "reflect.Phase"), []], + [$types.t15_class_MyClass, []], + [$types.t1_interface_MyInterface, []], + [$types.t29_enum_MyEnum, []], + [$types.t30_struct_MyStruct, []], + [std.reflect.Type._ofArray(std.reflect.Type._ofNum(), false), []], + [std.reflect.Type._ofBool(), []], + [std.reflect.Type._ofBytes(), []], + [std.reflect.Type._ofDatetime(), []], + [std.reflect.Type._ofDuration(), []], + [std.reflect.Type._ofFunction(new std.reflect.FunctionType(std.reflect.Phase.INFLIGHT, [std.reflect.Type._ofNum(), ], std.reflect.Type._ofBool())), []], + [std.reflect.Type._ofJson(), []], + [std.reflect.Type._ofMap(std.reflect.Type._ofBool(), true), []], + [std.reflect.Type._ofMutJson(), []], + [std.reflect.Type._ofNum(), []], + [std.reflect.Type._ofOptional(std.reflect.Type._ofStr()), []], + [std.reflect.Type._ofStr(), []], + [std.reflect.Type._ofVoid(), []], + ], + }); + } + } + const t1 = std.reflect.Type._ofNum(); + (expect.Util.equal(t1.kind, "num")); + (expect.Util.equal((t1.toString()), "num")); + const t2 = std.reflect.Type._ofStr(); + (expect.Util.equal(t2.kind, "str")); + (expect.Util.equal((t2.toString()), "str")); + const t3 = std.reflect.Type._ofBool(); + (expect.Util.equal(t3.kind, "bool")); + (expect.Util.equal((t3.toString()), "bool")); + const t4 = std.reflect.Type._ofFunction(new std.reflect.FunctionType(std.reflect.Phase.INFLIGHT, [std.reflect.Type._ofNum(), ], std.reflect.Type._ofBool())); + (expect.Util.equal(t4.kind, "function")); + (expect.Util.equal((t4.toString()), "inflight (num): bool")); + { + const $if_let_value = (t4.asFunction()); + if ($if_let_value != undefined) { + const fn = $if_let_value; + (expect.Util.equal(fn.params.length, 1)); + (expect.Util.equal($helpers.lookup(fn.params, 0).kind, "num")); + (expect.Util.equal(fn.returns.kind, "bool")); + (expect.Util.equal(fn.phase, std.reflect.Phase.INFLIGHT)); + (expect.Util.equal((fn.toString()), "inflight (num): bool")); + } + else { + (expect.Util.fail("t4 is not a function")); + } + } + const t5 = std.reflect.Type._ofFunction(new std.reflect.FunctionType(std.reflect.Phase.PREFLIGHT, [std.reflect.Type._ofBool(), ], std.reflect.Type._ofVoid())); + (expect.Util.equal(t5.kind, "function")); + (expect.Util.equal((t5.toString()), "preflight (bool): void")); + { + const $if_let_value = (t5.asFunction()); + if ($if_let_value != undefined) { + const fn = $if_let_value; + (expect.Util.equal(fn.params.length, 1)); + (expect.Util.equal($helpers.lookup(fn.params, 0).kind, "bool")); + (expect.Util.equal(fn.returns.kind, "void")); + (expect.Util.equal((fn.toString()), "preflight (bool): void")); + } + else { + (expect.Util.fail("t5 is not a function")); + } + } + const t6 = std.reflect.Type._ofVoid(); + (expect.Util.equal(t6.kind, "void")); + (expect.Util.equal((t6.toString()), "void")); + const t7 = std.reflect.Type._ofOptional(std.reflect.Type._ofStr()); + (expect.Util.equal(t7.kind, "optional")); + (expect.Util.equal((t7.toString()), "str?")); + { + const $if_let_value = (t7.asOptional()); + if ($if_let_value != undefined) { + const opt = $if_let_value; + (expect.Util.equal(opt.child.kind, "str")); + (expect.Util.equal((opt.toString()), "str?")); + } + else { + (expect.Util.fail("t7 is not an optional")); + } + } + const t8 = std.reflect.Type._ofArray(std.reflect.Type._ofNum(), false); + (expect.Util.equal(t8.kind, "array")); + (expect.Util.equal((t8.toString()), "Array")); + { + const $if_let_value = (t8.asArray()); + if ($if_let_value != undefined) { + const arr = $if_let_value; + (expect.Util.equal(arr.isMut, false)); + (expect.Util.equal(arr.child.kind, "num")); + (expect.Util.equal((arr.toString()), "Array")); + } + else { + (expect.Util.fail("t8 is not an array")); + } + } + const t9 = std.reflect.Type._ofMap(std.reflect.Type._ofBool(), true); + (expect.Util.equal(t9.kind, "mutmap")); + (expect.Util.equal((t9.toString()), "MutMap")); + { + const $if_let_value = (t9.asMap()); + if ($if_let_value != undefined) { + const map = $if_let_value; + (expect.Util.equal(map.isMut, true)); + (expect.Util.equal(map.child.kind, "bool")); + (expect.Util.equal((map.toString()), "MutMap")); + } + else { + (expect.Util.fail("t9 is not a map")); + } + } + const t10 = std.reflect.Type._ofJson(); + (expect.Util.equal(t10.kind, "json")); + (expect.Util.equal((t10.toString()), "Json")); + const t11 = std.reflect.Type._ofMutJson(); + (expect.Util.equal(t11.kind, "mutjson")); + (expect.Util.equal((t11.toString()), "MutJson")); + const t12 = std.reflect.Type._ofDuration(); + (expect.Util.equal(t12.kind, "duration")); + (expect.Util.equal((t12.toString()), "duration")); + const t13 = std.reflect.Type._ofBytes(); + (expect.Util.equal(t13.kind, "bytes")); + (expect.Util.equal((t13.toString()), "bytes")); + const t14 = std.reflect.Type._ofDatetime(); + (expect.Util.equal(t14.kind, "datetime")); + (expect.Util.equal((t14.toString()), "datetime")); + const t15 = std.reflect.Type._ofBytes(); + (expect.Util.equal(t15.kind, "bytes")); + (expect.Util.equal((t15.toString()), "bytes")); + const t16 = $types.t1_interface_MyInterface; + (expect.Util.equal(t16.kind, "interface")); + (expect.Util.equal((t16.toString()), "MyInterface")); + { + const $if_let_value = (t16.asInterface()); + if ($if_let_value != undefined) { + const iface = $if_let_value; + (expect.Util.equal(iface.name, "MyInterface")); + (expect.Util.equal((iface.toString()), "MyInterface")); + (expect.Util.equal(iface.bases.length, 1)); + (expect.Util.equal($helpers.lookup(iface.bases, 0).name, "BaseInterface")); + (expect.Util.equal($macros.__Map_size(false, iface.methods, ), 1)); + (expect.Util.equal($helpers.lookup(iface.methods, "method1").name, "method1")); + (expect.Util.equal(($helpers.lookup(iface.methods, "method1").child.toString()), "preflight (): void")); + } + else { + (expect.Util.fail("t16 is not an interface")); + } + } + const t17 = $types.t15_class_MyClass; + (expect.Util.equal(t17.kind, "class")); + (expect.Util.equal((t17.toString()), "MyClass")); + { + const $if_let_value = (t17.asClass()); + if ($if_let_value != undefined) { + const cls = $if_let_value; + (expect.Util.equal(cls.name, "MyClass")); + (expect.Util.equal((cls.toString()), "MyClass")); + { + const $if_let_value = cls.base; + if ($if_let_value != undefined) { + const base = $if_let_value; + (expect.Util.equal(base.name, "Resource")); + } + else { + (expect.Util.fail("t17 does not have a base class")); + } + } + (expect.Util.equal($macros.__Map_size(false, cls.properties, ), 1)); + (expect.Util.equal($helpers.lookup(cls.properties, "field1").name, "field1")); + (expect.Util.equal($helpers.lookup(cls.properties, "field1").child.kind, "str")); + (expect.Util.ok(($macros.__Map_size(false, cls.methods, ) >= 2))); + (expect.Util.equal($helpers.lookup(cls.methods, "method1").name, "method1")); + (expect.Util.equal($helpers.lookup(cls.methods, "method1").isStatic, false)); + (expect.Util.equal(($helpers.lookup(cls.methods, "method1").child.toString()), "preflight (): void")); + (expect.Util.equal($helpers.lookup(cls.methods, "method2").name, "method2")); + (expect.Util.equal($helpers.lookup(cls.methods, "method2").isStatic, true)); + (expect.Util.equal(($helpers.lookup(cls.methods, "method2").child.toString()), "preflight (): void")); + } + else { + (expect.Util.fail("t17 is not a class")); + } + } + const t18 = $types.t29_enum_MyEnum; + (expect.Util.equal(t18.kind, "enum")); + (expect.Util.equal((t18.toString()), "MyEnum")); + { + const $if_let_value = (t18.asEnum()); + if ($if_let_value != undefined) { + const enm = $if_let_value; + (expect.Util.equal(enm.name, "MyEnum")); + (expect.Util.equal((enm.toString()), "MyEnum")); + (expect.Util.equal($macros.__Map_size(false, enm.variants, ), 2)); + (expect.Util.equal($helpers.lookup(enm.variants, "VARIANT1").name, "VARIANT1")); + (expect.Util.equal($helpers.lookup(enm.variants, "VARIANT2").name, "VARIANT2")); + } + else { + (expect.Util.fail("t18 is not an enum")); + } + } + const t19 = $types.t30_struct_MyStruct; + (expect.Util.equal(t19.kind, "struct")); + (expect.Util.equal((t19.toString()), "MyStruct")); + { + const $if_let_value = (t19.asStruct()); + if ($if_let_value != undefined) { + const st = $if_let_value; + (expect.Util.equal(st.name, "MyStruct")); + (expect.Util.equal((st.toString()), "MyStruct")); + (expect.Util.equal(st.bases.length, 2)); + (expect.Util.equal($helpers.lookup(st.bases, 0).name, "Base1")); + (expect.Util.equal($helpers.lookup(st.bases, 1).name, "Base2")); + (expect.Util.equal($macros.__Map_size(false, st.fields, ), 4)); + (expect.Util.equal($helpers.lookup(st.fields, "base1").name, "base1")); + (expect.Util.equal($helpers.lookup(st.fields, "base1").child.kind, "bool")); + (expect.Util.equal($helpers.lookup(st.fields, "base2").name, "base2")); + (expect.Util.equal($helpers.lookup(st.fields, "base2").child.kind, "bool")); + (expect.Util.equal($helpers.lookup(st.fields, "field1").name, "field1")); + (expect.Util.equal($helpers.lookup(st.fields, "field1").child.kind, "num")); + (expect.Util.equal($helpers.lookup(st.fields, "field2").name, "field2")); + (expect.Util.equal($helpers.lookup(st.fields, "field2").child.kind, "array")); + const arr = $helpers.unwrap(($helpers.lookup(st.fields, "field2").child.asArray())); + (expect.Util.equal(arr.child.kind, "optional")); + const opt = $helpers.unwrap((arr.child.asOptional())); + (expect.Util.equal(opt.child.kind, "json")); + } + else { + (expect.Util.fail("t19 is not a struct")); + } + } + globalThis.$ClassFactory.new("@winglang/sdk.std.Test", std.Test, this, "test:@type in inflight", new $Closure1(this, "$Closure1")); + } +} +const $APP = $PlatformManager.createApp({ outdir: $outdir, name: "type_intrinsic.test", rootConstruct: $Root, isTestEnvironment: $wing_is_test, entrypointDir: process.env['WING_SOURCE_DIR'], rootId: process.env['WING_ROOT_ID'] }); +$APP.synth(); +//# sourceMappingURL=preflight.cjs.map +``` + diff --git a/tools/hangar/__snapshots__/test_corpus/valid/type_intrinsic.test.w_test_sim.md b/tools/hangar/__snapshots__/test_corpus/valid/type_intrinsic.test.w_test_sim.md new file mode 100644 index 00000000000..f0583c8fc67 --- /dev/null +++ b/tools/hangar/__snapshots__/test_corpus/valid/type_intrinsic.test.w_test_sim.md @@ -0,0 +1,12 @@ +# [type_intrinsic.test.w](../../../../../tests/valid/type_intrinsic.test.w) | test | sim + +## stdout.log +```log +pass ─ type_intrinsic.test.wsim » root/Default/test:@type in inflight + +Tests 1 passed (1) +Snapshots 1 skipped +Test Files 1 passed (1) +Duration +``` + diff --git a/tools/hangar/__snapshots__/test_corpus/valid/unused_lift.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/unused_lift.test.w_compile_tf-aws.md index c14a5324a53..4cb8365bc43 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/unused_lift.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/unused_lift.test.w_compile_tf-aws.md @@ -153,6 +153,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/use_inflight_method_inside_init_closure.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/use_inflight_method_inside_init_closure.test.w_compile_tf-aws.md index b244356791c..8fdc9b57c2b 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/use_inflight_method_inside_init_closure.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/use_inflight_method_inside_init_closure.test.w_compile_tf-aws.md @@ -175,6 +175,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/website_with_api.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/website_with_api.test.w_compile_tf-aws.md index 20fd38bf0fc..ef1b586022e 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/website_with_api.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/website_with_api.test.w_compile_tf-aws.md @@ -657,6 +657,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/while.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/while.test.w_compile_tf-aws.md index d6f53a1258a..99d1ec9b372 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/while.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/while.test.w_compile_tf-aws.md @@ -29,6 +29,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) { diff --git a/tools/hangar/__snapshots__/test_corpus/valid/while_loop_await.test.w_compile_tf-aws.md b/tools/hangar/__snapshots__/test_corpus/valid/while_loop_await.test.w_compile_tf-aws.md index abb372a0242..d62fa7fb872 100644 --- a/tools/hangar/__snapshots__/test_corpus/valid/while_loop_await.test.w_compile_tf-aws.md +++ b/tools/hangar/__snapshots__/test_corpus/valid/while_loop_await.test.w_compile_tf-aws.md @@ -195,6 +195,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true"; const std = $stdlib.std; const $helpers = $stdlib.helpers; const $extern = $helpers.createExternRequire(__dirname); +const $types = require("./types.cjs"); const $PlatformManager = new $stdlib.platform.PlatformManager({platformPaths: $platforms}); class $Root extends $stdlib.std.Resource { constructor($scope, $id) {