@flatjs/evolve 1.8.1-next.53 → 1.8.1-next.55
Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# @flatjs/evolve
|
2
2
|
|
3
|
+
## 1.8.1-next.55
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 97d839c: Fix ForkTsChecker incorrect `include` of tsconfig.json
|
8
|
+
|
9
|
+
## 1.8.1-next.54
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- 0b95309: update logging formats
|
14
|
+
- Updated dependencies [0b95309]
|
15
|
+
- @flatjs/mock@1.8.1-next.47
|
16
|
+
|
3
17
|
## 1.8.1-next.53
|
4
18
|
|
5
19
|
### Patch Changes
|
@@ -1 +1 @@
|
|
1
|
-
import{logger}from"@flatjs/common";import ReactRefreshWebpackPlugin from"@pmmmwh/react-refresh-webpack-plugin";import CaseSensitivePathsPlugin from"case-sensitive-paths-webpack-plugin";import ForkTsCheckerWebpackPlugin from"fork-ts-checker-webpack-plugin";import MiniCssExtractPlugin from"mini-css-extract-plugin";import webpack from"webpack";import{BundleAnalyzerPlugin}from"webpack-bundle-analyzer";import{
|
1
|
+
import{logger}from"@flatjs/common";import ReactRefreshWebpackPlugin from"@pmmmwh/react-refresh-webpack-plugin";import CaseSensitivePathsPlugin from"case-sensitive-paths-webpack-plugin";import ForkTsCheckerWebpackPlugin from"fork-ts-checker-webpack-plugin";import MiniCssExtractPlugin from"mini-css-extract-plugin";import webpack from"webpack";import{BundleAnalyzerPlugin}from"webpack-bundle-analyzer";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{createCleanWebpackPlugin}from"../plugins/clean-webpack/index.js";import{createBuiltinDefineVariables}from"../plugins/define-variable/index.js";import{createModuleFederationPlugin}from"../plugins/module-federation/index.js";import{createHtmlPlugins}from"../plugins/multi-html/index.js";export const createPlugins=async(e,n,a)=>{const[r,i]=n,t=enableBundleHashNameForModule(a,i?.options),l=[new webpack.WatchIgnorePlugin({paths:[/\.d\.[cm]ts$/]}),new CaseSensitivePathsPlugin,new MiniCssExtractPlugin({filename:`[name]/${getBundleFileName("css",e,t)}`,chunkFilename:"[id].[contenthash].css"}),...await createBuiltinDefineVariables(e,a),...createCleanWebpackPlugin(e,n,a),...createModuleFederationPlugin(e,n,a),...createHtmlPlugins(e,n,a)],{analyzer:s,loaderOptions:o}=a,c=(n[1].entry||[]).find((e=>/.vue$/.test(e)));o.runTsChecker&&!c&&l.push(new ForkTsCheckerWebpackPlugin({async:e,typescript:{context:a.projectCwd,memoryLimit:8192}})),s&&l.push(new BundleAnalyzerPlugin({analyzerPort:"auto",analyzerMode:"server",...s}));const u=shouldEnableReactFastRefresh(e,n,a);u&&l.push(new ReactRefreshWebpackPlugin({overlay:!1})),!u&&e&&logger.warn(`The HMR has disabled cause of ("${r}":"moduleFederation")`);const m=a.webpack?.plugins||[];return l.concat(m)};
|
@@ -1 +1 @@
|
|
1
|
-
import{mergeOptions,logger,searchConfig}from"@flatjs/common";import{configFileName,moduleName}from"../constants.js";import{defaultEvolveOptions}from"../default-options.js";import{refreshEvolveMockOptions}from"../helpers/refresh-evolve-mock-options.js";export const loadEvolveConfig=async(o,e,t={},
|
1
|
+
import{mergeOptions,logger,searchConfig}from"@flatjs/common";import{configFileName,moduleName}from"../constants.js";import{defaultEvolveOptions}from"../default-options.js";import{refreshEvolveMockOptions}from"../helpers/refresh-evolve-mock-options.js";export const loadEvolveConfig=async(o,e,t={},n={configFile:configFileName,esmLoaderOptions:{externals:["@flatjs/evolve","@flatjs/mock"]}})=>{const{configFile:i,esmLoaderOptions:s}=n,r=await searchConfig(i,e,{esm:{...s,projectCwd:e}});let l={};l="function"==typeof r?.config?r?.config(o):r?.config||{};const f=mergeOptions(defaultEvolveOptions,l),m=mergeOptions(f,t),a=mergeOptions(m,{projectCwd:e}),c=await refreshEvolveMockOptions(e,a,n);return logger.debug(`Load evolve config:\n${JSON.stringify(c,null,2)}`,moduleName),c};
|
@@ -1 +1 @@
|
|
1
|
-
import{isAbsolute,join}from"node:path";import{getDiffFiles,getCommitIdOfBranch}from"@armit/git";import{arraysIntersect,logger}from"@flatjs/common";import{traverseGraph}from"@flatjs/graph";import{filterActivedEntriesByEntryInputs,filterActivedEntriesByModule}from"../helpers/filter-actived-entries.js";import{getGitRoot}from"../helpers/get-git-root.js";import{normalizeEvolveEntryMap}from"../helpers/normalize-entry-map.js";import{resolveEntryMapInputFiles}from"../helpers/resolve-entry-map-input-files.js";import{loadEvolveConfig}from"../load-config/load-evolve-config.js";import{prepareBuild}from"./prepare-build.js";export async function getBuildEntryFiles(e,t,
|
1
|
+
import{isAbsolute,join}from"node:path";import{getDiffFiles,getCommitIdOfBranch}from"@armit/git";import{arraysIntersect,logger}from"@flatjs/common";import{traverseGraph}from"@flatjs/graph";import{filterActivedEntriesByEntryInputs,filterActivedEntriesByModule}from"../helpers/filter-actived-entries.js";import{getGitRoot}from"../helpers/get-git-root.js";import{normalizeEvolveEntryMap}from"../helpers/normalize-entry-map.js";import{resolveEntryMapInputFiles}from"../helpers/resolve-entry-map-input-files.js";import{loadEvolveConfig}from"../load-config/load-evolve-config.js";import{prepareBuild}from"./prepare-build.js";export async function getBuildEntryFiles(e,t,i){const r=[],n=[];for(const e of i)t.includes(e)?r.push(e):n.push(e);if(n.length){const i=await traverseGraph({input:n,projectCwd:e,treeNodeFilter:()=>!0});if(!i)return r;logger.debug(`DependencyGraph:\n${JSON.stringify(i,null,2)}`);for(const e of n){const n=i[e]||[];arraysIntersect(n,t)&&r.push(e)}}return r}export async function dynamicCheckBuildEntryMap(e,t,i,r,n){const o=await loadEvolveConfig({command:"build"},e,r,n);if(o.ci?.fixedBuildModules&&o.ci?.fixedBuildModules.length){logger.info("Use `fixedBuildModules` configuration to build...");return{buildEntries:filterActivedEntriesByModule(o.entryMap,o.ci?.fixedBuildModules),newEvolveOptions:o}}if(logger.info("Dynamicly checking code changed modules ..."),!t){const e=o.ci?.basedBranch||"master";logger.info(`Resolving base branch "${e}" commit hash ...`),t=await getCommitIdOfBranch(e)}let l=t?await getDiffFiles(t,i):[];const s=getGitRoot(e);if(!s)throw new Error(`No .git root (${e}) found`);if(l=l.map((e=>isAbsolute(e)?e:join(s,e))),logger.debug(`Diff files: \n${JSON.stringify(l,null,2)}`),!l.length)return logger.warn("It seems that there are no code files changed."),{buildEntries:{},newEvolveOptions:o};const a=await resolveEntryMapInputFiles(e,o.entryMap),d=await getBuildEntryFiles(e,l,a);logger.debug(`To build entry files: \n${JSON.stringify(d,null,2)}`);return{buildEntries:await filterActivedEntriesByEntryInputs(e,o.entryMap,d),newEvolveOptions:o}}export const startDynamicBuild=async(e,t,i,r={},n)=>{const{buildEntries:o,newEvolveOptions:l}=await dynamicCheckBuildEntryMap(e,t,i,r,n),s=Object.keys(o);if(!s.length)return logger.warn("No build entries providered!"),[];logger.info(`Start dynamic build:\n${JSON.stringify({buildEntries:s},null,2)}`);const a=normalizeEvolveEntryMap(o,l.entryMap);return prepareBuild(e,a,l)};
|
package/dist/main/start-build.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{logger}from"@flatjs/common";import{filterActivedEntriesByModule}from"../helpers/filter-actived-entries.js";import{normalizeEvolveEntryMap}from"../helpers/normalize-entry-map.js";import{loadEvolveConfig}from"../load-config/load-evolve-config.js";import{prepareBuild}from"./prepare-build.js";export const startBuild=async(e,
|
1
|
+
import{logger}from"@flatjs/common";import{filterActivedEntriesByModule}from"../helpers/filter-actived-entries.js";import{normalizeEvolveEntryMap}from"../helpers/normalize-entry-map.js";import{loadEvolveConfig}from"../load-config/load-evolve-config.js";import{prepareBuild}from"./prepare-build.js";export const startBuild=async(r,e,o={},i)=>{const t=await loadEvolveConfig({command:"build"},r,o,i),l=filterActivedEntriesByModule(t.entryMap,e),n=Object.keys(l);if(!n.length)return logger.warn("No build entries providered!"),[];logger.info(`Start normal build:\n${JSON.stringify({buildEntries:n},null,2)}`);const a=normalizeEvolveEntryMap(l,t.entryMap);return prepareBuild(r,a,t)};
|
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.55",
|
4
4
|
"license": "MIT",
|
5
5
|
"type": "module",
|
6
6
|
"exports": {
|
@@ -45,7 +45,7 @@
|
|
45
45
|
"@flatjs/evolve-preset-babel": "1.8.1-next.11",
|
46
46
|
"@flatjs/forge-postcss-plugin-pixel": "1.8.1-next.25",
|
47
47
|
"@flatjs/graph": "1.8.1-next.29",
|
48
|
-
"@flatjs/mock": "1.8.1-next.
|
48
|
+
"@flatjs/mock": "1.8.1-next.47",
|
49
49
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
|
50
50
|
"@types/babel__core": "7.20.1",
|
51
51
|
"babel-loader": "9.1.2",
|