Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update devDependencies, fix eslint, use ES6 #330

Merged
merged 11 commits into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ coverage
*.map.js
*.bundle.js
*.config.js
.eslintrc.js

# jetbrains IDE stuff
.idea/
Expand Down
13 changes: 6 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ module.exports = {
afterEach: 'readonly'
},
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint'
],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
afshin marked this conversation as resolved.
Show resolved Hide resolved
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'ES6',
project: ['./tsconfigbase.json']
},
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
Expand All @@ -44,7 +43,7 @@ module.exports = {
'no-inner-declarations': 'off',
'no-prototype-builtins': 'off',
'no-control-regex': 'warn',
'no-undef': 'warn',
'no-undef': 'off',
'no-case-declarations': 'warn',
'no-useless-escape': 'off',
'prefer-const': 'off',
Expand Down
4 changes: 2 additions & 2 deletions examples/example-accordionpanel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"source-map-loader": "0.2.4",
"style-loader": "^1.0.2",
"typescript": "~4.7.3",
"webpack": "^4.41.3",
"webpack-cli": "^3.3.10"
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
}
}
4 changes: 2 additions & 2 deletions examples/example-accordionpanel/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"sourceMap": true,
"module": "commonjs",
"moduleResolution": "node",
"target": "ES5",
"target": "ES6",
"outDir": "./build",
"lib": ["ES5", "ES2015.Promise", "ES2015.Iterable", "DOM"],
"lib": ["DOM", "ES6"],
"types": []
},
"include": ["src/*"]
Expand Down
4 changes: 2 additions & 2 deletions examples/example-datagrid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"rimraf": "^3.0.2",
"style-loader": "^1.0.2",
"typescript": "~4.7.3",
"webpack": "^4.41.3",
"webpack-cli": "^3.3.10"
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
}
}
4 changes: 2 additions & 2 deletions examples/example-datagrid/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"strictNullChecks": true,
"module": "commonjs",
"moduleResolution": "node",
"target": "ES5",
"target": "ES6",
"outDir": "./build",
"lib": ["ES5", "ES2015.Promise", "ES2015.Iterable", "DOM"],
"lib": ["DOM", "ES6"],
"types": []
},
"include": ["src/*"]
Expand Down
26 changes: 13 additions & 13 deletions examples/example-dockpanel-iife/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@

<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.js"></script>

<script src="../../packages/algorithm/dist/index.min.js"></script>
<script src="../../packages/collections/dist/index.min.js"></script>
<script src="../../packages/properties/dist/index.min.js"></script>
<script src="../../packages/messaging/dist/index.min.js"></script>
<script src="../../packages/signaling/dist/index.min.js"></script>
<script src="../../packages/disposable/dist/index.min.js"></script>
<script src="../../packages/domutils/dist/index.min.js"></script>
<script src="../../packages/coreutils/dist/index.min.js"></script>
<script src="../../packages/keyboard/dist/index.min.js"></script>
<script src="../../packages/commands/dist/index.min.js"></script>
<script src="../../packages/dragdrop/dist/index.min.js"></script>
<script src="../../packages/virtualdom/dist/index.min.js"></script>
<script src="../../packages/widgets/dist/index.min.js"></script>
<script src="../../packages/algorithm/dist/index.js"></script>
<script src="../../packages/collections/dist/index.js"></script>
<script src="../../packages/properties/dist/index.js"></script>
<script src="../../packages/messaging/dist/index.js"></script>
<script src="../../packages/signaling/dist/index.js"></script>
<script src="../../packages/disposable/dist/index.js"></script>
<script src="../../packages/domutils/dist/index.js"></script>
<script src="../../packages/coreutils/dist/index.js"></script>
<script src="../../packages/keyboard/dist/index.js"></script>
<script src="../../packages/commands/dist/index.js"></script>
<script src="../../packages/dragdrop/dist/index.js"></script>
<script src="../../packages/virtualdom/dist/index.js"></script>
<script src="../../packages/widgets/dist/index.js"></script>

<link href="./style/index.css" rel="stylesheet">
<script src="./src/index.js"></script>
Expand Down
19 changes: 11 additions & 8 deletions examples/example-dockpanel-iife/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,18 @@ function createMenu() {
return root;
}

function ContentWidget(name) {
Widget.call(this, { node: ContentWidget.prototype.createNode() });
this.setFlag(Widget.Flag.DisallowLayout);
this.addClass('content');
this.addClass(name.toLowerCase());
this.title.label = name;
this.title.closable = true;
this.title.caption = 'Long description for: ' + name;
class ContentWidget extends Widget {
constructor(name) {
super({ node: ContentWidget.prototype.createNode() });
this.setFlag(Widget.Flag.DisallowLayout);
this.addClass('content');
this.addClass(name.toLowerCase());
this.title.label = name;
this.title.closable = true;
this.title.caption = 'Long description for: ' + name;
}
}

ContentWidget.prototype = Object.create(Widget.prototype);

ContentWidget.prototype.createNode = function () {
Expand Down
4 changes: 2 additions & 2 deletions examples/example-dockpanel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"source-map-loader": "0.2.4",
"style-loader": "^1.0.2",
"typescript": "~4.7.3",
"webpack": "^4.41.3",
"webpack-cli": "^3.3.10"
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
}
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lerna": "3.14.1",
"lerna": "5.3.0",
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true
Expand Down
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,18 @@
"update:dependency": "update-dependency --lerna",
"update:versions": "lerna version --no-push --no-git-tag-version"
},
"dependencies": {},
"devDependencies": {
"@jupyterlab/buildutils": "^3.0.0",
"@typescript-eslint/eslint-plugin": "~4.8.1",
"@typescript-eslint/parser": "~4.8.1",
"eslint": "~7.14.0",
"eslint-config-prettier": "~6.15.0",
"eslint-plugin-prettier": "~3.1.4",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"@typescript-eslint/parser": "^5.32.0",
"eslint": "^8.21.0",
afshin marked this conversation as resolved.
Show resolved Hide resolved
"husky": "^4.2.5",
"lerna": "^4.0.0",
"lerna": "^5.3.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 we should definitely bring that to JLab

"lint-staged": "^10.2.13",
"prettier": "~2.1.1",
"prettier": "^2.7.1",
"shell-quote": "^1.7.2",
"typedoc": "~0.23.9"
"typedoc": "~0.23.9",
"typescript": "~4.7.3"
},
"jupyter-releaser": {
"skip": [
Expand Down
13 changes: 7 additions & 6 deletions packages/algorithm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
},
"devDependencies": {
"@microsoft/api-extractor": "^7.6.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@types/mocha": "^2.2.39",
"chai": "^4.3.4",
"karma": "^6.3.4",
Expand All @@ -56,17 +57,17 @@
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"mocha": "^9.0.3",
"postcss": "^8.4.14",
"rimraf": "^3.0.2",
"rollup": "^2.56.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-postcss": "^4.0.0",
"rollup": "^2.77.2",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-sourcemaps": "^0.6.3",
"terser": "^5.7.1",
"tslib": "^2.3.0",
"tslib": "^2.4.0",
"typedoc": "~0.23.9",
"typescript": "~4.7.3",
"webpack": "^4.41.3",
"webpack-cli": "^3.3.10"
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
Comment on lines +69 to +70
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably out of scope for this PR. But it will be nice to drop webpack because it is inconsistent to distribute lumino using rollup but testing it using webpack.

},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/algorithm/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import nodeResolve from 'rollup-plugin-node-resolve';
import nodeResolve from '@rollup/plugin-node-resolve';
import sourcemaps from 'rollup-plugin-sourcemaps';
import postcss from 'rollup-plugin-postcss';

Expand Down
6 changes: 3 additions & 3 deletions packages/algorithm/src/iter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ export function toArray<T>(object: IterableOrArrayLike<T>): T[] {
* toObject(data); // { one: 1, two: 2, three: 3 }
* ```
*/
export function toObject<T>(
object: IterableOrArrayLike<[string, T]>
): { [key: string]: T } {
export function toObject<T>(object: IterableOrArrayLike<[string, T]>): {
[key: string]: T;
} {
let it = iter(object);
let pair: [string, T] | undefined;
let result: { [key: string]: T } = {};
Expand Down
2 changes: 1 addition & 1 deletion packages/algorithm/tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../../tsconfigbase",
"compilerOptions": {
"lib": ["ES5"],
"lib": ["ES6"],
"outDir": "lib",
"rootDir": "src",
"types": ["chai", "mocha"]
Expand Down
2 changes: 1 addition & 1 deletion packages/algorithm/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfigbase",
"compilerOptions": {
"declarationDir": "types",
"lib": ["ES5", "ES2015.Collection", "ES2015.Iterable"],
"lib": ["ES6"],
"outDir": "lib",
"rootDir": "src"
},
Expand Down
13 changes: 7 additions & 6 deletions packages/application/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
},
"devDependencies": {
"@microsoft/api-extractor": "^7.6.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@types/chai": "^3.4.35",
"@types/mocha": "^2.2.39",
"chai": "^4.3.4",
Expand All @@ -62,17 +63,17 @@
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"mocha": "^9.0.3",
"postcss": "^8.4.14",
"rimraf": "^3.0.2",
"rollup": "^2.56.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-postcss": "^4.0.0",
"rollup": "^2.77.2",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-sourcemaps": "^0.6.3",
"terser": "^5.7.1",
"tslib": "^2.3.0",
"tslib": "^2.4.0",
"typedoc": "~0.23.9",
"typescript": "~4.7.3",
"webpack": "^4.41.3",
"webpack-cli": "^3.3.10"
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/application/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import nodeResolve from 'rollup-plugin-node-resolve';
import nodeResolve from '@rollup/plugin-node-resolve';
import sourcemaps from 'rollup-plugin-sourcemaps';
import postcss from 'rollup-plugin-postcss';

Expand Down
2 changes: 1 addition & 1 deletion packages/application/tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../../tsconfigbase",
"compilerOptions": {
"lib": ["ES5"],
"lib": ["ES6"],
"outDir": "lib",
"rootDir": "src",
"types": ["chai", "mocha"]
Expand Down
8 changes: 1 addition & 7 deletions packages/application/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
"extends": "../../tsconfigbase",
"compilerOptions": {
"declarationDir": "types",
"lib": [
"ES5",
"ES2015.Collection",
"ES2015.Promise",
"ES2015.Iterable",
"DOM"
],
"lib": ["DOM", "ES6"],
"outDir": "lib",
"rootDir": "src"
},
Expand Down
13 changes: 7 additions & 6 deletions packages/collections/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
},
"devDependencies": {
"@microsoft/api-extractor": "^7.6.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@types/chai": "^3.4.35",
"@types/mocha": "^2.2.39",
"chai": "^4.3.4",
Expand All @@ -60,17 +61,17 @@
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"mocha": "^9.0.3",
"postcss": "^8.4.14",
"rimraf": "^3.0.2",
"rollup": "^2.56.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-postcss": "^4.0.0",
"rollup": "^2.77.2",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-sourcemaps": "^0.6.3",
"terser": "^5.7.1",
"tslib": "^2.3.0",
"tslib": "^2.4.0",
"typedoc": "~0.23.9",
"typescript": "~4.7.3",
"webpack": "^4.41.3",
"webpack-cli": "^3.3.10"
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/collections/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import nodeResolve from 'rollup-plugin-node-resolve';
import nodeResolve from '@rollup/plugin-node-resolve';
import sourcemaps from 'rollup-plugin-sourcemaps';
import postcss from 'rollup-plugin-postcss';

Expand Down
2 changes: 1 addition & 1 deletion packages/collections/tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../../tsconfigbase",
"compilerOptions": {
"lib": ["ES5"],
"lib": ["ES6"],
"outDir": "lib",
"rootDir": "src",
"types": ["chai", "mocha"]
Expand Down
2 changes: 1 addition & 1 deletion packages/collections/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfigbase",
"compilerOptions": {
"declarationDir": "types",
"lib": ["ES5"],
"lib": ["ES6"],
"outDir": "lib",
"rootDir": "src"
},
Expand Down
Loading