craft-native 0.0.37
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.md +21 -0
- package/README.md +424 -0
- package/bin/cli.ts +937 -0
- package/dist/api/android-advanced.d.ts +737 -0
- package/dist/api/android-advanced.d.ts.map +1 -0
- package/dist/api/app.d.ts +432 -0
- package/dist/api/app.d.ts.map +1 -0
- package/dist/api/clipboard.d.ts +85 -0
- package/dist/api/clipboard.d.ts.map +1 -0
- package/dist/api/crypto.d.ts +79 -0
- package/dist/api/crypto.d.ts.map +1 -0
- package/dist/api/db.d.ts +427 -0
- package/dist/api/db.d.ts.map +1 -0
- package/dist/api/dialog.d.ts +141 -0
- package/dist/api/dialog.d.ts.map +1 -0
- package/dist/api/fs.d.ts +131 -0
- package/dist/api/fs.d.ts.map +1 -0
- package/dist/api/http.d.ts +196 -0
- package/dist/api/http.d.ts.map +1 -0
- package/dist/api/index.d.ts +38 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/ios-advanced.d.ts +833 -0
- package/dist/api/ios-advanced.d.ts.map +1 -0
- package/dist/api/macos-advanced.d.ts +721 -0
- package/dist/api/macos-advanced.d.ts.map +1 -0
- package/dist/api/media.d.ts +233 -0
- package/dist/api/media.d.ts.map +1 -0
- package/dist/api/mobile.d.ts +658 -0
- package/dist/api/mobile.d.ts.map +1 -0
- package/dist/api/process.d.ts +168 -0
- package/dist/api/process.d.ts.map +1 -0
- package/dist/api/sidebar.d.ts +125 -0
- package/dist/api/sidebar.d.ts.map +1 -0
- package/dist/api/tray.d.ts +410 -0
- package/dist/api/tray.d.ts.map +1 -0
- package/dist/api/window.d.ts +462 -0
- package/dist/api/window.d.ts.map +1 -0
- package/dist/api/windows-advanced.d.ts +719 -0
- package/dist/api/windows-advanced.d.ts.map +1 -0
- package/dist/assets/index.d.ts +69 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/binary-resolver.d.ts +39 -0
- package/dist/binary-resolver.d.ts.map +1 -0
- package/dist/bridge/android.d.ts +574 -0
- package/dist/bridge/android.d.ts.map +1 -0
- package/dist/bridge/core.d.ts +474 -0
- package/dist/bridge/core.d.ts.map +1 -0
- package/dist/bridge/ids.d.ts +18 -0
- package/dist/bridge/ids.d.ts.map +1 -0
- package/dist/bridge/ios.d.ts +528 -0
- package/dist/bridge/ios.d.ts.map +1 -0
- package/dist/bridge/webkit-pending.d.ts +50 -0
- package/dist/bridge/webkit-pending.d.ts.map +1 -0
- package/dist/build/bundle-optimizer.d.ts +69 -0
- package/dist/build/bundle-optimizer.d.ts.map +1 -0
- package/dist/components/index.d.ts +719 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/native.d.ts +728 -0
- package/dist/components/native.d.ts.map +1 -0
- package/dist/components/sidebar.d.ts +458 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/dev/devtools.d.ts +118 -0
- package/dist/dev/devtools.d.ts.map +1 -0
- package/dist/dev/error-overlay.d.ts +73 -0
- package/dist/dev/error-overlay.d.ts.map +1 -0
- package/dist/dev/hot-reload.d.ts +127 -0
- package/dist/dev/hot-reload.d.ts.map +1 -0
- package/dist/index.cjs +10253 -0
- package/dist/index.d.cts +59 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10240 -0
- package/dist/logging/index.d.ts +152 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/optimizations/index.d.ts +232 -0
- package/dist/optimizations/index.d.ts.map +1 -0
- package/dist/package.d.ts +90 -0
- package/dist/package.d.ts.map +1 -0
- package/dist/performance/runtime.d.ts +230 -0
- package/dist/performance/runtime.d.ts.map +1 -0
- package/dist/performance/startup.d.ts +223 -0
- package/dist/performance/startup.d.ts.map +1 -0
- package/dist/plugins/index.d.ts +114 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/security/index.d.ts +268 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/signing/index.d.ts +104 -0
- package/dist/signing/index.d.ts.map +1 -0
- package/dist/styles/headwind.d.ts +222 -0
- package/dist/styles/headwind.d.ts.map +1 -0
- package/dist/styles/index.d.ts +31 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles/sidebar-templates.d.ts +77 -0
- package/dist/styles/sidebar-templates.d.ts.map +1 -0
- package/dist/styles/sidebars.d.ts +194 -0
- package/dist/styles/sidebars.d.ts.map +1 -0
- package/dist/types.d.ts +1555 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/updater/index.d.ts +164 -0
- package/dist/updater/index.d.ts.map +1 -0
- package/dist/utils/audio.d.ts +40 -0
- package/dist/utils/audio.d.ts.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/native.d.ts +27 -0
- package/dist/utils/native.d.ts.map +1 -0
- package/dist/utils/react.d.ts +157 -0
- package/dist/utils/react.d.ts.map +1 -0
- package/dist/utils/storage.d.ts +35 -0
- package/dist/utils/storage.d.ts.map +1 -0
- package/dist/utils/svelte.d.ts +187 -0
- package/dist/utils/svelte.d.ts.map +1 -0
- package/dist/utils/timer.d.ts +57 -0
- package/dist/utils/timer.d.ts.map +1 -0
- package/dist/utils/vue.d.ts +157 -0
- package/dist/utils/vue.d.ts.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Craft Security Enhancements
|
|
3
|
+
* CSP, CORS, certificate pinning, secure storage, and input validation
|
|
4
|
+
*/
|
|
5
|
+
export interface CSPDirectives {
|
|
6
|
+
'default-src'?: string[];
|
|
7
|
+
'script-src'?: string[];
|
|
8
|
+
'style-src'?: string[];
|
|
9
|
+
'img-src'?: string[];
|
|
10
|
+
'font-src'?: string[];
|
|
11
|
+
'connect-src'?: string[];
|
|
12
|
+
'media-src'?: string[];
|
|
13
|
+
'object-src'?: string[];
|
|
14
|
+
'frame-src'?: string[];
|
|
15
|
+
'worker-src'?: string[];
|
|
16
|
+
'child-src'?: string[];
|
|
17
|
+
'form-action'?: string[];
|
|
18
|
+
'frame-ancestors'?: string[];
|
|
19
|
+
'base-uri'?: string[];
|
|
20
|
+
'report-uri'?: string[];
|
|
21
|
+
'report-to'?: string[];
|
|
22
|
+
'upgrade-insecure-requests'?: boolean;
|
|
23
|
+
'block-all-mixed-content'?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface CORSConfig {
|
|
26
|
+
origin?: string | string[] | boolean | ((_origin: string) => boolean);
|
|
27
|
+
methods?: string[];
|
|
28
|
+
allowedHeaders?: string[];
|
|
29
|
+
exposedHeaders?: string[];
|
|
30
|
+
credentials?: boolean;
|
|
31
|
+
maxAge?: number;
|
|
32
|
+
preflightContinue?: boolean;
|
|
33
|
+
optionsSuccessStatus?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface CertificatePinConfig {
|
|
36
|
+
hostname: string;
|
|
37
|
+
pins: string[];
|
|
38
|
+
includeSubdomains?: boolean;
|
|
39
|
+
maxAge?: number;
|
|
40
|
+
reportUri?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface SecureStorageConfig {
|
|
43
|
+
algorithm?: string;
|
|
44
|
+
keyLength?: number;
|
|
45
|
+
ivLength?: number;
|
|
46
|
+
saltLength?: number;
|
|
47
|
+
iterations?: number;
|
|
48
|
+
}
|
|
49
|
+
export declare class ContentSecurityPolicy {
|
|
50
|
+
private directives;
|
|
51
|
+
constructor(directives?: CSPDirectives);
|
|
52
|
+
/**
|
|
53
|
+
* Add source to directive
|
|
54
|
+
*/
|
|
55
|
+
addSource(directive: keyof CSPDirectives, source: string): this;
|
|
56
|
+
/**
|
|
57
|
+
* Remove source from directive
|
|
58
|
+
*/
|
|
59
|
+
removeSource(directive: keyof CSPDirectives, source: string): this;
|
|
60
|
+
/**
|
|
61
|
+
* Generate CSP header string
|
|
62
|
+
*/
|
|
63
|
+
toString(): string;
|
|
64
|
+
/**
|
|
65
|
+
* Generate nonce for inline scripts
|
|
66
|
+
*/
|
|
67
|
+
static generateNonce(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Create strict CSP for production
|
|
70
|
+
*/
|
|
71
|
+
static strict(): ContentSecurityPolicy;
|
|
72
|
+
/**
|
|
73
|
+
* Create a relaxed CSP suitable for local development. Refuses to run when
|
|
74
|
+
* NODE_ENV is set to "production" (or CRAFT_ENV/APP_ENV are) so the relaxed
|
|
75
|
+
* preset cannot accidentally ship.
|
|
76
|
+
*
|
|
77
|
+
* `script-src` defaults to `'self' 'strict-dynamic'` (with the supplied
|
|
78
|
+
* `nonce`, if any) — `'unsafe-inline'` is no longer included by default.
|
|
79
|
+
* Pass `{ allowUnsafeInline: true }` if your dev workflow truly needs it
|
|
80
|
+
* (e.g. legacy inline `<script>` blobs in fixtures); the option name is
|
|
81
|
+
* deliberately verbose so it shows up in code review.
|
|
82
|
+
*/
|
|
83
|
+
static development(options?: {
|
|
84
|
+
nonce?: string;
|
|
85
|
+
allowUnsafeInline?: boolean;
|
|
86
|
+
}): ContentSecurityPolicy;
|
|
87
|
+
}
|
|
88
|
+
export declare class CORSHandler {
|
|
89
|
+
private config;
|
|
90
|
+
constructor(config?: CORSConfig);
|
|
91
|
+
/**
|
|
92
|
+
* Get CORS headers for a request
|
|
93
|
+
*/
|
|
94
|
+
getHeaders(requestOrigin?: string): Record<string, string>;
|
|
95
|
+
/**
|
|
96
|
+
* Get preflight headers
|
|
97
|
+
*/
|
|
98
|
+
getPreflightHeaders(requestOrigin?: string): Record<string, string>;
|
|
99
|
+
private getAllowedOrigin;
|
|
100
|
+
}
|
|
101
|
+
export declare class CertificatePinner {
|
|
102
|
+
private pins;
|
|
103
|
+
/**
|
|
104
|
+
* Add certificate pin
|
|
105
|
+
*/
|
|
106
|
+
addPin(config: CertificatePinConfig): void;
|
|
107
|
+
/**
|
|
108
|
+
* Remove certificate pin
|
|
109
|
+
*/
|
|
110
|
+
removePin(hostname: string): void;
|
|
111
|
+
/**
|
|
112
|
+
* Verify certificate
|
|
113
|
+
*/
|
|
114
|
+
verify(hostname: string, publicKey: Buffer): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Generate HTTP Public Key Pinning header
|
|
117
|
+
*/
|
|
118
|
+
getHPKPHeader(hostname: string): string | null;
|
|
119
|
+
/**
|
|
120
|
+
* Calculate pin from public key
|
|
121
|
+
*/
|
|
122
|
+
static calculatePin(publicKey: Buffer): string;
|
|
123
|
+
}
|
|
124
|
+
export declare class SecureStorage {
|
|
125
|
+
private config;
|
|
126
|
+
private key;
|
|
127
|
+
private destroyed;
|
|
128
|
+
constructor(masterPassword: string, config?: SecureStorageConfig & {
|
|
129
|
+
salt?: Buffer;
|
|
130
|
+
});
|
|
131
|
+
private requireKey;
|
|
132
|
+
/**
|
|
133
|
+
* Encrypt data
|
|
134
|
+
*/
|
|
135
|
+
encrypt(data: string): string;
|
|
136
|
+
/**
|
|
137
|
+
* Decrypt data. Throws on malformed JSON instead of bubbling an opaque
|
|
138
|
+
* SyntaxError out of the crypto layer.
|
|
139
|
+
*/
|
|
140
|
+
decrypt(encrypted: string): string;
|
|
141
|
+
/**
|
|
142
|
+
* Hash data (one-way)
|
|
143
|
+
*/
|
|
144
|
+
hash(data: string): string;
|
|
145
|
+
/**
|
|
146
|
+
* Get the salt used for key derivation.
|
|
147
|
+
* Callers MUST persist this salt alongside ciphertext so that the same key
|
|
148
|
+
* can be re-derived on the next run.
|
|
149
|
+
*/
|
|
150
|
+
getSalt(): Buffer;
|
|
151
|
+
/**
|
|
152
|
+
* Zero-fill the derived key buffer and mark the instance as destroyed.
|
|
153
|
+
* After `destroy()` further calls to `encrypt`/`decrypt`/`hash` throw.
|
|
154
|
+
*
|
|
155
|
+
* Callers that hold long-lived references should invoke this when the
|
|
156
|
+
* sensitive session ends — leaving the derived key in process memory
|
|
157
|
+
* indefinitely defeats the point of the pbkdf2 stretch in the first
|
|
158
|
+
* place.
|
|
159
|
+
*/
|
|
160
|
+
destroy(): void;
|
|
161
|
+
/** Reports whether `destroy()` has been called. */
|
|
162
|
+
isDestroyed(): boolean;
|
|
163
|
+
}
|
|
164
|
+
export declare const validators: {
|
|
165
|
+
/**
|
|
166
|
+
* Validate email. Best-effort regex aligned with HTML5's `<input
|
|
167
|
+
* type=email>` validator (the same pattern WHATWG specifies). Real
|
|
168
|
+
* validation should rely on sending a confirmation email — never on a
|
|
169
|
+
* client-side regex — but this catches obvious typos like `a@b.` or
|
|
170
|
+
* `@example.com`.
|
|
171
|
+
*/
|
|
172
|
+
email: (value: string) => boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Validate URL
|
|
175
|
+
*/
|
|
176
|
+
url: (value: string) => boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Validate UUID. Accepts versions 1–8 per RFC 9562 (the previous regex
|
|
179
|
+
* stopped at v5 and rejected the increasingly common v7 time-ordered
|
|
180
|
+
* UUIDs). The variant nibble must be one of `8`, `9`, `a`, `b` (RFC
|
|
181
|
+
* 4122 / 9562 layout).
|
|
182
|
+
*/
|
|
183
|
+
uuid: (value: string) => boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Validate integer
|
|
186
|
+
*/
|
|
187
|
+
integer: (value: string | number) => boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Validate range
|
|
190
|
+
*/
|
|
191
|
+
range: (min: number, max: number) => (value: number) => boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Validate length
|
|
194
|
+
*/
|
|
195
|
+
length: (min: number, max?: number) => (value: string) => boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Validate alphanumeric
|
|
198
|
+
*/
|
|
199
|
+
alphanumeric: (value: string) => boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Validate no script tags (basic XSS prevention).
|
|
202
|
+
* Catches full/partial script tags and javascript: URLs. For full XSS
|
|
203
|
+
* protection always prefer contextual escaping (escapeHtml) and a strict CSP.
|
|
204
|
+
*/
|
|
205
|
+
noScript: (value: string) => boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Validate no SQL injection patterns
|
|
208
|
+
*/
|
|
209
|
+
noSqlInjection: (value: string) => boolean;
|
|
210
|
+
};
|
|
211
|
+
export declare const sanitizers: {
|
|
212
|
+
/**
|
|
213
|
+
* Escape HTML
|
|
214
|
+
*/
|
|
215
|
+
escapeHtml: (value: string) => string;
|
|
216
|
+
/**
|
|
217
|
+
* Strip HTML tags
|
|
218
|
+
*/
|
|
219
|
+
stripHtml: (value: string) => string;
|
|
220
|
+
/**
|
|
221
|
+
* Normalize whitespace
|
|
222
|
+
*/
|
|
223
|
+
normalizeWhitespace: (value: string) => string;
|
|
224
|
+
/**
|
|
225
|
+
* Remove non-printable characters.
|
|
226
|
+
*
|
|
227
|
+
* Strips Unicode "Other" category code points (`\p{C}`) — control
|
|
228
|
+
* codes, surrogates, format chars, private-use chars — while
|
|
229
|
+
* preserving the rest of the BMP and astral plane. The previous
|
|
230
|
+
* implementation deleted everything outside ASCII printable, which
|
|
231
|
+
* silently removed accents (`é`), CJK characters (`中`), and emojis
|
|
232
|
+
* from any user input that touched the sanitizer.
|
|
233
|
+
*/
|
|
234
|
+
removeNonPrintable: (value: string) => string;
|
|
235
|
+
/**
|
|
236
|
+
* Escape SQL (basic - prefer parameterized queries)
|
|
237
|
+
*/
|
|
238
|
+
escapeSql: (value: string) => string;
|
|
239
|
+
};
|
|
240
|
+
export declare class RateLimiter {
|
|
241
|
+
private windowMs;
|
|
242
|
+
private maxRequests;
|
|
243
|
+
private requests;
|
|
244
|
+
constructor(windowMs?: number, maxRequests?: number);
|
|
245
|
+
/**
|
|
246
|
+
* Check if request is allowed
|
|
247
|
+
*/
|
|
248
|
+
isAllowed(key: string): boolean;
|
|
249
|
+
/**
|
|
250
|
+
* Get remaining requests
|
|
251
|
+
*/
|
|
252
|
+
getRemaining(key: string): number;
|
|
253
|
+
/**
|
|
254
|
+
* Reset limit for key
|
|
255
|
+
*/
|
|
256
|
+
reset(key: string): void;
|
|
257
|
+
}
|
|
258
|
+
declare const _exports: {
|
|
259
|
+
ContentSecurityPolicy: typeof ContentSecurityPolicy;
|
|
260
|
+
CORSHandler: typeof CORSHandler;
|
|
261
|
+
CertificatePinner: typeof CertificatePinner;
|
|
262
|
+
SecureStorage: typeof SecureStorage;
|
|
263
|
+
validators: typeof validators;
|
|
264
|
+
sanitizers: typeof sanitizers;
|
|
265
|
+
RateLimiter: typeof RateLimiter;
|
|
266
|
+
};
|
|
267
|
+
export default _exports;
|
|
268
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/security/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,WAAW,aAAa;IAC5B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,2BAA2B,CAAC,EAAE,OAAO,CAAA;IACrC,yBAAyB,CAAC,EAAE,OAAO,CAAA;CACpC;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,MAAM,GAAG,M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I;CAGzB;AAED,QAAA,MAAM,QAAQ,EAAE;IACd,qBAAqB,EAAE,OAAO,qBAAqB,CAAC;IACpD,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,WAAW,EAAE,OAAO,WAAW,CAAC;CASjC,CAAC;AACF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Craft Code Signing & Notarization
|
|
3
|
+
* Sign and notarize applications for all platforms
|
|
4
|
+
*/
|
|
5
|
+
export interface SigningConfig {
|
|
6
|
+
platform: 'macos' | 'windows' | 'linux';
|
|
7
|
+
identity?: string;
|
|
8
|
+
certificate?: string;
|
|
9
|
+
password?: string;
|
|
10
|
+
timestampServer?: string;
|
|
11
|
+
entitlements?: string;
|
|
12
|
+
hardened?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface NotarizationConfig {
|
|
15
|
+
appleId: string;
|
|
16
|
+
teamId: string;
|
|
17
|
+
/**
|
|
18
|
+
* App-specific password. Passing this directly puts the secret on the
|
|
19
|
+
* `xcrun notarytool` argv where `ps -ef` can read it on the build host.
|
|
20
|
+
* Prefer `keychainProfile` instead — set one up once with
|
|
21
|
+
* `xcrun notarytool store-credentials <profile>` and Apple keeps the
|
|
22
|
+
* credential in the keychain.
|
|
23
|
+
*/
|
|
24
|
+
password?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Name of a notarytool keychain profile (created via
|
|
27
|
+
* `xcrun notarytool store-credentials`). When set, this is used instead
|
|
28
|
+
* of `--apple-id`/`--team-id`/`--password`.
|
|
29
|
+
*/
|
|
30
|
+
keychainProfile?: string;
|
|
31
|
+
bundleId: string;
|
|
32
|
+
}
|
|
33
|
+
export interface SigningResult {
|
|
34
|
+
success: boolean;
|
|
35
|
+
path: string;
|
|
36
|
+
signature?: string;
|
|
37
|
+
errors?: string[];
|
|
38
|
+
}
|
|
39
|
+
export declare class CodeSigner {
|
|
40
|
+
private config;
|
|
41
|
+
constructor(config: SigningConfig);
|
|
42
|
+
/**
|
|
43
|
+
* Sign an application or binary
|
|
44
|
+
*/
|
|
45
|
+
sign(path: string): Promise<SigningResult>;
|
|
46
|
+
private signMacOS;
|
|
47
|
+
private signWindows;
|
|
48
|
+
private signLinux;
|
|
49
|
+
/**
|
|
50
|
+
* Verify a signature.
|
|
51
|
+
*/
|
|
52
|
+
verify(path: string): Promise<boolean>;
|
|
53
|
+
}
|
|
54
|
+
export declare class Notarizer {
|
|
55
|
+
private config;
|
|
56
|
+
constructor(config: NotarizationConfig);
|
|
57
|
+
/**
|
|
58
|
+
* Submit app for notarization
|
|
59
|
+
*/
|
|
60
|
+
/**
|
|
61
|
+
* Build the argv list for `xcrun notarytool`. Prefers `--keychain-profile`
|
|
62
|
+
* when configured so the password never ends up on the command line where
|
|
63
|
+
* other users on the build host can see it via `ps`.
|
|
64
|
+
*/
|
|
65
|
+
private notarytoolArgs;
|
|
66
|
+
notarize(path: string): Promise<{
|
|
67
|
+
success: boolean;
|
|
68
|
+
requestId?: string;
|
|
69
|
+
error?: string;
|
|
70
|
+
}>;
|
|
71
|
+
/**
|
|
72
|
+
* Check notarization status. Returns the parsed JSON status from notarytool.
|
|
73
|
+
*/
|
|
74
|
+
checkStatus(requestId: string): Promise<{
|
|
75
|
+
status: string;
|
|
76
|
+
message?: string;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Get notarization log.
|
|
80
|
+
*/
|
|
81
|
+
getLog(requestId: string): Promise<string>;
|
|
82
|
+
}
|
|
83
|
+
export declare function generateEntitlements(options: {
|
|
84
|
+
hardened?: boolean;
|
|
85
|
+
allowJit?: boolean;
|
|
86
|
+
allowUnsigned?: boolean;
|
|
87
|
+
allowDyld?: boolean;
|
|
88
|
+
network?: {
|
|
89
|
+
client?: boolean;
|
|
90
|
+
server?: boolean;
|
|
91
|
+
};
|
|
92
|
+
camera?: boolean;
|
|
93
|
+
microphone?: boolean;
|
|
94
|
+
usb?: boolean;
|
|
95
|
+
bluetooth?: boolean;
|
|
96
|
+
location?: boolean;
|
|
97
|
+
addressBook?: boolean;
|
|
98
|
+
calendar?: boolean;
|
|
99
|
+
photos?: boolean;
|
|
100
|
+
appleEvents?: boolean;
|
|
101
|
+
}): string;
|
|
102
|
+
export declare function signingCommand(args: string[]): Promise<void>;
|
|
103
|
+
export default CodeSigner;
|
|
104
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signing/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA+CH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB;AAGD,qBAAa,UAAU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AO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,GAAG,MAAM,CAkFT;AAGD,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAkKlE;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Headwind CSS Integration
|
|
3
|
+
* @description Integration with zig-headwind, a blazing-fast Tailwind CSS alternative built in Zig.
|
|
4
|
+
* Provides utility-first CSS styling with Tailwind-compatible class names.
|
|
5
|
+
* @module @craft-native/styles/headwind
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { tw, cx, variants, style } from '@craft-native/styles/headwind'
|
|
10
|
+
*
|
|
11
|
+
* // Use Tailwind-compatible classes
|
|
12
|
+
* const buttonClass = tw`px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600`
|
|
13
|
+
*
|
|
14
|
+
* // Conditional classes
|
|
15
|
+
* const className = cx(
|
|
16
|
+
* 'base-class',
|
|
17
|
+
* isActive && 'active',
|
|
18
|
+
* { 'disabled': isDisabled }
|
|
19
|
+
* )
|
|
20
|
+
*
|
|
21
|
+
* // Create variant-based styles
|
|
22
|
+
* const button = variants({
|
|
23
|
+
* base: 'px-4 py-2 rounded font-medium transition-colors',
|
|
24
|
+
* variants: {
|
|
25
|
+
* intent: {
|
|
26
|
+
* primary: 'bg-blue-500 text-white hover:bg-blue-600',
|
|
27
|
+
* secondary: 'bg-gray-200 text-gray-900 hover:bg-gray-300',
|
|
28
|
+
* danger: 'bg-red-500 text-white hover:bg-red-600'
|
|
29
|
+
* },
|
|
30
|
+
* size: {
|
|
31
|
+
* sm: 'text-sm px-3 py-1.5',
|
|
32
|
+
* md: 'text-base px-4 py-2',
|
|
33
|
+
* lg: 'text-lg px-6 py-3'
|
|
34
|
+
* }
|
|
35
|
+
* },
|
|
36
|
+
* defaultVariants: {
|
|
37
|
+
* intent: 'primary',
|
|
38
|
+
* size: 'md'
|
|
39
|
+
* }
|
|
40
|
+
* })
|
|
41
|
+
*
|
|
42
|
+
* // Use the variant
|
|
43
|
+
* const className = button({ intent: 'danger', size: 'lg' })
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* Tagged template literal for Tailwind/Headwind classes.
|
|
48
|
+
* Provides syntax highlighting and potential compile-time validation.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const className = tw`flex items-center justify-center p-4 bg-blue-500`
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function tw(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
56
|
+
/**
|
|
57
|
+
* Type for class value inputs.
|
|
58
|
+
*/
|
|
59
|
+
export type ClassValue = string | number | boolean | null | undefined | ClassValue[] | Record<string, boolean | null | undefined>;
|
|
60
|
+
/**
|
|
61
|
+
* Merge class names conditionally.
|
|
62
|
+
* Supports strings, arrays, objects, and falsy values.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* // String classes
|
|
67
|
+
* cx('foo', 'bar') // 'foo bar'
|
|
68
|
+
*
|
|
69
|
+
* // Conditional classes
|
|
70
|
+
* cx('base', isActive && 'active', isDisabled && 'disabled')
|
|
71
|
+
*
|
|
72
|
+
* // Object syntax
|
|
73
|
+
* cx('base', { active: isActive, disabled: isDisabled })
|
|
74
|
+
*
|
|
75
|
+
* // Mixed
|
|
76
|
+
* cx('base', ['array', 'of', 'classes'], { conditional: true })
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare function cx(...inputs: ClassValue[]): string;
|
|
80
|
+
/**
|
|
81
|
+
* Variant configuration type.
|
|
82
|
+
*/
|
|
83
|
+
export interface VariantConfig<V extends Record<string, Record<string, string>>> {
|
|
84
|
+
/** Base classes always applied */
|
|
85
|
+
base?: string;
|
|
86
|
+
/** Variant definitions */
|
|
87
|
+
variants: V;
|
|
88
|
+
/** Default variant values */
|
|
89
|
+
defaultVariants?: {
|
|
90
|
+
[K in keyof V]?: keyof V[K];
|
|
91
|
+
};
|
|
92
|
+
/** Compound variants for specific combinations */
|
|
93
|
+
compoundVariants?: Array<{
|
|
94
|
+
[K in keyof V]?: keyof V[K];
|
|
95
|
+
} & {
|
|
96
|
+
className: string;
|
|
97
|
+
}>;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Create a variant-based style function.
|
|
101
|
+
* Similar to CVA (class-variance-authority) or Stitches variants.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* const button = variants({
|
|
106
|
+
* base: 'inline-flex items-center justify-center rounded-md font-medium',
|
|
107
|
+
* variants: {
|
|
108
|
+
* intent: {
|
|
109
|
+
* primary: 'bg-blue-500 text-white hover:bg-blue-600',
|
|
110
|
+
* secondary: 'bg-gray-100 text-gray-900 hover:bg-gray-200',
|
|
111
|
+
* ghost: 'hover:bg-gray-100'
|
|
112
|
+
* },
|
|
113
|
+
* size: {
|
|
114
|
+
* sm: 'h-8 px-3 text-sm',
|
|
115
|
+
* md: 'h-10 px-4 text-sm',
|
|
116
|
+
* lg: 'h-12 px-6 text-base'
|
|
117
|
+
* },
|
|
118
|
+
* disabled: {
|
|
119
|
+
* true: 'opacity-50 cursor-not-allowed'
|
|
120
|
+
* }
|
|
121
|
+
* },
|
|
122
|
+
* defaultVariants: {
|
|
123
|
+
* intent: 'primary',
|
|
124
|
+
* size: 'md'
|
|
125
|
+
* },
|
|
126
|
+
* compoundVariants: [
|
|
127
|
+
* {
|
|
128
|
+
* intent: 'primary',
|
|
129
|
+
* disabled: true,
|
|
130
|
+
* className: 'bg-blue-300'
|
|
131
|
+
* }
|
|
132
|
+
* ]
|
|
133
|
+
* })
|
|
134
|
+
*
|
|
135
|
+
* // Usage
|
|
136
|
+
* button() // Uses defaults
|
|
137
|
+
* button({ intent: 'secondary' })
|
|
138
|
+
* button({ intent: 'primary', size: 'lg', disabled: true })
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
export declare function variants<V extends Record<string, Record<string, string>>>(_config: VariantConfig<V>): (props?: {
|
|
142
|
+
[K in keyof V]?: keyof V[K];
|
|
143
|
+
} & {
|
|
144
|
+
className?: string;
|
|
145
|
+
}) => string;
|
|
146
|
+
/**
|
|
147
|
+
* Convert Tailwind classes to inline style object.
|
|
148
|
+
* Useful for React Native or platforms that don't support CSS classes.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* const styles = style('p-4 bg-blue-500 text-white rounded-lg')
|
|
153
|
+
* // { padding: 16, backgroundColor: '#3b82f6', color: '#ffffff', borderRadius: 8 }
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export declare function style(classes: string): Record<string, string | number>;
|
|
157
|
+
/**
|
|
158
|
+
* Headwind CLI configuration.
|
|
159
|
+
*/
|
|
160
|
+
export interface HeadwindConfig {
|
|
161
|
+
/** Content paths to scan for classes */
|
|
162
|
+
content: string[];
|
|
163
|
+
/** Output CSS file path */
|
|
164
|
+
output: string;
|
|
165
|
+
/** Enable minification */
|
|
166
|
+
minify?: boolean;
|
|
167
|
+
/** Dark mode strategy */
|
|
168
|
+
darkMode?: 'class' | 'media';
|
|
169
|
+
/** Custom theme extensions */
|
|
170
|
+
theme?: {
|
|
171
|
+
extend?: {
|
|
172
|
+
colors?: Record<string, string | Record<string, string>>;
|
|
173
|
+
spacing?: Record<string, string>;
|
|
174
|
+
fontSize?: Record<string, string>;
|
|
175
|
+
fontFamily?: Record<string, string[]>;
|
|
176
|
+
borderRadius?: Record<string, string>;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
/** Enable JIT mode */
|
|
180
|
+
jit?: boolean;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Generate Headwind configuration file.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* const config = generateConfig({
|
|
187
|
+
* content: ['./src/components/*.tsx'],
|
|
188
|
+
* output: './dist/styles.css',
|
|
189
|
+
* minify: true,
|
|
190
|
+
* darkMode: 'class',
|
|
191
|
+
* theme: {
|
|
192
|
+
* extend: {
|
|
193
|
+
* colors: {
|
|
194
|
+
* brand: { 50: '#f0f9ff', 500: '#3b82f6', 900: '#1e3a8a' }
|
|
195
|
+
* }
|
|
196
|
+
* }
|
|
197
|
+
* }
|
|
198
|
+
* })
|
|
199
|
+
*/
|
|
200
|
+
export declare function generateConfig(options: HeadwindConfig): string;
|
|
201
|
+
/**
|
|
202
|
+
* Build CSS using Headwind CLI.
|
|
203
|
+
* Requires zig-headwind to be installed.
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* await buildCSS({
|
|
207
|
+
* content: ['./src/components/*.tsx'],
|
|
208
|
+
* output: './public/styles.css',
|
|
209
|
+
* minify: process.env.NODE_ENV === 'production'
|
|
210
|
+
* })
|
|
211
|
+
*/
|
|
212
|
+
export declare function buildCSS(options: HeadwindConfig): Promise<void>;
|
|
213
|
+
declare const _exports: {
|
|
214
|
+
tw: typeof tw;
|
|
215
|
+
cx: typeof cx;
|
|
216
|
+
variants: typeof variants;
|
|
217
|
+
style: typeof style;
|
|
218
|
+
generateConfig: typeof generateConfig;
|
|
219
|
+
buildCSS: typeof buildCSS;
|
|
220
|
+
};
|
|
221
|
+
export default _exports;
|
|
222
|
+
//# sourceMappingURL=headwind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headwind.d.ts","sourceRoot":"","sources":["../../src/styles/headwind.ts"],"names":[],"mappings":"AAAA;;;;;;;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O,CAAC,IAAI,CAAC,CA0BrE;AAMD,QAAA,MAAM,QAAQ,EAAE;IACd,EAAE,EAAE,OAAO,EAAE,CAAC;IACd,EAAE,EAAE,OAAO,EAAE,CAAC;IACd,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,QAAQ,EAAE,OAAO,QAAQ,CAAC;CAQ3B,CAAC;AACF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Craft Styles
|
|
3
|
+
* CSS/Tailwind utilities and pre-built component styles
|
|
4
|
+
* @module @craft-native/styles
|
|
5
|
+
*/
|
|
6
|
+
export { tw, cx, variants, style, generateConfig, buildCSS } from './headwind';
|
|
7
|
+
export type { ClassValue, VariantConfig, HeadwindConfig } from './headwind';
|
|
8
|
+
export { tahoeStyles, arcStyles, orbstackStyles, sidebarUtils, sidebarCSSVariables, getSidebarStyle } from './sidebars';
|
|
9
|
+
export { renderTahoeSidebar, renderArcSidebar, renderOrbStackSidebar, tahoeDemoData, arcDemoData, orbstackDemoData, getFullPageHTML } from './sidebar-templates';
|
|
10
|
+
export type { SidebarItemData, SidebarSectionData, SidebarData } from './sidebar-templates';
|
|
11
|
+
export { cx as clsx } from './headwind';
|
|
12
|
+
import { tahoeStyles, arcStyles, orbstackStyles } from './sidebars';
|
|
13
|
+
import { renderTahoeSidebar, renderArcSidebar, renderOrbStackSidebar } from './sidebar-templates';
|
|
14
|
+
import { tw, cx, variants } from './headwind';
|
|
15
|
+
export declare const styles: {
|
|
16
|
+
tw: typeof tw;
|
|
17
|
+
cx: typeof cx;
|
|
18
|
+
variants: typeof variants;
|
|
19
|
+
sidebar: {
|
|
20
|
+
tahoe: typeof tahoeStyles;
|
|
21
|
+
arc: typeof arcStyles;
|
|
22
|
+
orbstack: typeof orbstackStyles;
|
|
23
|
+
};
|
|
24
|
+
templates: {
|
|
25
|
+
tahoe: typeof renderTahoeSidebar;
|
|
26
|
+
arc: typeof renderArcSidebar;
|
|
27
|
+
orbstack: typeof renderOrbStackSidebar;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export default styles;
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/styles/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,EAAE,EACF,EAAE,EACF,QAAQ,EACR,KAAK,EACL,cAAc,EACd,QAAQ,EACT,MAAM,YAAY,CAAA;AACnB,YAAY,EACV,UAAU,EACV,aAAa,EACb,cAAc,EACf,MAAM,YAAY,CAAA;AAGnB,OAAO,EACL,WAAW,EACX,SAAS,EACT,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,eAAe,EAChB,MAAM,YAAY,CAAA;AAGnB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,WAAW,EACZ,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,YAAY,CAAA;AAGvC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AACjG,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE7C,eAAO,MAAM,MAAM,EAAE;IACnB,EAAE,EAAE,OAAO,EAAE,CAAC;IACd,EAAE,EAAE,OAAO,EAAE,CAAC;IACd,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,OAA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