@flatjs/evolve 1.8.1-next.109 → 1.8.1-next.111
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +15 -0
- package/dist/dev-server/add-compiler-to-dev-server.d.ts +2 -1
- package/dist/dev-server/add-compiler-to-dev-server.js +1 -1
- package/dist/dev-server/create-dev-server-compiler-tasks.d.ts +1 -1
- package/dist/dev-server/create-dev-server-compiler-tasks.js +1 -1
- package/dist/dev-server/create-dev-server.d.ts +1 -0
- package/dist/dev-server/create-dev-server.js +1 -1
- package/dist/main/prepare-serve.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# @flatjs/evolve
|
2
2
|
|
3
|
+
## 1.8.1-next.111
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- Updated dependencies [f5d60b9]
|
8
|
+
- @flatjs/mock@1.8.1-next.84
|
9
|
+
|
10
|
+
## 1.8.1-next.110
|
11
|
+
|
12
|
+
### Patch Changes
|
13
|
+
|
14
|
+
- 0508747: Force client websocketURL hostname to local publicIp for `webpack-dev-server`
|
15
|
+
- Updated dependencies [0508747]
|
16
|
+
- @flatjs/mock@1.8.1-next.83
|
17
|
+
|
3
18
|
## 1.8.1-next.109
|
4
19
|
|
5
20
|
### Patch Changes
|
@@ -5,6 +5,7 @@ import { type FlatEvolveOptions } from '../types/types-options.js';
|
|
5
5
|
* @param compiler Webpack compiler(s)
|
6
6
|
* @param enableHmr Value indicates if we need to liveReload or `HMR`
|
7
7
|
* @param devPort The port number of `@flatjs/mock`
|
8
|
+
* @param publicIp The public ip address of local server
|
8
9
|
* @param evolveOptions The configuration of `@flatjs/evolve` (FlatEvolveOptions)
|
9
10
|
*/
|
10
|
-
export declare const addCompilerToDevServer: (compiler: Compiler, enableHmr: boolean, devPort: number, evolveOptions: FlatEvolveOptions) => Promise<boolean>;
|
11
|
+
export declare const addCompilerToDevServer: (compiler: Compiler, enableHmr: boolean, devPort: number, publicIp: string, evolveOptions: FlatEvolveOptions) => Promise<boolean>;
|
@@ -1 +1 @@
|
|
1
|
-
import{join}from"node:path";import WebpackDevServer from"webpack-dev-server";export const addCompilerToDevServer=(e,r,t,
|
1
|
+
import{join}from"node:path";import WebpackDevServer from"webpack-dev-server";export const addCompilerToDevServer=(e,r,o,t,s)=>{const{projectCwd:p,devServer:i}=s,l=new WebpackDevServer({server:{type:i?.https?"https":"http",options:{...i?.https}},open:!1,compress:!0,port:o,hot:r,liveReload:!r,allowedHosts:"all",static:{directory:`${join(p,"/public")}`},headers:{"Access-Control-Allow-Origin":"*"},client:{progress:!0,overlay:i?.clientOverlay,webSocketURL:{hostname:t||void 0}}},e);return new Promise(((e,r)=>{l.startCallback((o=>{if(o)return r(o);e(!0)}))}))};
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { type FlatEvolveOptions } from '../types/types-options.js';
|
2
2
|
import { type EvolveDevServerEntryMap } from './middlewares/create-page-middleware.js';
|
3
|
-
export declare const createDevServerCompilerTasks: (projectCwd: string, mainPage: string, servedDevServerEntries: EvolveDevServerEntryMap, evolveOptions: FlatEvolveOptions) => Promise<Promise<boolean>[]>;
|
3
|
+
export declare const createDevServerCompilerTasks: (projectCwd: string, mainPage: string, publicIp: string, servedDevServerEntries: EvolveDevServerEntryMap, evolveOptions: FlatEvolveOptions) => Promise<Promise<boolean>[]>;
|
@@ -1 +1 @@
|
|
1
|
-
import{relative}from"node:path";import{chalk,logger,mergeOptions,urlJoin}from"@flatjs/common";import webpack from"webpack";import{loadWebpackConfig}from"../create-webpack/load-webpack-config.js";import{shouldEnableReactFastRefresh}from"../helpers/should-enable-react-fast-refresh.js";import{splitToMultiCompilerConfigs}from"../helpers/split-to-multi-compiler.js";import{addCompilerToDevServer}from"./add-compiler-to-dev-server.js";export const createDevServerCompilerTasks=async(e,o,r,t)=>{const
|
1
|
+
import{relative}from"node:path";import{chalk,logger,mergeOptions,urlJoin}from"@flatjs/common";import webpack from"webpack";import{loadWebpackConfig}from"../create-webpack/load-webpack-config.js";import{shouldEnableReactFastRefresh}from"../helpers/should-enable-react-fast-refresh.js";import{splitToMultiCompilerConfigs}from"../helpers/split-to-multi-compiler.js";import{addCompilerToDevServer}from"./add-compiler-to-dev-server.js";export const createDevServerCompilerTasks=async(e,o,r,t,a)=>{const i=[];for(const[n,l]of Object.entries(t)){const s=l.entryConfig,p=s.options?.moduleFederation,c=shouldEnableReactFastRefresh(!0,[n,s],a);(p?.remotes||[]).forEach((e=>{e.endpoint=e=>{const o=t[e];if(!o)throw new Error(`No servedDevServerEntry found via "${e}"`);return urlJoin(o?.devServerHostUri,["/public"])}}));const{devServerPort:m,devServerHostUri:f}=t[n],d={[n]:s},h=urlJoin(f,["public"]),v=await loadWebpackConfig("development",d,mergeOptions(a,{webpack:{publicPath:h}})),u=shouldEnableReactFastRefresh(!0,[n,s],a),g=webpack(splitToMultiCompilerConfigs(d,v,a,u)[0]);i.push(addCompilerToDevServer(g,c,m,r,a));const b=g.name||"";g.hooks.invalid.tap("fileChange",(o=>{const r=relative(e,o||"");logger.info(`file change ➩ ${chalk(["cyan"])(r)}`,b)})),g.hooks.done.tap("compileDone",(()=>{logger.info(`debug page ➩ ${chalk(["cyan"])(o)}`,b)}))}return i};
|
@@ -1 +1 @@
|
|
1
|
-
import https from"node:https";import{prepareMockDomain}from"@flatjs/mock";import express from"express";export const createDevServer=async e=>{const r=express(),t=e.devServer?.mockOptions,{mockPort:o,hostUri:s}=await prepareMockDomain(t||{});return new Promise((t=>{const
|
1
|
+
import https from"node:https";import{prepareMockDomain}from"@flatjs/mock";import express from"express";export const createDevServer=async e=>{const r=express(),t=e.devServer?.mockOptions,{mockPort:o,hostUri:p,publicIp:s}=await prepareMockDomain(t||{});return new Promise((t=>{const i=e.devServer?.https?https.createServer(e.devServer?.https,r):r;r.set("hostUri",p),i.listen(o,(()=>{t({app:r,publicIp:s,devHostUri:p,devPort:o})}))}))};
|
@@ -1 +1 @@
|
|
1
|
-
import{arrayUnique,urlJoin}from"@flatjs/common";import{attachMockMiddlewares}from"@flatjs/mock";import{createAppPageRoute,createDevServer,createDevServerCompilerTasks,createDevServerEntries}from"../dev-server/index.js";import{openPage}from"../helpers/index.js";import{envVerify}from"./env-verify.js";export const prepareServe=async(e,r,t)=>{await envVerify(e,t);const{app:o,devPort:a,devHostUri:i}=await createDevServer(t),
|
1
|
+
import{arrayUnique,urlJoin}from"@flatjs/common";import{attachMockMiddlewares}from"@flatjs/mock";import{createAppPageRoute,createDevServer,createDevServerCompilerTasks,createDevServerEntries}from"../dev-server/index.js";import{openPage}from"../helpers/index.js";import{envVerify}from"./env-verify.js";export const prepareServe=async(e,r,t)=>{await envVerify(e,t);const{app:o,devPort:a,devHostUri:i,publicIp:s}=await createDevServer(t),c=t.devServer?.mockOptions?.mockFilters||[];for(const[,e]of Object.entries(r))c.push(...e.options?.mockFilters||[]);await attachMockMiddlewares(o,{...t.devServer?.mockOptions,mockFilters:arrayUnique(c),projectCwd:e});const n=await createDevServerEntries(a,r,t);createAppPageRoute(e,o,i,n,t);const p=urlJoin(i,["/pages"]);t.devServer?.autoOpen&&openPage(p);const v=await createDevServerCompilerTasks(e,p,s,n,t);return Promise.all(v).then((()=>o))};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@flatjs/evolve",
|
3
|
-
"version": "1.8.1-next.
|
3
|
+
"version": "1.8.1-next.111",
|
4
4
|
"license": "MIT",
|
5
5
|
"type": "module",
|
6
6
|
"exports": {
|
@@ -47,7 +47,7 @@
|
|
47
47
|
"@flatjs/evolve-preset-babel": "1.8.1-next.24",
|
48
48
|
"@flatjs/forge-postcss-plugin-pixel": "1.8.1-next.39",
|
49
49
|
"@flatjs/graph": "1.8.1-next.58",
|
50
|
-
"@flatjs/mock": "1.8.1-next.
|
50
|
+
"@flatjs/mock": "1.8.1-next.84",
|
51
51
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
|
52
52
|
"@types/babel__core": "7.20.1",
|
53
53
|
"babel-loader": "9.1.3",
|