Skip to content

Commit adf83b7

Browse files
authored
Move to tarantool frontend tools (#1555)
* Update dependencies and configuration files * Update the code to follow the new style rules. * Setup node-version=16.8.0 in github workflows * Fix graphqlgen command
1 parent 5c06e0b commit adf83b7

File tree

189 files changed

+32731
-49993
lines changed

Some content is hidden

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

189 files changed

+32731
-49993
lines changed

.eslintignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
webui/node_modules
3+
webui/build
4+
webui/flow-typed
5+
webui/public
6+
webui/scripts
7+
webui/src/generated
8+
webui/config
9+
webui/scripts

.github/workflows/backend-test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v2
2121
- uses: actions/setup-node@v1
22+
with:
23+
node-version: '16.8.0'
2224
- uses: actions/setup-python@v2
2325

2426
# Setup sphinx

.github/workflows/frontend-test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
steps:
3333
- uses: actions/checkout@v2
3434
- uses: actions/setup-node@v1
35+
with:
36+
node-version: '16.8.0'
3537

3638
- uses: tarantool/setup-tarantool@v1
3739
with:

.github/workflows/publish.yml

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@v2
2727
- uses: actions/setup-node@v1
28+
with:
29+
node-version: '16.8.0'
2830
- uses: actions/setup-python@v2
2931
- run: python -m pip install -r rst/requirements.txt
3032

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
webui/node_modules
3+
webui/src/generated

cartridge-scm-1.rockspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies = {
1212
'errors == 2.2.1-1',
1313
'vshard == 0.1.18-1',
1414
'membership == 2.4.0-1',
15-
'frontend-core == 7.10.0-1',
15+
'frontend-core == 7.11.0-1',
1616
'graphql == 0.1.1-1',
1717
}
1818

webui/.babelrc.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
"react-app",
5+
{
6+
flow: true,
7+
},
8+
],
9+
],
10+
plugins: [
11+
[
12+
"@emotion",
13+
{
14+
autoLabel: "never",
15+
},
16+
],
17+
],
18+
};

webui/.eslintignore

-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@
66
/src/generated
77
/config
88
/scripts
9-
/src/start.js

webui/.eslintrc

-80
This file was deleted.

webui/.eslintrc.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const { join } = require('path');
2+
3+
module.exports = {
4+
extends: [
5+
'@tarantool.io/eslint-config',
6+
'@tarantool.io/eslint-config/react',
7+
'@tarantool.io/eslint-config/emotion',
8+
'@tarantool.io/eslint-config/cypress',
9+
],
10+
settings: {
11+
'import/resolver': {
12+
alias: [
13+
['src', join(__dirname, 'src')],
14+
['~', join(__dirname, 'src')],
15+
],
16+
},
17+
},
18+
overrides: [
19+
{
20+
files: ['*.test.js', '*.spec.js'],
21+
rules: {
22+
'sonarjs/no-duplicate-string': 'off',
23+
},
24+
},
25+
],
26+
rules: {
27+
'sonarjs/cognitive-complexity': 'off',
28+
},
29+
};

webui/.flowconfig

+5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
[ignore]
2+
*.ts
3+
*.tsx
24
.*broken.json.*
5+
36
[include]
47

58
[libs]
69
.*flow-typed.*
10+
711
[lints]
812

913
[options]
1014
module.system.node.resolve_dirname=node_modules
1115
module.system.node.resolve_dirname=.
1216
module.name_mapper.extension='svg' -> '<PROJECT_ROOT>/src/helpers/SVGModule.js'
17+
1318
[strict]

webui/.importsortrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("@tarantool.io/import-sort-style/config");

webui/.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
src/generated

webui/.prettierrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@tarantool.io/prettier-config/with-import-sort');

webui/BuildFrontend.cmake

+7-4
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ check_hash(${HASH_FILE} "${BASE_DIR}/package-lock.json")
4040
if (REBUILD)
4141
message(STATUS "Installing node_modules")
4242
execute_process(
43-
COMMAND ${CMAKE_COMMAND} -E
44-
env NODE_ENV=production
45-
npm ci --no-audit --no-progress --prefer-offline
43+
COMMAND npm ci --no-audit --no-progress --prefer-offline
4644
WORKING_DIRECTORY "${BASE_DIR}"
4745
RESULT_VARIABLE _result
4846
)
@@ -67,11 +65,16 @@ file(GLOB_RECURSE FRONTEND_FILES
6765
list(APPEND FRONTEND_FILES
6866
"${BASE_DIR}/.env"
6967
"${BASE_DIR}/.env.production"
70-
"${BASE_DIR}/.eslintrc"
68+
"${BASE_DIR}/.eslintignore"
69+
"${BASE_DIR}/.eslintrc.js"
70+
"${BASE_DIR}/.prettierignore"
71+
"${BASE_DIR}/.prettierrc.js"
72+
"${BASE_DIR}/.importsortrc.js"
7173
"${BASE_DIR}/.flowconfig"
7274
"${BASE_DIR}/codegen.yml"
7375
"${BASE_DIR}/scripts/build.js"
7476
"${BASE_DIR}/package-lock.json"
77+
"${BASE_DIR}/tsconfig.json"
7578
)
7679
check_hash(${HASH_FILE} "${FRONTEND_FILES}")
7780

webui/config/paths.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const url = require('url');
77
// Make sure any symlinks in the project folder are resolved:
88
// https://github.com/facebookincubator/create-react-app/issues/637
99
const appDirectory = fs.realpathSync(process.cwd());
10-
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
10+
const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath);
1111

1212
const envPublicUrl = process.env.PUBLIC_URL;
1313

@@ -22,8 +22,7 @@ function ensureSlash(path, needsSlash) {
2222
}
2323
}
2424

25-
const getPublicUrl = appPackageJson =>
26-
envPublicUrl || require(appPackageJson).homepage;
25+
const getPublicUrl = (appPackageJson) => envPublicUrl || require(appPackageJson).homepage;
2726

2827
// We use `PUBLIC_URL` environment variable or "homepage" field to infer
2928
// "public path" at which the app is served.
@@ -33,8 +32,7 @@ const getPublicUrl = appPackageJson =>
3332
// like /todos/42/static/js/bundle.7289d.js. We have to know the root.
3433
function getServedPath(appPackageJson) {
3534
const publicUrl = getPublicUrl(appPackageJson);
36-
const servedUrl =
37-
envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : '/');
35+
const servedUrl = envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : '/');
3836
return ensureSlash(servedUrl, true);
3937
}
4038

0 commit comments

Comments
 (0)