@flatjs/evolve 2.2.6 → 2.3.0

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 webpack from"webpack";import{logger}from"@flatjs/common";import{createGlobalCompilerConfig}from"../compiler/create-global-compiler.js";export const createBuildServerGlobalCompiler=async o=>{const r=createGlobalCompilerConfig(!0,o);if(r)return webpack(r,(o=>{o&&logger.error(o)}))};
1
+ import webpack from"webpack";import{logger,mergeOptions}from"@flatjs/common";import{createTsCheckerCompilerConfig}from"@flatjs/forge-ts-checker";import{isVueEntryItem}from"../helpers/is-vue-entry-item.js";export const createBuildServerGlobalCompiler=async e=>{const{entryMap:r,globalCompilerOptions:o,projectCwd:t,devServer:i}=e;if(isVueEntryItem(r))return;const p=mergeOptions({serveMode:!0,projectCwd:t,runTsChecker:o?.runTsChecker},{watchOptions:{ignored:i?.watchOptions?.ignored,poll:i?.watchOptions?.poll}}),n=createTsCheckerCompilerConfig(p);return n?webpack(n,(e=>{e&&logger.error(e)})):void 0};
@@ -1,4 +1,2 @@
1
- import webpack from 'webpack';
2
1
  import { type FlatEvolveOptions } from '../types/types-options.js';
3
- export declare const createGlobalCompilerConfig: (serveMode: boolean, evolveOptions: FlatEvolveOptions) => false | webpack.Configuration;
4
2
  export declare const createGlobalCompiler: (serveMode: boolean, evolveOptions: FlatEvolveOptions) => Promise<boolean>;
@@ -1 +1 @@
1
- import webpack from"webpack";import{getDirname}from"@armit/file-utility";import{createExternals}from"../create-webpack/create-externals.js";import{createResolve}from"../create-webpack/create-resolve.js";import{ruleBabel}from"../create-webpack/rule-sets/rule-scripts.js";import{createTsCheckerPlugins}from"../plugins/ts-checker/ts-checker-plugin.js";export const createGlobalCompilerConfig=(e,r)=>{const{projectCwd:t,webpack:o,devServer:a,globalCompilerOptions:l}=r,{runTsChecker:c=!0}=l||{};if(!c)return!1;const n=e?"development":"production",s=a?.watchOptions||{},p=[ruleBabel({})],i=[...createTsCheckerPlugins(e,r)];return{context:t,mode:n,watch:e,name:"flat/evolve/global-compiler",entry:{".global-compiler-bundle":["."]},resolve:createResolve(t,o),module:{rules:p},plugins:i,watchOptions:s,devtool:!1,externals:createExternals(o?.externals),cache:{type:"memory"},performance:{},output:{environment:{},path:getDirname(import.meta.url,"./")}}};export const createGlobalCompiler=async(e,r)=>{const t=createGlobalCompilerConfig(e,r);return!!t&&new Promise(((e,r)=>{webpack(t,(t=>{if(t)return r(t.message);e(!0)}))}))};
1
+ import{mergeOptions}from"@flatjs/common";import{createTsCheckerCompiler}from"@flatjs/forge-ts-checker";import{isVueEntryItem}from"../helpers/is-vue-entry-item.js";export const createGlobalCompiler=async(e,r)=>{const{entryMap:t,globalCompilerOptions:o,projectCwd:s,devServer:i}=r,n=mergeOptions({serveMode:e,projectCwd:s,runTsChecker:o?.runTsChecker},{runTsChecker:!isVueEntryItem(t),watchOptions:{ignored:i?.watchOptions?.ignored,poll:i?.watchOptions?.poll}});return await createTsCheckerCompiler(n)};
@@ -0,0 +1,2 @@
1
+ import type { FlatEvolveOptions } from '../types/types-options.js';
2
+ export declare const isVueEntryItem: (entryMap: FlatEvolveOptions["entryMap"]) => boolean;
@@ -0,0 +1 @@
1
+ export const isVueEntryItem=e=>{let t=!1;for(const[,r]of Object.entries(e)){if((r.entry||[]).find((e=>/.vue$/.test(e)))){t=!0;break}}return t};
@@ -1,2 +1,2 @@
1
- import { type TerserOptions } from 'terser-webpack-plugin';
2
- export type TerserMinimizerOptions = Omit<TerserOptions, 'nameCache' | 'sourceMap'>;
1
+ import type { MinifyOptions } from 'terser';
2
+ export type TerserMinimizerOptions = Omit<MinifyOptions, 'nameCache' | 'sourceMap'>;
@@ -1,7 +1,8 @@
1
+ import type { ForgeTsCheckerOptions } from '@flatjs/forge-ts-checker';
1
2
  export interface GlobalCompilerOptions {
2
3
  /**
3
4
  * The value indicates whether runs typescript type checker and linter on separate process.
4
5
  * @default true
5
6
  */
6
- runTsChecker?: boolean;
7
+ runTsChecker?: ForgeTsCheckerOptions['runTsChecker'];
7
8
  }
@@ -84,7 +84,7 @@ export interface RuleSetLoaderOptions {
84
84
  cssnanoOptions?: Record<string, unknown>;
85
85
  /**
86
86
  * Allow to extends extra plugins of `postcss-loader`
87
- * @example `['tailwindcss', {}]`
87
+ * @example `env.resolve(import.meta.url, '@tailwindcss/postcss'),
88
88
  */
89
89
  plugins?: Array<AcceptedPlugin | string | [string, Record<string, unknown>]>;
90
90
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatjs/evolve",
3
- "version": "2.2.6",
3
+ "version": "2.3.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -35,77 +35,77 @@
35
35
  "typecheck": "tsc --project ./tsconfig.json --noEmit"
36
36
  },
37
37
  "dependencies": {
38
- "@armit/babel-merge": "^0.2.9",
39
- "@armit/config-loader": "^0.3.3",
40
- "@armit/file-utility": "^0.2.9",
41
- "@armit/git": "^0.2.9",
42
- "@armit/package": "^0.2.13",
43
- "@babel/core": "^7.26.8",
44
- "@clack/prompts": "^0.10.0",
38
+ "@armit/babel-merge": "^0.2.11",
39
+ "@armit/config-loader": "^0.3.5",
40
+ "@armit/file-utility": "^0.2.11",
41
+ "@armit/git": "^0.2.11",
42
+ "@armit/package": "^0.2.15",
43
+ "@babel/core": "^7.26.10",
44
+ "@clack/prompts": "^0.10.1",
45
45
  "@discoveryjs/json-ext": "0.6.3",
46
- "@flatjs/babel-plugin-import": "2.2.6",
47
- "@flatjs/common": "2.2.1",
48
- "@flatjs/evolve-preset-babel": "2.2.1",
49
- "@flatjs/forge-postcss-plugin-pixel": "2.2.1",
50
- "@flatjs/graph": "2.2.6",
51
- "@flatjs/mock": "2.3.6",
52
- "@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
46
+ "@flatjs/babel-plugin-import": "2.2.8",
47
+ "@flatjs/common": "2.2.3",
48
+ "@flatjs/evolve-preset-babel": "2.2.3",
49
+ "@flatjs/forge-postcss-plugin-pixel": "2.2.3",
50
+ "@flatjs/forge-ts-checker": "1.1.0",
51
+ "@flatjs/graph": "2.2.8",
52
+ "@flatjs/mock": "2.4.0",
53
+ "@pmmmwh/react-refresh-webpack-plugin": "^0.5.16",
53
54
  "@types/babel__core": "^7.20.5",
54
- "babel-loader": "^9.2.1",
55
+ "babel-loader": "^10.0.0",
55
56
  "better-opn": "^3.0.2",
56
57
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
57
58
  "chokidar": "^4.0.3",
58
- "ci-info": "^4.1.0",
59
+ "ci-info": "^4.2.0",
59
60
  "css-loader": "^7.1.2",
60
61
  "cssnano": "^7.0.6",
61
- "express": "^4.21.2",
62
+ "express": "^5.1.0",
62
63
  "fast-glob": "^3.3.3",
63
- "fork-ts-checker-webpack-plugin": "^9.0.2",
64
- "happy-dom": "^17.0.2",
64
+ "happy-dom": "^17.4.4",
65
65
  "html-webpack-plugin": "^5.6.3",
66
66
  "image-minimizer-webpack-plugin": "^4.1.3",
67
- "less": "^4.2.2",
67
+ "less": "^4.3.0",
68
68
  "less-loader": "^12.2.0",
69
69
  "listr": "^0.14.3",
70
70
  "lodash": "^4.17.21",
71
71
  "log-update": "^6.1.0",
72
72
  "mini-css-extract-plugin": "^2.9.2",
73
- "postcss": "^8.5.1",
73
+ "postcss": "^8.5.3",
74
74
  "postcss-loader": "^8.1.1",
75
- "react-refresh": "^0.16.0",
75
+ "react-refresh": "^0.17.0",
76
76
  "svgo": "^3.3.2",
77
77
  "tarjan-graph": "^3.0.0",
78
- "terser-webpack-plugin": "^5.3.11",
78
+ "terser-webpack-plugin": "^5.3.14",
79
79
  "tinypool": "^1.0.2",
80
80
  "tsconfig-paths-webpack-plugin": "^4.2.0",
81
- "type-fest": "^4.34.1",
82
- "typescript": "^5.7.3",
83
- "webpack": "^5.97.1",
81
+ "type-fest": "^4.40.0",
82
+ "typescript": "^5.8.3",
83
+ "webpack": "^5.99.6",
84
84
  "webpack-bundle-analyzer": "^4.10.2",
85
- "webpack-dev-server": "^5.2.0",
85
+ "webpack-dev-server": "^5.2.1",
86
86
  "webpack-sources": "^3.2.3"
87
87
  },
88
88
  "devDependencies": {
89
- "@dimjs/lang": "2.0.1",
90
- "@dimjs/model": "2.0.2",
91
- "@dimjs/model-react": "2.0.2",
92
- "@dimjs/utils": "2.0.7",
93
- "@flatjs/testing": "2.2.1",
94
- "@hyperse/eslint-config-hyperse": "^1.2.10",
95
- "@swc/core": "1.10.15",
96
- "@types/express": "5.0.0",
89
+ "@dimjs/lang": "2.1.1",
90
+ "@dimjs/model": "2.1.1",
91
+ "@dimjs/model-react": "2.1.1",
92
+ "@dimjs/utils": "2.1.2",
93
+ "@flatjs/testing": "2.2.3",
94
+ "@hyperse/eslint-config-hyperse": "^1.4.1",
95
+ "@swc/core": "1.11.21",
96
+ "@types/express": "5.0.1",
97
97
  "@types/listr": "0.14.9",
98
- "@types/node": "22.13.1",
99
- "eslint": "^9.20.0",
98
+ "@types/node": "22.14.1",
99
+ "eslint": "^9.25.1",
100
100
  "imagemin-gifsicle": "7.0.0",
101
101
  "imagemin-jpegtran": "8.0.0",
102
102
  "imagemin-pngquant": "10.0.0",
103
103
  "imagemin-svgo": "11.0.1",
104
104
  "npm-run-all": "4.1.5",
105
- "react": "18.3.1",
105
+ "react": "19.1.0",
106
106
  "rimraf": "6.0.1",
107
107
  "vite-tsconfig-paths": "5.1.4",
108
- "vitest": "3.0.5",
108
+ "vitest": "3.1.2",
109
109
  "vue-loader": "17.4.2"
110
110
  },
111
111
  "peerDependencies": {
@@ -1,13 +0,0 @@
1
- import { type Compiler } from 'webpack';
2
- export interface TsCheckerGuardPluginOption {
3
- /**
4
- * Whether to exit the process when issues is not empty
5
- * @default false
6
- */
7
- autoExit?: boolean;
8
- }
9
- export declare class TsCheckerGuardPlugin {
10
- private options;
11
- constructor(option?: TsCheckerGuardPluginOption);
12
- apply(compiler: Compiler): void;
13
- }
@@ -1 +0,0 @@
1
- import ForkTsCheckerWebpackPlugin from"fork-ts-checker-webpack-plugin";import{logger,mergeOptions}from"@flatjs/common";export class TsCheckerGuardPlugin{constructor(r={}){this.options=mergeOptions({autoExit:!1},r)}apply(r){const t=ForkTsCheckerWebpackPlugin.getCompilerHooks(r);t.start.tap("start",(r=>(logger.info("Check typing..."),r))),t.issues.tap("issues",(r=>{const{autoExit:t}=this.options,o=r.filter((r=>"error"===r.severity));if(t&&o?.length>0)throw new Error(`TS_CHECKER_ERROR: \n ${JSON.stringify(o,null,2)}`);return r}))}}
@@ -1,3 +0,0 @@
1
- import { type WebpackPlugin } from '../../create-webpack/types.js';
2
- import { type FlatEvolveOptions } from '../../types/types-options.js';
3
- export declare const createTsCheckerPlugins: (serveMode: boolean, evolveOptions: FlatEvolveOptions) => WebpackPlugin[];
@@ -1 +0,0 @@
1
- import ForkTsCheckerWebpackPlugin from"fork-ts-checker-webpack-plugin";import{TsCheckerGuardPlugin}from"./ts-checker-guard-plugin.js";export const createTsCheckerPlugins=(e,r)=>{const{entryMap:t,globalCompilerOptions:c}=r,s=[];let n=!1;for(const[,e]of Object.entries(t)){if((e.entry||[]).find((e=>/.vue$/.test(e)))){n=!0;break}}if(c?.runTsChecker&&!n){const t=new ForkTsCheckerWebpackPlugin({async:e,devServer:!1,issue:{},typescript:{context:r.projectCwd,memoryLimit:8192}});s.push(t),s.push(new TsCheckerGuardPlugin({autoExit:!e}))}return s};