Skip to content

Commit

Permalink
refac to workspace monorepo; fix mui useTheme imports;
Browse files Browse the repository at this point in the history
  • Loading branch information
elbakerino committed Oct 26, 2024
1 parent 5269cb4 commit a942feb
Show file tree
Hide file tree
Showing 87 changed files with 13,020 additions and 49,123 deletions.
72 changes: 59 additions & 13 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,26 +1,44 @@
# https://editorconfig.org

root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
end_of_line = lf
indent_size = 4
max_line_length = 1200
indent_style = space
insert_final_newline = true
max_line_length = 400
tab_width = 4
trim_trailing_whitespace = true
ij_continuation_indent_size = 4
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
ij_formatter_tags_enabled = true
ij_smart_tabs = false
ij_wrap_on_typing = false

[*.md]
max_line_length = 90000

[{*.cjs,*.js,*.ts,*.jsx,*.tsx}]
[*.twig]
ij_twig_keep_indents_on_empty_lines = false
ij_twig_spaces_inside_comments_delimiters = true
ij_twig_spaces_inside_delimiters = true
ij_twig_spaces_inside_variable_delimiters = true

[.editorconfig]
ij_editorconfig_align_group_field_declarations = false
ij_editorconfig_space_after_colon = false
ij_editorconfig_space_after_comma = true
ij_editorconfig_space_before_colon = false
ij_editorconfig_space_before_comma = false
ij_editorconfig_spaces_around_assignment_operators = true

[{*.cjs,*.js}]
max_line_length = 240
ij_continuation_indent_size = 4
ij_javascript_align_imports = false
ij_javascript_align_multiline_array_initializer_expression = false
ij_javascript_align_multiline_binary_operation = false
ij_javascript_align_multiline_chained_methods = false
ij_javascript_align_multiline_extends_list = false
ij_javascript_align_multiline_extends_list = true
ij_javascript_align_multiline_for = true
ij_javascript_align_multiline_parameters = true
ij_javascript_align_multiline_parameters_in_calls = false
Expand Down Expand Up @@ -61,7 +79,7 @@ ij_javascript_for_statement_new_line_after_left_paren = false
ij_javascript_for_statement_right_paren_on_new_line = false
ij_javascript_for_statement_wrap = off
ij_javascript_force_quote_style = true
ij_javascript_force_semicolon_style = false
ij_javascript_force_semicolon_style = true
ij_javascript_function_expression_brace_style = end_of_line
ij_javascript_if_brace_force = never
ij_javascript_import_merge_members = global
Expand All @@ -79,7 +97,7 @@ ij_javascript_keep_first_column_comment = true
ij_javascript_keep_indents_on_empty_lines = false
ij_javascript_keep_line_breaks = true
ij_javascript_keep_simple_blocks_in_one_line = false
ij_javascript_keep_simple_methods_in_one_line = true
ij_javascript_keep_simple_methods_in_one_line = false
ij_javascript_line_comment_add_space = true
ij_javascript_line_comment_at_first_column = false
ij_javascript_method_brace_style = end_of_line
Expand Down Expand Up @@ -173,8 +191,36 @@ ij_javascript_use_double_quotes = false
ij_javascript_use_explicit_js_extension = global
ij_javascript_use_path_mapping = always
ij_javascript_use_public_modifier = false
ij_javascript_use_semicolon_after_statement = true
ij_javascript_use_semicolon_after_statement = false
ij_javascript_var_declaration_wrap = normal
ij_javascript_while_brace_force = never
ij_javascript_while_on_new_line = false
ij_javascript_wrap_comments = false

[{*.htm,*.html,*.ng,*.sht,*.shtm,*.shtml}]
ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3
ij_html_align_attributes = true
ij_html_align_text = false
ij_html_attribute_wrap = off
ij_html_block_comment_at_first_column = true
ij_html_do_not_align_children_of_min_lines = 0
ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p
ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot
ij_html_enforce_quotes = false
ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var
ij_html_keep_blank_lines = 2
ij_html_keep_indents_on_empty_lines = false
ij_html_keep_line_breaks = true
ij_html_keep_line_breaks_in_text = true
ij_html_keep_whitespaces = false
ij_html_keep_whitespaces_inside = span,pre,textarea
ij_html_line_comment_at_first_column = true
ij_html_new_line_after_last_attribute = never
ij_html_new_line_before_first_attribute = never
ij_html_quote_style = double
ij_html_remove_new_line_before_tags = br
ij_html_space_after_tag_name = false
ij_html_space_around_equality_in_attribute = false
ij_html_space_inside_empty_tag = false
ij_html_text_wrap = off
ij_html_uniform_ident = false
28 changes: 10 additions & 18 deletions packages/.eslintrc → .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"eslint:recommended",
"plugin:react-hooks/recommended"
],
"ignorePatterns": [],
"settings": {
"react": {
"version": "detect"
Expand Down Expand Up @@ -86,7 +87,7 @@
},
//"ecmaVersion": 2018,
//"sourceType": "module",
"project": "./tsconfig.json"
"projectService": true
},
"plugins": [
"react",
Expand All @@ -99,22 +100,15 @@
}
},
"rules": {
"deprecation/deprecation": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/member-delimiter-style": [
"@typescript-eslint/no-unused-vars": [
"error",
{
"multiline": {
"delimiter": "none",
"requireLast": false
},
"singleline": {
"delimiter": "comma",
"requireLast": false
}
"caughtErrors": "none"
}
],
"deprecation/deprecation": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-empty-interface": "error",
"indent": [
"error",
4,
Expand All @@ -130,19 +124,17 @@
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "only-multiline"
"functions": "always-multiline"
}
],
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"no-redundant-jsdoc": "off",
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/semi": [
"warn",
"never"
],
"semi-style": "off"
}
}
Expand Down
55 changes: 34 additions & 21 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,74 @@ env:

on:
push:
branches: [ main, develop, feature/develop-0.5.0 ]
branches: [ main, develop ]
pull_request:
branches: [ main, develop, feature/develop-0.5.0 ]
# create:
# tags:
# - '[0-9]+.[0-9]+.[0-9]+*'
branches: [ main, develop ]

create:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build_node:
build_publish:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 14.x ]
node-version: [ 18.x ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set Branch
id: vars
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/}
id: short_ref
run: echo "short_ref=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Set git_url_commit
id: git_url_commit
run: echo "git_url_commit=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}" >> $GITHUB_OUTPUT
- name: Set git_url_ci_run
id: git_url_ci_run
run: echo "git_url_ci_run=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" >> $GITHUB_OUTPUT
- name: Set git_commit
id: git_commit
run: echo "git_commit=${GITHUB_REPOSITORY}/${GITHUB_SHA}" >> $GITHUB_OUTPUT
- name: Set git_ci_run
id: git_ci_run
run: echo "git_ci_run=${GITHUB_REPOSITORY}/${GITHUB_RUN_ID}" >> $GITHUB_OUTPUT
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'

- name: Cache CI node_modules
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}

- name: Setup packages
- name: Install Deps
run: |
npm ci
npm run bootstrap
npm run link
- name: Run tests
run: |
npm test
- name: Build
run: |
npm run build
- name: CP License files
run: |
cp LICENSE dist/ctrls-progress
- name: Publish to NPM
if: github.ref == 'refs/heads/main'
#if: startsWith(github.ref, 'refs/tags/')
run: |
./publish.sh
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ~/.npmrc
node publish.js dist/ctrls-progress
rm ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44 changes: 27 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,34 +1,44 @@
/coverage
/build
/dist

# env variables
.env
!.env.example
.npmrc

# default upload dir
/upload

# default tmp dir
/tmp
/dist

# Composer
/vendor

# NodeJS
# Node.js
node_modules

lerna-debug.log
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Webpack profiling
profile.json

licenses.json

#Procfile

# Mac
.DS_Store

#
## JetBrains IDE's

.idea/
*.iml
*.iws

/coverage
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 0 additions & 1 deletion .npmignore

This file was deleted.

22 changes: 6 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Contributing

1. Fork/Clone repository **branch `develop`**
2. Install root dev-dependencies (like lerna, webpack): `npm i`
3. Install & link the `packages`: `npm run bootstrap && npm run link`
4. Start dev-server: `npm start`
- (will clean-dist + start demo app)
5. Open browser on [localhost:4200](http://localhost:9230) for demo
6. Explore [packages](packages)
7. Code -> Commit -> Pull Request -> Being Awesome!
2. Install dev-dependencies: `npm i`
3. Start dev-server: `npm run dev`
4. Open browser on [localhost:9230](http://localhost:9230) for demo
5. Explore [packages](packages)
6. Code -> Commit -> Pull Request -> Being Awesome!

**Commands:**

Expand All @@ -21,16 +19,8 @@
- needs manual bootstrapping, linking and update handling
- Build: `npm run build`
- needs manual bootstrapping and update handling
- Clean node_modules and build dirs: `npm run clean`
- Clean build dirs: `npm run clean-dist`
- Clean build dirs: `npm run clean`
- Add new node_module to one package: `lerna add <npm-package-name> --scope=@ui-schema/demo-web [--dev] [--peer]`, without `--scope` in all packages
- Do not change `package.json` of packages manually, and if Bootstrap [lerna](https://lerna.js.org/): `npm run bootstrap` (maybe delete `package-lock.json`), or simply open an issue
- Add new package `lerna create <name>` and follow on screen, e.g.: `lerna create material-pickers` add package name `@ui-schema/material-pickerss`, creates folder `./packages/material-pickers`

> All-in-one clean & reinstall command - skip the first one if not installed completely:
> `npm run clean && rm -rf node_modules && rm -f package-lock.json && npm i && npm run bootstrap && npm run bootstrap && npm run link`
>
> The two-times `bootstrap` fixes sometimes stale `packages` dependencies/lock-files, but sometimes a manual deletion of those also helps with `node_modules` resolving issues.

## Contributors

Expand Down
2 changes: 2 additions & 0 deletions apps/demo/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_ENV=local
REACT_APP_BASE_PATH=
Loading

0 comments on commit a942feb

Please sign in to comment.