Skip to content

Commit

Permalink
chore: Refactor flyteconsole (#654)
Browse files Browse the repository at this point in the history
* chore: refactor flyteconsole app

Signed-off-by: Carina Ursu <[email protected]>

* chore: fix tests

Signed-off-by: Carina Ursu <[email protected]>

* chore: snyk fix

Signed-off-by: Carina Ursu <[email protected]>

* chore: exclude-1.4

Signed-off-by: Carina Ursu <[email protected]>

* chore: bump console

Signed-off-by: Carina Ursu <[email protected]>

Signed-off-by: Carina Ursu <[email protected]>
  • Loading branch information
ursucarina authored Jan 19, 2023
1 parent 516bbff commit 924bb7e
Show file tree
Hide file tree
Showing 846 changed files with 39,952 additions and 28,578 deletions.
18 changes: 11 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
.git
.env
node_modules
Dockerfile

# *
# !package.json
# !yarn.lock
# !packages/
# !node_modules/
# !jes
.storybook/
stories-intro/
Dockerfile*
.dockerignore
npm-debug.log
.storybook
.vscode
README*
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
LICENSE
src/generated/
.github/
.dist/
Expand All @@ -7,4 +8,4 @@ node_modules/
tsd/
webpack.common.config.ts
webpack.dev.config.ts
webpack.prod.config.ts
webpack.prod.config.ts
19 changes: 16 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,20 @@ module.exports = {
'import/prefer-default-export': 'off',
'react/jsx-boolean-value': 'off',
'react/jsx-filename-extension': [2, { extensions: ['.jsx', '.tsx'] }],
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'lines-between-class-members': [
'error',
'always',
{ exceptAfterSingleLine: true },
],

// disabled to let "@typescript-eslint/*" rules do it's job
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': ['warn', { ignoreDeclarationMerge: true }], // still will warn on exporting enums :(
'@typescript-eslint/no-redeclare': [
'warn',
{ ignoreDeclarationMerge: true },
], // still will warn on exporting enums :(

/**
* Up for discussion
Expand Down Expand Up @@ -133,7 +140,13 @@ module.exports = {
overrides: [
{
// overrides for test files
files: ['*.spec.*', '*.test.*', '*.stories.*', 'src/**/test/*', 'src/**/mocks/*'],
files: [
'*.spec.*',
'*.test.*',
'*.stories.*',
'src/**/test/*',
'src/**/mocks/*',
],
rules: {
camelcase: 'off',
'@typescript-eslint/no-explicit-any': 'off',
Expand Down
21 changes: 20 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# C extensions
*.so

# Snyk
.dccache

# Packages
bin/
build/
Expand Down Expand Up @@ -43,16 +46,32 @@ app/public/styles/*.css
.cache/
venv/
*.tsbuildinfo
*.log
**.orig

# Frontend
.awcache/
.dist/
npm-debug.log
jest
jest_0
yarn-error.log
.coverage/

# yarn related
node_modules
.pnp.*
*.yalc
yalc.lock
**/.yarn/*
yarn-error.log
!**/.yarn/plugins
!**/.yarn/releases
!**/.yarn/sdks
!**/.yarn/versions
# patches contain the patchfiles which have been generated with the `yarn patch-commit` command.
# We always want them in repository, since they are necessary to install dependencies.
!.yarn/patches

# Certs
.srl
certificate/
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
[ -n "$CI" ] && exit 0

echo "Linting staged files..."
yarn lint-staged
73 changes: 73 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
.env
*.swp
LICENSE

# C extensions
*.so

# Packages
bin/
build/
dist/
downloads/
env/
lib/
lib64/
parts/
sdist/
var/

# Translations
*.mo

# build packages or files that shouldn't be in repo
node_modules
bower_components
.sass-cache
.tmp
app/public/dist
app/public/styles/*.css

# Mr Developer (mac, editor, IDEs, etc)
.mr.developer.cfg
.project
.pydevproject
.vagrant
.ropeproject
.tmp
.sass-cache
.DS_Store
.zedstate
.idea
.cache/
venv/
*.tsbuildinfo
*.log
**.orig

# Frontend
.awcache/
.dist/
npm-debug.log
jest
jest_0
.coverage/

# yarn related
node_modules
.pnp.*
*.yalc
yalc.lock
**/.yarn/*
yarn-error.log
!**/.yarn/plugins
!**/.yarn/releases
!**/.yarn/sdks
!**/.yarn/versions
# patches contain the patchfiles which have been generated with the `yarn patch-commit` command.
# We always want them in repository, since they are necessary to install dependencies.
!.yarn/patches

# Certs
.srl
certificate/
21 changes: 15 additions & 6 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
singleQuote: true
tabWidth: 4
printWidth: 100
tabWidth: 2
printWidth: 80
trailingComma: "all"
useTabs: false
semi: true

arrowParens: "avoid"
bracketSpacing: true
htmlWhitespaceSensitivity: "css"

overrides:
- files: ["*.js", "*.jsx", "*.ts", "*.tsx"]
options:
tabWidth: 2
- files: ["*.yml", "*.yaml"]
options:
singleQuote: false
tabWidth: 2
- files: ["*.html"]
options:
tabWidth: 4
- files: ["dockerfile"]
options:
useTabs: true
24 changes: 12 additions & 12 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines."
}
],
["@semantic-release/npm", { "npmPublish": false }],
"@semantic-release/github"
]
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines."
}
],
["@semantic-release/npm", { "npmPublish": false }],
"@semantic-release/github"
]
}
10 changes: 5 additions & 5 deletions .storybook/StorybookContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { QueryClientProvider } from 'react-query';
import { MemoryRouter } from 'react-router-dom';
import { SnackbarProvider } from 'notistack';

import { ErrorBoundary } from '../packages/zapp/console/src/components/common/ErrorBoundary';
import { createQueryClient } from '../packages/zapp/console/src/components/data/queryCache';
import { muiTheme } from '../packages/zapp/console/src/components/Theme/muiTheme';
import { LocalCacheProvider } from '../packages/zapp/console/src/basics/LocalCache/ContextProvider';
import { FeatureFlagsProvider } from '../packages/zapp/console/src/basics/FeatureFlags';
import { ErrorBoundary } from '../packages/console/src/components/common/ErrorBoundary';
import { createQueryClient } from '../packages/console/src/components/data/queryCache';
import { muiTheme } from '../packages/console/src/components/Theme/muiTheme';
import { LocalCacheProvider } from '../packages/console/src/basics/LocalCache/ContextProvider';
import { FeatureFlagsProvider } from '../packages/console/src/basics/FeatureFlags';

const useStyles = makeStyles((theme: Theme) => ({
container: {
Expand Down
20 changes: 15 additions & 5 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,26 @@ module.exports = {
// flyteidl.d.ts file.
test: /\.tsx?$/,
exclude: /node_modules/,
use: ['babel-loader', { loader: 'ts-loader', options: { transpileOnly: true } }],
use: [
'babel-loader',
{ loader: 'ts-loader', options: { transpileOnly: true } },
],
},
];

config.resolve.alias = {
...config.resolve.alias,
'@flyteconsole/locale': path.resolve(__dirname, '../packages/basics/locale/src'),
'@flyteconsole/ui-atoms': path.resolve(__dirname, '../packages/composites/ui-atoms/src'),
'@flyteconsole/components': path.resolve(__dirname, '../packages/plugins/components/src'),
'@flyteconsole/flyte-api': path.resolve(__dirname, '../packages/plugins/flyte-api/src'),
'@flyteorg/console': path.resolve(__dirname, '../packages/console/src'),
'@flyteorg/locale': path.resolve(__dirname, '../packages/locale/src'),
'@flyteorg/ui-atoms': path.resolve(__dirname, '../packages/ui-atoms/src'),
'@flyteorg/components': path.resolve(
__dirname,
'../packages/components/src',
),
'@flyteorg/flyte-api': path.resolve(
__dirname,
'../packages/flyte-api/src',
),
};

return config;
Expand Down
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const parameters = {
};

export const decorators = [
(Story) => (
Story => (
<StorybookContainer>
<Story />
</StorybookContainer>
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nodejs 16.14.2
yarn 1.22.17
nodejs 18.1.0
yarn 3.2.1
16 changes: 10 additions & 6 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": ["eamodio.gitlens", "dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"eamodio.gitlens",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
28 changes: 14 additions & 14 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "launch generator",
"type": "node",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/script/generator/src/index.js",
"console": "integratedTerminal"
}
]
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "launch generator",
"type": "node",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/script/generator/src/index.js",
"console": "integratedTerminal"
}
]
}
Loading

0 comments on commit 924bb7e

Please sign in to comment.