builder.io 1.1.13-11 → 1.1.13-14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "builder.io",
3
- "version": "1.1.13-11",
3
+ "version": "1.1.13-14",
4
4
  "description": "Add Builder.io code snippets to an application",
5
5
  "type": "module",
6
6
  "bin": {
@@ -19,10 +19,11 @@
19
19
  "figma"
20
20
  ],
21
21
  "dependencies": {
22
+ "glob": "10.4",
22
23
  "launch-editor": "^2.6.0",
24
+ "open": "^10.1.0",
23
25
  "prettier": "^2.8.8",
24
- "typescript": "^5.1.6",
25
- "open": "^10.1.0"
26
+ "typescript": "^5.1.6"
26
27
  },
27
28
  "homepage": "https://builder.io/",
28
29
  "keywords": [
@@ -1,2 +1,5 @@
1
- import type { AddCliOptions, SyncInfo } from "../../types";
1
+ import type { AddCliOptions, FileNode, FolderNode, Snippet, SyncInfo } from "../../types";
2
2
  export declare function addCommand(opts: AddCliOptions): Promise<SyncInfo | undefined>;
3
+ export declare function fetchSnippet(id: string): Promise<Snippet | null>;
4
+ export declare function writeFiles(snippet: Snippet, files: Array<FileNode | FolderNode>, rootPath: string): Promise<FileNode[]>;
5
+ export declare function suggestRootPath(framework: string): string;
@@ -0,0 +1,10 @@
1
+ import type { AddCliOptions, DevToolsSys, FileNode, SyncInfo } from "../types";
2
+ export declare function extractSignatureInfo(content: string): {
3
+ contentId?: string;
4
+ sessionKey?: string;
5
+ snippetId?: string;
6
+ };
7
+ export declare function findBuilderFiles(basePath: string, targetContentId: string, targetSessionKey: string): Promise<FileNode[]>;
8
+ export declare function watchDirectory(basePath: string, syncInfo: SyncInfo, onChange: (updatedSyncInfo: SyncInfo) => void): () => void;
9
+ export declare function setupSyncServer(sys: DevToolsSys, initialSyncInfo?: SyncInfo): Promise<void>;
10
+ export declare function syncCommand(opts: AddCliOptions): Promise<SyncInfo | undefined>;
package/types/types.d.ts CHANGED
@@ -436,7 +436,8 @@ export interface FileNode {
436
436
  name: string;
437
437
  code: string;
438
438
  path: string;
439
- isLoading?: boolean;
439
+ timestamp?: number;
440
+ snippetId?: string;
440
441
  }
441
442
  export interface FolderNode {
442
443
  name: string;
@@ -451,7 +452,7 @@ export interface Snippet {
451
452
  suggestedName: string;
452
453
  id: string;
453
454
  files: Array<FileNode | FolderNode>;
454
- sessionKey?: string;
455
+ sessionKey: string;
455
456
  }
456
457
  export interface SyncInfo {
457
458
  snippet: Snippet;