@reframejs/unframer 4.2.0-reframe.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/README.md +389 -0
- package/bin.js +5 -0
- package/dist/babel-jsx.d.ts +24 -0
- package/dist/babel-jsx.js +299 -0
- package/dist/babel-plugin-imports.d.ts +15 -0
- package/dist/babel-plugin-imports.js +211 -0
- package/dist/babel-typedoc.d.ts +39 -0
- package/dist/babel-typedoc.js +76 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +3 -0
- package/dist/cli.d.ts +59 -0
- package/dist/cli.js +821 -0
- package/dist/compat.d.ts +2 -0
- package/dist/compat.js +23 -0
- package/dist/config.d.ts +18 -0
- package/dist/config.js +27 -0
- package/dist/css-core.d.ts +50 -0
- package/dist/css-core.js +231 -0
- package/dist/css.d.ts +15 -0
- package/dist/css.js +36 -0
- package/dist/esbuild.d.ts +31 -0
- package/dist/esbuild.js +317 -0
- package/dist/exporter.d.ts +96 -0
- package/dist/exporter.js +1151 -0
- package/dist/flat-cache-interceptor.d.ts +24 -0
- package/dist/flat-cache-interceptor.js +87 -0
- package/dist/framer-chunks/chunk-IKQSD2QC.js +10 -0
- package/dist/framer-chunks/fontshare-PZLWRK4B-MHMZIGTX.js +7 -0
- package/dist/framer-chunks/fontshare-SXU5BGFE-OWTMMPGS.js +7 -0
- package/dist/framer-chunks/fontshare-TIA7QUPT-PUDLUTQ7.js +7 -0
- package/dist/framer-chunks/framer-font-RD2SUPQH-Q4MS7WS6.js +7 -0
- package/dist/framer-chunks/google-EGNT223R-P4DUHBW2.js +7 -0
- package/dist/framer-chunks/google-H6SFY4F5-5JSJCGDR.js +7 -0
- package/dist/framer-chunks/google-YSYBFRE6-L7YAHH7V.js +7 -0
- package/dist/framer-client.server.d.ts +4 -0
- package/dist/framer-client.server.js +45 -0
- package/dist/framer-package-versions.d.ts +781 -0
- package/dist/framer-package-versions.js +782 -0
- package/dist/framer-types.d.ts +30 -0
- package/dist/framer-types.js +35 -0
- package/dist/framer.d.ts +4990 -0
- package/dist/framer.js +64296 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +13 -0
- package/dist/package-manager.d.ts +10 -0
- package/dist/package-manager.js +138 -0
- package/dist/plugin-mcp-dist/lib/client-websocket.d.ts +5 -0
- package/dist/plugin-mcp-dist/lib/client-websocket.js +103 -0
- package/dist/plugin-mcp-dist/lib/cms.d.ts +10 -0
- package/dist/plugin-mcp-dist/lib/cms.js +58 -0
- package/dist/plugin-mcp-dist/lib/errors.d.ts +5 -0
- package/dist/plugin-mcp-dist/lib/errors.js +48 -0
- package/dist/plugin-mcp-dist/lib/framer-client.d.ts +2 -0
- package/dist/plugin-mcp-dist/lib/framer-client.js +4 -0
- package/dist/plugin-mcp-dist/lib/framer-client.server.d.ts +3 -0
- package/dist/plugin-mcp-dist/lib/framer-client.server.js +46 -0
- package/dist/plugin-mcp-dist/lib/framer.d.ts +30 -0
- package/dist/plugin-mcp-dist/lib/framer.js +1084 -0
- package/dist/plugin-mcp-dist/lib/hooks.d.ts +6 -0
- package/dist/plugin-mcp-dist/lib/hooks.js +46 -0
- package/dist/plugin-mcp-dist/lib/mcp-client.d.ts +142 -0
- package/dist/plugin-mcp-dist/lib/mcp-client.js +40 -0
- package/dist/plugin-mcp-dist/lib/mcp-handlers.d.ts +385 -0
- package/dist/plugin-mcp-dist/lib/mcp-handlers.js +1924 -0
- package/dist/plugin-mcp-dist/lib/mcp-tools.d.ts +5 -0
- package/dist/plugin-mcp-dist/lib/mcp-tools.js +5 -0
- package/dist/plugin-mcp-dist/lib/mcp-websocket.d.ts +10 -0
- package/dist/plugin-mcp-dist/lib/mcp-websocket.js +88 -0
- package/dist/plugin-mcp-dist/lib/plugin-websocket.d.ts +5 -0
- package/dist/plugin-mcp-dist/lib/plugin-websocket.js +170 -0
- package/dist/plugin-mcp-dist/lib/react-export.d.ts +51 -0
- package/dist/plugin-mcp-dist/lib/react-export.js +358 -0
- package/dist/plugin-mcp-dist/lib/schema.d.ts +276 -0
- package/dist/plugin-mcp-dist/lib/schema.js +907 -0
- package/dist/plugin-mcp-dist/lib/store.d.ts +2 -0
- package/dist/plugin-mcp-dist/lib/store.js +10 -0
- package/dist/plugin-mcp-dist/lib/tree-utils.d.ts +6 -0
- package/dist/plugin-mcp-dist/lib/tree-utils.js +141 -0
- package/dist/plugin-mcp-dist/lib/tunnel.d.ts +46 -0
- package/dist/plugin-mcp-dist/lib/tunnel.js +117 -0
- package/dist/plugin-mcp-dist/lib/types.d.ts +110 -0
- package/dist/plugin-mcp-dist/lib/types.js +188 -0
- package/dist/plugin-mcp-dist/lib/upstream-socket.d.ts +13 -0
- package/dist/plugin-mcp-dist/lib/upstream-socket.js +56 -0
- package/dist/plugin-mcp-dist/lib/utils.d.ts +13 -0
- package/dist/plugin-mcp-dist/lib/utils.js +57 -0
- package/dist/plugin-mcp-dist/lib/websocket-server.d.ts +10 -0
- package/dist/plugin-mcp-dist/lib/websocket-server.js +88 -0
- package/dist/plugin-mcp-dist/lib/xml.d.ts +10 -0
- package/dist/plugin-mcp-dist/lib/xml.js +395 -0
- package/dist/react.d.ts +76 -0
- package/dist/react.js +280 -0
- package/dist/renamer.d.ts +11 -0
- package/dist/renamer.js +139 -0
- package/dist/sentry.d.ts +2 -0
- package/dist/sentry.js +5 -0
- package/dist/stackblitz.d.ts +9 -0
- package/dist/stackblitz.js +179 -0
- package/dist/styles/framer.css +920 -0
- package/dist/styles/reset.css +37 -0
- package/dist/typescript.d.ts +24 -0
- package/dist/typescript.js +197 -0
- package/dist/undici-dispatcher.d.ts +2 -0
- package/dist/undici-dispatcher.js +10 -0
- package/dist/unframer-loader.d.ts +2 -0
- package/dist/unframer-loader.js +12 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.js +81 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +2 -0
- package/package.json +131 -0
package/dist/esbuild.js
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { fetch } from 'undici';
|
|
2
|
+
import { RateLimit, Sema } from 'async-sema';
|
|
3
|
+
import { logger, spinner } from './utils.js';
|
|
4
|
+
import { transform } from 'esbuild';
|
|
5
|
+
import { resolvePackage } from './exporter.js';
|
|
6
|
+
import { notifyError } from './sentry.js';
|
|
7
|
+
import { dispatcher } from './undici-dispatcher.js';
|
|
8
|
+
import { framerPackageVersions } from './framer-package-versions.js';
|
|
9
|
+
export const defaultExternalPackages = [
|
|
10
|
+
'react',
|
|
11
|
+
'react-dom',
|
|
12
|
+
'framer',
|
|
13
|
+
'unframer',
|
|
14
|
+
'framer-motion', //
|
|
15
|
+
];
|
|
16
|
+
let redirectCache = new Map();
|
|
17
|
+
export const replaceWebPageIds = ({ elements, code, }) => {
|
|
18
|
+
// Match webPageId pattern with optional trailing comma
|
|
19
|
+
const pattern = /{[\s\n]*webPageId[\s\n]*:[\s\n]*(['"])(.*?)\1[\s\n]*,?[\s\n]*}/g;
|
|
20
|
+
return code.replace(pattern, (match, quote, id) => {
|
|
21
|
+
const path = elements.find((e) => e.webPageId === id)?.path;
|
|
22
|
+
if (!path) {
|
|
23
|
+
return match;
|
|
24
|
+
}
|
|
25
|
+
logger.log(`Replacing relative link to ${id} with fixed path: ${path}`);
|
|
26
|
+
return `'${path}'`;
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
export function esbuildPluginBundleDependencies({ signal = undefined, externalPackages = [], externalizeNpm = false, outDir, onCollectMissingPackage = (pkg) => { }, onFetch = (info) => { }, }) {
|
|
30
|
+
externalPackages = [...defaultExternalPackages, ...externalPackages];
|
|
31
|
+
// console.log(externalPackages)
|
|
32
|
+
const codeCache = new Map();
|
|
33
|
+
const reportedMissingPackages = new Set();
|
|
34
|
+
spinner.start();
|
|
35
|
+
const plugin = {
|
|
36
|
+
name: 'esbuild-plugin',
|
|
37
|
+
setup(build) {
|
|
38
|
+
const namespace = '/';
|
|
39
|
+
build.onResolve({ filter: /^https?:\/\// }, (args) => {
|
|
40
|
+
const url = new URL(args.path);
|
|
41
|
+
return {
|
|
42
|
+
path: args.path,
|
|
43
|
+
external: false,
|
|
44
|
+
// sideEffects: false,
|
|
45
|
+
namespace,
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
const resolveDep = async (args) => {
|
|
49
|
+
if (signal?.aborted) {
|
|
50
|
+
throw new Error('aborted');
|
|
51
|
+
}
|
|
52
|
+
if (args.path.startsWith('https://')) {
|
|
53
|
+
return {
|
|
54
|
+
path: args.path,
|
|
55
|
+
external: false,
|
|
56
|
+
// sideEffects: false,
|
|
57
|
+
namespace,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (args.path === 'framer') {
|
|
61
|
+
return {
|
|
62
|
+
path: 'unframer',
|
|
63
|
+
external: true,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if ('framer-motion' === args.path) {
|
|
67
|
+
return {
|
|
68
|
+
path: 'unframer',
|
|
69
|
+
external: true,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (externalPackages.some((x) => x === args.path || args.path.startsWith(x + '/'))) {
|
|
73
|
+
const pkg = getPackageName(args.path);
|
|
74
|
+
const installed = await resolvePackage({
|
|
75
|
+
cwd: outDir,
|
|
76
|
+
pkg,
|
|
77
|
+
}).catch(() => '');
|
|
78
|
+
if (!installed) {
|
|
79
|
+
if (!reportedMissingPackages.has(pkg)) {
|
|
80
|
+
const hasFramerVersion = Object.prototype.hasOwnProperty.call(framerPackageVersions, pkg);
|
|
81
|
+
if (hasFramerVersion) {
|
|
82
|
+
const version = framerPackageVersions[pkg];
|
|
83
|
+
spinner.info(`Missing package detected: ${pkg} (using Framer version ^${version})`);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
spinner.info(`Missing package detected: ${pkg}`);
|
|
87
|
+
}
|
|
88
|
+
reportedMissingPackages.add(pkg);
|
|
89
|
+
}
|
|
90
|
+
// Check if we have a specific version from framerPackageVersions
|
|
91
|
+
const packageWithVersion = Object.prototype.hasOwnProperty.call(framerPackageVersions, pkg)
|
|
92
|
+
? `${pkg}@^${framerPackageVersions[pkg]}`
|
|
93
|
+
: pkg;
|
|
94
|
+
onCollectMissingPackage?.(packageWithVersion);
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
path: args.path,
|
|
98
|
+
external: true,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
// console.log('resolve', args.path)
|
|
102
|
+
if (args.path.startsWith('.') || args.path.startsWith('/')) {
|
|
103
|
+
// esm.sh uses /*@pkg@version/path for unbundled deps; when externalizing npm,
|
|
104
|
+
// strip the esm.sh prefix and treat as a bare npm specifier
|
|
105
|
+
if (externalizeNpm && args.path.startsWith('/*')) {
|
|
106
|
+
const bare = args.path.slice(2); // remove /*
|
|
107
|
+
const pkg = getPackageName(bare);
|
|
108
|
+
return {
|
|
109
|
+
path: pkg,
|
|
110
|
+
external: true,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
const u = new URL(args.path, args.importer).toString();
|
|
114
|
+
// logger.log('resolve', u)
|
|
115
|
+
return {
|
|
116
|
+
path: u,
|
|
117
|
+
namespace,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
if (externalizeNpm) {
|
|
121
|
+
const pkg = getPackageName(args.path);
|
|
122
|
+
const installed = await resolvePackage({
|
|
123
|
+
cwd: outDir,
|
|
124
|
+
pkg,
|
|
125
|
+
}).catch(() => '');
|
|
126
|
+
if (!installed) {
|
|
127
|
+
if (!reportedMissingPackages.has(pkg)) {
|
|
128
|
+
const hasFramerVersion = Object.prototype.hasOwnProperty.call(framerPackageVersions, pkg);
|
|
129
|
+
if (hasFramerVersion) {
|
|
130
|
+
const version = framerPackageVersions[pkg];
|
|
131
|
+
spinner.info(`Missing package detected: ${pkg} (using Framer version ^${version})`);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
spinner.info(`Missing package detected: ${pkg}`);
|
|
135
|
+
}
|
|
136
|
+
reportedMissingPackages.add(pkg);
|
|
137
|
+
}
|
|
138
|
+
// Check if we have a specific version from framerPackageVersions
|
|
139
|
+
const packageWithVersion = Object.prototype.hasOwnProperty.call(framerPackageVersions, pkg)
|
|
140
|
+
? `${pkg}@^${framerPackageVersions[pkg]}`
|
|
141
|
+
: pkg;
|
|
142
|
+
onCollectMissingPackage?.(packageWithVersion);
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
path: args.path,
|
|
146
|
+
external: true,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
const url = `https://esm.sh/*${args.path}`;
|
|
150
|
+
return {
|
|
151
|
+
path: url,
|
|
152
|
+
namespace,
|
|
153
|
+
external: false,
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
// build.onResolve({ filter: /^\w/ }, resolveDep)
|
|
157
|
+
build.onResolve({ filter: /.*/, namespace }, resolveDep);
|
|
158
|
+
build.onEnd(() => {
|
|
159
|
+
spinner.stop();
|
|
160
|
+
});
|
|
161
|
+
build.onLoad({ filter: /.*/, namespace }, async (args) => {
|
|
162
|
+
try {
|
|
163
|
+
if (signal?.aborted) {
|
|
164
|
+
throw new Error('aborted');
|
|
165
|
+
}
|
|
166
|
+
const url = args.path;
|
|
167
|
+
const resolved = await resolveRedirect({
|
|
168
|
+
url,
|
|
169
|
+
redirectCache,
|
|
170
|
+
signal,
|
|
171
|
+
});
|
|
172
|
+
if (codeCache.has(url)) {
|
|
173
|
+
const code = await codeCache.get(url);
|
|
174
|
+
return {
|
|
175
|
+
contents: code,
|
|
176
|
+
loader: 'js',
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
let loader = 'jsx';
|
|
180
|
+
const promise = Promise.resolve().then(async () => {
|
|
181
|
+
onFetch({ url, resolvedUrl: resolved });
|
|
182
|
+
logger.log('fetching', url, 'because of', args.path);
|
|
183
|
+
spinner.update(`Fetching ${url.replace(/https?:\/\//, '')}`);
|
|
184
|
+
const res = await fetchWithRetry(resolved, {
|
|
185
|
+
signal,
|
|
186
|
+
dispatcher,
|
|
187
|
+
});
|
|
188
|
+
if (!res.ok) {
|
|
189
|
+
throw new Error(`Cannot fetch ${resolved}: ${res.status} ${res.statusText}`);
|
|
190
|
+
}
|
|
191
|
+
// console.log('type', res.headers.get('content-type'))
|
|
192
|
+
if (res.headers
|
|
193
|
+
.get('content-type')
|
|
194
|
+
?.startsWith('application/json')) {
|
|
195
|
+
loader = 'json';
|
|
196
|
+
return await res.text();
|
|
197
|
+
}
|
|
198
|
+
let text = await res.text();
|
|
199
|
+
// when it finds a line with /* webpackIgnore: true */
|
|
200
|
+
// it also adds /* @vite-ignore */
|
|
201
|
+
text = text.replace(/(\/\* webpackIgnore: true \*\/)/g, '$1 /* @vite-ignore */');
|
|
202
|
+
// if (!text.includes('import.meta.url')) {
|
|
203
|
+
// return text
|
|
204
|
+
// }
|
|
205
|
+
logger.log('transforming', url);
|
|
206
|
+
const transformed = await transform(text, {
|
|
207
|
+
define: {
|
|
208
|
+
'import.meta.url': JSON.stringify(resolved),
|
|
209
|
+
navigator: '__unframerNavigator',
|
|
210
|
+
window: '__unframerWindow',
|
|
211
|
+
},
|
|
212
|
+
// Fix lottie (navigator): https://github.com/airbnb/lottie-web/issues/3047
|
|
213
|
+
// Fix window is undefined errors in SSR/Node environments
|
|
214
|
+
banner: `var __unframerWindow = typeof window !== 'undefined' ? window : undefined; var __unframerNavigator = typeof __unframerWindow !== 'undefined' ? navigator : undefined;`,
|
|
215
|
+
minify: false,
|
|
216
|
+
format: 'esm',
|
|
217
|
+
jsx: 'transform',
|
|
218
|
+
logLevel: 'error',
|
|
219
|
+
loader,
|
|
220
|
+
platform: 'browser',
|
|
221
|
+
});
|
|
222
|
+
// console.log('transformed', resolved)
|
|
223
|
+
return transformed.code;
|
|
224
|
+
});
|
|
225
|
+
if (loader === 'jsx') {
|
|
226
|
+
codeCache.set(url, promise);
|
|
227
|
+
}
|
|
228
|
+
const code = await promise;
|
|
229
|
+
return {
|
|
230
|
+
contents: code,
|
|
231
|
+
loader,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
catch (e) {
|
|
235
|
+
logger.error(e.message);
|
|
236
|
+
notifyError(e);
|
|
237
|
+
process.exit(1);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
return plugin;
|
|
243
|
+
}
|
|
244
|
+
export async function resolveRedirect({ redirectCache, signal, url, }) {
|
|
245
|
+
if (!url) {
|
|
246
|
+
return '';
|
|
247
|
+
}
|
|
248
|
+
url = url.toString();
|
|
249
|
+
if (redirectCache && redirectCache.has(url)) {
|
|
250
|
+
return await redirectCache.get(url);
|
|
251
|
+
}
|
|
252
|
+
// console.time(`resolveRedirect ${url}`)
|
|
253
|
+
const p = recursiveResolveRedirect(url, signal);
|
|
254
|
+
// console.timeEnd(`resolveRedirect ${url}`)
|
|
255
|
+
if (redirectCache) {
|
|
256
|
+
redirectCache.set(url, p);
|
|
257
|
+
}
|
|
258
|
+
return await p;
|
|
259
|
+
}
|
|
260
|
+
export async function recursiveResolveRedirect(url, signal) {
|
|
261
|
+
if (!url) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
let res = await fetchWithRetry(url, {
|
|
265
|
+
redirect: 'manual',
|
|
266
|
+
method: 'HEAD',
|
|
267
|
+
dispatcher,
|
|
268
|
+
signal,
|
|
269
|
+
});
|
|
270
|
+
const loc = res.headers.get('location');
|
|
271
|
+
if (res.status < 400 && res.status >= 300 && loc) {
|
|
272
|
+
// Resolve relative Location headers (e.g. /ogl@1.0.11/src/index.js) against the original URL's origin
|
|
273
|
+
const resolved = new URL(loc, url).toString();
|
|
274
|
+
logger.log('following redirect', resolved);
|
|
275
|
+
return recursiveResolveRedirect(resolved);
|
|
276
|
+
}
|
|
277
|
+
return url;
|
|
278
|
+
}
|
|
279
|
+
let semaphore = new Sema(3);
|
|
280
|
+
let rateLimiter = RateLimit(20, { timeUnit: 1000 });
|
|
281
|
+
export const fetchWithRetry = retryTwice(async (url, options) => {
|
|
282
|
+
await semaphore.acquire();
|
|
283
|
+
const timeout = setTimeout(() => {
|
|
284
|
+
logger.error('fetch taking more than 10s', url);
|
|
285
|
+
}, 10000);
|
|
286
|
+
return await fetch(url, options).finally(() => {
|
|
287
|
+
clearTimeout(timeout);
|
|
288
|
+
semaphore.release();
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
export function retryTwice(fn) {
|
|
292
|
+
return async (...args) => {
|
|
293
|
+
try {
|
|
294
|
+
return await fn(...args);
|
|
295
|
+
}
|
|
296
|
+
catch (e) {
|
|
297
|
+
// ignore abort errors
|
|
298
|
+
if (e.name === 'AbortError') {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
logger.error('retrying', e.message);
|
|
302
|
+
return await fn(...args);
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
export function getPackageName(importPath) {
|
|
307
|
+
// Handle scoped packages
|
|
308
|
+
if (importPath.startsWith('@')) {
|
|
309
|
+
const [scope, rest] = importPath.split('/');
|
|
310
|
+
if (!rest)
|
|
311
|
+
return importPath;
|
|
312
|
+
return `${scope}/${rest.split('/')[0]}`;
|
|
313
|
+
}
|
|
314
|
+
// Handle regular packages
|
|
315
|
+
return importPath.split('/')[0];
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=esbuild.js.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { BuildResult, type BuildOptions } from 'esbuild';
|
|
2
|
+
import { Config } from './cli.js';
|
|
3
|
+
import { ComponentFontBundle } from './css-core.js';
|
|
4
|
+
import type { PropertyControls } from './framer-types.js';
|
|
5
|
+
export type StyleToken = {
|
|
6
|
+
id: string;
|
|
7
|
+
name?: string | null;
|
|
8
|
+
lightColor: string;
|
|
9
|
+
darkColor: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function bundle({ config, cwd: out, watch, signal, metafile }: {
|
|
12
|
+
config: Config;
|
|
13
|
+
cwd: string;
|
|
14
|
+
watch?: boolean;
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
metafile?: boolean;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
result: BundleResult;
|
|
19
|
+
rebuild: () => Promise<BundleResult>;
|
|
20
|
+
buildContext: import("esbuild").BuildContext<{
|
|
21
|
+
absWorkingDir: string;
|
|
22
|
+
entryPoints: {
|
|
23
|
+
in: string;
|
|
24
|
+
out: string;
|
|
25
|
+
}[];
|
|
26
|
+
jsx: "automatic";
|
|
27
|
+
bundle: true;
|
|
28
|
+
platform: "browser";
|
|
29
|
+
metafile: true;
|
|
30
|
+
format: "esm";
|
|
31
|
+
minify: false;
|
|
32
|
+
treeShaking: true;
|
|
33
|
+
splitting: true;
|
|
34
|
+
logLevel: "error";
|
|
35
|
+
pure: string[];
|
|
36
|
+
external: string[];
|
|
37
|
+
chunkNames: string;
|
|
38
|
+
plugins: import("esbuild").Plugin[];
|
|
39
|
+
write: false;
|
|
40
|
+
outdir: string;
|
|
41
|
+
}> | {
|
|
42
|
+
rebuild(): Promise<BuildResult<BuildOptions>>;
|
|
43
|
+
cancel(): void;
|
|
44
|
+
dispose(): void;
|
|
45
|
+
};
|
|
46
|
+
}>;
|
|
47
|
+
export declare function resolvePackageVersion({ cwd, pkg }: {
|
|
48
|
+
cwd: any;
|
|
49
|
+
pkg: any;
|
|
50
|
+
}): Promise<string | undefined>;
|
|
51
|
+
export declare function resolvePackage({ cwd, pkg }: {
|
|
52
|
+
cwd: any;
|
|
53
|
+
pkg: any;
|
|
54
|
+
}): Promise<boolean>;
|
|
55
|
+
export declare function getDarkModeSelector(opts: {
|
|
56
|
+
darkModeType?: 'class' | 'media';
|
|
57
|
+
content: string;
|
|
58
|
+
}): string;
|
|
59
|
+
export declare function getStyleTokensCss(tokens: StyleToken[], darkModeType?: 'class' | 'media'): string;
|
|
60
|
+
export declare function findRelativeLinks(text: string): number[];
|
|
61
|
+
export declare function extractPropControlsUnsafe(filename: any, name: any): Promise<{
|
|
62
|
+
propertyControls?: PropertyControls;
|
|
63
|
+
fonts?: ComponentFontBundle[];
|
|
64
|
+
}>;
|
|
65
|
+
export declare function parsePropertyControls(code: string): string | null;
|
|
66
|
+
type ExtractedTokenInfo = {
|
|
67
|
+
tokenName: string;
|
|
68
|
+
metadata?: Record<string, any>;
|
|
69
|
+
defaultValue: string;
|
|
70
|
+
};
|
|
71
|
+
export declare function extractTokenInfo(code: string): ExtractedTokenInfo[];
|
|
72
|
+
export declare function indentWithTabs(str: string, tabs: string): string;
|
|
73
|
+
export declare function createExampleComponentCode({ outDir, config }: {
|
|
74
|
+
outDir: string;
|
|
75
|
+
config: Config;
|
|
76
|
+
}): Promise<{
|
|
77
|
+
outDirForExample: string;
|
|
78
|
+
exampleCode: string;
|
|
79
|
+
}>;
|
|
80
|
+
type BundleResult = {
|
|
81
|
+
components: Array<{
|
|
82
|
+
componentPathSlug: string;
|
|
83
|
+
name: string;
|
|
84
|
+
url: string;
|
|
85
|
+
componentName: string;
|
|
86
|
+
propertyControls?: PropertyControls;
|
|
87
|
+
}>;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Compares two semantic version strings.
|
|
91
|
+
* Returns true if versionB is greater than versionA.
|
|
92
|
+
* Handles x.y.z, x.y, x, and optional pre-release (-alpha, etc).
|
|
93
|
+
*/
|
|
94
|
+
export declare function isVersionGreater(versionA: string, versionB: string): boolean;
|
|
95
|
+
export {};
|
|
96
|
+
//# sourceMappingURL=exporter.d.ts.map
|