@flatjs/evolve 1.8.1-next.29 → 1.8.1-next.30

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @flatjs/evolve
2
2
 
3
+ ## 1.8.1-next.30
4
+
5
+ ### Patch Changes
6
+
7
+ - af2051d: Add `startStatic` API
8
+ - @flatjs/mock@1.8.1-next.27
9
+
3
10
  ## 1.8.1-next.29
4
11
 
5
12
  ### Patch Changes
@@ -1 +1 @@
1
- import{logger,requireResolve}from"@flatjs/common";import{reactBabelPreset,vueBabelPreset}from"@flatjs/evolve-preset-babel";import babelMerge from"babel-merge";import{moduleName}from"../constants.js";export const mergeBabelOption=(e=[],r={usePreset:"react"})=>{const t=e.map((e=>[requireResolve("babel-plugin-import"),{transformToDefaultImport:!1,libraryDirectory:"dist",...e},e.libraryName])),{usePreset:a="react",...l}=r,o="react"===a?reactBabelPreset():"vue"===a?vueBabelPreset():reactBabelPreset();let s={};try{s=babelMerge(o,l),s.plugins?s.plugins.unshift(...t):s.plugins=t}catch(e){logger.error(e,moduleName)}return{...s,babelrc:!1}};
1
+ import{logger,requireResolve}from"@flatjs/common";import{reactBabelPreset,vueBabelPreset}from"@flatjs/evolve-preset-babel";import babelMerge from"babel-merge";import{moduleName}from"../constants.js";export const mergeBabelOption=(e=[],r={usePreset:"react"})=>{const t=e.map((e=>[requireResolve("babel-plugin-import"),{transformToDefaultImport:!1,libraryDirectory:"dist",...e},e.libraryName])),{usePreset:a="react",...l}=r,o="react"===a?reactBabelPreset():"vue"===a?vueBabelPreset():reactBabelPreset();let s={};try{s=babelMerge(o,l),s.plugins?s.plugins.unshift(...t):s.plugins=t}catch(e){logger.error(e,moduleName)}return{...s,babelrc:!1,compact:!1}};
@@ -4,4 +4,4 @@ import { type FlatEvolveOptions } from '../types/index.js';
4
4
  * @param projectCwd The Root directory (workspace) of this project.
5
5
  * @param evolveOptions FlatEvolveOptions
6
6
  */
7
- export declare const prepareStatic: (evolveOptions: FlatEvolveOptions) => Promise<import("express-serve-static-core").Express>;
7
+ export declare const prepareStatic: (projectCwd: string, evolveOptions: FlatEvolveOptions) => Promise<void>;
@@ -1 +1 @@
1
- import{chalk,logger,urlJoin}from"@flatjs/common";import{createDevServer}from"../dev-server/create-dev-server.js";export const prepareStatic=async e=>createDevServer(e).then((({app:e,devHostUri:r})=>{const t=urlJoin(r,["/pages"]);return logger.info(`${"static page".padEnd(12," ")} ➩ ${chalk(["cyan"])(t)}`),e}));
1
+ import{chalk,logger,urlJoin}from"@flatjs/common";import{attachMockMiddlewares}from"@flatjs/mock";import{createAppPageRoute}from"../dev-server/create-app-page-route.js";import{createDevServer}from"../dev-server/create-dev-server.js";import{openPage}from"../helpers/open-page.js";export const prepareStatic=async(e,r)=>{const{app:a,devHostUri:o}=await createDevServer(r);attachMockMiddlewares(a,{...r.devServer?.mockOptions,projectCwd:e}),createAppPageRoute(e,a,o,{},r);const t=urlJoin(o,["/pages"]);r.devServer?.autoOpen&&openPage(t),logger.info(`${"static page".padEnd(12," ")} ➩ ${chalk(["cyan"])(t)}`)};
@@ -7,4 +7,4 @@ import { type FlatEvolveOptions } from '../types/types-options.js';
7
7
  * @param evolveOptions FlatEvolveOptions
8
8
  * @param configLoaderOptions FlatMockOptions
9
9
  */
10
- export declare const startStatic: (projectCwd: string, overrideEvolveOptions?: PartialDeep<FlatEvolveOptions>, configLoaderOptions?: ConfigLoaderOptions) => Promise<import("express-serve-static-core").Express>;
10
+ export declare const startStatic: (projectCwd: string, overrideEvolveOptions?: PartialDeep<FlatEvolveOptions>, configLoaderOptions?: ConfigLoaderOptions) => Promise<void>;
@@ -1 +1 @@
1
- import{loadEvolveConfig}from"../load-config/load-evolve-config.js";import{prepareStatic}from"./prepare-static.js";export const startStatic=async(o,t={},a)=>{const r=await loadEvolveConfig({command:"static"},o,t,a);return prepareStatic(r)};
1
+ import{loadEvolveConfig}from"../load-config/load-evolve-config.js";import{prepareStatic}from"./prepare-static.js";export const startStatic=async(o,t={},a)=>{const r=await loadEvolveConfig({command:"static"},o,t,a);return prepareStatic(o,r)};
@@ -34,7 +34,7 @@ export type FlatEvolveDevServerOptions = {
34
34
  /**
35
35
  * Allow us costomized global serve data injected into `window.GLOBAL = {...globalData}`
36
36
  */
37
- defaultServeGlobalData?: (entryItem: EvolveEntryMapContent, hostUrl: string) => Promise<Record<string, unknown>>;
37
+ defaultServeGlobalData?: (entryItem: EvolveEntryMapContent, hostUrl: string) => Promise<Record<string, unknown>> | Record<string, unknown>;
38
38
  /**
39
39
  * The value indicates if we will auto open broswers page for `serve`
40
40
  * @default true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatjs/evolve",
3
- "version": "1.8.1-next.29",
3
+ "version": "1.8.1-next.30",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -43,7 +43,7 @@
43
43
  "@flatjs/common": "1.8.1-next.15",
44
44
  "@flatjs/evolve-preset-babel": "1.8.1-next.6",
45
45
  "@flatjs/forge-postcss-plugin-pixel": "1.8.1-next.15",
46
- "@flatjs/mock": "1.8.1-next.26",
46
+ "@flatjs/mock": "1.8.1-next.27",
47
47
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
48
48
  "@types/babel__core": "7.20.0",
49
49
  "babel-loader": "9.1.2",