@flatjs/evolve 3.0.4 → 3.0.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.
@@ -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{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{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{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,...createCircularDependencyWebpackPlugins(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),...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{getPageMainHtml}from"./get-page-main-html.js";import{getPageModuleHtml}from"./get-page-module-html.js";import{getRuntimeManifest}from"./get-runtime-manifest.js";export const createPageMiddleware=(e,t,a,m)=>(m.devServer?.middlewares||[]).concat(async(i,n)=>{let g;if("/runtime/manifest.json"!==i.path)g="/"===i.path?await getPageMainHtml(a,e,m):await getPageModuleHtml(a,i,e,t,m),n.send(g);else{const t=await getRuntimeManifest(a,e,m);n.json(t)}});
1
+ import{getPageMainHtml}from"./get-page-main-html.js";import{getPageModuleHtml}from"./get-page-module-html.js";import{getRuntimeManifest}from"./get-runtime-manifest.js";export const createPageMiddleware=(e,t,a,i)=>(i.devServer?.middlewares||[]).concat(async(m,n)=>{let g;if("/runtime/manifest.json"===m.path){const t=await getRuntimeManifest(a,e,i);return void n.json(t)}g="/"===m.path?await getPageMainHtml(a,e,i):await getPageModuleHtml(a,m,e,t,i),n.send(g)});
@@ -13,4 +13,4 @@ import ImageMinimizerPlugin from 'image-minimizer-webpack-plugin';
13
13
  * sudo yum install gifsicle
14
14
  * @returns
15
15
  */
16
- export declare const imageRspackMinimizer: () => ImageMinimizerPlugin<unknown, unknown> | null;
16
+ export declare const imageRspackMinimizer: () => ImageMinimizerPlugin<any, any> | null;
@@ -13,4 +13,4 @@ import ImageMinimizerPlugin from 'image-minimizer-webpack-plugin';
13
13
  * sudo yum install gifsicle
14
14
  * @returns
15
15
  */
16
- export declare const imageWebpackMinimizer: () => ImageMinimizerPlugin<unknown, unknown> | null;
16
+ export declare const imageWebpackMinimizer: () => ImageMinimizerPlugin<any, any> | null;
@@ -0,0 +1,57 @@
1
+ import type { Compilation } from '@rspack/core';
2
+ import { type Plugins } from '@rspack/core';
3
+ import { type FlatEvolveOptions } from '../../../types/types-options.js';
4
+ export interface CircularDependencyOptions {
5
+ /**
6
+ * The project root.
7
+ */
8
+ projectCwd?: string;
9
+ /**
10
+ * exclude detection of files based on a RegExp
11
+ * @default /node_modules/
12
+ */
13
+ exclude?: RegExp;
14
+ /**
15
+ * include specific files based on a RegExp
16
+ * @default `new RegExp('.*')`
17
+ */
18
+ include?: RegExp;
19
+ /**
20
+ * add errors to webpack instead of warnings
21
+ * @default false
22
+ */
23
+ failOnError?: boolean;
24
+ /**
25
+ * allow import cycles that include an asynchronous import,
26
+ * e.g. via via import(/* webpackMode: "weak" *\/ './file.js')
27
+ * @default false
28
+ */
29
+ allowAsyncCycles?: boolean;
30
+ /**
31
+ * `onStart` is called before the cycle detection starts
32
+ */
33
+ onStart?: (options: {
34
+ compilation: Compilation;
35
+ }) => void;
36
+ /**
37
+ * `onDetected` is called for each module that is cyclical
38
+ * `paths` will be an Array of the relative module paths that make up the cycle
39
+ */
40
+ onDetected?: (options: {
41
+ paths: string[];
42
+ compilation: Compilation;
43
+ }) => void;
44
+ /**
45
+ * `onEnd` is called before the cycle detection ends
46
+ */
47
+ onEnd?: (options: {
48
+ compilation: Compilation;
49
+ }) => void;
50
+ }
51
+ /**
52
+ * Detect modules with circular dependencies when bundling with webpack for `development` mode.
53
+ * @param serveMode development mode
54
+ * @param evolveOptions evolve options
55
+ * @returns
56
+ */
57
+ export declare const createCircularDependencyRspackPlugins: (serveMode: boolean, evolveOptions: FlatEvolveOptions) => Plugins;
@@ -0,0 +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 +1 @@
1
- import{assertSwcImportOptions}from"@flatjs/babel-plugin-import/helpers";import{requireResolve}from"@flatjs/common";import{shouldEnableReactFastRefresh}from"../../helpers/should-enable-react-fast-refresh.js";export const rspackRuleScripts=(e,r,t)=>{const{loaderOptions:s,projectCwd:o,inspector:a}=t,{modularImports:p=[]}=s,l=assertSwcImportOptions(o,p),m=shouldEnableReactFastRefresh(e,r,t),c=[];return c.push([requireResolve(import.meta.url,"@flatjs/swc-plugin-import"),{modularImports:l}]),e&&a&&c.push(["@hyperse/inspector-swc-plugin",{projectCwd:o}]),{test:/\.(jsx|tsx|ts|js|mjs|cjs|mts|cts)$/,exclude:/node_modules/,use:[{loader:"builtin:swc-loader",options:{jsc:{parser:{decorators:!0,syntax:"typescript",tsx:!0},externalHelpers:!0,experimental:{keepImportAttributes:!0,plugins:[...c]},transform:{legacyDecorator:!0,react:{runtime:"automatic",pragma:"React.createElement",pragmaFrag:"React.Fragment",throwIfNamespace:!0,development:m,refresh:m}}},env:{mode:"entry",targets:{browsers:["ie >= 11","safari > 10"]}}}}]}};
1
+ import{assertSwcImportOptions}from"@flatjs/babel-plugin-import/helpers";import{requireResolve}from"@flatjs/common";import{shouldEnableReactFastRefresh}from"../../helpers/should-enable-react-fast-refresh.js";export const rspackRuleScripts=(e,r,t)=>{const{loaderOptions:s,projectCwd:o,inspector:a}=t,{modularImports:p=[]}=s,l=assertSwcImportOptions(o,p),m=shouldEnableReactFastRefresh(e,r,t),n=[];return n.push([requireResolve(import.meta.url,"@flatjs/swc-plugin-import"),{modularImports:l}]),e&&a&&n.push(["@hyperse/inspector-swc-plugin",{projectCwd:o}]),{test:/\.(jsx|tsx|ts|js|mjs|cjs|mts|cts)$/,use:[{loader:"builtin:swc-loader",options:{isModule:"unknown",jsc:{parser:{decorators:!0,syntax:"typescript",tsx:!0},externalHelpers:!0,experimental:{keepImportAttributes:!0,plugins:[...n]},transform:{legacyDecorator:!0,react:{runtime:"automatic",pragma:"React.createElement",pragmaFrag:"React.Fragment",throwIfNamespace:!0,development:m,refresh:m}}},env:{mode:"entry",targets:{browsers:["ie >= 11","safari > 10"]}}}}]}};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatjs/evolve",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -43,30 +43,30 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@armit/babel-merge": "^0.3.0",
46
- "@armit/file-utility": "^0.3.0",
46
+ "@armit/file-utility": "^0.3.1",
47
47
  "@armit/git": "^0.3.0",
48
- "@armit/package": "^0.3.0",
49
- "@babel/core": "^7.27.4",
48
+ "@armit/package": "^0.3.1",
49
+ "@babel/core": "^7.28.4",
50
50
  "@clack/prompts": "^0.11.0",
51
51
  "@discoveryjs/json-ext": "0.6.3",
52
- "@flatjs/babel-plugin-import": "2.2.9",
53
- "@flatjs/common": "2.2.4",
54
- "@flatjs/evolve-preset-babel": "2.2.4",
55
- "@flatjs/forge-postcss-plugin-pixel": "2.2.4",
56
- "@flatjs/forge-ts-checker": "1.1.2",
57
- "@flatjs/graph": "2.2.9",
58
- "@flatjs/mock": "2.4.1",
59
- "@flatjs/swc-plugin-import": "1.0.1",
60
- "@hyperse/config-loader": "^1.0.5",
52
+ "@flatjs/babel-plugin-import": "2.2.10",
53
+ "@flatjs/common": "2.2.5",
54
+ "@flatjs/evolve-preset-babel": "2.2.5",
55
+ "@flatjs/forge-postcss-plugin-pixel": "2.2.5",
56
+ "@flatjs/forge-ts-checker": "1.1.3",
57
+ "@flatjs/graph": "2.2.10",
58
+ "@flatjs/mock": "2.4.2",
59
+ "@flatjs/swc-plugin-import": "1.0.2",
60
+ "@hyperse/config-loader": "^1.0.7",
61
61
  "@hyperse/html-webpack-plugin-loader": "^1.0.7",
62
- "@hyperse/inspector": "^1.1.13",
63
- "@hyperse/inspector-babel-plugin": "^1.1.7",
64
- "@hyperse/inspector-common": "^1.1.4",
65
- "@hyperse/inspector-middleware": "^1.1.7",
66
- "@hyperse/inspector-swc-plugin": "^1.1.9",
67
- "@pmmmwh/react-refresh-webpack-plugin": "^0.6.0",
68
- "@rsdoctor/rspack-plugin": "^1.2.3",
69
- "@rspack/core": "~1.5.3",
62
+ "@hyperse/inspector": "^1.1.14",
63
+ "@hyperse/inspector-babel-plugin": "^1.1.8",
64
+ "@hyperse/inspector-common": "^1.1.5",
65
+ "@hyperse/inspector-middleware": "^1.1.8",
66
+ "@hyperse/inspector-swc-plugin": "^1.1.10",
67
+ "@pmmmwh/react-refresh-webpack-plugin": "^0.6.1",
68
+ "@rsdoctor/rspack-plugin": "^1.3.2",
69
+ "@rspack/core": "~1.5.8",
70
70
  "@rspack/dev-server": "~1.1.4",
71
71
  "@rspack/plugin-react-refresh": "^1.5.1",
72
72
  "@swc/helpers": "^0.5.17",
@@ -75,50 +75,50 @@
75
75
  "better-opn": "^3.0.2",
76
76
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
77
77
  "chokidar": "^4.0.3",
78
- "ci-info": "^4.2.0",
78
+ "ci-info": "^4.3.1",
79
79
  "css-loader": "^7.1.2",
80
- "cssnano": "^7.0.7",
80
+ "cssnano": "^7.1.1",
81
81
  "express": "^5.1.0",
82
82
  "fast-glob": "^3.3.3",
83
- "happy-dom": "^18.0.1",
84
- "html-webpack-plugin": "^5.6.3",
85
- "image-minimizer-webpack-plugin": "^4.1.3",
86
- "less": "^4.3.0",
83
+ "happy-dom": "^20.0.1",
84
+ "html-webpack-plugin": "^5.6.4",
85
+ "image-minimizer-webpack-plugin": "^4.1.4",
86
+ "less": "^4.4.2",
87
87
  "less-loader": "^12.3.0",
88
88
  "listr": "^0.14.3",
89
89
  "lodash": "^4.17.21",
90
- "log-update": "^6.1.0",
91
- "mini-css-extract-plugin": "^2.9.2",
90
+ "log-update": "^7.0.1",
91
+ "mini-css-extract-plugin": "^2.9.4",
92
92
  "postcss": "^8.5.6",
93
- "postcss-loader": "^8.1.1",
94
- "react-refresh": "^0.17.0",
95
- "svgo": "^3.3.2",
93
+ "postcss-loader": "^8.2.0",
94
+ "react-refresh": "^0.18.0",
95
+ "svgo": "^4.0.0",
96
96
  "tarjan-graph": "^3.0.0",
97
97
  "terser-webpack-plugin": "^5.3.14",
98
- "tinypool": "^1.1.1",
98
+ "tinypool": "^2.0.0",
99
99
  "tsconfig-paths-webpack-plugin": "^4.2.0",
100
100
  "type-fest": "^4.41.0",
101
- "typescript": "^5.8.3",
102
- "webpack": "^5.99.9",
101
+ "typescript": "^5.9.3",
102
+ "webpack": "5.99.9",
103
103
  "webpack-bundle-analyzer": "^4.10.2",
104
104
  "webpack-dev-server": "^5.2.2",
105
- "webpack-sources": "^3.3.2"
105
+ "webpack-sources": "^3.3.3"
106
106
  },
107
107
  "devDependencies": {
108
- "@flatjs/testing": "2.2.4",
109
- "@hyperse/eslint-config-hyperse": "^1.4.5",
110
- "@swc/core": "1.12.1",
108
+ "@flatjs/testing": "2.2.5",
109
+ "@hyperse/eslint-config-hyperse": "^1.4.8",
110
+ "@swc/core": "1.13.5",
111
111
  "@types/express": "5.0.3",
112
112
  "@types/listr": "0.14.9",
113
- "@types/node": "24.0.3",
114
- "@types/react": "19.1.8",
115
- "eslint": "^9.29.0",
113
+ "@types/node": "24.7.2",
114
+ "@types/react": "19.2.2",
115
+ "eslint": "^9.37.0",
116
116
  "imagemin-gifsicle": "7.0.0",
117
117
  "imagemin-jpegtran": "8.0.0",
118
118
  "imagemin-pngquant": "10.0.0",
119
119
  "imagemin-svgo": "11.0.1",
120
120
  "npm-run-all": "4.1.5",
121
- "react": "19.1.0",
121
+ "react": "19.2.0",
122
122
  "rimraf": "6.0.1",
123
123
  "vite-tsconfig-paths": "5.1.4",
124
124
  "vitest": "3.2.4",