@modern-js/core 1.11.0-beta.0 → 1.11.1
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.
- package/CHANGELOG.md +14 -0
- package/dist/bin.js +0 -0
- package/dist/config/types/index.d.ts +14 -7
- package/dist/config/types/postcss.d.ts +28 -0
- package/dist/config/types/postcss.js +2 -0
- package/dist/loadPlugins.js +0 -1
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @modern-js/core
|
|
2
2
|
|
|
3
|
+
## 1.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f730081c: feat: modify `RuntimeConfig` type to make it extensible
|
|
8
|
+
- d1ab1f05: fix(core): should not register the `core` command
|
|
9
|
+
- 2ec8181a: fix(core): modern --version get incorrect value
|
|
10
|
+
- 6451a098: fix: cyclic dependencies of @modern-js/core and @moden-js/webpack
|
|
11
|
+
- 7fcfd6cc: fix(core): fix tools.postcss typing
|
|
12
|
+
- Updated dependencies [6451a098]
|
|
13
|
+
- Updated dependencies [d5a2cfd8]
|
|
14
|
+
- Updated dependencies [437367c6]
|
|
15
|
+
- @modern-js/utils@1.7.6
|
|
16
|
+
|
|
3
17
|
## 1.11.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/dist/bin.js
CHANGED
|
File without changes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { IncomingMessage, ServerResponse } from 'http';
|
|
3
3
|
import type { NextFunction, BffProxyOptions } from '@modern-js/types';
|
|
4
|
-
import type { MetaOptions } from '@modern-js/utils';
|
|
4
|
+
import type { MetaOptions, ChainIdentifier } from '@modern-js/utils';
|
|
5
5
|
import type { TransformOptions } from '@babel/core';
|
|
6
6
|
import type webpack from 'webpack';
|
|
7
|
-
import type { Configuration as WebpackConfiguration } from 'webpack';
|
|
8
|
-
import type
|
|
7
|
+
import type { RuleSetRule, Configuration as WebpackConfiguration } from 'webpack';
|
|
8
|
+
import type WebpackChain from '@modern-js/utils/webpack-chain';
|
|
9
9
|
import type autoprefixer from 'autoprefixer';
|
|
10
10
|
import type { BasePluginOptions, TerserOptions as RawTerserOptions } from 'terser-webpack-plugin';
|
|
11
11
|
import type { PluginConfig } from '../../loadPlugins';
|
|
@@ -14,7 +14,8 @@ import type { SassConfig, SassLoaderOptions } from './sass';
|
|
|
14
14
|
import type { LessConfig, LessLoaderOptions } from './less';
|
|
15
15
|
import type { UnbundleConfig } from './unbundle';
|
|
16
16
|
import type { SSGConfig, SSGRouteOptions, SSGMultiEntryOptions, SSGSingleEntryOptions } from './ssg';
|
|
17
|
-
import { ElectronConfig } from './electron';
|
|
17
|
+
import type { ElectronConfig } from './electron';
|
|
18
|
+
import type { PostCSSLoaderOptions } from './postcss';
|
|
18
19
|
declare type AutoprefixerOptions = autoprefixer.Options;
|
|
19
20
|
declare type TerserOptions = BasePluginOptions & RawTerserOptions;
|
|
20
21
|
export type { TestConfig, JestConfig, UnbundleConfig, SassConfig, SassLoaderOptions, LessConfig, LessLoaderOptions, SSGConfig, SSGRouteOptions, SSGMultiEntryOptions, SSGSingleEntryOptions, TransformOptions, AutoprefixerOptions, TerserOptions, };
|
|
@@ -147,15 +148,19 @@ export declare type DevServerConfig = {
|
|
|
147
148
|
after?: RequestHandler[];
|
|
148
149
|
[propsName: string]: any;
|
|
149
150
|
};
|
|
151
|
+
export declare type PostCSSConfig = PostCSSLoaderOptions | ((options: PostCSSLoaderOptions) => PostCSSLoaderOptions | void);
|
|
150
152
|
export declare type WebpackConfig = WebpackConfiguration | ((config: WebpackConfiguration, utils: {
|
|
151
153
|
env: string;
|
|
152
154
|
name: string;
|
|
153
155
|
webpack: typeof webpack;
|
|
156
|
+
addRules: (rules: RuleSetRule[]) => void;
|
|
157
|
+
prependPlugins: (plugins: WebpackConfiguration['plugins']) => void;
|
|
158
|
+
appendPlugins: (plugins: WebpackConfiguration['plugins']) => void;
|
|
159
|
+
removePlugin: (pluginName: string) => void;
|
|
154
160
|
/**
|
|
155
161
|
* @deprecated please use `tools.webpackChain` instead.
|
|
156
162
|
*/
|
|
157
163
|
chain: WebpackChain;
|
|
158
|
-
[key: string]: any;
|
|
159
164
|
}) => WebpackConfiguration | void);
|
|
160
165
|
export declare type WebpackChainConfig = (chain: WebpackChain, utils: {
|
|
161
166
|
env: string;
|
|
@@ -171,7 +176,7 @@ export interface ToolsConfig {
|
|
|
171
176
|
webpackChain?: WebpackChainConfig;
|
|
172
177
|
babel?: BabelConfig;
|
|
173
178
|
autoprefixer?: AutoprefixerConfig;
|
|
174
|
-
postcss?:
|
|
179
|
+
postcss?: PostCSSConfig;
|
|
175
180
|
styledComponents?: ConfigFunction;
|
|
176
181
|
lodash?: ConfigFunction;
|
|
177
182
|
devServer?: DevServerConfig;
|
|
@@ -204,7 +209,9 @@ export interface ToolsConfig {
|
|
|
204
209
|
*/
|
|
205
210
|
less?: LessConfig;
|
|
206
211
|
}
|
|
207
|
-
export
|
|
212
|
+
export interface RuntimeConfig {
|
|
213
|
+
[name: string]: any;
|
|
214
|
+
}
|
|
208
215
|
export interface RuntimeByEntriesConfig {
|
|
209
216
|
[name: string]: RuntimeConfig;
|
|
210
217
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Syntax, Parser, Stringifier, AcceptedPlugin, SourceMapOptions } from 'postcss';
|
|
2
|
+
export declare type PostCSSOptions = {
|
|
3
|
+
to?: string;
|
|
4
|
+
from?: string;
|
|
5
|
+
map?: boolean | SourceMapOptions;
|
|
6
|
+
syntax?: Syntax;
|
|
7
|
+
parser?: string | object | (() => Parser);
|
|
8
|
+
plugins?: AcceptedPlugin[];
|
|
9
|
+
stringifier?: Stringifier | Syntax;
|
|
10
|
+
};
|
|
11
|
+
export declare type PostCSSLoaderOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* Enable PostCSS Parser support in CSS-in-JS. If you use JS styles the postcss-js parser, add the execute option.
|
|
14
|
+
*/
|
|
15
|
+
execute?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* By default generation of source maps depends on the devtool option. All values enable source map generation except eval and false value.
|
|
18
|
+
*/
|
|
19
|
+
sourceMap?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The special implementation option determines which implementation of PostCSS to use.
|
|
22
|
+
*/
|
|
23
|
+
implementation?: unknown;
|
|
24
|
+
/**
|
|
25
|
+
* Allows to set PostCSS options and plugins.
|
|
26
|
+
*/
|
|
27
|
+
postcssOptions?: PostCSSOptions;
|
|
28
|
+
};
|
package/dist/loadPlugins.js
CHANGED
|
@@ -31,7 +31,6 @@ function getAppPlugins(appDirectory, oldPluginConfig, internalPlugins) {
|
|
|
31
31
|
.filter(name => {
|
|
32
32
|
const config = allPlugins[name];
|
|
33
33
|
if (config.forced === true) {
|
|
34
|
-
// 参考 packages/cli/core/src/bin.ts 文件
|
|
35
34
|
return true;
|
|
36
35
|
}
|
|
37
36
|
return (0, utils_1.isDepExists)(appDirectory, name);
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.11.
|
|
14
|
+
"version": "1.11.1",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"main": "./dist/index.js",
|
|
@@ -38,16 +38,14 @@
|
|
|
38
38
|
]
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
-
"bin": "./dist/bin.js",
|
|
42
41
|
"dependencies": {
|
|
43
42
|
"@modern-js/load-config": "^1.3.3",
|
|
44
43
|
"@modern-js/plugin": "^1.3.5",
|
|
45
|
-
"@modern-js/utils": "^1.7.
|
|
44
|
+
"@modern-js/utils": "^1.7.6"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
47
|
"@jest/types": "^27.0.6",
|
|
49
|
-
"@modern-js/types": "1.5.
|
|
50
|
-
"@modern-js/webpack": "1.8.0",
|
|
48
|
+
"@modern-js/types": "1.5.4",
|
|
51
49
|
"@scripts/build": "0.0.0",
|
|
52
50
|
"@scripts/jest-config": "0.0.0",
|
|
53
51
|
"@types/babel__code-frame": "^7.0.3",
|
|
@@ -60,6 +58,7 @@
|
|
|
60
58
|
"autoprefixer": "^10.3.1",
|
|
61
59
|
"btsm": "2.2.2",
|
|
62
60
|
"jest": "^27",
|
|
61
|
+
"postcss": "^8",
|
|
63
62
|
"sass": "^1.45.0",
|
|
64
63
|
"electron-builder": "22.7.0",
|
|
65
64
|
"terser-webpack-plugin": "^5.1.4",
|