Skip to content

Commit

Permalink
chore: rest
Browse files Browse the repository at this point in the history
Signed-off-by: Carina Ursu <[email protected]>
  • Loading branch information
ursucarina committed Dec 23, 2022
1 parent 6688a61 commit fe5a9ba
Show file tree
Hide file tree
Showing 56 changed files with 448 additions and 44,209 deletions.
11 changes: 3 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@ root = true

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

[package.json]
indent_style = space
indent_size = 2

[*.{md,css,yml,json}]
indent_style = space
indent_size = 2
[*.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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ app/public/styles/*.css
.cache/
venv/
*.tsbuildinfo
*.log
**.orig

# Frontend
.awcache/
Expand Down
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/
15 changes: 14 additions & 1 deletion .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
singleQuote: true
tabWidth: 2
printWidth: 100
printWidth: 80
trailingComma: "all"
useTabs: false
semi: true

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

overrides:
- files: ["*.yml", "*.yaml"]
options:
singleQuote: false
- files: ["*.html"]
options:
tabWidth: 4
- files: ["dockerfile"]
options:
useTabs: true
21 changes: 15 additions & 6 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +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,
'@flyteoss/console': path.resolve(__dirname, '../packages/console/src'),
'@flyteoss/locale': path.resolve(__dirname, '../packages/locale/src'),
'@flyteoss/ui-atoms': path.resolve(__dirname, '../packages/ui-atoms/src'),
'@flyteoss/components': path.resolve(__dirname, '../packages/components/src'),
'@flyteoss/flyte-api': path.resolve(__dirname, '../packages/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
6 changes: 5 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
// 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"],
"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": []
}
27 changes: 22 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
{
"[html][json]": {
"explorer.autoReveal": "focusNoScroll",
"explorer.enableUndo": true,
"explorer.excludeGitIgnore": false,

"files.autoSave": "afterDelay",

"problems.autoReveal": true,

// editor
"editor.formatOnSave": true,
"editor.renderWhitespace": "all",
"editor.defaultFormatter": "esbenp.prettier-vscode",

// typescript
"typescript.updateImportsOnFileMove.enabled": "always",

"[javascript][javascriptreact][typescript][typescriptreact][json]": {
"editor.detectIndentation": false,
"editor.tabSize": 2
},
"[javascript][javascriptreact][typescript][typescriptreact]": {

"[html]": {
"editor.detectIndentation": false,
"editor.tabSize": 2
"editor.tabSize": 4,
"editor.defaultFormatter": "vscode.html-language-features"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,

"[dockerfile]": {
"editor.defaultFormatter": "ms-azuretools.vscode-docker"
}
Expand Down
6 changes: 2 additions & 4 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ plugins:

nodeLinker: node-modules
nmSelfReferences: false
nmMode: hardlinks-global
nmMode: classic

# lanuage
defaultLanguageName: "node"

pnpEnableInlining: true

# changeset
changesetBaseRefs:
- "master"
Expand All @@ -34,7 +32,7 @@ changesetBaseRefs:
changesetIgnorePatterns:
- "**/*.test.{js,ts}"

enableTransparentWorkspaces: false
enableTransparentWorkspaces: true

# ui
enableColors: true
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ For example in case if package plan to be used in `console` app

Ensure to add proper webpack alias path resolutions into:

- ./storybook/main.js - as `'@flyteoss/flyte-api': path.resolve(__dirname, '../packages/flyte-api/src’),`
- packages/zapp/console/webpack.common.config.ts to alias section - as `'@flyteoss/flyte-api': path.resolve(__dirname, '../packages/flyte-api/src’),`
- ./storybook/main.js - as `'@flyteorg/flyte-api': path.resolve(__dirname, '../packages/flyte-api/src’),`
- packages/zapp/console/webpack.common.config.ts to alias section - as `'@flyteorg/flyte-api': path.resolve(__dirname, '../packages/flyte-api/src’),`

To add child package usage to other package, in parent package ->

- Add `{ "path": “../${package-name}" }` to tsconfig.json
- Add `{ "path": “../${package-name}/tsconfig.json" }` to tsconfig.json (if exists)

* Then you can import your changes as `import { getLoginUrl } from '@flyteoss/flyte-api’;`
* Then you can import your changes as `import { getLoginUrl } from '@flyteorg/flyte-api’;`

> If you see `yarn lint` package not defined issues update `.\eslintrc.js` by adding your package to
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ build_prod:
pack:
yarn workspaces focus --production --all

yarn workspace @flyteoss/flyteidl build
yarn workspace @flyteoss/common build
yarn workspace @flyteoss/locale build
yarn workspace @flyteoss/ui-atoms build
yarn workspace @flyteoss/flyte-api build
yarn workspace @flyteoss/components build
yarn workspace @flyteoss/console build
yarn workspace @flyteorg/flyteidl build
yarn workspace @flyteorg/common build
yarn workspace @flyteorg/locale build
yarn workspace @flyteorg/ui-atoms build
yarn workspace @flyteorg/flyte-api build
yarn workspace @flyteorg/components build
yarn workspace @flyteorg/console build

# test_unit runs all unit tests
.PHONY: test_unit
Expand Down
6 changes: 5 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ module.exports = {
projects: ['<rootDir>/packages/*', '<rootDir>/website'],

coverageDirectory: '<rootDir>/.coverage',
collectCoverageFrom: ['**/*.{ts,tsx}', '!**/*/*.stories.{ts,tsx}', '!**/*/*.mocks.{ts,tsx}'],
collectCoverageFrom: [
'**/*.{ts,tsx}',
'!**/*/*.stories.{ts,tsx}',
'!**/*/*.mocks.{ts,tsx}',
],
coveragePathIgnorePatterns: [...sharedConfig.coveragePathIgnorePatterns],
coverageReporters: ['text', 'json', 'html'],
};
Loading

0 comments on commit fe5a9ba

Please sign in to comment.