@popmelt.com/core 0.22.1 → 0.24.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 +30 -0
- package/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/claude-plugin/skills/popmelt-core/SKILL.md +1 -0
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/codex-plugin/skills/popmelt-core/SKILL.md +1 -0
- package/dist/ParticipantRuntime-PTBGXKSH.mjs +139 -0
- package/dist/PreviewRuntime-2SCFCGWC.mjs +2 -0
- package/dist/adapter-react-three-fiber.mjs +1 -1
- package/dist/bridge-entry.mjs +86 -89
- package/dist/browser-runtime-3Z4U66AP.mjs +2 -0
- package/dist/browser.d.mts +2 -1
- package/dist/browser.mjs +1 -1
- package/dist/chunk-6URDGUIL.mjs +2 -0
- package/dist/chunk-BYLH3WFB.mjs +2 -0
- package/dist/chunk-C4ONFAGF.mjs +399 -0
- package/dist/{chunk-7Z5QN5LB.mjs → chunk-DHAOAIKK.mjs} +1 -1
- package/dist/{chunk-RILGQYOR.mjs → chunk-EUDGPGCQ.mjs} +1 -1
- package/dist/chunk-EX63NVDN.mjs +2 -0
- package/dist/chunk-J3UIBBU2.mjs +1 -1
- package/dist/chunk-M3HCNQ4T.mjs +250 -0
- package/dist/chunk-N2ZEZCHO.mjs +1 -1
- package/dist/cli.mjs +112 -113
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/media.mjs +1 -1
- package/dist/{options-5yRxW1AX.d.mts → participantBootstrap-Dqu2h47B.d.mts} +22 -1
- package/dist/plugin-astro.d.mts +2 -0
- package/dist/plugin-astro.mjs +3 -3
- package/dist/plugin-nuxt.d.mts +3 -1
- package/dist/plugin-nuxt.mjs +2 -1
- package/dist/plugin-vite.mjs +1 -1
- package/dist/server-T4EMCHVP.mjs +228 -0
- package/dist/server.d.mts +122 -1
- package/dist/server.mjs +96 -90
- package/package.json +1 -1
- package/dist/browser-runtime-Y7W67TJE.mjs +0 -2
- package/dist/chunk-QO2FFOQ4.mjs +0 -448
- package/dist/server-EEFXBJOO.mjs +0 -222
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o,b as d,c as l,d as s}from"./chunk-
|
|
1
|
+
import{a as o,b as d,c as l,d as s}from"./chunk-EUDGPGCQ.mjs";function g(r){let p=r?.basePath??"/popmelt",e={port:null,projectId:null},n="virtual:popmelt/bridge",i=`\0${n}`;return{name:"popmelt",resolveId(t){if(t===n)return i},load(t){if(t===i)return`export const bridgeUrl = ${JSON.stringify(e.port===null?null:`http://localhost:${e.port}`)}; export const projectId = ${JSON.stringify(e.projectId)};`},async configureServer(t){e=await o(r,t,5173),await d(e,t),t.middlewares.use(l(p,()=>e))},transformIndexHtml(){if(e.port!==null)return[{tag:"script",attrs:{type:"text/javascript"},children:s(e),injectTo:"head-prepend"}]}}}export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p}from"./chunk-NOHXTT24.mjs";import{request as c}from"http";function u(){let e=process.env.POPMELT_BRIDGE_URL;if(!e)return null;try{let t=new URL(e);return{port:t.port?Number.parseInt(t.port,10):null,projectId:process.env.POPMELT_PROJECT_ID||null,leaseEligible:!1}}catch{return null}}async function h(e,t,i){let r=u();if(e?.bridge===!1||r)return r??{port:null,projectId:null,leaseEligible:!1};try{let{startPopmelt:o}=await import("./server-
|
|
1
|
+
import{a as p}from"./chunk-NOHXTT24.mjs";import{request as c}from"http";function u(){let e=process.env.POPMELT_BRIDGE_URL;if(!e)return null;try{let t=new URL(e);return{port:t.port?Number.parseInt(t.port,10):null,projectId:process.env.POPMELT_PROJECT_ID||null,leaseEligible:!1}}catch{return null}}async function h(e,t,i){let r=u();if(e?.bridge===!1||r)return r??{port:null,projectId:null,leaseEligible:!1};try{let{startPopmelt:o}=await import("./server-T4EMCHVP.mjs"),n=t.config?.server?.host,l=n===!0?"0.0.0.0":n||"localhost",s=t.config?.server?.port??i,d=`http://${l==="0.0.0.0"?"localhost":l}:${s}`,a=await o({port:e?.port,projectRoot:e?.projectRoot,devOrigin:d,force:!0,detached:!0,manageLease:!1});return console.log(`[popmelt] bridge ready at http://localhost:${a.port}`),{port:a.port,projectId:a.projectId,leaseEligible:!0}}catch(o){let n=o instanceof Error?o.message:String(o);return console.warn("[popmelt] bridge failed to start:",n),{port:null,projectId:null,leaseEligible:!1}}}async function v(e,t,i=fetch){if(!e.leaseEligible||e.port===null)return null;let r=await p({port:e.port,projectId:e.projectId},i);if(!r)return null;let o=()=>{n()},n=async()=>{process.removeListener("beforeExit",o),await r.release()};return process.once("beforeExit",o),t.httpServer?.once("close",()=>{n()}),{id:r.id,release:n}}function g(e,t,i){if(i.port===null)return null;let r=new URL(t,"http://popmelt.local");if(r.pathname!==`${e}/status`)return null;let o=new URL("/status",`http://localhost:${i.port}`);return r.searchParams.forEach((n,l)=>o.searchParams.append(l,n)),i.projectId&&o.searchParams.set("projectId",i.projectId),o}function b(e,t){return(i,r,o)=>{let n=g(e,i.url||"",t());if(!n)return o();let l=c(n,{method:i.method,headers:{...i.headers,host:n.host}},s=>{r.writeHead(s.statusCode||502,s.headers),s.pipe(r)});l.on("error",()=>{r.writeHead(502,{"Content-Type":"text/plain"}),r.end(`Popmelt bridge not running on port ${t().port}`)}),i.pipe(l)}}function P(e){let t=e.port===null?null:`http://localhost:${e.port}`;return`window.__POPMELT_BRIDGE_URL__=${JSON.stringify(t)};window.__POPMELT_PROJECT_ID__=${JSON.stringify(e.projectId)};`}export{h as a,v as b,b as c,P as d};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function t(o){let r=o??(typeof location>"u"?null:location.href);return r!==null&&new URL(r).searchParams.has("__popmelt_code_preview")}function n(o,r){if(o.version!==void 0&&o.version!==1||!o.projectId||!o.revision||r&&r!==o.projectId)throw new Error("Incompatible Popmelt participant bootstrap or project identity.");let e=new URL(o.url);if(e.protocol!=="http:"||!["localhost","127.0.0.1","[::1]"].includes(e.hostname)||e.username||e.password||e.search||e.hash||e.pathname!=="/")throw new Error("Invalid Popmelt participant bridge URL.")}export{t as a,n as b};
|
package/dist/chunk-J3UIBBU2.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{createContext as
|
|
2
|
+
import{createContext as r,useContext as o}from"react";var t=r(null);function n(){let e=o(t);if(!e)throw new Error("usePopmelt must be used within PopmeltProvider");return e}export{t as a,n as b};
|