builder.io 1.1.41 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/index.cjs +366 -340
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +54 -54
- package/core/index.mjs +54 -54
- package/figma/index.cjs +1 -1
- package/node/index.cjs +15 -15
- package/node/index.mjs +4 -4
- package/package.json +1 -1
- package/server/index.cjs +5 -5
- package/server/index.mjs +5 -5
- package/types/cli/code.d.ts +3 -0
- package/types/cli/sync-utils.d.ts +2 -0
- package/types/common/ast/imported-statements.d.ts +4 -0
- package/types/common/ast/imported-statements.unit.d.ts +1 -0
- package/types/common/typescript.d.ts +1 -1
- package/types/common/utils.d.ts +1 -0
- package/types/core/adapters/react/react-components.d.ts +4 -4
- package/types/figma/index.d.ts +7 -0
- package/types/types.d.ts +2 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type ts from "typescript";
|
|
2
2
|
import type { DevToolsSys, TranspileFileOptions, TranspileModuleOptions, TranspileResult } from "../types";
|
|
3
|
-
export declare function createTsProgram(sys: DevToolsSys, filePaths: string[]): Promise<ts.Program>;
|
|
3
|
+
export declare function createTsProgram(sys: DevToolsSys, filePaths: string[], overrideTsOptions?: ts.CompilerOptions): Promise<ts.Program>;
|
|
4
4
|
export declare function getTypeChecker(sys: DevToolsSys, filePath: string, tsProgram: ts.Program | null): Promise<{
|
|
5
5
|
typeChecker: ts.TypeChecker;
|
|
6
6
|
sourceFile: ts.SourceFile;
|
package/types/common/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComponentInfo, DevToolsSys } from "../types";
|
|
2
|
+
export declare function isMapperFile(fileName: string): boolean;
|
|
2
3
|
export declare function getImportPath(sys: DevToolsSys, containingModulePath: string, moduleToImportPath: string): string;
|
|
3
4
|
export declare function normalizePathSlash(path: string): string;
|
|
4
5
|
export declare function getComponentImportNameFilePath(sys: DevToolsSys, filePath: string): string;
|
|
@@ -2,10 +2,10 @@ import type ts from "typescript";
|
|
|
2
2
|
import type { AppDependency, ComponentInfo, DevToolsSys } from "../../../types";
|
|
3
3
|
import type { ReactDevToolsSys } from "./index";
|
|
4
4
|
export declare function parseReactAllComponentSourceInputs(sys: DevToolsSys, components: ComponentInfo[]): Promise<ComponentInfo[]>;
|
|
5
|
-
export declare function parseReactComponentSourceInputs(sys: DevToolsSys, srcCmp: ReactComponentSource, tsProgram: ts.Program | null): Promise<import("../../../types").ComponentInput[]>;
|
|
6
|
-
export declare function getReactComponentsFromPath(sys: DevToolsSys, filePath: string): Promise<ReactComponentSource[] | null>;
|
|
7
|
-
export declare function getReactComponentsFromCode(sys: DevToolsSys, filePath: string, code: string): Promise<ReactComponentSource[]>;
|
|
8
|
-
export declare function getReactComponentsFromSourceFile(sys: DevToolsSys, typeChecker: ts.TypeChecker | null, filePath: string, sourceFile: ts.SourceFile): Promise<ReactComponentSource[]>;
|
|
5
|
+
export declare function parseReactComponentSourceInputs(sys: DevToolsSys, srcCmp: ReactComponentSource, tsProgram: ts.Program | null, includeImports: boolean): Promise<import("../../../types").ComponentInput[]>;
|
|
6
|
+
export declare function getReactComponentsFromPath(sys: DevToolsSys, filePath: string, includeImports: boolean): Promise<ReactComponentSource[] | null>;
|
|
7
|
+
export declare function getReactComponentsFromCode(sys: DevToolsSys, filePath: string, code: string, includeImports?: boolean): Promise<ReactComponentSource[]>;
|
|
8
|
+
export declare function getReactComponentsFromSourceFile(sys: DevToolsSys, typeChecker: ts.TypeChecker | null, filePath: string, sourceFile: ts.SourceFile, includeImports: boolean): Promise<ReactComponentSource[]>;
|
|
9
9
|
export declare function getReactSourceComponentsFromDir(sys: ReactDevToolsSys, tsProgram: ts.Program): Promise<ReactComponentSource[]>;
|
|
10
10
|
export interface ReactComponentSourceNode {
|
|
11
11
|
name: string;
|
package/types/figma/index.d.ts
CHANGED
|
@@ -74,4 +74,11 @@ export interface FigmaTokenMapper {
|
|
|
74
74
|
}
|
|
75
75
|
export declare function figmaMapping<T extends BaseFigmaProps = FigmaProps>(_config: FigmaMappingWithKeyMapper<T> | FigmaMappingWithUrlMapper<T> | FigmaGenericMapper | FigmaTokenMapper): void;
|
|
76
76
|
export declare function explicitFalse(value: any): any;
|
|
77
|
+
export interface ChildElement<P = any> {
|
|
78
|
+
type: any;
|
|
79
|
+
props: P;
|
|
80
|
+
key: string | null;
|
|
81
|
+
}
|
|
82
|
+
export type ChildrenNode = ChildElement | string | number | Iterable<ChildrenNode> | boolean | null | undefined;
|
|
83
|
+
export type ComponentProps<T> = T extends (props: infer P) => any ? P : any;
|
|
77
84
|
export {};
|
package/types/types.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export interface DevToolsSys extends DevToolsPath {
|
|
|
37
37
|
isFile: () => boolean;
|
|
38
38
|
};
|
|
39
39
|
writeFile: (filePath: string, content: string) => Promise<void>;
|
|
40
|
+
unlink: (filePath: string) => Promise<void>;
|
|
41
|
+
unlinkSync: (filePath: string) => void;
|
|
40
42
|
formatCode: (filePath: string, code: string) => Promise<string>;
|
|
41
43
|
hash: (str: string) => Promise<string>;
|
|
42
44
|
on: (eventName: "change", callback: FileChangeCallback) => void;
|