ko 6.5.2 → 6.5.3
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/README.md +5 -5
- package/lib/actions/dev.js +1 -2
- package/lib/core/config.js +0 -1
- package/lib/core/hooks.js +6 -2
- package/lib/webpack/index.js +1 -11
- package/lib/webpack/plugins.js +2 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# ko
|
|
2
|
-
|
|
2
|
+
English | [简体中文](./README_CN.md)
|
|
3
3
|
## Simple, yet powerful, tool for managing your react applications.
|
|
4
4
|
|
|
5
5
|
<a href="https://www.npmjs.com/package/ko"><img alt="NPM Status" src="https://img.shields.io/npm/v/ko.svg?style=flat"></a>
|
|
@@ -23,13 +23,13 @@ pnpm add ko --save-dev
|
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Documents
|
|
26
|
-
* [Introduction](https://dtstack.github.io/ko/docs/introduction)
|
|
27
|
-
* [Getting Started](https://dtstack.github.io/ko/docs/getting-started)
|
|
28
|
-
* [FAQ](https://dtstack.github.io/ko/docs/FAQ)
|
|
26
|
+
* [Introduction](https://dtstack.github.io/ko/zh-CN/docs/current/introduction)
|
|
27
|
+
* [Getting Started](https://dtstack.github.io/ko/zh-CN/docs/current/getting-started)
|
|
28
|
+
* [FAQ](https://dtstack.github.io/ko/zh-CN/docs/current/FAQ)
|
|
29
29
|
|
|
30
30
|
## Contributing
|
|
31
31
|
|
|
32
|
-
We'd love to have your helping hand on `ko`! See [CONTRIBUTING](
|
|
32
|
+
We'd love to have your helping hand on `ko`! See [CONTRIBUTING](../../CONTRIBUTING.md) for more information on how to get started.
|
|
33
33
|
|
|
34
34
|
## License
|
|
35
35
|
|
package/lib/actions/dev.js
CHANGED
|
@@ -14,7 +14,7 @@ class Dev extends factory_1.default {
|
|
|
14
14
|
super(service);
|
|
15
15
|
}
|
|
16
16
|
get devServerConfig() {
|
|
17
|
-
const { serve, publicPath
|
|
17
|
+
const { serve, publicPath } = this.service.config;
|
|
18
18
|
const { host, port, proxy, staticPath, historyApiFallback = false } = serve;
|
|
19
19
|
return {
|
|
20
20
|
port,
|
|
@@ -30,7 +30,6 @@ class Dev extends factory_1.default {
|
|
|
30
30
|
allowedHosts: 'all',
|
|
31
31
|
client: {
|
|
32
32
|
overlay: false,
|
|
33
|
-
logging: logLevel,
|
|
34
33
|
},
|
|
35
34
|
historyApiFallback,
|
|
36
35
|
};
|
package/lib/core/config.js
CHANGED
package/lib/core/hooks.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const tapable_1 = require("tapable");
|
|
4
7
|
const types_1 = require("../types");
|
|
8
|
+
const webpack_1 = __importDefault(require("webpack"));
|
|
5
9
|
class Hooks {
|
|
6
10
|
constructor() {
|
|
7
11
|
this.hookKeySet = types_1.HOOK_KEY_SET;
|
|
@@ -22,13 +26,13 @@ class Hooks {
|
|
|
22
26
|
const tapInstance = new tapable_1.AsyncSeriesWaterfallHook(['ctx']);
|
|
23
27
|
hooks[types_1.ACTION.ADD].forEach(hook => {
|
|
24
28
|
tapInstance.tapPromise({ name: hook.name, stage: hook.stage, before: hook.before }, async (ctx) => {
|
|
25
|
-
const result = await hook.fn(ctx);
|
|
29
|
+
const result = await hook.fn(ctx, webpack_1.default);
|
|
26
30
|
return ctx.concat(result);
|
|
27
31
|
});
|
|
28
32
|
});
|
|
29
33
|
hooks[types_1.ACTION.UPDATE].forEach(hook => {
|
|
30
34
|
tapInstance.tapPromise({ name: hook.name, stage: hook.stage, before: hook.before }, async (ctx) => {
|
|
31
|
-
const result = await hook.fn(ctx);
|
|
35
|
+
const result = await hook.fn(ctx, webpack_1.default);
|
|
32
36
|
return result;
|
|
33
37
|
});
|
|
34
38
|
});
|
package/lib/webpack/index.js
CHANGED
|
@@ -54,16 +54,6 @@ class WebpackConfig {
|
|
|
54
54
|
(0, utils_1.assert)((0, fs_1.existsSync)(pkgPath), 'project package.json file not found');
|
|
55
55
|
return require(pkgPath).version;
|
|
56
56
|
}
|
|
57
|
-
get stats() {
|
|
58
|
-
const mapping = {
|
|
59
|
-
info: 'normal',
|
|
60
|
-
error: 'errors-only',
|
|
61
|
-
warn: 'errors-warnings',
|
|
62
|
-
none: 'none',
|
|
63
|
-
};
|
|
64
|
-
const { logLevel } = this.opts;
|
|
65
|
-
return mapping[logLevel];
|
|
66
|
-
}
|
|
67
57
|
get base() {
|
|
68
58
|
const { cwd, publicPath, entry, outputPath, alias, hash, analyzer } = this.opts;
|
|
69
59
|
const webpackBaseConf = {
|
|
@@ -111,7 +101,7 @@ class WebpackConfig {
|
|
|
111
101
|
hints: false,
|
|
112
102
|
},
|
|
113
103
|
cache: this.cache,
|
|
114
|
-
stats:
|
|
104
|
+
stats: 'none',
|
|
115
105
|
infrastructureLogging: {
|
|
116
106
|
level: 'error',
|
|
117
107
|
},
|
package/lib/webpack/plugins.js
CHANGED
|
@@ -14,6 +14,7 @@ const html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
|
|
|
14
14
|
const webpack_bundle_analyzer_1 = require("webpack-bundle-analyzer");
|
|
15
15
|
const auto_polyfills_webpack_plugin_1 = __importDefault(require("auto-polyfills-webpack-plugin"));
|
|
16
16
|
const friendly_errors_webpack_plugin_1 = __importDefault(require("@nuxt/friendly-errors-webpack-plugin"));
|
|
17
|
+
const error_overlay_webpack_plugin_1 = __importDefault(require("error-overlay-webpack-plugin"));
|
|
17
18
|
function getPlugins(opts) {
|
|
18
19
|
const { isProd, htmlTemplate, copy, analyzer, autoPolyfills, serve: { host, port, compilationSuccessInfo }, } = opts;
|
|
19
20
|
return [
|
|
@@ -87,6 +88,7 @@ function getPlugins(opts) {
|
|
|
87
88
|
notes: [],
|
|
88
89
|
},
|
|
89
90
|
}),
|
|
91
|
+
!isProd && new error_overlay_webpack_plugin_1.default(),
|
|
90
92
|
isProd &&
|
|
91
93
|
autoPolyfills &&
|
|
92
94
|
(typeof autoPolyfills === 'boolean'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ko",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.3",
|
|
4
4
|
"description": "build & lint library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ko",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
56
56
|
"detect-port": "^1.3.0",
|
|
57
57
|
"dynamic-resolve-webpack-plugin": "^2.0.0",
|
|
58
|
+
"error-overlay-webpack-plugin": "^1.1.1",
|
|
58
59
|
"esbuild-loader": "^2.19.0",
|
|
59
60
|
"html-webpack-plugin": "^5.5.0",
|
|
60
61
|
"inquirer": "^8.2.2",
|
|
@@ -101,5 +102,5 @@
|
|
|
101
102
|
"test": "jest",
|
|
102
103
|
"build": "tsc"
|
|
103
104
|
},
|
|
104
|
-
"readme": "# ko\
|
|
105
|
+
"readme": "# ko\nEnglish | [简体中文](./README_CN.md)\n## Simple, yet powerful, tool for managing your react applications. \n\n<a href=\"https://www.npmjs.com/package/ko\"><img alt=\"NPM Status\" src=\"https://img.shields.io/npm/v/ko.svg?style=flat\"></a>\n\n## Features\n\n* Support building applications on top of **webpack v5** and **esbuild**\n* Customize ko to work exactly the way you need it for your applications \n* Built-in popular linting tools to lint your source code\n* Built-in support typescript\n\n## Installation\n\nYou can install ko using npm, yarn or pnpm:\n``` bash\nnpm install ko --save-dev\n# or\nyarn add ko --dev\n# or \npnpm add ko --save-dev\n```\n\n## Documents\n* [Introduction](https://dtstack.github.io/ko/zh-CN/docs/current/introduction)\n* [Getting Started](https://dtstack.github.io/ko/zh-CN/docs/current/getting-started)\n* [FAQ](https://dtstack.github.io/ko/zh-CN/docs/current/FAQ)\n\n## Contributing\n\nWe'd love to have your helping hand on `ko`! See [CONTRIBUTING](../../CONTRIBUTING.md) for more information on how to get started.\n\n## License\n\nCopyright © DTStack. All rights reserved.\n\nLicensed under the MIT license.\n"
|
|
105
106
|
}
|