@devup-api/rsbuild-plugin 0.1.3 → 0.1.5

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/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- var{defineProperty:E,getOwnPropertyNames:K,getOwnPropertyDescriptor:L}=Object,N=Object.prototype.hasOwnProperty;var G=new WeakMap,Q=(x)=>{var P=G.get(x),k;if(P)return P;if(P=E({},"__esModule",{value:!0}),x&&typeof x==="object"||typeof x==="function")K(x).map((R)=>!N.call(P,R)&&E(P,R,{get:()=>x[R],enumerable:!(k=L(x,R))||k.enumerable}));return G.set(x,P),P};var S=(x,P)=>{for(var k in P)E(x,k,{get:P[k],enumerable:!0,configurable:!0,set:(R)=>P[k]=()=>R})};var V={};S(V,{devupApiRsbuildPlugin:()=>J,default:()=>J});module.exports=Q(V);var H=require("node:path"),B=require("@devup-api/generator"),q=require("@devup-api/utils");function J(x){return{name:"devup-api",async setup(P){let k=await q.createTmpDirAsync(x?.tempDir),R=await q.readOpenapiAsync(x?.openapiFile);await q.writeInterfaceAsync(H.join(k,"api.d.ts"),B.generateInterface(R,x));let F=B.createUrlMap(R,x);P.modifyRsbuildConfig((z)=>{if(z.source??={},z.source.define??={},F)z.source.define["process.env.DEVUP_API_URL_MAP"]=JSON.stringify(JSON.stringify(F));return z})}}}
1
+ var{defineProperty:H,getOwnPropertyNames:Q,getOwnPropertyDescriptor:S}=Object,V=Object.prototype.hasOwnProperty;var K=new WeakMap,W=(x)=>{var P=K.get(x),R;if(P)return P;if(P=H({},"__esModule",{value:!0}),x&&typeof x==="object"||typeof x==="function")Q(x).map((k)=>!V.call(P,k)&&H(P,k,{get:()=>x[k],enumerable:!(R=S(x,k))||R.enumerable}));return K.set(x,P),P};var X=(x,P)=>{for(var R in P)H(x,R,{get:P[R],enumerable:!0,configurable:!0,set:(k)=>P[R]=()=>k})};var Y={};X(Y,{devupApiRsbuildPlugin:()=>N,default:()=>N});module.exports=W(Y);var L=require("node:path"),E=require("@devup-api/generator"),q=require("@devup-api/utils");function N(x){return{name:"devup-api",async setup(P){let R=await q.createTmpDirAsync(x?.tempDir),k=q.normalizeOpenapiFiles(x?.openapiFiles),J=await q.readOpenapiAsync(k);await q.writeInterfaceAsync(L.join(R,"api.d.ts"),E.generateInterface(J,x));let G=E.createUrlMap(J,x);P.modifyRsbuildConfig((B)=>{if(B.source??={},B.source.define??={},G&&Object.keys(G).length>0)B.source.define["process.env.DEVUP_API_URL_MAP"]=JSON.stringify(JSON.stringify(G));return B})}}}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{join as B}from"node:path";import{createUrlMap as E,generateInterface as F}from"@devup-api/generator";import{createTmpDirAsync as G,readOpenapiAsync as H,writeInterfaceAsync as J}from"@devup-api/utils";function K(x){return{name:"devup-api",async setup(q){let z=await G(x?.tempDir),R=await H(x?.openapiFile);await J(B(z,"api.d.ts"),F(R,x));let k=E(R,x);q.modifyRsbuildConfig((P)=>{if(P.source??={},P.source.define??={},k)P.source.define["process.env.DEVUP_API_URL_MAP"]=JSON.stringify(JSON.stringify(k));return P})}}}export{K as devupApiRsbuildPlugin,K as default};
1
+ import{join as G}from"node:path";import{createUrlMap as H,generateInterface as J}from"@devup-api/generator";import{createTmpDirAsync as K,normalizeOpenapiFiles as L,readOpenapiAsync as N,writeInterfaceAsync as Q}from"@devup-api/utils";function S(x){return{name:"devup-api",async setup(q){let B=await K(x?.tempDir),E=L(x?.openapiFiles),k=await N(E);await Q(G(B,"api.d.ts"),J(k,x));let R=H(k,x);q.modifyRsbuildConfig((P)=>{if(P.source??={},P.source.define??={},R&&Object.keys(R).length>0)P.source.define["process.env.DEVUP_API_URL_MAP"]=JSON.stringify(JSON.stringify(R));return P})}}}export{S as devupApiRsbuildPlugin,S as default};
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAOtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD,wBAAgB,qBAAqB,CACnC,OAAO,CAAC,EAAE,eAAe,GACxB,aAAa,CA2Bf"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAQtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD,wBAAgB,qBAAqB,CACnC,OAAO,CAAC,EAAE,eAAe,GACxB,aAAa,CA4Bf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devup-api/rsbuild-plugin",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -20,9 +20,9 @@
20
20
  "access": "public"
21
21
  },
22
22
  "dependencies": {
23
- "@devup-api/utils": "0.1.3",
24
- "@devup-api/core": "0.1.3",
25
- "@devup-api/generator": "0.1.3"
23
+ "@devup-api/utils": "0.1.5",
24
+ "@devup-api/core": "0.1.5",
25
+ "@devup-api/generator": "0.1.5"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@rsbuild/core": "*",