Skip to content

Commit

Permalink
Merge branch 'master' into imports-2018
Browse files Browse the repository at this point in the history
- Resolve trivial merge conflicts, among them moving from .js to .ts(x)
- Migrate additional entries of the deleted `scripts/build-client-js.sh`
  and `watch-client-js.sh` to `webpack.client.js
- Migrate search results page changes, disable "Add to Collection"
  checkboxes for imports
- Drop red heading which explains imports at the bottom of search page
  for now, it has evolved since and would probably become convoluted
- Move "Review recent imports" menu entry into the docs dropdown,
  the menubar has become very crowded since 2018

Tasks which still have to be done:

- Account for the renamed entity types "creator" and "publication"
  - Use `AuthorAttributes` instead of `CreatorAttributes`
  - Use `EditionGroupAttributes` instead of `PublicationAttributes`
- Signature of `EntityImage` has changed, `backupIcon` is now an object
- Signature of `EntityRelationships` has changed and expects more props
- Check how much extra massaging is necessary for imports with the recent
  changes to search indexing!
  • Loading branch information
kellnerd committed Jun 5, 2024
2 parents f8bb16c + b3bc879 commit d055486
Show file tree
Hide file tree
Showing 622 changed files with 71,730 additions and 30,881 deletions.
1 change: 1 addition & 0 deletions .babel-ts-register.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('@babel/register')({extensions: ['.js', '.jsx', '.ts', '.tsx']});
69 changes: 23 additions & 46 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,57 +1,34 @@
{
"plugins": [
"lodash",
"transform-es2015-modules-commonjs",
"transform-object-rest-spread",
"transform-class-properties",
"array-includes",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-classes",
"@babel/plugin-transform-runtime",
[
"transform-runtime", {
"polyfill": false,
"regenerator": true
"babel-plugin-transform-require-ignore",
{
"extensions": [".scss", ".css"]
}
]
],
"presets": [
"flow",
"react",
["env", {
"@babel/preset-typescript",
"@babel/preset-react",
["@babel/preset-env", {
"corejs": 3,
"targets": {
"node": "current"
}
}]
],
"env": {
"browser": {
"plugins": [
"lodash",
"transform-es2015-modules-commonjs",
"transform-object-rest-spread",
"transform-class-properties",
"array-includes",
[
"transform-runtime", {
"polyfill": false,
"regenerator": true
}
"node": "current",
"browsers": [
"chrome >= 44",
"edge >= 14",
"firefox >= 40",
"ie >= 11",
"opera >= 43",
"safari >= 9"
]
],
"presets": [
"flow",
"react",
["env", {
"targets": {
"browsers": [
"chrome >= 44",
"edge >= 14",
"firefox >= 40",
"ie >= 11",
"opera >= 43",
"safari >= 9"
]
}
}]
]
}
}
},
"useBuiltIns": "usage"
}]
]
}
4 changes: 1 addition & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.git/
.github/
config/*
!config/config.json.ctmpl
data/
flow-typed/
lib/
Expand All @@ -10,12 +11,9 @@ static/stylesheets/
test/
.doclets.yml
.editorconfig
.eslintignore
.eslintrc.js
.flowconfig
.gitignore
.gitmodules
.tern-project
.travis-yml
LICENSE
README.md
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ insert_final_newline = true
trim_trailing_whitespace = true

# The YAML spec explicitly forbids tabs; we use YAML for ESLint
[{package.json,.eslintrc,.travis.yml}]
[{package.json,.eslintrc}]
indent_size = 2
indent_style = space
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ nyc
coverage
out
!.eslintrc.js
webpack.client.js
143 changes: 69 additions & 74 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
/* eslint-disable import/unambiguous, import/no-commonjs, no-magic-numbers */
/* eslint-disable no-inline-comments */


const options = {
env: {
es6: true,
node: true
},
extends: [
'eslint:recommended',
'plugin:flowtype/recommended',
'plugin:node/recommended',
'plugin:react/recommended',
'plugin:import/recommended'
],
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true,
generators: true,
jsx: true,
modules: false
},
ecmaVersion: 8,
sourceType: 'module'
},
'plugin:import/recommended',
'plugin:@typescript-eslint/recommended'
],
parser: '@typescript-eslint/parser',
plugins: [
'react',
'import',
'flowtype',
'babel'
]
'@typescript-eslint'
],
root: true,
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
}
},
react: {
version: 'detect'
}
}
};


Expand All @@ -38,24 +38,12 @@ const ERROR = 2;
const TRANSITION_WARNING = 1; // warnings that should be reviewed soon
const WARNING = 1; // warnings that should stay warnings
const TRANSITION_IGNORE = 0; // ignores that should be reviewed soon
const IGNORE = 0;

// These should not be removed at all.
const possibleErrorsRules = {
'for-direction': ERROR,
'getter-return': ERROR,
'no-await-in-loop': ERROR,
'no-console': ERROR,
'no-extra-parens': [
ERROR,
'all',
{
enforceForArrowConditionals: false,
ignoreJSX: 'multi-line',
nestedBinaryExpressions: false,
returnAssign: false
}
],
'no-prototype-builtins': ERROR,
'no-template-curly-in-string': ERROR,
'valid-jsdoc': [
ERROR,
Expand All @@ -74,7 +62,7 @@ const bestPracticesRules = {
'array-callback-return': ERROR,
'block-scoped-var': ERROR,
'class-methods-use-this': TRANSITION_IGNORE,
complexity: ERROR,
complexity: [ERROR, {max: 50}],
'consistent-return': ERROR,
curly: ERROR,
'default-case': ERROR,
Expand Down Expand Up @@ -142,7 +130,6 @@ const bestPracticesRules = {
'no-useless-return': ERROR,
'no-void': ERROR,
'no-warning-comments': WARNING,
'no-with': ERROR,
'prefer-promise-reject-errors': ERROR,
radix: ERROR,
'require-await': ERROR,
Expand All @@ -165,16 +152,12 @@ const variablesRules = {
'init-declarations': TRANSITION_IGNORE,
'no-catch-shadow': ERROR,
'no-label-var': ERROR,
'no-shadow': ERROR,
'no-shadow-restricted-names': ERROR,
'no-undef-init': ERROR,
'no-undefined': ERROR,
'no-unused-vars': WARNING,
'no-use-before-define': ERROR
'no-undefined': ERROR
};

const nodeAndCommonJSRules = {
'callback-return': [
'node/callback-return': [
ERROR,
[
'callback',
Expand All @@ -183,14 +166,21 @@ const nodeAndCommonJSRules = {
'done'
]
],
'global-require': ERROR,
'handle-callback-err': ERROR,
'no-mixed-requires': ERROR,
'no-new-require': ERROR,
'no-path-concat': ERROR,
'no-process-env': TRANSITION_WARNING,
'no-process-exit': ERROR,
'no-sync': ERROR
'node/global-require': ERROR,
'node/handle-callback-err': ERROR,
'node/no-missing-import': [
ERROR,
{tryExtensions: ['.js', '.jsx', '.ts', '.tsx']}
],
'node/no-mixed-requires': ERROR,
'node/no-new-require': ERROR,
'node/no-path-concat': ERROR,
'node/no-process-env': TRANSITION_WARNING,
'node/no-process-exit': ERROR,
'node/no-sync': ERROR,
'node/no-unpublished-import': IGNORE,
'node/no-unsupported-features/es-builtins': IGNORE,
'node/no-unsupported-features/es-syntax': IGNORE
};

// Agreement of all project leads needed before changing these.
Expand Down Expand Up @@ -276,9 +266,10 @@ const stylisticIssuesRules = {
6
],
'max-len': [
ERROR,
WARNING,
{
code: 80,
code: 150,
ignoreComments: true,
ignoreUrls: true,
tabWidth: 4
}
Expand All @@ -296,11 +287,17 @@ const stylisticIssuesRules = {
TRANSITION_IGNORE,
15
],
'new-cap': [
ERROR,
{
capIsNew: false
}
],
'new-parens': ERROR,
'no-array-constructor': ERROR,
'no-bitwise': ERROR,
'no-continue': ERROR,
'no-inline-comments': ERROR,
'no-inline-comments': WARNING,
'no-lonely-if': ERROR,
'no-mixed-spaces-and-tabs': [
ERROR,
Expand All @@ -312,10 +309,8 @@ const stylisticIssuesRules = {
'no-trailing-spaces': ERROR,
'no-unneeded-ternary': ERROR,
'no-whitespace-before-property': ERROR,
'object-curly-newline': [
ERROR,
{consistent: true}
],
'object-curly-newline': ERROR,
'object-curly-spacing': ERROR,
'one-var': [
ERROR,
'never'
Expand Down Expand Up @@ -373,12 +368,7 @@ const ecmaScript6Rules = {
before: false
}
],
'no-confusing-arrow': [
ERROR,
{
allowParens: true
}
],
'no-confusing-arrow': ERROR,
'no-duplicate-imports': ERROR,
'no-useless-computed-key': ERROR,
'no-useless-constructor': ERROR,
Expand All @@ -402,20 +392,25 @@ const ecmaScript6Rules = {
'yield-star-spacing': ERROR
};

const babelRules = {
'babel/new-cap': [
const typescriptRules = {
'@typescript-eslint/ban-types': TRANSITION_WARNING,
'@typescript-eslint/explicit-module-boundary-types': TRANSITION_IGNORE,
'@typescript-eslint/no-explicit-any': TRANSITION_IGNORE,
'@typescript-eslint/no-extra-parens': [
ERROR,
'all',
{
capIsNew: false
enforceForArrowConditionals: false,
ignoreJSX: 'multi-line',
nestedBinaryExpressions: false,
returnAssign: false
}
],
'babel/no-invalid-this': ERROR,
'babel/object-curly-spacing': ERROR,
'babel/semi': ERROR
};

const flowTypeRules = {
'flowtype/semi': ERROR
'@typescript-eslint/no-invalid-this': ERROR,
'@typescript-eslint/no-shadow': ERROR,
'@typescript-eslint/no-unused-vars': WARNING,
'@typescript-eslint/no-use-before-define': ERROR,
'@typescript-eslint/semi': ERROR
};

const reactRules = {
Expand Down Expand Up @@ -515,7 +510,7 @@ const reactRules = {
const es6ImportRules = {
'import/first': ERROR,
'import/newline-after-import': [
ERROR,
WARNING,
{
count: 2
}
Expand All @@ -535,7 +530,8 @@ const es6ImportRules = {
'**/data/**',
'**/config/**',
'**/test/**',
'react-dom/server'
'react-dom/server',
'**/react-select/*'
]
}
],
Expand All @@ -555,8 +551,7 @@ options.rules = Object.assign(
nodeAndCommonJSRules,
stylisticIssuesRules,
ecmaScript6Rules,
babelRules,
flowTypeRules,
typescriptRules,
reactRules,
es6ImportRules
);
Expand Down
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# all text files follow Unix end-of-line convention
* text eol=lf

# avoid modifying binary files
*.png binary
*.jpg binary
*.svg binary
*.ico binary
Loading

0 comments on commit d055486

Please sign in to comment.