Skip to content

Commit

Permalink
[chore,deps] Update build config, deps
Browse files Browse the repository at this point in the history
  • Loading branch information
amivanoff committed Sep 3, 2021
1 parent 26032b8 commit 786c39c
Show file tree
Hide file tree
Showing 10 changed files with 1,693 additions and 2,091 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/.vscode
/es
/example
/node-modules
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ module.exports = {
rules: {
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': [
'error',
{
extendDefaults: true,
types: {
'{}': false,
Function: false,
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "pwa-chrome",
"request": "launch",
"name": "Storybook in Chrome",
"url": "http://localhost:6006/?path=/story/remoteboxplot--time-series-box-plot",
"url": "http://localhost:6006/?path=/story/remotedatarenderer--remote-data-renderer",
"webRoot": "${workspaceFolder}",
},
]
Expand Down
20 changes: 7 additions & 13 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
module.exports = {
verbose: true,
preset: 'ts-jest',
preset: 'ts-jest/presets/js-with-ts-esm',
testEnvironment: 'jsdom',
transform: {
'.(ts|tsx|js)': 'ts-jest',
},
testRegex: '(/test/.*|\\.(test|spec))\\.(ts|tsx|js)$',
moduleFileExtensions: ['ts', 'tsx', 'js'],
testPathIgnorePatterns: ['/es/', '/example/', '/lib/', '/node_modules/(?!@agentlab)'],

//preset: 'ts-jest/presets/default-esm',
//transform: {},
//extensionsToTreatAsEsm: ['.ts'],
testPathIgnorePatterns: ['/cypress/', '/es/', '/example/', '/lib/', '/node_modules/'],
transformIgnorePatterns: ['node_modules/(?!(lodash-es)/)'],
collectCoverageFrom: ['./src/**/*.{js,jsx,ts,tsx}'],
coverageProvider: 'v8',
globals: {
extensionsToTreatAsEsm: ['.ts', '.js'],
'ts-jest': {
//useESM: true,
tsconfig: 'tsconfig-jest.json',
useESM: true,
},
},
};
85 changes: 44 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"clean": "rimraf dist es lib",
"start": "rollup -w",
"build": "yarn clean && yarn rollup -c",
"build-tsc": "yarn tsc --project ./tsconfig-build.json",
"test": "jest",
"test:ci": "cross-env NODE_ENV=--experimental-vm-modules jest --ci --coverage --maxWorkers=2",
"lint": "eslint \"{src,stories,test}**/*.{js,jsx,ts,tsx}\"",
"prepare": "husky install && yarn build",
"storybook": "start-storybook -p 6006",
Expand All @@ -25,88 +27,89 @@
"lint-staged": "lint-staged"
},
"peerDependencies": {
"@agentlab/ldkg-ui-react": ">=0.1.10",
"@agentlab/sparql-jsld-client": ">=5.0.0-rc.9",
"@agentlab/ldkg-ui-react": ">=0.1.12",
"@agentlab/sparql-jsld-client": "^5.0.0-rc.10",
"@ant-design/charts": "1.1.3",
"@ant-design/icons": ">=4.6.2",
"@ant-design/icons": ">=4.6.4",
"@antv/data-set": ">=0.11.8",
"@antv/g2plot": "2.3.19",
"@rdfjs/data-model": ">=1.2.0",
"antd": ">=4.16.5",
"@rdfjs/data-model": ">=1.3.3",
"antd": ">=4.16.13",
"json-pointer": ">=0.6.1",
"jsonpath-plus": "^5.1.0",
"lodash-es": ">=4.17.21",
"mobx": ">=6.3.2",
"mobx-react-lite": ">=3.2.0",
"mobx": ">=6.3.3",
"mobx-react-lite": ">=3.2.1",
"mobx-state-tree": ">=5.0.2",
"moment": ">=2.29.1",
"react": ">=17.0.2",
"react-dom": ">=17.0.2",
"react-error-boundary": ">=3.1.3"
},
"dependencies": {
"@agentlab/ldkg-ui-react": "^0.1.10",
"@agentlab/sparql-jsld-client": "^5.0.0-rc.9",
"@agentlab/ldkg-ui-react": "^0.1.12",
"@agentlab/sparql-jsld-client": "^5.0.0-rc.10",
"@ant-design/charts": "^1.1.20",
"@ant-design/icons": "^4.6.2",
"@ant-design/icons": "^4.6.4",
"@antv/data-set": "^0.11.8",
"@antv/g2plot": "2.3.19",
"@types/json-pointer": "^1.0.31",
"json-pointer": "^0.6.1",
"jsonpath-plus": "^5.1.0"
},
"devDependencies": {
"@babel/core": "^7.14.6",
"@rollup/plugin-commonjs": "^19.0.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-typescript": "^8.2.1",
"@storybook/addon-actions": "^6.3.0",
"@storybook/addon-essentials": "^6.3.0",
"@storybook/addon-links": "^6.3.0",
"@storybook/addons": "^6.3.0",
"@storybook/node-logger": "^6.3.0",
"@babel/core": "^7.15.4",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"@rollup/plugin-typescript": "^8.2.5",
"@storybook/addon-actions": "^6.3.7",
"@storybook/addon-essentials": "^6.3.7",
"@storybook/addon-links": "^6.3.7",
"@storybook/addons": "^6.3.7",
"@storybook/node-logger": "^6.3.7",
"@storybook/preset-ant-design": "^0.0.2",
"@storybook/preset-scss": "^1.0.3",
"@storybook/react": "^6.3.0",
"@storybook/react": "^6.3.7",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.1.9",
"@types/jest": "^26.0.23",
"@typescript-eslint/eslint-plugin": "^4.28.0",
"@typescript-eslint/parser": "^4.28.0",
"autoprefixer": "^10.2.5",
"@testing-library/user-event": "^13.2.1",
"@types/jest": "^27.0.1",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"autoprefixer": "^10.3.1",
"babel-loader": "^8.2.2",
"cross-env": "^7.0.3",
"css-loader": "^5.2.4",
"cssnano": "^5.0.2",
"eslint": "^7.29.0",
"cssnano": "^5.0.7",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.7.2",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-flowtype": "^5.9.2",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^24.4.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.25.1",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^6.0.0",
"jest": "^27.0.5",
"husky": "^7.0.2",
"jest": "^27.1.0",
"jest-watch-typeahead": "^0.6.4",
"lint-staged": "^11.0.0",
"postcss": "^8.2.15",
"prettier": "^2.3.1",
"lint-staged": "^11.1.2",
"postcss": "^8.3.6",
"prettier": "^2.3.2",
"rimraf": "^3.0.2",
"rollup": "^2.52.3",
"rollup": "^2.56.3",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-postcss": "^4.0.1",
"rollup-plugin-terser": "^7.0.2",
"sass": "^1.32.12",
"sass-loader": "10.1.1",
"storybook-css-modules-preset": "^1.1.1",
"style-loader": "^2.0.0",
"ts-jest": "^27.0.3",
"tslib": "^2.3.0",
"typescript": "^4.2.4",
"ts-jest": "^27.0.5",
"tslib": "^2.3.1",
"typescript": "4.3.5",
"typescript-plugin-css-modules": "^3.4.0"
},
"lint-staged": {
Expand Down
26 changes: 7 additions & 19 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* eslint-disable import/no-extraneous-dependencies */
import babel from 'rollup-plugin-babel';
import autoprefixer from 'autoprefixer';
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
import postcss from 'rollup-plugin-postcss';

import autoprefixer from 'autoprefixer';
//import cssnano from 'cssnano';
//import { terser } from 'rollup-plugin-terser';

export default {
Expand All @@ -15,13 +14,11 @@ export default {
output: [
/*{
dir: './lib',
//file: 'lib/ldkg-ui-diags.cjs.js',
format: 'cjs',
sourcemap: true,
},*/
{
dir: './es',
//file: 'es/ldkg-ui-diags.esm.js',
format: 'esm',
sourcemap: true,
},
Expand All @@ -33,20 +30,11 @@ export default {
peerDepsExternal(),
resolve(),
commonjs(),
typescript({ declaration: true, outDir: './es' }),
/*postcss({
plugins: [
autoprefixer(),
cssnano({
preset: 'default',
}),
],
inject: false,
minimize: false,
sourceMap: false,
//extensions: ['.less', '.css'],
//use: [['less', { javascriptEnabled: true }]],
}),*/
typescript({
tsconfig: './tsconfig-build.json',
declaration: true,
outDir: './es',
}),
postcss({
plugins: [autoprefixer()],
sourceMap: true,
Expand Down
12 changes: 12 additions & 0 deletions tsconfig-build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
"extends": "./tsconfig",
"include": ["src"],
"exclude": ["cypress", "es", "lib", "node_modules", "stories", "test"],
"compilerOptions": {
"module": "es2020",
"target": "es2019",
"lib": ["dom", "dom.iterable", "esnext"]
//"types": []
}
}
13 changes: 0 additions & 13 deletions tsconfig-jest.json

This file was deleted.

17 changes: 8 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
"include": ["src"],
"exclude": ["es", "lib", "node_modules", "stories", "test"],
"include": ["src", "stories", "test"],
"exclude": ["es", "lib", "node_modules"],
"compilerOptions": {
"module": "es2020",
"target": "es2019",
"module": "esnext",
"target": "esnext",
"lib": ["dom", "dom.iterable", "esnext"],
"outDir": "./lib",
"allowJs": true,
Expand All @@ -14,15 +14,16 @@
// output .js.map sourcemap files for consumers
"sourceMap": true,
// match output dir to input dir. e.g. dist/index instead of dist/src/index
////"rootDir": "./src",
//"rootDir": "./src",
// stricter type-checking for stronger correctness. Recommended by TS
"strict": true,
// linter checks for common issues
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"types": ["jest"],
// noUnused* overlap with @typescript-eslint/no-unused-vars, can disable if duplicative
//"noUnusedLocals": true,
//"noUnusedParameters": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
// use Node's module resolution algorithm, instead of the legacy TS one
"moduleResolution": "node",
"resolveJsonModule": true,
Expand All @@ -38,8 +39,6 @@
"forceConsistentCasingInFileNames": true,
// `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc`
"noEmit": true,
"noEmitOnError": true,
"types": ["jest"],
"plugins": [
{
"name": "typescript-plugin-css-modules"
Expand Down
Loading

0 comments on commit 786c39c

Please sign in to comment.