siteplane 0.1.36
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/LICENSE +5 -0
- package/README.md +32 -0
- package/dist/bin/siteplane.js +4383 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2260 -0
- package/dist/next.d.ts +91 -0
- package/dist/next.js +2710 -0
- package/package.json +45 -0
package/dist/next.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
type NextConfigLike = {
|
|
2
|
+
env?: Record<string, string | undefined>;
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
export type SiteplaneNextOptions = {
|
|
6
|
+
projectDir?: string;
|
|
7
|
+
buildRevision?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type SiteplaneFieldScanIssue = {
|
|
11
|
+
code: string;
|
|
12
|
+
message: string;
|
|
13
|
+
fieldId?: string;
|
|
14
|
+
filePath: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type SiteplaneSourceMapping = {
|
|
18
|
+
kind: "function";
|
|
19
|
+
filePath: string;
|
|
20
|
+
exportName?: string;
|
|
21
|
+
sourcePath?: string;
|
|
22
|
+
editTarget?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
type SiteplaneDomMapping = {
|
|
26
|
+
attribute: "data-siteplane-field-id";
|
|
27
|
+
previewStrategy: "dom" | "event";
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
type SiteplaneContractFieldBase = {
|
|
31
|
+
fieldId: string;
|
|
32
|
+
routeKey: string;
|
|
33
|
+
source: SiteplaneSourceMapping;
|
|
34
|
+
dom?: SiteplaneDomMapping;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type SiteplaneSiteFieldContractV1 = {
|
|
38
|
+
version: 1;
|
|
39
|
+
fieldContractVersion: string;
|
|
40
|
+
scannerContractVersion: string;
|
|
41
|
+
fields: Array<
|
|
42
|
+
| (SiteplaneContractFieldBase & {
|
|
43
|
+
fieldType: "text" | "longText";
|
|
44
|
+
fallback: string;
|
|
45
|
+
})
|
|
46
|
+
| (SiteplaneContractFieldBase & {
|
|
47
|
+
fieldType: "link";
|
|
48
|
+
fallback: {
|
|
49
|
+
href: string;
|
|
50
|
+
label?: string;
|
|
51
|
+
target?: "_self" | "_blank";
|
|
52
|
+
};
|
|
53
|
+
})
|
|
54
|
+
| (SiteplaneContractFieldBase & {
|
|
55
|
+
fieldType: "image";
|
|
56
|
+
fallback: {
|
|
57
|
+
src: string;
|
|
58
|
+
alt: string;
|
|
59
|
+
width?: number;
|
|
60
|
+
height?: number;
|
|
61
|
+
crop?: {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
zoom: number;
|
|
65
|
+
aspectRatio: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
})
|
|
69
|
+
>;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export declare class SiteplaneNextContractError extends Error {
|
|
73
|
+
readonly code:
|
|
74
|
+
| "field_contract_scan_failed"
|
|
75
|
+
| "missing_build_revision"
|
|
76
|
+
| "missing_field_contract"
|
|
77
|
+
| "stale_field_contract";
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export declare function scanNextProjectFieldContract(projectDir: string): Promise<{
|
|
81
|
+
fieldContractHash: string;
|
|
82
|
+
contract: SiteplaneSiteFieldContractV1;
|
|
83
|
+
hardErrors: SiteplaneFieldScanIssue[];
|
|
84
|
+
warnings: SiteplaneFieldScanIssue[];
|
|
85
|
+
suggestions: SiteplaneFieldScanIssue[];
|
|
86
|
+
}>;
|
|
87
|
+
|
|
88
|
+
export declare function withSiteplane<TConfig extends NextConfigLike>(
|
|
89
|
+
nextConfig: TConfig,
|
|
90
|
+
options?: SiteplaneNextOptions
|
|
91
|
+
): Promise<TConfig & { env: Record<string, string | undefined> }>;
|