builder.io 1.6.9 → 1.6.12
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/cli/index.cjs +319 -321
- package/cli/index.cjs.map +4 -4
- package/cli/main.cjs +2 -2
- package/core/index.cjs +58 -58
- package/core/index.mjs +58 -58
- package/figma/jsx-runtime/index.d.ts +2 -2
- package/figma/jsx-runtime/prop-types.d.ts +9 -9
- package/figma/jsx-runtime/react.d.ts +101 -105
- package/node/index.cjs +46 -47
- package/node/index.mjs +46 -47
- package/package.json +1 -1
- package/remix/build.cjs +1 -1
- package/remix/index.mjs +1 -1
- package/remix/server-build/index.cjs +3 -3
- package/server/index.cjs +137 -137
- package/server/index.mjs +138 -138
- package/types/_tests_/code.e2e.d.ts +1 -0
- package/types/_tests_/create-builder.e2e.d.ts +1 -0
- package/types/_tests_/figma-generate.e2e.d.ts +1 -0
- package/types/_tests_/figma-publish.e2e.d.ts +1 -0
- package/types/_tests_/help.e2e.d.ts +1 -0
- package/types/_tests_/utils.d.ts +42 -0
- package/types/_tests_/vitest.config.d.ts +2 -0
- package/types/cli/builder-add/options.d.ts +1 -1
- package/types/cli/code-file-utils.d.ts +1 -1
- package/types/cli/code.d.ts +1 -1
- package/types/cli/credentials.d.ts +1 -1
- package/types/cli/figma-publish.d.ts +3 -1
- package/types/cli/generate.d.ts +2 -2
- package/types/cli/index.d.ts +2 -0
- package/types/cli/spinner.d.ts +0 -1
- package/types/cli/track.d.ts +1 -1
- package/types/common/ast/component-input-types.d.ts +1 -1
- package/types/common/builder/builder-api.d.ts +1 -1
- package/types/common/builder/content-generation.d.ts +1 -1
- package/types/common/test-utils.d.ts +1 -1
- package/types/core/adapters/next/next-test-utils.d.ts +5 -5
- package/types/core/adapters/react/react-test-utils.d.ts +2 -2
- package/types/core/adapters/remix/remix-test-utils.d.ts +2 -2
- package/types/figma/index.d.ts +0 -1
- package/types/server/request-handler.d.ts +0 -1
- package/types/tsconfig.tsbuildinfo +1 -0
- package/types/types.d.ts +1 -1
- package/types/vitest.config.d.ts +2 -0
- package/vite/index.cjs +3 -3
- package/vite/index.d.ts +1 -1
- package/vite/index.mjs +3 -3
- package/webpack/index.cjs +1 -1
- package/webpack/index.d.ts +1 -1
- package/webpack/index.mjs +1 -1
- package/types/cli/kv.d.ts +0 -20
- package/types/cli/main.d.cts +0 -2
- package/types/figma/jsx-runtime/index.d.cts +0 -2
- package/types/figma/jsx-runtime/index.d.ts +0 -2
- package/types/next/index.d.cts +0 -4
- package/types/next/index.d.mts +0 -4
- package/types/remix/index-shim.d.cts +0 -2
- /package/types/vite/{index.d.ts → main.d.ts} +0 -0
- /package/types/webpack/{index.d.ts → main.d.ts} +0 -0
package/types/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { spawnSync } from "node:child_process";
|
|
3
2
|
export interface DevToolsPath {
|
|
4
3
|
basename: (path: string, suffix?: string) => string;
|
|
@@ -354,6 +353,7 @@ export interface ComponentInfo {
|
|
|
354
353
|
meta?: Record<string, any>;
|
|
355
354
|
dependencies?: AppDependency[];
|
|
356
355
|
externalImportPath?: string;
|
|
356
|
+
framework: "react" | "angular" | "qwik";
|
|
357
357
|
}
|
|
358
358
|
export interface MinimalComponentInfo {
|
|
359
359
|
filePath: string;
|
package/vite/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`),
|
|
3
|
-
`),r=r.replace(/\\r/g,"\r")),
|
|
1
|
+
"use strict";var x=Object.create;var p=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var b=(e,o)=>{for(var t in o)p(e,t,{get:o[t],enumerable:!0})},u=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of A(o))!S.call(e,s)&&s!==t&&p(e,s,{get:()=>o[s],enumerable:!(n=R(o,s))||n.enumerable});return e};var O=(e,o,t)=>(t=e!=null?x(I(e)):{},u(o||!e||!e.__esModule?p(t,"default",{value:e,enumerable:!0}):t,e)),D=e=>u(p({},"__esModule",{value:!0}),e);var V={};b(V,{builderDevTools:()=>P});module.exports=D(V);var f=require("../core/index.cjs"),_=require("../node/index.cjs"),E=require("../server/index.cjs");async function d(e,o){let t=await e.readFile(o);return typeof t=="string"?$(t):null}function $(e){let o={},t=e.replace(/\r\n?/gm,`
|
|
2
|
+
`),n;for(;(n=h.exec(t))!=null;){let s=n[1],r=n[2]||"";r=r.trim();let c=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),c==='"'&&(r=r.replace(/\\n/g,`
|
|
3
|
+
`),r=r.replace(/\\r/g,"\r")),o[s]=r}return o}var h=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;var T=O(require("path"),1);var g="/~builder-dev-tools.js";function P(e={}){return{name:"vite-plugin-builder-dev-tools",async configureServer(t){if(process.argv.includes("codegen"))return;let n=await(0,_.createDevToolsNodeSys)({cwd:T.default.normalize(t.config.root)}),s=await(0,f.createDevTools)(n),r=await(0,E.createDevToolsServer)({...s,getClientId:()=>"vite-builder-dev-tools",closeAppServer:async()=>{n.debug("close server"),await t?.close()},restartAppServer:async()=>{n.debug("restart server"),await t?.restart()},enableAppWatch:async c=>{if(c){n.debug("enable watch"),t?.watcher.add(t.config.root);let i=n.join(t.config.root,".git"),a=n.join(t.config.root,"node_modules");t?.watcher.unwatch([i,a])}else n.debug("disable watch"),t?.watcher.unwatch(t.config.root);return c},...n,...e});t.watcher.on("change",async c=>{if(c.includes(".env")){let i=await d(n,c);i&&Object.keys(i).forEach(l=>{process.env[l]=i[l]})}}),t.middlewares.use(async(c,i,a)=>{try{let l=i.end;i.end=function(...w){if((i.getHeader("Content-Type")||"").toString().includes("text/html")){let m=new URL(g,r.getUrl());i.write(`<script src="${m}"></script>`)}return l.apply(this,w)},a()}catch(l){a(l)}})}}}0&&(module.exports={builderDevTools});
|
package/vite/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../types/vite";
|
|
1
|
+
export * from "../types/vite/main";
|
package/vite/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{createDevTools as
|
|
3
|
-
`),
|
|
4
|
-
`),
|
|
2
|
+
import{createDevTools as E}from"../core/index.mjs";import{createDevToolsNodeSys as T}from"../node/index.mjs";import{createDevToolsServer as w}from"../server/index.mjs";async function p(s,c){let t=await s.readFile(c);return typeof t=="string"?f(t):null}function f(s){let c={},t=s.replace(/\r\n?/gm,`
|
|
3
|
+
`),e;for(;(e=_.exec(t))!=null;){let a=e[1],o=e[2]||"";o=o.trim();let r=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),r==='"'&&(o=o.replace(/\\n/g,`
|
|
4
|
+
`),o=o.replace(/\\r/g,"\r")),c[a]=o}return c}var _=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;import m from"path";var u="/~builder-dev-tools.js";function h(s={}){return{name:"vite-plugin-builder-dev-tools",async configureServer(t){if(process.argv.includes("codegen"))return;let e=await T({cwd:m.normalize(t.config.root)}),a=await E(e),o=await w({...a,getClientId:()=>"vite-builder-dev-tools",closeAppServer:async()=>{e.debug("close server"),await t?.close()},restartAppServer:async()=>{e.debug("restart server"),await t?.restart()},enableAppWatch:async r=>{if(r){e.debug("enable watch"),t?.watcher.add(t.config.root);let n=e.join(t.config.root,".git"),l=e.join(t.config.root,"node_modules");t?.watcher.unwatch([n,l])}else e.debug("disable watch"),t?.watcher.unwatch(t.config.root);return r},...e,...s});t.watcher.on("change",async r=>{if(r.includes(".env")){let n=await p(e,r);n&&Object.keys(n).forEach(i=>{process.env[i]=n[i]})}}),t.middlewares.use(async(r,n,l)=>{try{let i=n.end;n.end=function(...d){if((n.getHeader("Content-Type")||"").toString().includes("text/html")){let g=new URL(u,o.getUrl());n.write(`<script src="${g}"></script>`)}return i.apply(this,d)},l()}catch(i){l(i)}})}}}export{h as builderDevTools};
|
package/webpack/index.cjs
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
`)?(a--,d===k&&(l+=q)):d===k?l-=p.length-M:(l=M-p.length,d=k),f=N;return}let C=B+a;g(w,b,T,p.slice(M,M+H))&&(T+=H),M+=H,f+=H,d===C?l-=H:(l=-H,d=C),q+=H}}while(o<N);if(M<p.length){let z=M===0?p:p.slice(M),P=B+a;t(z,P,q+(P===d?l:0),w,b,T,S<0?-1:_[S])}f=N},(p,B,q)=>{for(;m.length<p;)m.push(void 0);m[p]=q,s(p,B,q)},(p,B)=>{let q=c.get(B);q===void 0&&(q=c.size,c.set(B,q),i(q,B)),_[p]=q}),y="";for(;u<r.length;u++)y+=r[u].content;let v=A+a,E=be(y);for(let p=0;p<E.length;p++){let B=E[p];t(B,v,O+(v===d?l:0),-1,-1,-1,-1),p===E.length-1&&!B.endsWith(`
|
|
12
12
|
`)?d===v?l+=B.length:(l=B.length,d=v):(a++,v++,l=-O,d=v)}return{generatedLine:v,generatedColumn:O+(v===d?l:0)}}updateHash(e){this._sortReplacements(),e.update("ReplaceSource"),this._source.updateHash(e),e.update(this._name||"");for(let t of this._replacements)e.update(`${t.start}${t.end}${t.content}${t.name}`)}};dt.exports=Oe});var St=j((lr,gt)=>{"use strict";var Is=G(),Ds=fe(),Rs=ee(),{getMap:Ls,getSourceAndMap:Hs}=$(),_t=/\n(?=.|\s)/g,ye=class extends Is{constructor(e,t){super(),this._source=typeof t=="string"||Buffer.isBuffer(t)?new Ds(t,!0):t,this._prefix=e}getPrefix(){return this._prefix}original(){return this._source}source(){let e=this._source.source(),t=this._prefix;return t+e.replace(_t,`
|
|
13
13
|
`+t)}map(e){return Ls(this,e)}sourceAndMap(e){return Hs(this,e)}streamChunks(e,t,s,i){let r=this._prefix,f=r.length,u=!!(e&&e.columns===!1),{generatedLine:h,generatedColumn:o,source:a}=Rs(this._source,e,(l,d,m,c,_,g,A)=>{m!==0?m+=f:l!==void 0?u||c<0?l=r+l:f>0&&(t(r,d,m,-1,-1,-1,-1),m+=f):u||(m+=f),t(l,d,m,c,_,g,A)},s,i);return{generatedLine:h,generatedColumn:o===0?0:f+o,source:a!==void 0?r+a.replace(_t,`
|
|
14
|
-
`+r):void 0}}updateHash(e){e.update("PrefixSource"),this._source.updateHash(e),e.update(this._prefix)}};gt.exports=ye});var At=j((ar,mt)=>{"use strict";var Ps=G(),we=class extends Ps{constructor(e){super(),this._size=e}_error(){return new Error("Content and Map of this Source is not available (only size() is supported)")}size(){return this._size}source(){throw this._error()}buffer(){throw this._error()}map(e){throw this._error()}updateHash(){throw this._error()}};mt.exports=we});var vt=j((hr,Bt)=>{"use strict";var Mt=G(),Te=class n extends Mt{static from(e){return e instanceof Mt?e:new n(e)}constructor(e){super(),this._sourceLike=e}source(){return this._sourceLike.source()}buffer(){return typeof this._sourceLike.buffer=="function"?this._sourceLike.buffer():super.buffer()}size(){return typeof this._sourceLike.size=="function"?this._sourceLike.size():super.size()}map(e){return typeof this._sourceLike.map=="function"?this._sourceLike.map(e):super.map(e)}sourceAndMap(e){return typeof this._sourceLike.sourceAndMap=="function"?this._sourceLike.sourceAndMap(e):super.sourceAndMap(e)}updateHash(e){if(typeof this._sourceLike.updateHash=="function")return this._sourceLike.updateHash(e);if(typeof this._sourceLike.map=="function")throw new Error("A Source-like object with a 'map' method must also provide an 'updateHash' method");e.update(this.buffer())}};Bt.exports=Te});var Ot=j(bt=>{var V=(n,e)=>{let t;Object.defineProperty(bt,n,{get:()=>(e!==void 0&&(t=e(),e=void 0),t),configurable:!0})};V("Source",()=>G());V("RawSource",()=>fe());V("OriginalSource",()=>We());V("SourceMapSource",()=>st());V("CachedSource",()=>ft());V("ConcatSource",()=>lt());V("ReplaceSource",()=>pt());V("PrefixSource",()=>St());V("SizeOnlySource",()=>At());V("CompatSource",()=>vt())});var Gs={};Rt(Gs,{BuilderDevToolsPlugin:()=>Ce});module.exports=Ht(Gs);var wt=Lt(Ot(),1),de=require("
|
|
14
|
+
`+r):void 0}}updateHash(e){e.update("PrefixSource"),this._source.updateHash(e),e.update(this._prefix)}};gt.exports=ye});var At=j((ar,mt)=>{"use strict";var Ps=G(),we=class extends Ps{constructor(e){super(),this._size=e}_error(){return new Error("Content and Map of this Source is not available (only size() is supported)")}size(){return this._size}source(){throw this._error()}buffer(){throw this._error()}map(e){throw this._error()}updateHash(){throw this._error()}};mt.exports=we});var vt=j((hr,Bt)=>{"use strict";var Mt=G(),Te=class n extends Mt{static from(e){return e instanceof Mt?e:new n(e)}constructor(e){super(),this._sourceLike=e}source(){return this._sourceLike.source()}buffer(){return typeof this._sourceLike.buffer=="function"?this._sourceLike.buffer():super.buffer()}size(){return typeof this._sourceLike.size=="function"?this._sourceLike.size():super.size()}map(e){return typeof this._sourceLike.map=="function"?this._sourceLike.map(e):super.map(e)}sourceAndMap(e){return typeof this._sourceLike.sourceAndMap=="function"?this._sourceLike.sourceAndMap(e):super.sourceAndMap(e)}updateHash(e){if(typeof this._sourceLike.updateHash=="function")return this._sourceLike.updateHash(e);if(typeof this._sourceLike.map=="function")throw new Error("A Source-like object with a 'map' method must also provide an 'updateHash' method");e.update(this.buffer())}};Bt.exports=Te});var Ot=j(bt=>{var V=(n,e)=>{let t;Object.defineProperty(bt,n,{get:()=>(e!==void 0&&(t=e(),e=void 0),t),configurable:!0})};V("Source",()=>G());V("RawSource",()=>fe());V("OriginalSource",()=>We());V("SourceMapSource",()=>st());V("CachedSource",()=>ft());V("ConcatSource",()=>lt());V("ReplaceSource",()=>pt());V("PrefixSource",()=>St());V("SizeOnlySource",()=>At());V("CompatSource",()=>vt())});var Gs={};Rt(Gs,{BuilderDevToolsPlugin:()=>Ce});module.exports=Ht(Gs);var wt=Lt(Ot(),1),de=require("path"),Q=require("fs"),Tt=require("../core/index.cjs"),Ct=require("../node/index.cjs"),zt=require("../server/index.cjs");var yt="BuilderDevToolsPlugin",he=null;async function Ws(n){let e=await(0,Ct.createDevToolsNodeSys)({cwd:process.cwd()});e.debug("webpack setupDevTools init");let t=await(0,Tt.createDevTools)(e),s=await(0,zt.createDevToolsServer)({...t,getClientId:()=>"webpack-builder-dev-tools",closeAppServer:async()=>{},restartAppServer:async()=>{e.debug("restart server");let i=["next.config.js","next.config.ts","next.config.mjs","webpack.config.js","webpack.config.ts"].map(r=>(0,de.join)(e.getAppRootDir(),r));for(let r of i)if((0,Q.existsSync)(r)){e.debug(`restart server: ${r}`),(0,Q.writeFileSync)(r,(0,Q.readFileSync)(r,{encoding:"utf-8"})),await new Promise(f=>setTimeout(f,50));return}},enableAppWatch:async i=>i,...e,...n});return e.debug("webpack setupDevTools done"),{server:s,sys:e}}var Ce=class{constructor(e){Ee(this,"opts");this.opts=e||{},typeof this.opts.enabled!="boolean"&&(this.opts.enabled=process.env.NODE_ENV!=="production"),this.opts.enabled&&he==null&&(he=Ws(this.opts))}apply(e){if(this.opts.enabled===!1)return;let t=e,s=t.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,i=new WeakMap;t.hooks.compilation.tap(yt,r=>{r.hooks.processAssets.tapAsync({name:yt,stage:s},async(f,u)=>{if(he!=null){for(let h of r.chunks)for(let o of h.files){let a=(0,de.basename)(o),{server:l,sys:d}=await he;if(d.getFrameworks().some(A=>A.name==="next")&&a!=="webpack.js")continue;d.getAppRootDir=()=>t.context;let m=new URL("/~builder-dev-tools.js",l.getUrl()),c=`
|
|
15
15
|
;
|
|
16
16
|
/* Builder Devtools (Webpack) */
|
|
17
17
|
`;c+=`(() => {
|
package/webpack/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../types/webpack";
|
|
1
|
+
export * from "../types/webpack/main";
|
package/webpack/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ var wt=Object.create;var ae=Object.defineProperty;var Tt=Object.getOwnPropertyDe
|
|
|
12
12
|
`)?(a--,d===k&&(l+=q)):d===k?l-=p.length-M:(l=M-p.length,d=k),f=N;return}let C=B+a;g(w,b,T,p.slice(M,M+H))&&(T+=H),M+=H,f+=H,d===C?l-=H:(l=-H,d=C),q+=H}}while(o<N);if(M<p.length){let z=M===0?p:p.slice(M),P=B+a;t(z,P,q+(P===d?l:0),w,b,T,S<0?-1:_[S])}f=N},(p,B,q)=>{for(;m.length<p;)m.push(void 0);m[p]=q,s(p,B,q)},(p,B)=>{let q=c.get(B);q===void 0&&(q=c.size,c.set(B,q),i(q,B)),_[p]=q}),y="";for(;u<r.length;u++)y+=r[u].content;let v=A+a,E=Be(y);for(let p=0;p<E.length;p++){let B=E[p];t(B,v,O+(v===d?l:0),-1,-1,-1,-1),p===E.length-1&&!B.endsWith(`
|
|
13
13
|
`)?d===v?l+=B.length:(l=B.length,d=v):(a++,v++,l=-O,d=v)}return{generatedLine:v,generatedColumn:O+(v===d?l:0)}}updateHash(e){this._sortReplacements(),e.update("ReplaceSource"),this._source.updateHash(e),e.update(this._name||"");for(let t of this._replacements)e.update(`${t.start}${t.end}${t.content}${t.name}`)}};ot.exports=ve});var dt=j((lr,ht)=>{"use strict";var zs=G(),Es=ie(),qs=Y(),{getMap:Ns,getSourceAndMap:js}=$(),at=/\n(?=.|\s)/g,be=class extends zs{constructor(e,t){super(),this._source=typeof t=="string"||Buffer.isBuffer(t)?new Es(t,!0):t,this._prefix=e}getPrefix(){return this._prefix}original(){return this._source}source(){let e=this._source.source(),t=this._prefix;return t+e.replace(at,`
|
|
14
14
|
`+t)}map(e){return Ns(this,e)}sourceAndMap(e){return js(this,e)}streamChunks(e,t,s,i){let r=this._prefix,f=r.length,u=!!(e&&e.columns===!1),{generatedLine:h,generatedColumn:o,source:a}=qs(this._source,e,(l,d,m,c,_,g,A)=>{m!==0?m+=f:l!==void 0?u||c<0?l=r+l:f>0&&(t(r,d,m,-1,-1,-1,-1),m+=f):u||(m+=f),t(l,d,m,c,_,g,A)},s,i);return{generatedLine:h,generatedColumn:o===0?0:f+o,source:a!==void 0?r+a.replace(at,`
|
|
15
|
-
`+r):void 0}}updateHash(e){e.update("PrefixSource"),this._source.updateHash(e),e.update(this._prefix)}};ht.exports=be});var _t=j((ar,pt)=>{"use strict";var xs=G(),Oe=class extends xs{constructor(e){super(),this._size=e}_error(){return new Error("Content and Map of this Source is not available (only size() is supported)")}size(){return this._size}source(){throw this._error()}buffer(){throw this._error()}map(e){throw this._error()}updateHash(){throw this._error()}};pt.exports=Oe});var mt=j((hr,St)=>{"use strict";var gt=G(),ye=class n extends gt{static from(e){return e instanceof gt?e:new n(e)}constructor(e){super(),this._sourceLike=e}source(){return this._sourceLike.source()}buffer(){return typeof this._sourceLike.buffer=="function"?this._sourceLike.buffer():super.buffer()}size(){return typeof this._sourceLike.size=="function"?this._sourceLike.size():super.size()}map(e){return typeof this._sourceLike.map=="function"?this._sourceLike.map(e):super.map(e)}sourceAndMap(e){return typeof this._sourceLike.sourceAndMap=="function"?this._sourceLike.sourceAndMap(e):super.sourceAndMap(e)}updateHash(e){if(typeof this._sourceLike.updateHash=="function")return this._sourceLike.updateHash(e);if(typeof this._sourceLike.map=="function")throw new Error("A Source-like object with a 'map' method must also provide an 'updateHash' method");e.update(this.buffer())}};St.exports=ye});var Mt=j(At=>{var V=(n,e)=>{let t;Object.defineProperty(At,n,{get:()=>(e!==void 0&&(t=e(),e=void 0),t),configurable:!0})};V("Source",()=>G());V("RawSource",()=>ie());V("OriginalSource",()=>Re());V("SourceMapSource",()=>Ye());V("CachedSource",()=>rt());V("ConcatSource",()=>ut());V("ReplaceSource",()=>lt());V("PrefixSource",()=>dt());V("SizeOnlySource",()=>_t());V("CompatSource",()=>mt())});var bt=jt(Mt(),1);import{basename as ks,join as Is}from"
|
|
15
|
+
`+r):void 0}}updateHash(e){e.update("PrefixSource"),this._source.updateHash(e),e.update(this._prefix)}};ht.exports=be});var _t=j((ar,pt)=>{"use strict";var xs=G(),Oe=class extends xs{constructor(e){super(),this._size=e}_error(){return new Error("Content and Map of this Source is not available (only size() is supported)")}size(){return this._size}source(){throw this._error()}buffer(){throw this._error()}map(e){throw this._error()}updateHash(){throw this._error()}};pt.exports=Oe});var mt=j((hr,St)=>{"use strict";var gt=G(),ye=class n extends gt{static from(e){return e instanceof gt?e:new n(e)}constructor(e){super(),this._sourceLike=e}source(){return this._sourceLike.source()}buffer(){return typeof this._sourceLike.buffer=="function"?this._sourceLike.buffer():super.buffer()}size(){return typeof this._sourceLike.size=="function"?this._sourceLike.size():super.size()}map(e){return typeof this._sourceLike.map=="function"?this._sourceLike.map(e):super.map(e)}sourceAndMap(e){return typeof this._sourceLike.sourceAndMap=="function"?this._sourceLike.sourceAndMap(e):super.sourceAndMap(e)}updateHash(e){if(typeof this._sourceLike.updateHash=="function")return this._sourceLike.updateHash(e);if(typeof this._sourceLike.map=="function")throw new Error("A Source-like object with a 'map' method must also provide an 'updateHash' method");e.update(this.buffer())}};St.exports=ye});var Mt=j(At=>{var V=(n,e)=>{let t;Object.defineProperty(At,n,{get:()=>(e!==void 0&&(t=e(),e=void 0),t),configurable:!0})};V("Source",()=>G());V("RawSource",()=>ie());V("OriginalSource",()=>Re());V("SourceMapSource",()=>Ye());V("CachedSource",()=>rt());V("ConcatSource",()=>ut());V("ReplaceSource",()=>lt());V("PrefixSource",()=>dt());V("SizeOnlySource",()=>_t());V("CompatSource",()=>mt())});var bt=jt(Mt(),1);import{basename as ks,join as Is}from"path";import{existsSync as Ds,readFileSync as Rs,writeFileSync as Ls}from"fs";import{createDevTools as Hs}from"../core/index.mjs";import{createDevToolsNodeSys as Ps}from"../node/index.mjs";import{createDevToolsServer as Ws}from"../server/index.mjs";var Bt="BuilderDevToolsPlugin",le=null;async function Gs(n){let e=await Ps({cwd:process.cwd()});e.debug("webpack setupDevTools init");let t=await Hs(e),s=await Ws({...t,getClientId:()=>"webpack-builder-dev-tools",closeAppServer:async()=>{},restartAppServer:async()=>{e.debug("restart server");let i=["next.config.js","next.config.ts","next.config.mjs","webpack.config.js","webpack.config.ts"].map(r=>Is(e.getAppRootDir(),r));for(let r of i)if(Ds(r)){e.debug(`restart server: ${r}`),Ls(r,Rs(r,{encoding:"utf-8"})),await new Promise(f=>setTimeout(f,50));return}},enableAppWatch:async i=>i,...e,...n});return e.debug("webpack setupDevTools done"),{server:s,sys:e}}var vt=class{constructor(e){we(this,"opts");this.opts=e||{},typeof this.opts.enabled!="boolean"&&(this.opts.enabled=process.env.NODE_ENV!=="production"),this.opts.enabled&&le==null&&(le=Gs(this.opts))}apply(e){if(this.opts.enabled===!1)return;let t=e,s=t.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,i=new WeakMap;t.hooks.compilation.tap(Bt,r=>{r.hooks.processAssets.tapAsync({name:Bt,stage:s},async(f,u)=>{if(le!=null){for(let h of r.chunks)for(let o of h.files){let a=ks(o),{server:l,sys:d}=await le;if(d.getFrameworks().some(A=>A.name==="next")&&a!=="webpack.js")continue;d.getAppRootDir=()=>t.context;let m=new URL("/~builder-dev-tools.js",l.getUrl()),c=`
|
|
16
16
|
;
|
|
17
17
|
/* Builder Devtools (Webpack) */
|
|
18
18
|
`;c+=`(() => {
|
package/types/cli/kv.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
interface KVGetRequest {
|
|
2
|
-
privateKey: string;
|
|
3
|
-
spaceId: string;
|
|
4
|
-
docId: string;
|
|
5
|
-
}
|
|
6
|
-
interface KVPutRequest {
|
|
7
|
-
privateKey: string;
|
|
8
|
-
spaceId: string;
|
|
9
|
-
docId: string;
|
|
10
|
-
/**
|
|
11
|
-
* Must be an object but not an array. TS is a fool sometimes.
|
|
12
|
-
* https://stackoverflow.com/a/70448528/1520787
|
|
13
|
-
*/
|
|
14
|
-
data: Record<string, any> & {
|
|
15
|
-
length?: never;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export declare function putBuilderSpaceKv(kvReq: KVPutRequest): Promise<any>;
|
|
19
|
-
export declare function getBuilderSpaceKv(kvReq: KVGetRequest): Promise<any>;
|
|
20
|
-
export {};
|
package/types/cli/main.d.cts
DELETED
package/types/next/index.d.cts
DELETED
package/types/next/index.d.mts
DELETED
|
File without changes
|
|
File without changes
|