Skip to content

Commit 86a0f11

Browse files
Merge pull request #25 from datavisyn/release-2.0.0
Release 2.0.0
2 parents 7b6dc0f + b476ae9 commit 86a0f11

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+6109
-22380
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
ecmaVersion: 'latest',
1111
},
1212
rules: {
13+
'no-console': 'off',
1314
'max-len': 'off',
1415
},
1516
overrides: [

.github/workflows/build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: build
22

3-
on: [push, workflow_dispatch]
3+
on:
4+
push:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '15 1 * * *'
48

59
jobs:
610
build:

README.md

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,42 @@
1-
visyn_scripts
2-
=====================
3-
[![NPM version][npm-image]][npm-url] [![Build Status][circleci-image]][circleci-url]
1+
# visyn_scripts
42

5-
This package includes scripts and configuration files used by [datavisyn](https://datavisyn.io/) repositories. Collecting everything in a single installable repository unifies configurations across many repositories, thus reducing the maintenance overhead.
3+
[![NPM version](https://badge.fury.io/js/visyn_scripts.svg)](https://npmjs.org/package/visyn_scripts)
4+
[![build](https://github.com/datavisyn/visyn_scripts/actions/workflows/build.yml/badge.svg)](https://github.com/datavisyn/visyn_scripts/actions/workflows/build.yml)
5+
6+
This package includes scripts and configuration files used by [datavisyn](https://datavisyn.io/) repositories. Collecting everything in a single installable repository unifies configurations across many repositories, thus reducing the maintenance overhead.
67

78
## Usage
89

910
Install visyn_scripts via npm: `npm i --save-dev git+ssh://[email protected]/datavisyn/visyn_scripts.git#develop`
1011

11-
Add visyn_scripts to your package.json scripts, i.e. add `"compile": "visyn_scripts compile"` and execute it with `npm run compile`, or alternatively directly execute it with `npx visyn_scripts compile`.
12+
Add visyn_scripts to your package.json scripts, i.e. add `"compile": "visyn_scripts compile"` and execute it with `npm run compile`, or alternatively directly execute it with `npx visyn_scripts compile`.
1213

1314
## Scripts
1415

1516
The main purpose of visyn_scripts are the unified scripts:
1617

1718
### build
18-
Builds a workspace using webpack.
19+
20+
Builds a workspace using webpack.
1921

2022
### compile
23+
2124
Builds a repository using typescript.
2225

2326
### copy
27+
2428
Copies assets, styles, and static files to the dist folder.
2529

2630
### docs
31+
2732
Generates docs of a repository using typedoc.
2833

2934
### lint
35+
3036
Lints a repository using ESLint.
3137

3238
### test
39+
3340
Tests a repository using Jest.
3441

3542
## Configurations
@@ -45,19 +52,6 @@ module.exports = require('visyn_scripts/config/prettierrc.template');
4552

4653
...
4754

55+
---
4856

49-
***
50-
51-
<a href="https://www.datavisyn.io"><img src="https://www.datavisyn.io/img/logos/datavisyn-logo.png" align="left" width="200px" hspace="10" vspace="6"></a>
52-
This repository is part of the **Target Discovery Platform** (TDP). For tutorials, API docs, and more information about the build and deployment process, see the [documentation page](https://wiki.datavisyn.io).
53-
54-
55-
56-
57-
[tdp-image-client]: https://img.shields.io/badge/Target%20Discovery%20Platform-Client%20Plugin-F47D20.svg
58-
[tdp-image-server]: https://img.shields.io/badge/Target%20Discovery%20Platform-Server%20Plugin-10ACDF.svg
59-
[tdp-url]: http://datavisyn.io
60-
[npm-image]: https://badge.fury.io/js/visyn_scripts.svg
61-
[npm-url]: https://npmjs.org/package/visyn_scripts
62-
[circleci-image]: https://circleci.com/gh/datavisyn/visyn_scripts.svg?style=shield
63-
[circleci-url]: https://circleci.com/gh/datavisyn/visyn_scripts
57+
<a href="https://www.datavisyn.io"><img src="https://www.datavisyn.io/wp-content/uploads/2021/11/datavisyn_RGB_A.svg" align="left" width="200px" hspace="10" vspace="6"></a>

bin/commands/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
describe: 'Build a workspace using webpack',
77
handler: (args) => {
88
const configPath = resolve(__dirname, '../../config/webpack.config.js');
9-
call('webpack', `--config ${configPath} ${(args.strings || []).join(' ')}`, {
9+
call('webpack', `--config "${configPath}" ${(args.strings || []).join(' ')}`, {
1010
env: {
1111
NODE_OPTIONS: '--max-old-space-size=4096',
1212
},

bin/commands/lint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ module.exports = {
88
type: 'boolean',
99
}),
1010
handler: (args) => {
11-
call('eslint', `${args.cache ? '--cache' : ''} ${(args.strings || []).join(' ')} "src/**/*.ts{,x}" "tests/**/*.ts{,x}"`);
11+
call('eslint', `${args.cache ? '--cache' : ''} --no-error-on-unmatched-pattern ${(args.strings || []).join(' ')} "src/**/*.ts{,x}" "tests/**/*.ts{,x}" "cypress/**/*.ts{,x}"`);
1212
},
1313
};

bin/commands/start.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ module.exports = {
66
describe: 'Start webpack serve',
77
handler: (args) => {
88
const configPath = resolve(__dirname, '../../config/webpack.config.js');
9-
call('webpack', `serve --mode development --config ${configPath} --progress ${(args.strings || []).join(' ')}`);
9+
call('webpack', `serve --mode development --config "${configPath}" --progress ${(args.strings || []).join(' ')}`);
1010
},
1111
};

bin/commands/utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const call = (command, args, options = {}) => {
3636
},
3737
});
3838
} catch (e) {
39-
// eslint-disable-next-line no-console
4039
console.error(e);
4140
process.exit(1);
4241
}

config/eslintrc.template.js

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ module.exports = ({ tsconfigRootDir }) => ({
88
'plugin:import/recommended',
99
'plugin:react/recommended',
1010
'plugin:@typescript-eslint/recommended',
11-
'plugin:jest/recommended',
1211
'plugin:prettier/recommended',
1312
],
14-
plugins: ['react', '@typescript-eslint', 'jest'],
13+
plugins: ['react', '@typescript-eslint'],
1514
ignorePatterns: ['*.js'],
1615
env: {
1716
browser: true,
1817
es6: true,
1918
jest: true,
19+
'cypress/globals': true,
2020
},
2121
globals: {
2222
Atomics: 'readonly',
@@ -32,42 +32,43 @@ module.exports = ({ tsconfigRootDir }) => ({
3232
rules: {
3333
// Disables jsx-a11y https://github.com/import-js/eslint-plugin-import/blob/v2.25.4/docs/rules/no-webpack-loader-syntax.md
3434
// eslint-disable-next-line global-require
35-
...Object.keys(require('eslint-plugin-jsx-a11y').rules).reduce(
36-
(acc, rule) => {
37-
acc[`jsx-a11y/${rule}`] = 'off';
38-
return acc;
39-
},
40-
{},
41-
),
35+
...Object.keys(require('eslint-plugin-jsx-a11y').rules).reduce((acc, rule) => {
36+
acc[`jsx-a11y/${rule}`] = 'off';
37+
return acc;
38+
}, {}),
4239
'class-methods-use-this': 'off',
4340
'linebreak-style': 'off',
41+
'no-console': 'off',
4442
'no-continue': 'off',
4543
'no-multi-assign': 'warn',
4644
'no-nested-ternary': 'off',
4745
'no-return-assign': 'warn',
46+
'no-restricted-exports': 'off',
4847
'no-restricted-syntax': 'off',
4948
'no-plusplus': 'off',
5049
'no-prototype-builtins': 'warn',
5150
'no-minusminus': 'off',
5251
'no-underscore-dangle': 'off',
53-
'@typescript-eslint/no-unused-expressions': ['error', {
54-
allowShortCircuit: true,
55-
allowTernary: true,
56-
allowTaggedTemplates: true,
57-
}],
52+
'@typescript-eslint/no-unused-expressions': [
53+
'error',
54+
{
55+
allowShortCircuit: true,
56+
allowTernary: true,
57+
allowTaggedTemplates: true,
58+
},
59+
],
5860
'max-classes-per-file': 'off',
5961
'no-param-reassign': ['warn', { props: true, ignorePropertyModificationsFor: ['state'] }], // Exclude state as required by redux-toolkit: https://redux-toolkit.js.org/usage/immer-reducers#linting-state-mutations
6062
'import/no-extraneous-dependencies': 'off',
61-
// Disable the following 2 lines because to allow webpack file-loaders syntax
62-
'import/no-webpack-loader-syntax': 'off',
63-
'import/no-unresolved': 'off',
63+
'import/no-webpack-loader-syntax': 'off', // Disable to allow webpack file-loaders syntax
64+
'import/no-unresolved': 'off', // Disable to allow webpack file-loaders syntax
6465
'import/prefer-default-export': 'off',
6566
'import/order': 'error',
6667
'prefer-destructuring': ['warn', { object: true, array: false }],
6768
'prefer-promise-reject-errors': 'warn',
6869
'prefer-spread': 'warn',
6970
'@typescript-eslint/ban-ts-comment': 'warn',
70-
'react/destructuring-assignment': 'warn',
71+
'react/destructuring-assignment': 'off',
7172
'react/jsx-props-no-spreading': 'off',
7273
'react/no-unused-class-component-methods': 'warn',
7374
'react/prop-types': 'off',
@@ -83,4 +84,16 @@ module.exports = ({ tsconfigRootDir }) => ({
8384
},
8485
],
8586
},
87+
overrides: [
88+
{
89+
files: ['cypress/**/*'],
90+
extends: ['plugin:cypress/recommended', 'plugin:chai-friendly/recommended'],
91+
plugins: ['cypress', 'chai-friendly'],
92+
},
93+
{
94+
files: ['{src|tests}/**/*.{test|spec}.ts'],
95+
extends: ['plugin:jest/recommended'],
96+
plugins: ['jest'],
97+
},
98+
],
8699
});

0 commit comments

Comments
 (0)