ko 6.6.3 → 6.6.5-beta.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.
@@ -9,6 +9,7 @@ const webpack_2 = __importDefault(require("../webpack"));
9
9
  const factory_1 = __importDefault(require("./factory"));
10
10
  const detect_port_1 = __importDefault(require("detect-port"));
11
11
  const inquirer_1 = __importDefault(require("inquirer"));
12
+ const lodash_1 = require("lodash");
12
13
  class Dev extends factory_1.default {
13
14
  constructor(service) {
14
15
  super(service);
@@ -120,10 +121,11 @@ class Dev extends factory_1.default {
120
121
  process.env.NODE_ENV = 'development';
121
122
  this.service.freezeCliOptsWith(cliOpts);
122
123
  const config = await this.generateConfig();
123
- const port = config.devServer?.port;
124
+ const serverConfig = (0, lodash_1.omit)(config.devServer, 'compilationSuccessInfo');
125
+ const port = serverConfig.port;
124
126
  const newPort = (await this.checkPort(port));
125
127
  const compiler = (0, webpack_1.default)(config);
126
- const devServer = new webpack_dev_server_1.default({ ...config.devServer, port: newPort }, compiler);
128
+ const devServer = new webpack_dev_server_1.default({ ...serverConfig, port: newPort }, compiler);
127
129
  await devServer.start();
128
130
  const exitProcess = (callback) => () => {
129
131
  callback && callback();
package/lib/cli.js CHANGED
File without changes
package/lib/types.d.ts CHANGED
@@ -2,7 +2,19 @@ import { Pattern } from 'copy-webpack-plugin';
2
2
  import { Plugin } from 'postcss';
3
3
  import { IKeys, IOpts } from 'ko-lints';
4
4
  import { IOpts as AutoPolyfillsWebpackPluginOptions } from '@dtinsight/auto-polyfills-webpack-plugin';
5
- import { ClientConfiguration } from 'webpack-dev-server';
5
+ import { ClientConfiguration, Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
6
+ export interface IServeConfig extends WebpackDevServerConfiguration {
7
+ proxy?: Record<string, any>;
8
+ host: string;
9
+ port: number;
10
+ staticPath?: string;
11
+ client?: boolean | ClientConfiguration | undefined;
12
+ historyApiFallback?: any;
13
+ compilationSuccessInfo?: {
14
+ messages: string[];
15
+ notes?: string[];
16
+ };
17
+ }
6
18
  export type IOptions = {
7
19
  /**
8
20
  * The current working directory.
@@ -83,20 +95,9 @@ export type IOptions = {
83
95
  /**
84
96
  * Options for the development server.
85
97
  * Docs url: https://webpack.js.org/configuration/dev-server/
86
- * @param {{proxy?: Record<string, any>, host: string, port: number, staticPath?: string, historyApiFallback?: any, compilationSuccessInfo?: { messages: string[]; notes?: string[] }}}
87
- */
88
- serve: {
89
- proxy?: Record<string, any>;
90
- host: string;
91
- port: number;
92
- staticPath?: string;
93
- client?: boolean | ClientConfiguration | undefined;
94
- historyApiFallback?: any;
95
- compilationSuccessInfo?: {
96
- messages: string[];
97
- notes?: string[];
98
- };
99
- };
98
+ * @param {IServeConfig}
99
+ */
100
+ serve: IServeConfig;
100
101
  /**
101
102
  * Experimental features to enable.
102
103
  * @param {{speedUp?: boolean, minimizer?: boolean, disableLazyImports?: boolean, enableCssModule?: boolean, compress?: any}}
@@ -7,16 +7,18 @@ declare const loaders: (opts: IWebpackOptions) => (false | {
7
7
  };
8
8
  } | {
9
9
  test: RegExp;
10
- use: {
10
+ use: ({
11
11
  loader: string;
12
- }[];
13
- exclude?: undefined;
14
- } | {
15
- test: RegExp;
16
- exclude: (input: string) => boolean;
17
- use: {
12
+ } | {
18
13
  loader: string;
19
- }[];
14
+ options: {
15
+ esModule: boolean;
16
+ modules: {
17
+ namedExport: boolean;
18
+ localIdentName: string;
19
+ };
20
+ };
21
+ })[];
20
22
  } | {
21
23
  test: RegExp;
22
24
  loader: string;
@@ -25,47 +27,5 @@ declare const loaders: (opts: IWebpackOptions) => (false | {
25
27
  inline: string;
26
28
  };
27
29
  use?: undefined;
28
- } | {
29
- test: RegExp;
30
- include: (input: string) => boolean;
31
- use: ({
32
- loader: string;
33
- options: {
34
- presets: (string | {
35
- useAbsoluteRuntime: boolean;
36
- })[][];
37
- plugins: ((string | {
38
- libraryName: string;
39
- libraryDirectory: string;
40
- style: string;
41
- })[] | (string | {
42
- libraryName: string;
43
- libraryDirectory: string;
44
- camel2DashComponentName: string;
45
- })[])[];
46
- babelrc: boolean;
47
- configFile: boolean;
48
- cacheIdentifier: string;
49
- cacheDirectory: boolean;
50
- cacheCompression: boolean;
51
- compact: boolean;
52
- };
53
- } | {
54
- loader: string;
55
- options: {
56
- name: string;
57
- loader?: undefined;
58
- target?: undefined;
59
- };
60
- } | {
61
- loader: string;
62
- options: {
63
- loader: string;
64
- target: string;
65
- name?: undefined;
66
- };
67
- })[];
68
- loader?: undefined;
69
- options?: undefined;
70
30
  } | undefined)[];
71
31
  export default loaders;
@@ -9,10 +9,32 @@ declare class Style {
9
9
  private opts;
10
10
  constructor(opts: IWebpackOptions);
11
11
  get config(): (false | {
12
+ test: RegExp;
13
+ use: ({
14
+ loader: string;
15
+ } | {
16
+ loader: string;
17
+ options: {
18
+ esModule: boolean;
19
+ modules: {
20
+ namedExport: boolean;
21
+ localIdentName: string;
22
+ };
23
+ };
24
+ })[];
25
+ } | {
26
+ test: RegExp;
27
+ use: {
28
+ loader: string;
29
+ }[];
30
+ exclude: RegExp;
31
+ include?: undefined;
32
+ } | {
12
33
  test: RegExp;
13
34
  use: {
14
35
  loader: string;
15
36
  }[];
37
+ include: RegExp;
16
38
  exclude?: undefined;
17
39
  } | {
18
40
  test: RegExp;
@@ -20,6 +42,7 @@ declare class Style {
20
42
  use: {
21
43
  loader: string;
22
44
  }[];
45
+ include?: undefined;
23
46
  } | undefined)[];
24
47
  get sassCssModuleConfig(): {
25
48
  test: RegExp;
@@ -24,6 +24,12 @@ class Style {
24
24
  {
25
25
  test: /\.css$/,
26
26
  use: [this.styleLoader, this.cssLoader, this.postCSSLoader],
27
+ exclude: /node_modules/
28
+ },
29
+ {
30
+ test: /\.css$/,
31
+ use: [this.styleLoader, this.cssLoader],
32
+ include: /node_modules/
27
33
  },
28
34
  {
29
35
  test: /\.s[ac]ss$/,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ko",
3
- "version": "6.6.3",
3
+ "version": "6.6.5-beta.0",
4
4
  "description": "build & lint library",
5
5
  "keywords": [
6
6
  "ko",
@@ -34,16 +34,22 @@
34
34
  "files": [
35
35
  "lib/*"
36
36
  ],
37
+ "scripts": {
38
+ "prepublishOnly": "rm -rf lib && tsc",
39
+ "debug": "tsc -w --sourceMap",
40
+ "test": "jest",
41
+ "build": "tsc"
42
+ },
37
43
  "dependencies": {
38
44
  "@babel/core": "^7.18.0",
39
- "@dtinsight/auto-polyfills-webpack-plugin": "2.0.0",
45
+ "@dtinsight/auto-polyfills-webpack-plugin": "workspace:2.0.0",
40
46
  "@nuxt/friendly-errors-webpack-plugin": "^2.5.2",
41
47
  "@parcel/css": "^1.12.2",
42
48
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
43
49
  "autoprefixer": "^10.4.7",
44
50
  "babel-loader": "^8.2.5",
45
51
  "babel-plugin-treasure": "^0.9.0",
46
- "babel-preset-ko-app": "^1.0.0",
52
+ "babel-preset-ko-app": "workspace:^1.0.0",
47
53
  "buffer": "^6.0.3",
48
54
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
49
55
  "chalk": "^4.1.2",
@@ -54,11 +60,11 @@
54
60
  "css-loader": "^6.7.1",
55
61
  "css-minimizer-webpack-plugin": "^4.0.0",
56
62
  "detect-port": "^2.0.0",
57
- "dynamic-resolve-webpack-plugin": "^2.0.0",
63
+ "dynamic-resolve-webpack-plugin": "workspace:^2.0.0",
58
64
  "esbuild-loader": "^2.19.0",
59
65
  "html-webpack-plugin": "^5.5.0",
60
66
  "inquirer": "^8.2.2",
61
- "ko-lints": "^4.0.0",
67
+ "ko-lints": "workspace:^4.0.0",
62
68
  "less": "^3.13.1",
63
69
  "less-loader": "^9.1.0",
64
70
  "lodash": "^4.17.21",
@@ -96,11 +102,5 @@
96
102
  },
97
103
  "engines": {
98
104
  "node": ">=14"
99
- },
100
- "scripts": {
101
- "debug": "tsc -w --sourceMap",
102
- "test": "jest",
103
- "build": "tsc"
104
- },
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"
106
- }
105
+ }
106
+ }