@flatjs/evolve 3.0.8 → 3.0.10

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.
@@ -6,6 +6,10 @@ export declare const moduleName = "@flatjs/evolve";
6
6
  * flatjs-evolve.config.ts,.mjs,.mts
7
7
  */
8
8
  export declare const configFileName = "flatjs-evolve";
9
+ /**
10
+ * The name of the environment variables injected into the html template.
11
+ */
12
+ export declare const envVariablesName = "GLOBAL_ENV_VARIABLES";
9
13
  /**
10
14
  * `viewport.js`, Used to support the mobile `rem` adaptive solution.
11
15
  * The viewport code is dynamically inserted to `html` file via `html-plugin`
package/dist/constants.js CHANGED
@@ -1 +1 @@
1
- import process from"node:process";export const moduleName="@flatjs/evolve";export const configFileName="flatjs-evolve";export const viewportScripts='(function(d){var j;var b=1;var i=1;var h=750;var c=100;function e(s,o){var q=d.document;var l=q.documentElement;var k=navigator.userAgent;var m=k.toLowerCase().indexOf("android")>-1;i=d.devicePixelRatio||1;if(i>3){i=3}if(m){i=1}console.log("current devicePixelRatio:",i);l.setAttribute("data-dpr",i.toString());var p=q.querySelector(\'meta[name="viewport"]\');if(!p){b=1/i;p=q.createElement("meta");p.setAttribute("name","viewport");q.head.appendChild(p);p.setAttribute(["content","width=device-width,user-scalable=no,initial-scale=",b,",maximum-scale=",b,",minimum-scale=",b].join(""))}function n(){var t=document.documentElement.clientWidth;j=t/o*(s/i)*i;q.documentElement.style.fontSize=String(j)+"px"}var r;d.addEventListener("resize",function(){clearTimeout(r);r=setTimeout(n,300)},false);d.addEventListener("onload",n,false);n()}e(c,h);window.fabricViewport={currRem:j,currDpr:i,currScale:b,dpiPX2px:function f(k){return parseFloat(k.toString())/j*100+"px"},px2DPIpx:function a(k){return parseFloat(k.toString())/100*j+"px"},px2rem:function g(k){return parseFloat(k.toString())/100+"rem"}}})(window);';export const polyfill=[{id:"polyfill.io/v3/polyfill.min.js",src:"https://polyfill.io/v3/polyfill.min.js?features=Array.from%2CArray.isArray%2CArray.of%2CArray.prototype.entries%2CArray.prototype.every%2CArray.prototype.fill%2CArray.prototype.filter%2CArray.prototype.find%2CArray.prototype.findIndex%2CArray.prototype.flat%2CArray.prototype.forEach%2CArray.prototype.flatMap%2CArray.prototype.keys%2CArray.prototype.indexOf%2CArray.prototype.includes%2CArray.prototype.lastIndexOf%2CArray.prototype.map%2CArray.prototype.reduce%2CArray.prototype.reduceRight%2CArray.prototype.some%2CArray.prototype.sort%2CArray.prototype.values%2CArrayBuffer%2CBlob%2CDataView%2CDate.now%2CObject.assign%2CObject.create%2CObject.defineProperties%2CObject.defineProperty%2CObject.entries%2CObject.freeze%2CObject.fromEntries%2CObject.getOwnPropertySymbols%2CObject.getOwnPropertyNames%2CObject.getOwnPropertyDescriptors%2CObject.getOwnPropertyDescriptor%2CObject.getPrototypeOf%2CObject.is%2CObject.isExtensible%2CObject.isFrozen%2CObject.isSealed%2CObject.keys%2CObject.values%2CObject.setPrototypeOf%2CPromise%2CPromise.prototype.finally%2CReflect%2CReflect.apply%2CReflect.construct%2CReflect.defineProperty%2CReflect.deleteProperty%2CReflect.getPrototypeOf%2CReflect.getOwnPropertyDescriptor%2CReflect.get%2CReflect.ownKeys%2CReflect.isExtensible%2CReflect.has%2CReflect.preventExtensions%2CReflect.set%2CReflect.setPrototypeOf%2CSet%2CString.prototype.trimStart%2CString.prototype.trimEnd%2CString.prototype.trim%2CString.prototype.startsWith%2CString.prototype.repeat%2CString.prototype.replaceAll%2CString.prototype.padStart%2CString.prototype.padEnd%2CMap%2CObject.seal%2Cconsole.groupEnd%2Cconsole.group",position:"end",order:-1}];export const devReactFastRefresh={runtime:"reactRefreshRuntime",reactRefreshSetup:"reactRefreshSetup"};export const ignoreEntryOptionKeys=["title"];export const webpackStatsDir=".cache/stats";export const buildProgressSpinnerFrames="win32"===process.platform?["-","\\","|","/"]:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];export const defaultExtractionRule=["(?:https?:)?\\/\\/(?:[\\w-]+@)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}(?::\\d+)?","(?:https?:)?\\/\\/\\d{1,3}(?:\\.\\d{1,3}){3}(?::\\d+)?"];
1
+ import process from"node:process";export const moduleName="@flatjs/evolve";export const configFileName="flatjs-evolve";export const envVariablesName="GLOBAL_ENV_VARIABLES";export const viewportScripts='(function(d){var j;var b=1;var i=1;var h=750;var c=100;function e(s,o){var q=d.document;var l=q.documentElement;var k=navigator.userAgent;var m=k.toLowerCase().indexOf("android")>-1;i=d.devicePixelRatio||1;if(i>3){i=3}if(m){i=1}console.log("current devicePixelRatio:",i);l.setAttribute("data-dpr",i.toString());var p=q.querySelector(\'meta[name="viewport"]\');if(!p){b=1/i;p=q.createElement("meta");p.setAttribute("name","viewport");q.head.appendChild(p);p.setAttribute(["content","width=device-width,user-scalable=no,initial-scale=",b,",maximum-scale=",b,",minimum-scale=",b].join(""))}function n(){var t=document.documentElement.clientWidth;j=t/o*(s/i)*i;q.documentElement.style.fontSize=String(j)+"px"}var r;d.addEventListener("resize",function(){clearTimeout(r);r=setTimeout(n,300)},false);d.addEventListener("onload",n,false);n()}e(c,h);window.fabricViewport={currRem:j,currDpr:i,currScale:b,dpiPX2px:function f(k){return parseFloat(k.toString())/j*100+"px"},px2DPIpx:function a(k){return parseFloat(k.toString())/100*j+"px"},px2rem:function g(k){return parseFloat(k.toString())/100+"rem"}}})(window);';export const polyfill=[{id:"polyfill.io/v3/polyfill.min.js",src:"https://polyfill.io/v3/polyfill.min.js?features=Array.from%2CArray.isArray%2CArray.of%2CArray.prototype.entries%2CArray.prototype.every%2CArray.prototype.fill%2CArray.prototype.filter%2CArray.prototype.find%2CArray.prototype.findIndex%2CArray.prototype.flat%2CArray.prototype.forEach%2CArray.prototype.flatMap%2CArray.prototype.keys%2CArray.prototype.indexOf%2CArray.prototype.includes%2CArray.prototype.lastIndexOf%2CArray.prototype.map%2CArray.prototype.reduce%2CArray.prototype.reduceRight%2CArray.prototype.some%2CArray.prototype.sort%2CArray.prototype.values%2CArrayBuffer%2CBlob%2CDataView%2CDate.now%2CObject.assign%2CObject.create%2CObject.defineProperties%2CObject.defineProperty%2CObject.entries%2CObject.freeze%2CObject.fromEntries%2CObject.getOwnPropertySymbols%2CObject.getOwnPropertyNames%2CObject.getOwnPropertyDescriptors%2CObject.getOwnPropertyDescriptor%2CObject.getPrototypeOf%2CObject.is%2CObject.isExtensible%2CObject.isFrozen%2CObject.isSealed%2CObject.keys%2CObject.values%2CObject.setPrototypeOf%2CPromise%2CPromise.prototype.finally%2CReflect%2CReflect.apply%2CReflect.construct%2CReflect.defineProperty%2CReflect.deleteProperty%2CReflect.getPrototypeOf%2CReflect.getOwnPropertyDescriptor%2CReflect.get%2CReflect.ownKeys%2CReflect.isExtensible%2CReflect.has%2CReflect.preventExtensions%2CReflect.set%2CReflect.setPrototypeOf%2CSet%2CString.prototype.trimStart%2CString.prototype.trimEnd%2CString.prototype.trim%2CString.prototype.startsWith%2CString.prototype.repeat%2CString.prototype.replaceAll%2CString.prototype.padStart%2CString.prototype.padEnd%2CMap%2CObject.seal%2Cconsole.groupEnd%2Cconsole.group",position:"end",order:-1}];export const devReactFastRefresh={runtime:"reactRefreshRuntime",reactRefreshSetup:"reactRefreshSetup"};export const ignoreEntryOptionKeys=["title"];export const webpackStatsDir=".cache/stats";export const buildProgressSpinnerFrames="win32"===process.platform?["-","\\","|","/"]:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];export const defaultExtractionRule=["(?:https?:)?\\/\\/(?:[\\w-]+@)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}(?::\\d+)?","(?:https?:)?\\/\\/\\d{1,3}(?:\\.\\d{1,3}){3}(?::\\d+)?"];
@@ -1 +1 @@
1
- import CaseSensitivePathsPlugin from"case-sensitive-paths-webpack-plugin";import{logger}from"@flatjs/common";import{RsdoctorRspackPlugin}from"@rsdoctor/rspack-plugin";import rspack from"@rspack/core";import ReactRefreshPlugin from"@rspack/plugin-react-refresh";import{assertChunkFilename}from"../../helpers/assert-chunk-filename.js";import{enableBundleHashNameForModule}from"../../helpers/enable-bundle-hashname-for-module.js";import{getBundleFileName}from"../../helpers/get-bundle-file-name.js";import{shouldEnableReactFastRefresh}from"../../helpers/should-enable-react-fast-refresh.js";import{createCircularDependencyRspackPlugins}from"../../plugins/rspack/circular-dependency-plugin/index.js";import{createBuiltinDefineVariablesRspackPlugins}from"../../plugins/rspack/define-variable/index.js";import{createModuleFederationRspackPlugins}from"../../plugins/rspack/module-federation/index.js";import{createHtmlRspackPlugins}from"../../plugins/rspack/multi-html/index.js";import{createProgressRspackPlugins}from"../../plugins/rspack/progress-plugin/index.js";import{createCleanWebpackPlugins}from"../../plugins/webpack/clean-webpack/index.js";import{createCodeCheckerWebpackPlugins}from"../../plugins/webpack/code-checker/index.js";import{createStatsWebpackPlugins}from"../../plugins/webpack/stats-webpack/index.js";export const createRspackPlugins=async(e,s,a,r)=>{const n=s[0],[i,l]=n,c=enableBundleHashNameForModule(a,l?.options),o=[...createProgressRspackPlugins(e,s),new rspack.IgnorePlugin({resourceRegExp:/\.d\.[cm]ts$/}),new CaseSensitivePathsPlugin,...createCircularDependencyRspackPlugins(e,a),new rspack.CssExtractRspackPlugin({filename:`[name]/${getBundleFileName("css",e,c)}`,chunkFilename:assertChunkFilename(a,n,"css")}),...await createBuiltinDefineVariablesRspackPlugins(e,a),...createCleanWebpackPlugins(e,s,a),...createModuleFederationRspackPlugins(e,s,a),...createHtmlRspackPlugins(e,s,a),...createStatsWebpackPlugins(e,a,r),...createCodeCheckerWebpackPlugins(e,a)],t=shouldEnableReactFastRefresh(e,n,a);t&&o.push(new ReactRefreshPlugin({overlay:!1,exclude:[/node_modules/]})),!t&&e&&(a.devServer?.liveReload?logger.warn('The HMR disabled cause of "liveReload" specificed'):logger.warn(`The HMR disabled cause of \`"moduleFederation":"${i}"\``)),a.openRsdoctor&&o.push(new RsdoctorRspackPlugin);const p=a.webpack?.plugins||[];return o.concat(p)};
1
+ import CaseSensitivePathsPlugin from"case-sensitive-paths-webpack-plugin";import{logger}from"@flatjs/common";import{RsdoctorRspackPlugin}from"@rsdoctor/rspack-plugin";import rspack from"@rspack/core";import ReactRefreshPlugin from"@rspack/plugin-react-refresh";import{assertChunkFilename}from"../../helpers/assert-chunk-filename.js";import{enableBundleHashNameForModule}from"../../helpers/enable-bundle-hashname-for-module.js";import{getBundleFileName}from"../../helpers/get-bundle-file-name.js";import{shouldEnableReactFastRefresh}from"../../helpers/should-enable-react-fast-refresh.js";import{createCircularDependencyRspackPlugins}from"../../plugins/rspack/circular-dependency-plugin/index.js";import{createBuiltinDefineVariablesRspackPlugins}from"../../plugins/rspack/define-variable/index.js";import{createModuleFederationRspackPlugins}from"../../plugins/rspack/module-federation/index.js";import{createHtmlRspackPlugins}from"../../plugins/rspack/multi-html/index.js";import{createProgressRspackPlugins}from"../../plugins/rspack/progress-plugin/index.js";import{createCleanWebpackPlugins}from"../../plugins/webpack/clean-webpack/index.js";import{createCodeCheckerWebpackPlugins}from"../../plugins/webpack/code-checker/index.js";import{createStatsWebpackPlugins}from"../../plugins/webpack/stats-webpack/index.js";export const createRspackPlugins=async(e,s,a,r)=>{const n=s[0],[i,l]=n,c=enableBundleHashNameForModule(a,l?.options),o=[...createProgressRspackPlugins(e,s),new rspack.IgnorePlugin({resourceRegExp:/\.d\.[cm]ts$/}),new CaseSensitivePathsPlugin,...createCircularDependencyRspackPlugins(e,a),new rspack.CssExtractRspackPlugin({filename:`[name]/${getBundleFileName("css",e,c)}`,chunkFilename:assertChunkFilename(a,n,"css")}),...await createBuiltinDefineVariablesRspackPlugins(e,a),...createCleanWebpackPlugins(e,s,a),...createModuleFederationRspackPlugins(e,s,a),...await createHtmlRspackPlugins(e,s,a),...createStatsWebpackPlugins(e,a,r),...createCodeCheckerWebpackPlugins(e,a)],t=shouldEnableReactFastRefresh(e,n,a);t&&o.push(new ReactRefreshPlugin({overlay:!1,exclude:[/node_modules/]})),!t&&e&&(a.devServer?.liveReload?logger.warn('The HMR disabled cause of "liveReload" specificed'):logger.warn(`The HMR disabled cause of \`"moduleFederation":"${i}"\``)),a.openRsdoctor&&o.push(new RsdoctorRspackPlugin);const p=a.webpack?.plugins||[];return o.concat(p)};
@@ -1 +1 @@
1
- import CaseSensitivePathsPlugin from"case-sensitive-paths-webpack-plugin";import MiniCssExtractPlugin from"mini-css-extract-plugin";import webpack from"webpack";import{logger}from"@flatjs/common";import ReactRefreshWebpackPlugin from"@pmmmwh/react-refresh-webpack-plugin";import{assertChunkFilename}from"../../helpers/assert-chunk-filename.js";import{enableBundleHashNameForModule}from"../../helpers/enable-bundle-hashname-for-module.js";import{getBundleFileName}from"../../helpers/get-bundle-file-name.js";import{shouldEnableReactFastRefresh}from"../../helpers/should-enable-react-fast-refresh.js";import{createCircularDependencyWebpackPlugins}from"../../plugins/webpack/circular-dependency/index.js";import{createCleanWebpackPlugins}from"../../plugins/webpack/clean-webpack/index.js";import{createCodeCheckerWebpackPlugins}from"../../plugins/webpack/code-checker/index.js";import{createBuiltinDefineVariablesWebpackPlugins}from"../../plugins/webpack/define-variable/index.js";import{createModuleFederationWebpackPlugins}from"../../plugins/webpack/module-federation/index.js";import{createHtmlWebpackPlugins}from"../../plugins/webpack/multi-html/index.js";import{createStatsWebpackPlugins}from"../../plugins/webpack/stats-webpack/index.js";export const createPlugins=async(e,a,n,i)=>{const s=a[0],[r,l]=s,c=enableBundleHashNameForModule(n,l?.options),t=[new webpack.WatchIgnorePlugin({paths:[/\.d\.[cm]ts$/]}),new CaseSensitivePathsPlugin,...createCircularDependencyWebpackPlugins(e,n),new MiniCssExtractPlugin({filename:`[name]/${getBundleFileName("css",e,c)}`,chunkFilename:assertChunkFilename(n,s,"css")}),...await createBuiltinDefineVariablesWebpackPlugins(e,n),...createCleanWebpackPlugins(e,a,n),...createModuleFederationWebpackPlugins(e,a,n),...createHtmlWebpackPlugins(e,a,n),...createStatsWebpackPlugins(e,n,i),...createCodeCheckerWebpackPlugins(e,n)],p=shouldEnableReactFastRefresh(e,s,n);p&&t.push(new ReactRefreshWebpackPlugin({overlay:!1})),!p&&e&&(n.devServer?.liveReload?logger.warn('The HMR disabled cause of "liveReload" specificed'):logger.warn(`The HMR disabled cause of \`"moduleFederation":"${r}"\``));const o=n.webpack?.plugins||[];return t.concat(o)};
1
+ import CaseSensitivePathsPlugin from"case-sensitive-paths-webpack-plugin";import MiniCssExtractPlugin from"mini-css-extract-plugin";import webpack from"webpack";import{logger}from"@flatjs/common";import ReactRefreshWebpackPlugin from"@pmmmwh/react-refresh-webpack-plugin";import{assertChunkFilename}from"../../helpers/assert-chunk-filename.js";import{enableBundleHashNameForModule}from"../../helpers/enable-bundle-hashname-for-module.js";import{getBundleFileName}from"../../helpers/get-bundle-file-name.js";import{shouldEnableReactFastRefresh}from"../../helpers/should-enable-react-fast-refresh.js";import{createCircularDependencyWebpackPlugins}from"../../plugins/webpack/circular-dependency/index.js";import{createCleanWebpackPlugins}from"../../plugins/webpack/clean-webpack/index.js";import{createCodeCheckerWebpackPlugins}from"../../plugins/webpack/code-checker/index.js";import{createBuiltinDefineVariablesWebpackPlugins}from"../../plugins/webpack/define-variable/index.js";import{createModuleFederationWebpackPlugins}from"../../plugins/webpack/module-federation/index.js";import{createHtmlWebpackPlugins}from"../../plugins/webpack/multi-html/index.js";import{createStatsWebpackPlugins}from"../../plugins/webpack/stats-webpack/index.js";export const createPlugins=async(e,a,i,n)=>{const s=a[0],[r,l]=s,c=enableBundleHashNameForModule(i,l?.options),t=[new webpack.WatchIgnorePlugin({paths:[/\.d\.[cm]ts$/]}),new CaseSensitivePathsPlugin,...createCircularDependencyWebpackPlugins(e,i),new MiniCssExtractPlugin({filename:`[name]/${getBundleFileName("css",e,c)}`,chunkFilename:assertChunkFilename(i,s,"css")}),...await createBuiltinDefineVariablesWebpackPlugins(e,i),...createCleanWebpackPlugins(e,a,i),...createModuleFederationWebpackPlugins(e,a,i),...await createHtmlWebpackPlugins(e,a,i),...createStatsWebpackPlugins(e,i,n),...createCodeCheckerWebpackPlugins(e,i)],p=shouldEnableReactFastRefresh(e,s,i);p&&t.push(new ReactRefreshWebpackPlugin({overlay:!1})),!p&&e&&(i.devServer?.liveReload?logger.warn('The HMR disabled cause of "liveReload" specificed'):logger.warn(`The HMR disabled cause of \`"moduleFederation":"${r}"\``));const o=i.webpack?.plugins||[];return t.concat(o)};
@@ -0,0 +1,20 @@
1
+ import type { DefinedEnvVariablesFn } from '../types/types-env-variables.js';
2
+ /**
3
+ * The environment variables to be injected into the html template.
4
+ *
5
+ * The html will be injected during the compilation stage
6
+ *
7
+ * window.GLOBAL_ENV_VARIABLES = envVariables[env]
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * export definedEnvVariables<{
12
+ * apiBase: string;
13
+ * }>({
14
+ * prod: {
15
+ * apiBase: 'https://api.prod.example.com',
16
+ * },
17
+ * }),
18
+ * ```
19
+ */
20
+ export declare const defineEnvVariables: DefinedEnvVariablesFn;
@@ -0,0 +1 @@
1
+ export const defineEnvVariables=e=>e;
@@ -1 +1,2 @@
1
1
  export * from './define-config.js';
2
+ export * from './define-variables.js';
@@ -1 +1 @@
1
- export*from"./define-config.js";
1
+ export*from"./define-config.js";export*from"./define-variables.js";
@@ -1 +1 @@
1
- import{existsSync,readFileSync}from"node:fs";import{isAbsolute,join}from"node:path";import{ensureSlash,urlJoin}from"@flatjs/common";import{parseTemplate}from"@hyperse/html-webpack-plugin-loader";import{allowPx2remForModule}from"../../helpers/allow-px2rem-for-module.js";import{checkHtmlTemplateOptions}from"../../helpers/check-html-template-options.js";import{getHtmlMaxOrder,getHtmlMinOrder}from"../../helpers/get-html-max-order.js";import{getHtmlPluginConfig}from"../../helpers/get-html-plugin-config.js";import{getPackageDir}from"../../helpers/get-pacakge-dir.js";import{getRuntimeCDNBase}from"../../helpers/get-runtime-cdn-base.js";import{normalizeEvolveEntryName}from"../../helpers/normalize-entry-map.js";import{normalizePageProxy}from"../../helpers/normalize-page-proxy.js";import{normalizeTemplateInjectTokens}from"../../helpers/normalize-template-inject-tokens.js";import{injectFederationScripts}from"../../helpers/script-injects.js";import{ErrorModuleParser}from"./error-module-parser.js";import{getBundleAsset}from"./get-bundle-asset.js";import{getDevServerHostUri}from"./get-dev-server-host-uri.js";import{getHmrRuntimeChunks}from"./get-hmr-runtime-chunks.js";import{getNormalizedEntryName}from"./get-normalized-entry-name.js";export const getPageModuleHtml=async(e,t,r,o,n)=>{const{entryMap:s,projectVirtualPath:l}=n,i=Object.keys(s).sort((e,t)=>t.length-e.length),a=getPackageDir(),m=i.find(e=>{const r=normalizeEvolveEntryName(e,l);return ensureSlash(t.path.replace(/^\//,""),!0).startsWith(ensureSlash(r,!0))});if(!m){const e=readFileSync(join(a,"./templates/module-404.html"),"utf-8");return new ErrorModuleParser(e,{title:"404 Not Found",errorMeta:[{name:"@flatjs/evolve workspace",value:a},{name:"served entry names",value:JSON.stringify(i)},{name:"module path",value:`${t.path}`}]}).serialize()}const p=s[m],d=p.options,u=getDevServerHostUri(e,m,r),c=d?.templatePath||"./templates/module.html",g=join(n.projectCwd,"./templates/module.html"),h=readFileSync(isAbsolute(c)?c:existsSync(g)?g:join(a,"./templates/module.html"),"utf-8"),f=n.devServer,v=f?.defaultServeGlobalData?await f.defaultServeGlobalData(p,r):{},j={mode:"development",envCdn:urlJoin(r,["public"])},y=getNormalizedEntryName(m,l,e,f),S=normalizePageProxy(f?.pageProxy||"/pages"),H=normalizeTemplateInjectTokens(j,d);checkHtmlTemplateOptions(H);const M=parseTemplate(h);M.upsertTitleTag(getHtmlPluginConfig("title",j,d?.title));const P=H.favicon;P&&M.upsertFaviconTag(P.href,P.rel,P.attributes);const k=H.headMetaTags||[];M.upsertHeadMetaTags(k);const x=H.headStyles||[],b=getHtmlMaxOrder(x),z=getBundleAsset(u,y,".css");x.push({id:z,href:z,position:"end",order:b+1}),M.upsertHeadStyles(x);const w=H.headScripts||[],C=getHtmlMinOrder(w);getHmrRuntimeChunks(e,m,y,p,n,u).forEach(e=>{w.unshift({id:e,src:e,position:"end",order:C-1})}),M.upsertHeadScripts(w);const O=H.headInlineScripts||[],T=getHtmlMaxOrder(O),N=getHtmlMinOrder(O),E=Math.min(N,C),D={hostUrl:r,apiBase:urlJoin(r,[o]),virtualPath:join(S,l),moduleName:m.replace(l,"").replace(/^\//,""),...v,...d?.serveGlobalData||{}};O.push({id:"globalData",content:`window.GLOBAL=${JSON.stringify(D)}`,position:"end",order:E-2}),allowPx2remForModule([m,p],n)&&O.push({id:"viewport",content:getHtmlPluginConfig("viewport",j,d?.viewport),position:"end",order:N-1});const F=getRuntimeCDNBase(n.multiHtmlCdn,n.multiHtmlCdnEnvResolver||function cdnResolver(){});O.push({id:"flatjsMultiCdn",content:F,position:"end",order:T+1});const B=injectFederationScripts({me:[urlJoin(r,["public"])]},n.multiHtmlCdnEnvResolver);O.push({id:"evolveFetchMicroWidgets",content:B,position:"end",order:T+2}),M.upsertHeadInlineScripts(O);const R=H.headInlineStyles||[];M.upsertHeadInlineStyles(R);const A=H.bodyScripts||[],I=getHtmlMaxOrder(A),J=getBundleAsset(u,y,".js");return A.push({id:J,src:J,position:"end",order:I+1}),M.upsertBodyScripts(A),M.serialize()};
1
+ import{existsSync,readFileSync}from"node:fs";import{isAbsolute,join}from"node:path";import{ensureSlash,urlJoin}from"@flatjs/common";import{parseTemplate}from"@hyperse/html-webpack-plugin-loader";import{envVariablesName}from"../../constants.js";import{allowPx2remForModule}from"../../helpers/allow-px2rem-for-module.js";import{checkHtmlTemplateOptions}from"../../helpers/check-html-template-options.js";import{getHtmlMaxOrder,getHtmlMinOrder}from"../../helpers/get-html-max-order.js";import{getHtmlPluginConfig}from"../../helpers/get-html-plugin-config.js";import{getPackageDir}from"../../helpers/get-pacakge-dir.js";import{getRuntimeCDNBase}from"../../helpers/get-runtime-cdn-base.js";import{loadEnvConfig}from"../../helpers/load-env-config.js";import{normalizeEvolveEntryName}from"../../helpers/normalize-entry-map.js";import{normalizePageProxy}from"../../helpers/normalize-page-proxy.js";import{normalizeTemplateInjectTokens}from"../../helpers/normalize-template-inject-tokens.js";import{injectFederationScripts}from"../../helpers/script-injects.js";import{ErrorModuleParser}from"./error-module-parser.js";import{getBundleAsset}from"./get-bundle-asset.js";import{getDevServerHostUri}from"./get-dev-server-host-uri.js";import{getHmrRuntimeChunks}from"./get-hmr-runtime-chunks.js";import{getNormalizedEntryName}from"./get-normalized-entry-name.js";export const getPageModuleHtml=async(e,t,r,o,n)=>{const{entryMap:s,projectVirtualPath:i}=n,l=Object.keys(s).sort((e,t)=>t.length-e.length),a=getPackageDir(),m=l.find(e=>{const r=normalizeEvolveEntryName(e,i);return ensureSlash(t.path.replace(/^\//,""),!0).startsWith(ensureSlash(r,!0))});if(!m){const e=readFileSync(join(a,"./templates/module-404.html"),"utf-8");return new ErrorModuleParser(e,{title:"404 Not Found",errorMeta:[{name:"@flatjs/evolve workspace",value:a},{name:"served entry names",value:JSON.stringify(l)},{name:"module path",value:`${t.path}`}]}).serialize()}const p=s[m],d=p.options,u=getDevServerHostUri(e,m,r),c=d?.templatePath||"./templates/module.html",g=join(n.projectCwd,"./templates/module.html"),h=readFileSync(isAbsolute(c)?c:existsSync(g)?g:join(a,"./templates/module.html"),"utf-8"),f=n.devServer,v=f?.defaultServeGlobalData?await f.defaultServeGlobalData(p,r):{},j={mode:"development",envCdn:urlJoin(r,["public"])},y=getNormalizedEntryName(m,i,e,f),S=normalizePageProxy(f?.pageProxy||"/pages"),H=normalizeTemplateInjectTokens(j,d);checkHtmlTemplateOptions(H);const M=parseTemplate(h);M.upsertTitleTag(getHtmlPluginConfig("title",j,d?.title));const P=H.favicon;P&&M.upsertFaviconTag(P.href,P.rel,P.attributes);const b=H.headMetaTags||[];M.upsertHeadMetaTags(b);const w=H.headStyles||[],k=getHtmlMaxOrder(w),x=getBundleAsset(u,y,".css");w.push({id:x,href:x,position:"end",order:k+1}),M.upsertHeadStyles(w);const C=H.headScripts||[],N=getHtmlMinOrder(C);getHmrRuntimeChunks(e,m,y,p,n,u).forEach(e=>{C.unshift({id:e,src:e,position:"end",order:N-1})}),M.upsertHeadScripts(C);const z=H.headInlineScripts||[],O=getHtmlMaxOrder(z),E=getHtmlMinOrder(z),T=Math.min(E,N),D=await loadEnvConfig("me",n);D&&z.push({id:"envVariables",content:`window.${envVariablesName}=${JSON.stringify(D)}`,position:"end",order:T-3});const F={hostUrl:r,apiBase:urlJoin(r,[o]),virtualPath:join(S,i),moduleName:m.replace(i,"").replace(/^\//,""),...v,...d?.serveGlobalData||{}};z.push({id:"globalData",content:`window.GLOBAL=${JSON.stringify(F)}`,position:"end",order:T-2}),allowPx2remForModule([m,p],n)&&z.push({id:"viewport",content:getHtmlPluginConfig("viewport",j,d?.viewport),position:"end",order:E-1});const B=getRuntimeCDNBase(n.multiHtmlCdn,n.multiHtmlCdnEnvResolver||function cdnResolver(){});z.push({id:"flatjsMultiCdn",content:B,position:"end",order:O+1});const J=injectFederationScripts({me:[urlJoin(r,["public"])]},n.multiHtmlCdnEnvResolver);z.push({id:"evolveFetchMicroWidgets",content:J,position:"end",order:O+2}),M.upsertHeadInlineScripts(z);const R=H.headInlineStyles||[];M.upsertHeadInlineStyles(R);const A=H.bodyScripts||[],I=getHtmlMaxOrder(A),G=getBundleAsset(u,y,".js");return A.push({id:G,src:G,position:"end",order:I+1}),M.upsertBodyScripts(A),M.serialize()};
@@ -0,0 +1,3 @@
1
+ import type { EnvVariables } from '../types/types-env-variables.js';
2
+ import type { FlatEvolveOptions } from '../types/types-options.js';
3
+ export declare const loadEnvConfig: (env: string, evolveOptions: FlatEvolveOptions) => Promise<EnvVariables | undefined>;
@@ -0,0 +1 @@
1
+ import{existsSync}from"fs";import{join}from"path";import{chalk,logger}from"@flatjs/common";import{searchConfig}from"@hyperse/config-loader";export const loadEnvConfig=async(o,n)=>{const{projectCwd:t}=n,e=join(t,"configuration"),i=`env.${o}.ts`;if(!existsSync(join(e,i)))return void logger.warn(`Env config file not found: ${chalk(["yellow"])(i)}`);const r={externals:[/^@flatjs\/.*/],projectCwd:t};"test"===process.env.NODE_ENV&&(r.externalExclude=o=>o.toString().startsWith("@flatjs/"));const c=await searchConfig(o,e,r);let f;if(f="function"==typeof c?.config?await(c?.config(o)):c?.config||{},f)return f;logger.warn(`Env config is undefined: ${chalk(["yellow"])(i)}`)};
@@ -1 +1 @@
1
- import{logger}from"@flatjs/common";import{CircularDependencyRspackPlugin}from"@rspack/core";const cutBefore=(e,r)=>{const c=new RegExp(`^[\\s\\S]*?${r}`),n=e.replace(c,"");return n.includes("!/")?`/${n.split("!/")[1]}`:n};export const createCircularDependencyRspackPlugins=(e,r)=>{if(!e)return[];const{projectCwd:c}=r;return[new CircularDependencyRspackPlugin({allowAsyncCycles:!1,exclude:/node_modules/,failOnError:!1,onDetected(e,r){const n=r.map(e=>cutBefore(e,c)).join(" -> ");logger.warn(`Circular dependency detected:\r\n ${n}`)}})]};
1
+ import{logger}from"@flatjs/common";import{CircularDependencyRspackPlugin}from"@rspack/core";const cutBefore=(e,r)=>{const n=new RegExp(`^[\\s\\S]*?${r}`),c=e.replace(n,"");return c.includes("!/")?`/${c.split("!/")[1]}`:c};export const createCircularDependencyRspackPlugins=(e,r)=>{if(!e)return[];const{projectCwd:n}=r;return[new CircularDependencyRspackPlugin({exclude:/node_modules/,failOnError:!1,onDetected(e,r){const c=r.map(e=>cutBefore(e,n)).join(" -> ");logger.warn(`Circular dependency detected:\r\n ${c}`)}})]};
@@ -10,4 +10,4 @@ import { type FlatEvolveOptions } from '../../../types/types-options.js';
10
10
  * @param buildEntryItem the entries for this `build`
11
11
  * @param allEnv
12
12
  */
13
- export declare const createHtmlRspackPlugins: (serveMode: boolean, entryMapItemList: EntryMapItem[], evolveOptions: FlatEvolveOptions) => RspackPlugin[];
13
+ export declare const createHtmlRspackPlugins: (serveMode: boolean, entryMapItemList: EntryMapItem[], evolveOptions: FlatEvolveOptions) => Promise<RspackPlugin[]>;
@@ -1 +1 @@
1
- import{FlatEvolveMultiCdnRspackPlugin}from"./multi-html-cdn-rspack-plugin.js";import{createMultiHtmlRspackPlugins}from"./multi-html-rspack-plugin.js";export const createHtmlRspackPlugins=(t,l,s)=>{const u=[];if(t)return u;const i=Object.keys(s.multiHtmlCdn);return u.push(...createMultiHtmlRspackPlugins(t,s,l,i)),u.push(new FlatEvolveMultiCdnRspackPlugin(s,l)),u};
1
+ import{FlatEvolveMultiCdnRspackPlugin}from"./multi-html-cdn-rspack-plugin.js";import{createMultiHtmlRspackPlugins}from"./multi-html-rspack-plugin.js";export const createHtmlRspackPlugins=async(t,l,s)=>{const i=[];if(t)return i;const n=Object.keys(s.multiHtmlCdn);return i.push(...await createMultiHtmlRspackPlugins(t,s,l,n)),i.push(new FlatEvolveMultiCdnRspackPlugin(s,l)),i};
@@ -8,4 +8,4 @@ import { type FlatEvolveOptions } from '../../../types/types-options.js';
8
8
  * @param buildEntryItem the entries for this `build`
9
9
  * @param allEnv
10
10
  */
11
- export declare const createMultiHtmlRspackPlugins: (serveMode: boolean, evolveOptions: FlatEvolveOptions, entryMapItemList: EntryMapItem[], allEnv: Array<EvolveMultiCdnEnvType>) => RspackPlugin[];
11
+ export declare const createMultiHtmlRspackPlugins: (serveMode: boolean, evolveOptions: FlatEvolveOptions, entryMapItemList: EntryMapItem[], allEnv: Array<EvolveMultiCdnEnvType>) => Promise<RspackPlugin[]>;
@@ -1 +1 @@
1
- import HtmlWebpackPlugin from"html-webpack-plugin";import{existsSync}from"node:fs";import{logger,requireResolve}from"@flatjs/common";import{allowPx2remForModule}from"../../../helpers/allow-px2rem-for-module.js";import{checkHtmlTemplateOptions}from"../../../helpers/check-html-template-options.js";import{getHtmlMinOrder}from"../../../helpers/get-html-max-order.js";import{getHtmlPluginConfig}from"../../../helpers/get-html-plugin-config.js";import{normalizeTemplateInjectTokens}from"../../../helpers/normalize-template-inject-tokens.js";import{findEnvCdn}from"../../../helpers/script-injects.js";import{MultiHtmlModifyRspackPlugin}from"./multi-html-modify-rspack-plugin.js";const minifyOpts={minifyJS:!0,removeComments:!0,collapseWhitespace:!0,collapseBooleanAttributes:!1};export const createMultiHtmlRspackPlugins=(e,t,l,i)=>{const o=l[0],[,n]=o,m=[new MultiHtmlModifyRspackPlugin(l)],{options:r}=n,p=e?"development":"production",s=l.map(e=>e[0]);for(const e of i){const l={mode:p,envCdn:findEnvCdn(t.multiHtmlCdn,e)},i=normalizeTemplateInjectTokens(l,r);checkHtmlTemplateOptions(i);const n=i?.headInlineScripts||[];if(allowPx2remForModule(o,t)){const e=getHtmlMinOrder(n),t=getHtmlPluginConfig("viewport",l,r?.viewport);n.push({id:"viewport",content:t,position:"end",order:e-1})}let a=getHtmlPluginConfig("templatePath",l,r?.templatePath).replace("{0}",e.trim());existsSync(a)||(logger.warn(`The template file ${a} is not exists, use \`prod\` instead!`),a=getHtmlPluginConfig("templatePath",l,r?.templatePath).replace("{0}","prod"));a=`${requireResolve(import.meta.url,"@hyperse/html-webpack-plugin-loader/loader")}!${a}`,m.push(new HtmlWebpackPlugin({inject:"body",title:getHtmlPluginConfig("title",l,r?.title),chunks:s,minify:!1!==r?.htmlMinify&&!["me","dev"].includes(e)&&minifyOpts,filename:t=>`${t}/index${"prod"===e?"":`-${e}`}.html`,template:a,templateParameters:{title:"",...i,headInlineScripts:n},multiCdn:{env:e,disabled:(r?.excludeCdnEnvs||["me","dev","ntv"]).includes(e)}}))}return m};
1
+ import HtmlWebpackPlugin from"html-webpack-plugin";import{existsSync}from"node:fs";import{logger,requireResolve}from"@flatjs/common";import{envVariablesName}from"../../../constants.js";import{allowPx2remForModule}from"../../../helpers/allow-px2rem-for-module.js";import{checkHtmlTemplateOptions}from"../../../helpers/check-html-template-options.js";import{getHtmlMinOrder}from"../../../helpers/get-html-max-order.js";import{getHtmlPluginConfig}from"../../../helpers/get-html-plugin-config.js";import{loadEnvConfig}from"../../../helpers/load-env-config.js";import{normalizeTemplateInjectTokens}from"../../../helpers/normalize-template-inject-tokens.js";import{findEnvCdn}from"../../../helpers/script-injects.js";import{MultiHtmlModifyRspackPlugin}from"./multi-html-modify-rspack-plugin.js";const minifyOpts={minifyJS:!0,removeComments:!0,collapseWhitespace:!0,collapseBooleanAttributes:!1};export const createMultiHtmlRspackPlugins=async(e,t,i,l)=>{const n=i[0],[,o]=n,m=[new MultiHtmlModifyRspackPlugin(i)],{options:r}=o,s=e?"development":"production",p=i.map(e=>e[0]);for(const e of l){const i={mode:s,envCdn:findEnvCdn(t.multiHtmlCdn,e)},l=normalizeTemplateInjectTokens(i,r);checkHtmlTemplateOptions(l);const o=l?.headInlineScripts||[],a=getHtmlMinOrder(o),c=await loadEnvConfig(e,t);if(c&&o?.push({id:"envVariables",content:`window.${envVariablesName}=${JSON.stringify(c)}`,position:"end",order:a-2}),allowPx2remForModule(n,t)){const e=getHtmlMinOrder(o),t=getHtmlPluginConfig("viewport",i,r?.viewport);o.push({id:"viewport",content:t,position:"end",order:e-1})}let d=getHtmlPluginConfig("templatePath",i,r?.templatePath).replace("{0}",e.trim());existsSync(d)||(logger.warn(`The template file ${d} is not exists, use \`prod\` instead!`),d=getHtmlPluginConfig("templatePath",i,r?.templatePath).replace("{0}","prod"));d=`${requireResolve(import.meta.url,"@hyperse/html-webpack-plugin-loader/loader")}!${d}`,m.push(new HtmlWebpackPlugin({inject:"body",title:getHtmlPluginConfig("title",i,r?.title),chunks:p,minify:!1!==r?.htmlMinify&&!["me","dev"].includes(e)&&minifyOpts,filename:t=>`${t}/index${"prod"===e?"":`-${e}`}.html`,template:d,templateParameters:{title:"",...l,headInlineScripts:o},multiCdn:{env:e,disabled:(r?.excludeCdnEnvs||["me","dev","ntv"]).includes(e)}}))}return m};
@@ -10,4 +10,4 @@ import type { WebpackPlugin } from '../../../types/types-webpack.js';
10
10
  * @param buildEntryItem the entries for this `build`
11
11
  * @param allEnv
12
12
  */
13
- export declare const createHtmlWebpackPlugins: (serveMode: boolean, entryMapItemList: EntryMapItem[], evolveOptions: FlatEvolveOptions) => WebpackPlugin[];
13
+ export declare const createHtmlWebpackPlugins: (serveMode: boolean, entryMapItemList: EntryMapItem[], evolveOptions: FlatEvolveOptions) => Promise<WebpackPlugin[]>;
@@ -1 +1 @@
1
- import{FlatEvolveMultiCdnWebpackPlugin}from"./multi-html-cdn-webpack-plugin.js";import{createMultiHtmlWebpackPlugins}from"./multi-html-webpack-plugins.js";export const createHtmlWebpackPlugins=(t,l,e)=>{const u=[];if(t)return u;const i=Object.keys(e.multiHtmlCdn);return u.push(...createMultiHtmlWebpackPlugins(t,e,l,i)),u.push(new FlatEvolveMultiCdnWebpackPlugin(e)),u};
1
+ import{FlatEvolveMultiCdnWebpackPlugin}from"./multi-html-cdn-webpack-plugin.js";import{createMultiHtmlWebpackPlugins}from"./multi-html-webpack-plugins.js";export const createHtmlWebpackPlugins=async(t,l,e)=>{const i=[];if(t)return i;const n=Object.keys(e.multiHtmlCdn);return i.push(...await createMultiHtmlWebpackPlugins(t,e,l,n)),i.push(new FlatEvolveMultiCdnWebpackPlugin(e)),i};
@@ -8,4 +8,4 @@ import type { WebpackPlugin } from '../../../types/types-webpack.js';
8
8
  * @param buildEntryItem the entries for this `build`
9
9
  * @param allEnv
10
10
  */
11
- export declare const createMultiHtmlWebpackPlugins: (serveMode: boolean, evolveOptions: FlatEvolveOptions, entryMapItemList: EntryMapItem[], allEnv: Array<EvolveMultiCdnEnvType>) => WebpackPlugin[];
11
+ export declare const createMultiHtmlWebpackPlugins: (serveMode: boolean, evolveOptions: FlatEvolveOptions, entryMapItemList: EntryMapItem[], allEnv: Array<EvolveMultiCdnEnvType>) => Promise<WebpackPlugin[]>;
@@ -1 +1 @@
1
- import HtmlWebpackPlugin from"html-webpack-plugin";import{existsSync}from"node:fs";import{logger,requireResolve}from"@flatjs/common";import{allowPx2remForModule}from"../../../helpers/allow-px2rem-for-module.js";import{checkHtmlTemplateOptions}from"../../../helpers/check-html-template-options.js";import{getHtmlMinOrder}from"../../../helpers/get-html-max-order.js";import{getHtmlPluginConfig}from"../../../helpers/get-html-plugin-config.js";import{normalizeTemplateInjectTokens}from"../../../helpers/normalize-template-inject-tokens.js";import{findEnvCdn}from"../../../helpers/script-injects.js";import{MultiHtmlModifyWebpackPlugin}from"./multi-html-modify-webpack-plugin.js";const minifyOpts={minifyJS:!0,removeComments:!0,collapseWhitespace:!0,collapseBooleanAttributes:!1};export const createMultiHtmlWebpackPlugins=(e,t,l,i)=>{const o=l[0],[,n]=o,m=[new MultiHtmlModifyWebpackPlugin(l)],{options:r}=n,p=e?"development":"production",s=l.map(e=>e[0]);for(const e of i){const l={mode:p,envCdn:findEnvCdn(t.multiHtmlCdn,e)},i=normalizeTemplateInjectTokens(l,r);checkHtmlTemplateOptions(i);const n=i?.headInlineScripts||[];if(allowPx2remForModule(o,t)){const e=getHtmlMinOrder(n),t=getHtmlPluginConfig("viewport",l,r?.viewport);n.unshift({id:"viewport",content:t,position:"end",order:e-1})}let a=getHtmlPluginConfig("templatePath",l,r?.templatePath).replace("{0}",e.trim());existsSync(a)||(logger.warn(`The template file ${a} is not exists, use \`prod\` instead!`),a=getHtmlPluginConfig("templatePath",l,r?.templatePath).replace("{0}","prod"));a=`${requireResolve(import.meta.url,"@hyperse/html-webpack-plugin-loader/loader")}!${a}`,m.push(new HtmlWebpackPlugin({inject:"body",title:getHtmlPluginConfig("title",l,r?.title),chunks:s,minify:!1!==r?.htmlMinify&&!["me","dev"].includes(e)&&minifyOpts,filename:t=>`${t}/index${"prod"===e?"":`-${e}`}.html`,template:a,templateParameters:{title:"",...i,headInlineScripts:n},multiCdn:{env:e,disabled:(r?.excludeCdnEnvs||["me","dev","ntv"]).includes(e)}}))}return m};
1
+ import HtmlWebpackPlugin from"html-webpack-plugin";import{existsSync}from"node:fs";import{logger,requireResolve}from"@flatjs/common";import{envVariablesName}from"../../../constants.js";import{allowPx2remForModule}from"../../../helpers/allow-px2rem-for-module.js";import{checkHtmlTemplateOptions}from"../../../helpers/check-html-template-options.js";import{getHtmlMinOrder}from"../../../helpers/get-html-max-order.js";import{getHtmlPluginConfig}from"../../../helpers/get-html-plugin-config.js";import{loadEnvConfig}from"../../../helpers/load-env-config.js";import{normalizeTemplateInjectTokens}from"../../../helpers/normalize-template-inject-tokens.js";import{findEnvCdn}from"../../../helpers/script-injects.js";import{MultiHtmlModifyWebpackPlugin}from"./multi-html-modify-webpack-plugin.js";const minifyOpts={minifyJS:!0,removeComments:!0,collapseWhitespace:!0,collapseBooleanAttributes:!1};export const createMultiHtmlWebpackPlugins=async(e,t,i,l)=>{const n=i[0],[,o]=n,m=[new MultiHtmlModifyWebpackPlugin(i)],{options:r}=o,p=e?"development":"production",s=i.map(e=>e[0]);for(const e of l){const i={mode:p,envCdn:findEnvCdn(t.multiHtmlCdn,e)},l=normalizeTemplateInjectTokens(i,r);checkHtmlTemplateOptions(l);const o=l?.headInlineScripts||[],a=getHtmlMinOrder(o),c=await loadEnvConfig(e,t);if(c&&o?.push({id:"envVariables",content:`window.${envVariablesName}=${JSON.stringify(c)}`,position:"end",order:a-2}),allowPx2remForModule(n,t)){const e=getHtmlPluginConfig("viewport",i,r?.viewport);o.unshift({id:"viewport",content:e,position:"end",order:a-1})}let d=getHtmlPluginConfig("templatePath",i,r?.templatePath).replace("{0}",e.trim());existsSync(d)||(logger.warn(`The template file ${d} is not exists, use \`prod\` instead!`),d=getHtmlPluginConfig("templatePath",i,r?.templatePath).replace("{0}","prod"));d=`${requireResolve(import.meta.url,"@hyperse/html-webpack-plugin-loader/loader")}!${d}`,m.push(new HtmlWebpackPlugin({inject:"body",title:getHtmlPluginConfig("title",i,r?.title),chunks:s,minify:!1!==r?.htmlMinify&&!["me","dev"].includes(e)&&minifyOpts,filename:t=>`${t}/index${"prod"===e?"":`-${e}`}.html`,template:d,templateParameters:{title:"",...l,headInlineScripts:o},multiCdn:{env:e,disabled:(r?.excludeCdnEnvs||["me","dev","ntv"]).includes(e)}}))}return m};
@@ -0,0 +1,2 @@
1
+ export type EnvVariables<T extends object = object> = T;
2
+ export type DefinedEnvVariablesFn = <T extends object = object>(envVariables: EnvVariables<T>) => EnvVariables<T>;
@@ -0,0 +1 @@
1
+ export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatjs/evolve",
3
- "version": "3.0.8",
3
+ "version": "3.0.10",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -56,19 +56,19 @@
56
56
  "@flatjs/forge-ts-checker": "1.1.3",
57
57
  "@flatjs/graph": "2.2.10",
58
58
  "@flatjs/mock": "2.4.2",
59
- "@flatjs/swc-plugin-import": "1.0.2",
60
- "@hyperse/config-loader": "^1.0.7",
59
+ "@flatjs/swc-plugin-import": "1.0.4",
60
+ "@hyperse/config-loader": "^1.0.8",
61
61
  "@hyperse/html-webpack-plugin-loader": "^1.0.7",
62
- "@hyperse/inspector": "^2.0.0",
63
- "@hyperse/inspector-babel-plugin": "^2.0.0",
64
- "@hyperse/inspector-common": "^2.0.0",
65
- "@hyperse/inspector-middleware": "^2.0.0",
66
- "@hyperse/inspector-swc-plugin": "^2.0.0",
62
+ "@hyperse/inspector": "^2.0.1",
63
+ "@hyperse/inspector-babel-plugin": "^2.0.1",
64
+ "@hyperse/inspector-common": "^2.0.1",
65
+ "@hyperse/inspector-middleware": "^2.0.1",
66
+ "@hyperse/inspector-swc-plugin": "^2.0.1",
67
67
  "@pmmmwh/react-refresh-webpack-plugin": "^0.6.1",
68
68
  "@rsdoctor/rspack-plugin": "^1.3.2",
69
- "@rspack/core": "~1.6.8",
70
- "@rspack/dev-server": "~1.1.4",
71
- "@rspack/plugin-react-refresh": "^1.5.3",
69
+ "@rspack/core": "~1.7.1",
70
+ "@rspack/dev-server": "~1.1.5",
71
+ "@rspack/plugin-react-refresh": "^1.6.0",
72
72
  "@swc/helpers": "^0.5.17",
73
73
  "@types/babel__core": "^7.20.5",
74
74
  "babel-loader": "^10.0.0",
@@ -108,7 +108,7 @@
108
108
  "devDependencies": {
109
109
  "@flatjs/testing": "2.2.5",
110
110
  "@hyperse/eslint-config-hyperse": "^1.4.8",
111
- "@swc/core": "1.14.0",
111
+ "@swc/core": "1.15.5",
112
112
  "@types/express": "5.0.3",
113
113
  "@types/listr": "0.14.9",
114
114
  "@types/node": "24.7.2",
@@ -119,7 +119,7 @@
119
119
  "imagemin-pngquant": "10.0.0",
120
120
  "imagemin-svgo": "11.0.1",
121
121
  "npm-run-all": "4.1.5",
122
- "react": "19.2.0",
122
+ "react": "19.2.3",
123
123
  "rimraf": "6.0.1",
124
124
  "vite-tsconfig-paths": "5.1.4",
125
125
  "vitest": "3.2.4",