ko 6.6.7 → 6.6.8-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.
package/lib/cli.js CHANGED
File without changes
@@ -52,6 +52,7 @@ class Config {
52
52
  disableLazyImports: false,
53
53
  },
54
54
  autoPolyfills: false,
55
+ babelIncludes: [],
55
56
  };
56
57
  }
57
58
  }
package/lib/types.d.ts CHANGED
@@ -61,6 +61,22 @@ export type IOptions = {
61
61
  * @param {HookOptions[]}
62
62
  */
63
63
  plugins?: HookOptions[];
64
+ /**
65
+ * Additional packages/paths to transpile via Babel, on top of ko's defaults.
66
+ *
67
+ * ko already transpiles these by default (they publish ES2020+ syntax):
68
+ * - `immer`
69
+ * - `react-grid-layout`
70
+ * - `monaco-editor`
71
+ * - internal `dt-common` source (`node_modules/dt-common/src/**`)
72
+ *
73
+ * You do not need to re-list them here. Use this to add your own
74
+ * ES2020+ packages that ko doesn't know about. Entries are matched
75
+ * as substring against the file path.
76
+ *
77
+ * @param {string[]}
78
+ */
79
+ babelIncludes?: string[];
64
80
  /**
65
81
  * The path to the HTML template to use for the application.
66
82
  * @param {string}
@@ -76,7 +76,10 @@ class Script {
76
76
  else if (input.includes('monaco-editor')) {
77
77
  return true;
78
78
  }
79
- else if (input.includes('node_modules')) {
79
+ if (this.opts.babelIncludes?.some(item => item && input.includes(item))) {
80
+ return true;
81
+ }
82
+ if (input.includes('node_modules')) {
80
83
  return false;
81
84
  }
82
85
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ko",
3
- "version": "6.6.7",
3
+ "version": "6.6.8-beta.0",
4
4
  "description": "build & lint library",
5
5
  "keywords": [
6
6
  "ko",
@@ -34,17 +34,23 @@
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
45
  "core-js": "^3.30.0",
40
- "@dtinsight/auto-polyfills-webpack-plugin": "2.0.0",
46
+ "@dtinsight/auto-polyfills-webpack-plugin": "workspace:2.0.0",
41
47
  "@nuxt/friendly-errors-webpack-plugin": "^2.5.2",
42
48
  "@parcel/css": "^1.12.2",
43
49
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
44
50
  "autoprefixer": "^10.4.7",
45
51
  "babel-loader": "^8.2.5",
46
52
  "babel-plugin-treasure": "^0.9.0",
47
- "babel-preset-ko-app": "^1.0.0",
53
+ "babel-preset-ko-app": "workspace:^1.0.0",
48
54
  "buffer": "^6.0.3",
49
55
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
50
56
  "chalk": "^4.1.2",
@@ -55,11 +61,11 @@
55
61
  "css-loader": "^6.7.1",
56
62
  "css-minimizer-webpack-plugin": "^4.0.0",
57
63
  "detect-port": "^2.0.0",
58
- "dynamic-resolve-webpack-plugin": "^2.0.0",
64
+ "dynamic-resolve-webpack-plugin": "workspace:^2.0.0",
59
65
  "esbuild-loader": "^2.19.0",
60
66
  "html-webpack-plugin": "^5.5.0",
61
67
  "inquirer": "^8.2.2",
62
- "ko-lints": "^4.0.0",
68
+ "ko-lints": "workspace:^4.0.0",
63
69
  "less": "^3.13.1",
64
70
  "less-loader": "^9.1.0",
65
71
  "lodash": "^4.17.21",
@@ -97,11 +103,5 @@
97
103
  },
98
104
  "engines": {
99
105
  "node": ">=14"
100
- },
101
- "scripts": {
102
- "debug": "tsc -w --sourceMap",
103
- "test": "jest",
104
- "build": "tsc"
105
- },
106
- "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"
107
- }
106
+ }
107
+ }