Skip to content

Commit

Permalink
Merge pull request #382 from axonivy/use-esnext-target
Browse files Browse the repository at this point in the history
Use ESNext as typescript target
  • Loading branch information
ivy-cst committed Nov 6, 2023
2 parents d14d5a6 + bf29fee commit 24c626f
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 28 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ report.xml
eslint.xml
**/test-results/*
playwright-report


tsconfig.tsbuildinfo
2 changes: 1 addition & 1 deletion configs/base.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
"mocha": true,
"es6": true
},
"ignorePatterns": ["node_modules", "*.d.ts", ".eslintrc.js"]
"ignorePatterns": ["node_modules", "lib", "*.d.ts", ".eslintrc.js"]
}
6 changes: 4 additions & 2 deletions configs/base.tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"compilerOptions": {
"composite": true,
"incremental": true,
"skipLibCheck": true,
"declaration": true,
"declarationMap": true,
Expand All @@ -15,10 +17,10 @@
"allowSyntheticDefaultImports": true,
"module": "ESNext",
"moduleResolution": "node",
"target": "es2019",
"target": "ESNext",
"jsx": "react",
"jsxFactory": "JSX.createElement",
"lib": ["es6", "dom", "dom.iterable", "es2019"],
"lib": ["dom", "dom.iterable", "ESNext"],
"sourceMap": true,
"types": ["node", "reflect-metadata"]
}
Expand Down
4 changes: 2 additions & 2 deletions integration/eclipse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"vite-tsconfig-paths": "^4.2.1"
},
"scripts": {
"clean": "rimraf lib build/*",
"build": "type",
"clean": "rimraf lib build/* tsconfig.tsbuildinfo",
"build": "tsc --build",
"build:production": "yarn type && vite build",
"lint": "eslint -c ./.eslintrc.js --ext .ts ./src",
"type": "tsc --noEmit",
Expand Down
9 changes: 7 additions & 2 deletions integration/eclipse/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
"rootDir": "src",
"outDir": "lib",
"baseUrl": ".",
"types": ["vite/client"]
"types": ["vite/client"],
"noEmit": true
},
"include": ["src"]
"include": ["src"],
"references": [
{ "path": "../../packages/inscription" },
{ "path": "../../packages/editor" },
]
}
4 changes: 2 additions & 2 deletions integration/standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"vite-tsconfig-paths": "^4.2.1"
},
"scripts": {
"clean": "rimraf lib build/*",
"clean": "rimraf lib build/* tsconfig.tsbuildinfo",
"lint": "eslint -c ./.eslintrc.js --ext .ts,.tsx ./src",
"type": "tsc --noEmit",
"build": "type",
"build": "tsc --build",
"build:production": "yarn type && vite build",
"webtest": "playwright test",
"start": "vite"
Expand Down
9 changes: 7 additions & 2 deletions integration/standalone/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
"outDir": "lib",
"baseUrl": ".",
"noImplicitAny": false,
"types": ["vite/client"]
"types": ["vite/client"],
"noEmit": true
},
"include": ["src"]
"include": ["src"],
"references": [
{ "path": "../../packages/inscription" },
{ "path": "../../packages/editor" },
]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
},
"scripts": {
"build": "yarn && lerna run build",
"clean": "lerna run clean",
"build:production": "lerna run build:production",
"lint": "lerna run lint --",
"type": "lerna run type",
Expand Down
4 changes: 2 additions & 2 deletions packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"typescript": "^5.2.2"
},
"scripts": {
"clean": "rimraf lib",
"build": "yarn tsc",
"clean": "rimraf lib tsconfig.tsbuildinfo",
"build": "tsc --build",
"lint": "eslint -c ./.eslintrc.js --ext .ts,.tsx ./src",
"type": "tsc --noEmit",
"test:mocha": "mocha --config ../../configs/.mocharc.json \"./tests/**/*.spec.?(ts|tsx)\"",
Expand Down
9 changes: 8 additions & 1 deletion packages/editor/src/diagram/views.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class WorkflowEdgeView extends PolylineEdgeViewWithGapsOnIntersections {

protected renderAdditionals(edge: Edge, segments: Point[], context: RenderingContext): VNode[] {
const additionals = super.renderAdditionals(edge, segments, context);
const edgePadding = EdgePadding.from(edge);
const edgePadding = this.edgePadding(edge);
const edgePaddingNode = edgePadding ? [this.renderMouseHandle(segments, edgePadding)] : [];

const p1 = segments[segments.length - 2];
Expand All @@ -76,6 +76,13 @@ export class WorkflowEdgeView extends PolylineEdgeViewWithGapsOnIntersections {
return additionals;
}

private edgePadding(edge: Edge) {
if (edge.args) {
return EdgePadding.from(edge);
}
return undefined;
}

protected renderMouseHandle(segments: Point[], padding: number): VNode {
return (
<path
Expand Down
2 changes: 0 additions & 2 deletions packages/editor/src/edit-label/edit-label-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { injectable } from 'inversify';
export class IvyDirectLabelEditTool extends DirectLabelEditTool {
static readonly ID = 'glsp.direct-label-edit-tool';

protected editLabelKeyListener: KeyListener;

get id(): string {
return DirectLabelEditTool.ID;
}
Expand Down
8 changes: 2 additions & 6 deletions packages/editor/src/tools/node-creation-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@ import {
getAbsolutePosition,
NodeCreationTool,
NodeCreationToolMouseListener,
SModelElement,
ISnapper,
TYPES
SModelElement
} from '@eclipse-glsp/client';
import { TriggerNodeCreationAction } from '@eclipse-glsp/protocol';
import { inject, injectable, optional } from 'inversify';
import { injectable } from 'inversify';
import { addNegativeArea, removeNegativeArea } from './negative-area/model';

@injectable()
export class IvyNodeCreationTool extends NodeCreationTool {
static ID = 'tool_create_node';

@inject(TYPES.ISnapper) @optional() readonly snapper?: ISnapper;

protected ivyCreationToolMouseListener: NodeCreationToolMouseListener;

enable(): void {
Expand Down
5 changes: 4 additions & 1 deletion packages/editor/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
"baseUrl": ".",
"skipLibCheck": true
},
"include": ["src"]
"include": ["src"],
"references": [
{ "path": "../protocol" },
]
}
4 changes: 2 additions & 2 deletions packages/inscription/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"typescript": "^5.2.2"
},
"scripts": {
"clean": "rimraf lib",
"build": "tsc",
"clean": "rimraf lib tsconfig.tsbuildinfo",
"build": "tsc --build",
"type": "tsc --noEmit",
"lint": "eslint -c ./.eslintrc.js --ext .ts,.tsx ./src"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/inscription/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@
"baseUrl": ".",
"skipLibCheck": true
},
"include": ["src"]
"include": ["src"],
"references": [
{ "path": "../protocol" },
{ "path": "../editor" },
]
}
4 changes: 2 additions & 2 deletions packages/protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"typescript": "^5.2.2"
},
"scripts": {
"clean": "rimraf lib",
"build": "tsc",
"clean": "rimraf lib tsconfig.tsbuildinfo",
"build": "tsc --build",
"type": "tsc --noEmit",
"lint": "eslint -c ./.eslintrc.js --ext .ts,.tsx ./src"
},
Expand Down

0 comments on commit 24c626f

Please sign in to comment.