Skip to content

Commit

Permalink
feat: remove beemo and old IE compatibility (#1116)
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz authored Apr 20, 2023
1 parent 565efe6 commit c344c90
Show file tree
Hide file tree
Showing 14 changed files with 1,097 additions and 2,112 deletions.
8 changes: 0 additions & 8 deletions .config/beemo.ts

This file was deleted.

9 changes: 0 additions & 9 deletions .config/beemo/jest.ts

This file was deleted.

8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.eslintrc.js
babel.config.js
prettier.config.js
jest.config.js
rollup.config.js
build
dist
coverage
62 changes: 62 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'prettier', 'jest'],
extends: [
'eslint:recommended',
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended'
],
env: {
browser: true,
node: true
},
parserOptions: {
project: 'tsconfig.json',
ecmaVersion: 2020,
sourceType: 'module'
},
overrides: [
{
files: ['*.ts']
}
],
rules: {
'prettier/prettier': 'warn',
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/ban-types': 'warn',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true
}
],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-namespace': 'error',
'jest/no-conditional-expect': 'off',
// https://eslint.org/docs/rules/
'linebreak-style': ['error', 'unix'],
'no-irregular-whitespace': ['error', {skipComments: true}],
'no-alert': 'error',
'prefer-const': 'error',
'no-return-assign': 'error',
'no-useless-call': 'error',
'no-useless-concat': 'error',
"prefer-template": "error",
'no-undef': 'off', // typescript takes care of this for us
'no-unreachable': 'off' // typescript takes care of this for us
}
};
9 changes: 0 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
.DS_Store
.eslintignore
.eslintrc.js
.prettierignore
babel.config.js
beemo-error.log
build
build-es5
coverage/
jest.config.js
node_modules
npm-debug.log*
prettier.config.js
src/style.ts
tsconfig.json
yarn-debug.log*
yarn-error.log*
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.eslintrc.js
babel.config.js
jest.config.js
prettier.config.js
tsconfig.json
13 changes: 13 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
"presets": [
[
"@babel/env",
{
"targets": {
"node": "current"
}
}
],
"@babel/typescript"
]
};
22 changes: 22 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json"
],
"testPathIgnorePatterns": [
"<rootDir>/dist/",
"<rootDir>/node_modules/",
"<rootDir>/build/"
],
"coverageDirectory": "./coverage/",
"collectCoverage": true,
"testURL": "http://localhost/",
"setupFiles": [
"jest-canvas-mock"
],
"testEnvironment": "jsdom"
};
50 changes: 29 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,39 @@
"patches"
],
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/core": "^7.21.4",
"@babel/plugin-transform-runtime": "^7.21.4",
"@babel/preset-env": "^7.21.4",
"@babel/preset-typescript": "^7.21.4",
"@release-it/conventional-changelog": "^5.1.1",
"@rollup/plugin-commonjs": "24.1.0",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-terser": "^0.4.1",
"@types/semver": "^7.3.13",
"browser-sync": "^2.27.11",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"browser-sync": "^2.29.1",
"concurrently": "^8.0.1",
"del-cli": "^5.0.0",
"jest-canvas-mock": "^2.4.0",
"jest-environment-jsdom": "^29.4.3",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^29.5.0",
"jest-canvas-mock": "^2.5.0",
"jest-environment-jsdom": "^29.5.0",
"patch-package": "^6.5.1",
"postinstall-postinstall": "^2.1.0",
"release-it": "^15.6.0",
"prettier": "^2.8.7",
"release-it": "^15.10.1",
"rollup": "3.20.6",
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-ts": "^3.2.0",
"rollup": "3.20.4",
"sass": "^1.58.1",
"typescript": "^5.0.2",
"vega-lite-dev-config": "^0.21.0",
"vega-lite": "^5.2.0",
"vega": "^5.22.1"
"sass": "^1.62.0",
"typescript": "^5.0.4",
"vega": "^5.22.1",
"vega-lite": "^5.2.0"
},
"peerDependencies": {
"vega": "^5.21.0",
Expand All @@ -70,9 +80,9 @@
"dependencies": {
"fast-json-patch": "^3.1.1",
"json-stringify-pretty-compact": "^3.0.0",
"semver": "^7.3.8",
"semver": "^7.5.0",
"tslib": "^2.5.0",
"vega-interpreter": "^1.0.4",
"vega-interpreter": "^1.0.5",
"vega-schema-url-parser": "^2.2.0",
"vega-themes": "^2.12.1",
"vega-tooltip": "^0.31.0"
Expand All @@ -90,13 +100,11 @@
"serve": "browser-sync start --directory -s -f build *.html",
"start": "yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",
"pretest": "yarn build:style",
"test": "beemo jest --stdio stream",
"test": "jest --stdio stream",
"test:inspect": "node --inspect-brk ./node_modules/.bin/jest --runInBand",
"prepare": "beemo create-config && npx patch-package",
"prettierbase": "beemo prettier '*.{css,scss,html}'",
"eslintbase": "beemo eslint .",
"format": "yarn eslintbase --fix && yarn prettierbase --write",
"lint": "yarn eslintbase && yarn prettierbase --check",
"prettierbase": "prettier '*.{css,scss,html}'",
"format": "eslint . --fix && yarn prettierbase --write",
"lint": "eslint . && yarn prettierbase --check",
"release": "release-it"
}
}
13 changes: 13 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
"printWidth": 120,
"proseWrap": "never",
"overrides": [
{
"files": "*.{js,jsx,ts,tsx}",
"options": {
"bracketSpacing": false,
"singleQuote": true
}
}
]
};
4 changes: 2 additions & 2 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import resolve from "@rollup/plugin-node-resolve";
import ts from "rollup-plugin-ts";
import bundleSize from "rollup-plugin-bundle-size";
import terser from "@rollup/plugin-terser";
import bundleSize from "rollup-plugin-bundle-size";
import ts from "rollup-plugin-ts";

import pkg from "./package.json" assert { type: "json" };

Expand Down
8 changes: 0 additions & 8 deletions src/util.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import {writeConfig} from 'vega';

// polyfill for IE
if (!String.prototype.startsWith) {
// eslint-disable-next-line no-extend-native,func-names
String.prototype.startsWith = function (search, pos) {
return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
};
}

export function isURL(s: string): boolean {
return s.startsWith('http://') || s.startsWith('https://') || s.startsWith('//');
}
Expand Down
17 changes: 17 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "es2020",
"module": "es2020",
"moduleResolution": "node",
"noEmit": true,
"esModuleInterop": true,
"strict": true,
"allowSyntheticDefaultImports": true,
"importHelpers": true,
"resolveJsonModule": true
},
"include": [
"src/**/*.ts",
"test/**/*.ts"
]
}
Loading

0 comments on commit c344c90

Please sign in to comment.