Skip to content

Commit

Permalink
build: 构建编译到 es2015, 修复空值合并运算符导致编译失败的问题 close #2585 #2550 (#2587)
Browse files Browse the repository at this point in the history
* build: 构建编译到 es2015, 修复空值合并运算符导致编译失败的问题 close #2585 #2550

* test: 修复测试
  • Loading branch information
lijinke666 authored Mar 8, 2024
1 parent a82d571 commit db039d0
Show file tree
Hide file tree
Showing 19 changed files with 2,422 additions and 1,802 deletions.
1 change: 1 addition & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"code-block-style": false,
"no-bare-urls": false,
"ol-prefix": false,
"table-column-count": false,
"MD003": {
"style": "atx"
},
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.en-US.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18"> [简体中文](./CONTRIBUTING.md)
<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18" alt="language"/> [简体中文](./CONTRIBUTING.md)
English

## Any kind of contribution is welcome
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18"> 简体中文 | [English](./CONTRIBUTING.en-US.md)
<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18" alt="language" /> 简体中文 | [English](./CONTRIBUTING.en-US.md)

如果你恰好看到了这篇文章,你一定是希望对这个项目贡献自己的一份力量

Expand Down
2 changes: 1 addition & 1 deletion README.en-US.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18"> [简体中文](./README.md)
<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18" alt="language" /> [简体中文](./README.md)
English

<h1 align="center">S2</h1>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18"> 简体中文 | [English](./README.en-US.md)
<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18" alt="language" /> 简体中文 | [English](./README.en-US.md)

<h1 align="center">S2</h1>

Expand Down
43 changes: 21 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@
]
},
"devDependencies": {
"@babel/core": "^7.23.2",
"@commitlint/cli": "^18.2.0",
"@commitlint/config-conventional": "^18.1.0",
"@babel/core": "^7.24.0",
"@commitlint/cli": "^19.0.3",
"@commitlint/config-conventional": "^19.0.3",
"@microsoft/api-extractor": "^7.38.1",
"@originjs/vite-plugin-commonjs": "^1.0.3",
"@rollup/plugin-alias": "^5.0.1",
Expand All @@ -101,17 +101,17 @@
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@swc/core": "^1.3.95",
"@swc/jest": "^0.2.29",
"@swc/core": "^1.4.5",
"@swc/jest": "^0.2.36",
"@types/jest": "^27.5.2",
"@types/lodash": "4.14.199",
"@types/node": "^20.8.6",
"@types/rollup-plugin-peer-deps-external": "^2.2.2",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"@vitejs/plugin-react": "^4.1.0",
"@vitejs/plugin-vue": "^4.4.0",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vitejs/plugin-react": "^4.2.1",
"@vitejs/plugin-vue": "^5.0.4",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/vue3-jest": "^29.2.6",
Expand All @@ -121,14 +121,14 @@
"concurrently": "^8.2.2",
"cpx": "^1.5.0",
"cross-env": "^7.0.3",
"eslint": "^8.52.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-vue": "^9.17.0",
"gh-pages": "^3.2.3",
Expand All @@ -143,30 +143,29 @@
"jest-raw-loader": "^1.0.1",
"jest-url-loader": "^0.1.0",
"less": "^4.2.0",
"lint-staged": "^15.0.2",
"lint-staged": "^15.2.2",
"lodash-es": "^4.17.21",
"markdownlint-cli": "^0.37.0",
"markdownlint-cli": "^0.39.0",
"npm-run-all": "^4.1.5",
"ora": "^7.0.1",
"postcss": "^8.4.31",
"ora": "^8.0.1",
"postcss": "^8.4.35",
"postcss-less": "^6.0.0",
"prettier": "3.0.3",
"prettier": "3.2.5",
"rimraf": "^5.0.5",
"rollup": "^4.1.5",
"rollup": "^4.12.1",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-typescript2": "^0.36.0",
"rollup-plugin-visualizer": "^5.9.2",
"semantic-release": "^19.0.5",
"semantic-release-monorepo": "^7.0.5",
"semver": "^7.5.4",
"rollup-plugin-visualizer": "^5.12.0",
"semantic-release": "^23.0.2",
"semantic-release-monorepo": "^7.0.8",
"size-limit": "^11.0.0",
"stylelint": "^15.11.0",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-standard": "^34.0.0",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "^4.5.0",
"vite": "^5.1.5",
"vite-plugin-imp": "^2.4.0",
"vue-jest": "^5.0.0-alpha.10"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/s2-core/README.en-US.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18"> [简体中文](./README.md)
<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18" alt="language" /> [简体中文](./README.md)
English

<h1 align="center">S2</h1>
Expand Down
2 changes: 1 addition & 1 deletion packages/s2-core/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18"> 简体中文 | [English](./README.en-US.md)
<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18" alt="language" /> 简体中文 | [English](./README.en-US.md)

<h1 align="center">S2</h1>

Expand Down
6 changes: 3 additions & 3 deletions packages/s2-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
"tsc": "tsc --noEmit"
},
"dependencies": {
"@antv/g-lite": "^1.2.20",
"@antv/g-lite": "^1.2.22",
"@antv/event-emitter": "^0.1.3",
"@antv/g": "^5.18.23",
"@antv/g-canvas": "^1.11.25",
"@antv/g": "^5.18.25",
"@antv/g-canvas": "^1.11.27",
"d3-ease": "^3.0.1",
"d3-interpolate": "^1.3.2",
"d3-timer": "^1.0.9",
Expand Down
5 changes: 2 additions & 3 deletions packages/s2-core/src/facet/base-facet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1689,9 +1689,8 @@ export abstract class BaseFacet {
return;
}

return hiddenColumnsDetail.find(
(detail) =>
detail?.hideColumnNodes?.some((node) => node.id === columnNode.id),
return hiddenColumnsDetail.find((detail) =>
detail?.hideColumnNodes?.some((node) => node.id === columnNode.id),
);
}

Expand Down
8 changes: 4 additions & 4 deletions packages/s2-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
"devDependencies": {
"@ant-design/icons": "^5.2.6",
"@antv/event-emitter": "^0.1.3",
"@antv/g": "^5.18.23",
"@antv/g-plugin-a11y": "^0.6.20",
"@antv/g-plugin-rough-canvas-renderer": "^1.9.25",
"@antv/g2": "^5.1.11",
"@antv/g": "^5.18.25",
"@antv/g-plugin-a11y": "^0.6.22",
"@antv/g-plugin-rough-canvas-renderer": "^1.9.27",
"@antv/g2": "^5.1.15",
"@antv/s2": "workspace:*",
"@antv/s2-shared": "workspace:*",
"@testing-library/react": "^14.0.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/s2-react/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,15 @@ export default defineConfig({
},

build: {
target: 'es2015',
minify: isUmdFormat ? 'esbuild' : false,
sourcemap: true,

lib: {
name: 'S2-React',
entry: './src/index.ts',
formats: [format],
},
outDir,

rollupOptions: {
output: {
entryFileNames: `[name]${isUmdFormat ? '.min' : ''}.js`,
Expand Down
28 changes: 14 additions & 14 deletions packages/s2-vue/src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@ interface RequiredPropOption<T = any> {
export type EmitFn<
Options = Record<string, (...args: any[]) => any>,
Event extends keyof Options = keyof Options,
> = Options extends Array<infer V>
? (event: V, ...args: any[]) => void
: Record<string, any> extends Options
? (event: string, ...args: any[]) => void
: UnionToIntersection<
{
[key in Event]: Options[key] extends (...args: infer Args) => any
? (event: key, ...args: Args) => void
: (event: key, ...args: any[]) => void;
}[Event]
>;
> =
Options extends Array<infer V>
? (event: V, ...args: any[]) => void
: Record<string, any> extends Options
? (event: string, ...args: any[]) => void
: UnionToIntersection<
{
[key in Event]: Options[key] extends (...args: infer Args) => any
? (event: key, ...args: Args) => void
: (event: key, ...args: any[]) => void;
}[Event]
>;

/* -------------------------------------------------------------------------- */
/* 一些工具类型 */
Expand All @@ -46,9 +47,8 @@ type GetOptionalKeys<T> = keyof {
[K in keyof T as Pick<T, K> extends Required<Pick<T, K>> ? never : K]: K;
};

type IsEmitKey<Type> = Exclude<Type, undefined> extends (...args: any) => any
? true
: false;
type IsEmitKey<Type> =
Exclude<Type, undefined> extends (...args: any) => any ? true : false;

type TransformEmitKey<T> = T extends `on${infer R}` ? Uncapitalize<R> : T;

Expand Down
3 changes: 1 addition & 2 deletions packages/s2-vue/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,15 @@ export default defineConfig({
},

build: {
target: 'es2015',
minify: isUmdFormat ? 'esbuild' : false,
sourcemap: true,

lib: {
name: 'S2-Vue',
entry: './src/index.ts',
formats: [format],
},
outDir,

rollupOptions: {
output: {
entryFileNames: `[name]${isUmdFormat ? '.min' : ''}.js`,
Expand Down
Loading

0 comments on commit db039d0

Please sign in to comment.