@uibot/web-preview 0.0.0-stage → 0.10.1

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.
@@ -0,0 +1,29 @@
1
+ /**
2
+ * assemble — 把打包结果(JS bundle + CSS + 外部依赖 import map)拼成一份自包含、可在
3
+ * sandbox iframe 直渲的 HTML。纯字符串,不碰 FS/网络,易 `bun test`。
4
+ *
5
+ * 相对只接收「浏览器原生可跑」代码的方案,这里把可预览责任从生成端移到宿主
6
+ * (只产浏览器原生可跑的自包含代码);这里接收**真实 ESM 工程**的打包产物,自动拼装。
7
+ */
8
+ export interface AssembleInput {
9
+ /** Bun.build 产出的浏览器 ESM bundle 文本(已内联尽可能多的依赖)。 */
10
+ js: string;
11
+ /** 合并后的 CSS 文本(可选)。 */
12
+ css?: string;
13
+ /**
14
+ * 无法离线解析、走 CDN 的外部依赖 import map(bare specifier → URL)。
15
+ * 为空 → 纯离线 bundle,用严格断网 CSP。
16
+ */
17
+ importMap?: Record<string, string>;
18
+ /** 检测到 Tailwind → 注入 Tailwind browser(Play CDN)。 */
19
+ tailwind?: boolean;
20
+ /** 文档标题。 */
21
+ title?: string;
22
+ /** 挂载根元素 id(默认 root)。 */
23
+ rootId?: string;
24
+ /** 顶部提示(如「dexie 经 esm.sh 加载,需联网」),渲染成可关闭的提示条。 */
25
+ notices?: string[];
26
+ }
27
+ export declare function assemblePreviewHtml(input: AssembleInput): string;
28
+ /** 打包失败时渲染可读错误页(而非白屏)。 */
29
+ export declare function assembleErrorPage(message: string, detail?: string): string;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * detect — 纯函数:从工作区文件清单判断「这是不是一个可构建的前端工程」、
3
+ * 它的根目录在哪、构建入口是哪个文件、是否用了 Tailwind。
4
+ *
5
+ * 设计取向参考 open-design `apps/web/src/components/file-viewer-render-mode.ts`
6
+ * 的「按 source 特征决定渲染策略」,但这里换成「按工程结构决定能否打包预览」。
7
+ * 不读文件内容、不碰文件系统 —— 只对相对路径清单做判断,便于 `bun test`。
8
+ */
9
+ export type PreviewKind = "html" | "dev-server";
10
+ export interface ProjectInfo {
11
+ /** 工程根(相对工作区),顶层工程为 ''。 */
12
+ root: string;
13
+ /** 构建入口(相对工作区):优先 index.html,否则代码入口。 */
14
+ entry: string;
15
+ /** 该工程的 index.html(相对工作区),无则 null。 */
16
+ htmlEntry: string | null;
17
+ /** 代码入口(相对工作区),无则 null。 */
18
+ codeEntry: string | null;
19
+ /** 是否检测到 Tailwind 配置。 */
20
+ needsTailwind: boolean;
21
+ /** html = Bun/srcdoc 快照;dev-server = Vite/Start 开发端口。 */
22
+ previewKind: PreviewKind;
23
+ }
24
+ /**
25
+ * 从被点击的文件向上回溯,找到最近的、含 package.json 的祖先目录作为工程根。
26
+ * 找不到则返回 null(不是一个工程)。
27
+ */
28
+ export declare function findProjectRoot(path: string, files: readonly string[]): string | null;
29
+ /**
30
+ * 给定一个被点击的文件,推断它所属的可构建工程信息。非工程 / 无入口 → null。
31
+ */
32
+ export declare function detectProject(path: string, files: readonly string[]): ProjectInfo | null;
33
+ /** 被点击文件是否落在一个可构建工程内(前端据此决定是否给「预览」分支)。 */
34
+ export declare function isBuildableFile(path: string, files: readonly string[]): boolean;
35
+ /** 被点击文件是否就是工程的构建入口(入口默认进「预览」,其它文件默认进「源码」)。 */
36
+ export declare function isProjectEntry(path: string, files: readonly string[]): boolean;
37
+ /**
38
+ * 浏览器面板默认打开的入口:优先工程 html/代码入口,否则第一个可构建文件对应的 entry。
39
+ * 清单里没有可预览工程时返回 null(空态,而不是随便打开一个源码文件)。
40
+ */
41
+ export declare function findPreviewEntry(files: readonly string[]): string | null;
42
+ /**
43
+ * 从 index.html 文本里抽出 `<script type="module" src="...">` 的本地入口(相对路径)。
44
+ * Vite 工程的 index.html 通常是 `<script type="module" src="/src/main.tsx">`。
45
+ * 返回去掉前导 `/` 与 `./` 的相对 specifier;找不到返回 null。
46
+ */
47
+ export declare function entryFromIndexHtml(html: string): string | null;
@@ -0,0 +1,2 @@
1
+ /** 剥 LLM 偶发包在自包含 HTML 外的非 HTML 外壳。纯字符串,不依赖宿主。 */
2
+ export declare function stripHtmlEnvelope(html: string): string;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Sandbox iframe preview toolkit: CSP presets, head/body injection, the opaque-origin storage
3
+ * shim, the runtime error bridge, project detection, and assembly of a bundled front-end project
4
+ * into one self-contained document. Pure strings: no DOM, filesystem, network or bundler (the host
5
+ * runs the bundler and passes its output to `assemblePreviewHtml`).
6
+ */
7
+ export { type AssembleInput, assembleErrorPage, assemblePreviewHtml, } from "./assemble.js";
8
+ export { detectProject, entryFromIndexHtml, findPreviewEntry, findProjectRoot, isBuildableFile, isProjectEntry, type PreviewKind, type ProjectInfo, } from "./detect.js";
9
+ export { stripHtmlEnvelope } from "./html-envelope.js";
10
+ export { APP_SRCDOC_CSP, buildErrorBridgeScript, cspMetaTag, escapeAttr, escapeHtml, injectBeforeBodyEnd, injectBeforeHeadEnd, NETWORK_PREVIEW_CSP, PREVIEW_ERROR_MESSAGE, SANDBOX_LINK_SHIM_SCRIPT, SANDBOX_SHIM_SCRIPT, SANDBOX_STORAGE_SHIM_SCRIPT, STATIC_SRCDOC_CSP, STRICT_PREVIEW_CSP, } from "./srcdoc.js";
package/dist/index.js ADDED
@@ -0,0 +1,103 @@
1
+ function a(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function x(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function A(t,e){let n=t.toLowerCase(),r=n.indexOf("<body"),s=r>=0?r:n.length,i=n.lastIndexOf("</head>",s-1);if(i>=0)return t.slice(0,i)+e+t.slice(i);if(/<head[^>]*>/i.test(t))return t.replace(/<head[^>]*>/i,(c)=>`${c}${e}`);if(/<html[^>]*>/i.test(t))return t.replace(/<html[^>]*>/i,(c)=>`${c}<head>${e}</head>`);return e+t}function N(t,e){let n=t.toLowerCase(),r=n.lastIndexOf("</html>"),s=r>=0?r:n.length,i=n.lastIndexOf("</body>",s-1);if(i>=0)return t.slice(0,i)+e+t.slice(i);if(/<body[^>]*>/i.test(t))return t.replace(/<body[^>]*>/i,(c)=>`${c}${e}`);return t+e}var y=`<script data-uibot-storage-shim>(function(){
2
+ function makeStore(){
3
+ var data = {};
4
+ var api = {
5
+ getItem: function(k){ return Object.prototype.hasOwnProperty.call(data, k) ? data[k] : null; },
6
+ setItem: function(k, v){ data[k] = String(v); },
7
+ removeItem: function(k){ delete data[k]; },
8
+ clear: function(){ data = {}; },
9
+ key: function(i){ return Object.keys(data)[i] || null; }
10
+ };
11
+ Object.defineProperty(api, 'length', { get: function(){ return Object.keys(data).length; } });
12
+ return api;
13
+ }
14
+ function tryShim(name){
15
+ var works = false;
16
+ try { works = !!window[name] && typeof window[name].getItem === 'function'; void window[name].length; }
17
+ catch (_) { works = false; }
18
+ if (works) return;
19
+ try { Object.defineProperty(window, name, { configurable: true, value: makeStore() }); }
20
+ catch (_) { try { window[name] = makeStore(); } catch (__) {} }
21
+ }
22
+ tryShim('localStorage');
23
+ tryShim('sessionStorage');
24
+ })();</script>`,b=`<script data-uibot-link-shim>(function(){
25
+ document.addEventListener('click', function(e){
26
+ if (!e.target || !(e.target instanceof Element)) return;
27
+ var link = e.target.closest('a[href]');
28
+ if (!link) return;
29
+ var href = link.getAttribute('href');
30
+ if (href === null) return;
31
+ if (href === '' || href.charAt(0) === '#') {
32
+ e.preventDefault();
33
+ if (href === '' || href === '#') { window.scrollTo({ top: 0 }); return; }
34
+ var t = document.getElementById(href.slice(1));
35
+ if (t) t.scrollIntoView();
36
+ } else if (link.getAttribute('target') === '_blank') {
37
+ e.preventDefault();
38
+ try {
39
+ var u = new URL(href, location.href);
40
+ if (u.protocol === 'http:' || u.protocol === 'https:' || u.protocol === 'mailto:') {
41
+ window.open(href, '_blank', 'noopener,noreferrer');
42
+ }
43
+ } catch (_) {}
44
+ }
45
+ });
46
+ })();</script>`,g=y+b,w="uibot:preview-error";function h(){return`<script data-uibot-error-bridge>(function(){
47
+ function show(msg){
48
+ try {
49
+ var bar = document.getElementById('__uibot_err__');
50
+ if (!bar) {
51
+ bar = document.createElement('div');
52
+ bar.id = '__uibot_err__';
53
+ bar.style.cssText = 'position:fixed;left:0;right:0;top:0;z-index:2147483647;max-height:50vh;overflow:auto;'
54
+ + 'background:#7f1d1d;color:#fee2e2;font:12px/1.5 ui-monospace,Menlo,monospace;padding:10px 14px;'
55
+ + 'white-space:pre-wrap;box-shadow:0 2px 8px rgba(0,0,0,.3)';
56
+ (document.body || document.documentElement).appendChild(bar);
57
+ }
58
+ bar.textContent = '预览运行时错误:\\n' + msg;
59
+ } catch (_) {}
60
+ try { if (window.parent && window.parent !== window) window.parent.postMessage({ type: ${JSON.stringify(w)}, message: String(msg) }, '*'); } catch (_) {}
61
+ }
62
+ window.addEventListener('error', function(ev){
63
+ var m = ev && ev.error && ev.error.stack ? ev.error.stack : (ev && ev.message) || 'unknown error';
64
+ show(m);
65
+ });
66
+ window.addEventListener('unhandledrejection', function(ev){
67
+ var r = ev && ev.reason;
68
+ show(r && r.stack ? r.stack : String(r));
69
+ });
70
+ })();</script>`}var B="default-src 'none'; script-src 'none'; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; frame-src 'none'",D="default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline' https:; img-src data: blob: https:; font-src data: https:; connect-src 'none'; frame-src 'none'",d="default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data: blob:; font-src data:; connect-src 'none'; frame-src 'none'",_="default-src 'none'; script-src 'unsafe-inline' https://esm.sh https://cdn.jsdelivr.net; style-src 'unsafe-inline' https:; img-src data: blob: https:; font-src data: https:; connect-src 'none'; frame-src 'none'";function p(t){return`<meta http-equiv="Content-Security-Policy" content="${x(t)}">`}var M="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4";function H(t){let{js:e,css:n="",importMap:r={},tailwind:s=!1,title:i="Preview",rootId:c="root",notices:l=[]}=t,o=Object.keys(r).length>0,R=o||s?_:d,C=o?`<script type="importmap">${JSON.stringify({imports:r})}</script>`:"",j=s?`<script src="${M}"></script>`:"",T=n?`<style>${n}</style>`:"",O=l.length?W(l):"",k=e.replace(/<\/(script)/gi,"<\\/$1").replace(/<!--/g,"<\\!--");return`<!doctype html>
71
+ <html lang="zh-CN">
72
+ <head>
73
+ <meta charset="utf-8" />
74
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
75
+ ${p(R)}
76
+ <title>${a(i)}</title>
77
+ ${g}
78
+ ${h()}
79
+ ${j}
80
+ ${C}
81
+ ${T}
82
+ </head>
83
+ <body>
84
+ ${O}
85
+ <div id="${a(c)}"></div>
86
+ <script type="module">${k}</script>
87
+ </body>
88
+ </html>`}function W(t){return`<div id="__uibot_notice__" style="font:12px/1.5 ui-sans-serif,system-ui;background:#fef3c7;color:#92400e;padding:6px 12px;border-bottom:1px solid #fde68a" onclick="this.remove()" title="点击关闭">⚠ ${t.map((n)=>a(n)).join(" · ")}</div>`}function K(t,e){let n=e?`${t}
89
+
90
+ ${e}`:t;return`<!doctype html>
91
+ <html lang="zh-CN">
92
+ <head>
93
+ <meta charset="utf-8" />
94
+ ${p(d)}
95
+ <title>预览构建失败</title>
96
+ </head>
97
+ <body style="margin:0;font:13px/1.6 ui-monospace,Menlo,monospace;background:#1f2937;color:#fca5a5">
98
+ <div style="padding:16px 18px">
99
+ <div style="color:#fecaca;font-weight:600;margin-bottom:8px">⚠ 预览构建失败</div>
100
+ <pre style="white-space:pre-wrap;margin:0;color:#fda4af">${a(n)}</pre>
101
+ </div>
102
+ </body>
103
+ </html>`}var L=["src/main.tsx","src/main.jsx","src/main.ts","src/main.js","src/index.tsx","src/index.jsx","src/index.ts","src/index.js","src/routes/__root.tsx","src/routes/__root.jsx","main.tsx","main.jsx","index.tsx","index.jsx"],V=/(^|\/)tailwind\.config\.(?:js|ts|cjs|mjs)$/i,F=/(^|\/)vite\.config\.(?:js|ts|mjs|cjs|mts)$/i,G=/(^|\/)src\/routes\/__root\.(?:tsx|jsx|ts|js)$/i,X=/(^|\/)app\.config\.(?:js|ts|mjs)$/i;function S(t){let e=t.lastIndexOf("/");return e<0?"":t.slice(0,e)}function u(t,e){return t?`${t}/${e}`:e}function v(t,e){return e===""?!0:t===e||t.startsWith(`${e}/`)}function I(t,e){let n=new Set(e),r=S(t);for(;;){if(n.has(u(r,"package.json")))return r;if(r==="")return null;r=S(r)}}function f(t,e){let n=I(t,e);if(n===null)return null;let r=new Set(e),s=r.has(u(n,"index.html"))?u(n,"index.html"):null,i=null;for(let o of L){let m=u(n,o);if(r.has(m)){i=m;break}}if(!s&&!i)return null;let c=e.some((o)=>v(o,n)&&V.test(o)),l=e.some((o)=>v(o,n)&&(F.test(o)||G.test(o)||X.test(o)))?"dev-server":"html";return{root:n,entry:s??i,htmlEntry:s,codeEntry:i,needsTailwind:c,previewKind:l}}function z(t,e){return f(t,e)!==null}function P(t,e){let n=f(t,e);if(!n)return!1;return t===n.htmlEntry||t===n.codeEntry}function J(t){let e=t.find((n)=>P(n,t));if(e)return e;for(let n of t){let r=f(n,t);if(r)return r.entry}return t.find((n)=>/(^|\/)index\.html?$/i.test(n))??t.find((n)=>/\.html?$/i.test(n))??null}function q(t){let n=/<script\b[^>]*\btype\s*=\s*["']module["'][^>]*\bsrc\s*=\s*["']([^"']+)["']/i.exec(t);if(!n){let s=/<script\b[^>]*\bsrc\s*=\s*["']([^"']+)["'][^>]*\btype\s*=\s*["']module["']/i.exec(t);if(!s)return null;return E(s[1])}return E(n[1])}function E(t){if(/^(?:https?:)?\/\//i.test(t))return null;return t.replace(/^\.?\//,"")}function U(t){let e=t.trim(),r=/^```[a-zA-Z]*\n([\s\S]*?)\n?```$/.exec(e);if(r?.[1])e=r[1].trim();if(e.startsWith("<![CDATA[")&&e.endsWith("]]>"))e=e.slice(9,-3).trim();return e}export{D as APP_SRCDOC_CSP,_ as NETWORK_PREVIEW_CSP,w as PREVIEW_ERROR_MESSAGE,b as SANDBOX_LINK_SHIM_SCRIPT,g as SANDBOX_SHIM_SCRIPT,y as SANDBOX_STORAGE_SHIM_SCRIPT,B as STATIC_SRCDOC_CSP,d as STRICT_PREVIEW_CSP,K as assembleErrorPage,H as assemblePreviewHtml,h as buildErrorBridgeScript,p as cspMetaTag,f as detectProject,q as entryFromIndexHtml,x as escapeAttr,a as escapeHtml,J as findPreviewEntry,I as findProjectRoot,N as injectBeforeBodyEnd,A as injectBeforeHeadEnd,z as isBuildableFile,P as isProjectEntry,U as stripHtmlEnvelope};
@@ -0,0 +1,55 @@
1
+ /**
2
+ * srcdoc — sandbox iframe 预览的 HTML 包装与注入工具(纯字符串,易 `bun test`)。
3
+ *
4
+ * 移植自 open-design `apps/web/src/runtime/srcdoc.ts`(Apache-2.0),裁剪到本项目所需:
5
+ * - injectBeforeHeadEnd / injectBeforeBodyEnd:字符串优先的稳健插入(跳过 <script>/<style>
6
+ * 里的 </head>/</body> 字面量),不依赖 DOMParser(后端 Bun 无 DOM)。
7
+ * - SANDBOX_SHIM_SCRIPT:opaque-origin sandbox 下 localStorage/sessionStorage 的内存垫片
8
+ * —— 否则 `useState(() => localStorage.getItem(...))` 这类首屏读会抛 SecurityError 直接白屏。
9
+ * - buildErrorBridgeScript:捕获运行时错误 + unhandledrejection,在 iframe 内渲染可读错误条
10
+ * (而非白屏),并 postMessage 回宿主。这是 open-design / Claude 都没有的「不白屏」增强。
11
+ * 去掉了 deck/comment/inspect/palette/edit 等设计工具专用桥(本项目用不到)。
12
+ */
13
+ export declare function escapeHtml(value: string): string;
14
+ export declare function escapeAttr(value: string): string;
15
+ /**
16
+ * 在真实 </head> 前插入 payload(字符串优先:定位 <body> 之前最后一个 </head>,
17
+ * 跳过 script/style 里的字面量)。无 head → 退化到 <head>/前置。
18
+ */
19
+ export declare function injectBeforeHeadEnd(doc: string, payload: string): string;
20
+ /** 在真实 </body> 前插入 payload(字符串优先)。无 body → 追加到末尾。 */
21
+ export declare function injectBeforeBodyEnd(doc: string, payload: string): string;
22
+ /**
23
+ * opaque-origin sandbox(allow-scripts 无 allow-same-origin)下 Web Storage 会抛 SecurityError。
24
+ * 在任何用户脚本前装一个同源内存垫片,让读 localStorage 的代码优雅降级(刷新不持久而已)。
25
+ * 同时拦截 `#anchor` 与 `target=_blank` 链接,避免沙箱内导航异常。
26
+ */
27
+ export declare const SANDBOX_STORAGE_SHIM_SCRIPT = "<script data-uibot-storage-shim>(function(){\n function makeStore(){\n var data = {};\n var api = {\n getItem: function(k){ return Object.prototype.hasOwnProperty.call(data, k) ? data[k] : null; },\n setItem: function(k, v){ data[k] = String(v); },\n removeItem: function(k){ delete data[k]; },\n clear: function(){ data = {}; },\n key: function(i){ return Object.keys(data)[i] || null; }\n };\n Object.defineProperty(api, 'length', { get: function(){ return Object.keys(data).length; } });\n return api;\n }\n function tryShim(name){\n var works = false;\n try { works = !!window[name] && typeof window[name].getItem === 'function'; void window[name].length; }\n catch (_) { works = false; }\n if (works) return;\n try { Object.defineProperty(window, name, { configurable: true, value: makeStore() }); }\n catch (_) { try { window[name] = makeStore(); } catch (__) {} }\n }\n tryShim('localStorage');\n tryShim('sessionStorage');\n})();</script>";
28
+ /** Keeps `#anchor` and `target=_blank` links working inside the sandbox. */
29
+ export declare const SANDBOX_LINK_SHIM_SCRIPT = "<script data-uibot-link-shim>(function(){\n document.addEventListener('click', function(e){\n if (!e.target || !(e.target instanceof Element)) return;\n var link = e.target.closest('a[href]');\n if (!link) return;\n var href = link.getAttribute('href');\n if (href === null) return;\n if (href === '' || href.charAt(0) === '#') {\n e.preventDefault();\n if (href === '' || href === '#') { window.scrollTo({ top: 0 }); return; }\n var t = document.getElementById(href.slice(1));\n if (t) t.scrollIntoView();\n } else if (link.getAttribute('target') === '_blank') {\n e.preventDefault();\n try {\n var u = new URL(href, location.href);\n if (u.protocol === 'http:' || u.protocol === 'https:' || u.protocol === 'mailto:') {\n window.open(href, '_blank', 'noopener,noreferrer');\n }\n } catch (_) {}\n }\n });\n})();</script>";
30
+ /** Storage shim plus link handling; hosts with their own link interception use the storage shim alone. */
31
+ export declare const SANDBOX_SHIM_SCRIPT: string;
32
+ /** `type` of the message the error bridge posts to the parent: `{ type, message }`. */
33
+ export declare const PREVIEW_ERROR_MESSAGE = "uibot:preview-error";
34
+ /**
35
+ * 运行时错误捕获桥:onerror + unhandledrejection → 在 iframe 顶部渲染红色错误条(不白屏)
36
+ * + postMessage({type:'uibot:preview-error', message}) 回宿主(宿主可上报/提示)。
37
+ */
38
+ export declare function buildErrorBridgeScript(): string;
39
+ /**
40
+ * AppFrame 静态 srcdoc lane:比 STRICT_PREVIEW_CSP 更严(script-src 'none')。
41
+ * 生成幻灯/静态 HTML 不允许执行脚本;connect-src 仍 'none'。
42
+ */
43
+ export declare const STATIC_SRCDOC_CSP = "default-src 'none'; script-src 'none'; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; frame-src 'none'";
44
+ /**
45
+ * AppFrame 交互式 appMode srcdoc:放开内联 script/style,仍 connect-src 'none' 断网。
46
+ */
47
+ export declare const APP_SRCDOC_CSP = "default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline' https:; img-src data: blob: https:; font-src data: https:; connect-src 'none'; frame-src 'none'";
48
+ /** 严格档:纯静态 HTML(无外部依赖、断网),仅放开内联 style。 */
49
+ export declare const STRICT_PREVIEW_CSP = "default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data: blob:; font-src data:; connect-src 'none'; frame-src 'none'";
50
+ /**
51
+ * 联网档:bundle 含 import map(esm.sh)或 Tailwind CDN 时用。放开 esm.sh / jsdelivr 的脚本与样式,
52
+ * 但 **connect-src 'none' 仍断 fetch/xhr/beacon**(禁运行时外泄),img/font 放开 https 便于 CDN 资源。
53
+ */
54
+ export declare const NETWORK_PREVIEW_CSP: string;
55
+ export declare function cspMetaTag(csp: string): string;
package/package.json CHANGED
@@ -1,6 +1,34 @@
1
1
  {
2
2
  "name": "@uibot/web-preview",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.10.1",
4
+ "license": "MIT",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/Foundj/uibot.git",
8
+ "directory": "packages/web-preview"
9
+ },
10
+ "type": "module",
11
+ "main": "./dist/index.js",
12
+ "module": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "!dist/**/*.map",
23
+ "!dist/**/*.test.d.ts",
24
+ "!dist/**/*.spec.d.ts"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "scripts": {
30
+ "build": "rm -rf dist tsconfig.tsbuildinfo && bun build --minify ./src/index.ts --outdir ./dist --format esm --target browser && bun x tsc -b",
31
+ "typecheck": "bun x tsc -p tsconfig.json --noEmit",
32
+ "test": "bun test"
33
+ }
34
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.