Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
elbakerino committed Nov 17, 2024
2 parents 4ec9c86 + e5cf2e5 commit 781a5ec
Show file tree
Hide file tree
Showing 29 changed files with 15,955 additions and 46,600 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/*/build
node_modules
19 changes: 17 additions & 2 deletions packages/.eslintrc → .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"react/no-unknown-property": 1,
"react/prefer-es6-class": 1,
"react/prop-types": 0,
"react/react-in-jsx-scope": 1,
"react/react-in-jsx-scope": 0,
"react/self-closing-comp": 1,
"react/sort-comp": 0
},
Expand Down Expand Up @@ -143,7 +143,22 @@
"warn",
"never"
],
"semi-style": "off"
"semi-style": "off",
"react/react-in-jsx-scope": "off",
"no-restricted-imports": [
"error",
{
"paths": [
"@mui/material",
"@mui/icon-material",
"@ui-controls/progress"
],
"patterns": [
"@mui/*/*/*",
"@ui-controls/progress/*/*"
]
}
]
}
}
]
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ jobs:
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/*/}
- 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:
Expand All @@ -44,12 +44,10 @@ jobs:
- name: Setup packages
run: |
npm ci
npm run bootstrap
npm run link
- name: Run tests
run: |
npm test
npm run check
- name: Build
run: |
Expand Down
19 changes: 5 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,28 @@
# 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`
2. Install dependencies: `npm i`
3. 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!
4. Open browser on [localhost:9230](http://localhost:9230) for demo
5. Explore [packages](packages)
6. Code -> Commit -> Pull Request -> Being Awesome!

**Commands:**

- Developing test driven: `npm run tdd`
- needs manual bootstrapping and update handling
- `npm run tdd -- -u --testPathPattern=src/Validators`
- with `-u|--update` for snapshot update testing
- with `--testPathPattern` to run all tests in a specific folder / path
- `npm run tdd -- --testPathPattern=PatternValidator -t patternValidator` for only one test and often only one file
- Testing: `npm test`
- 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`
- 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

By committing your code/creating a pull request to this repository you agree to release the code under the [MIT License](LICENSE) attached to the repository and to adhere to the [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md).
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 align="center">UI-Controls</h1>

[![Github actions Build](https://github.com/control-ui/control-ui-ctrl/actions/workflows/blank.yml/badge.svg)](https://github.com/control-ui/control-ui-ctrl/actions)
[![react compatibility](https://img.shields.io/badge/React-%3E%3D17-success?style=flat-square&logo=react)](https://reactjs.org/)
[![react compatibility](https://img.shields.io/badge/React-18-success?style=flat-square&logo=react)](https://reactjs.org/)
[![MIT license](https://img.shields.io/npm/l/@ui-controls/progress?style=flat-square)](https://github.com/control-ui/control-ui-ctrl/blob/main/LICENSE)
![Typed](https://flat.badgen.net/badge/icon/Typed?icon=typescript&label&labelColor=blue&color=555555)

Expand All @@ -26,7 +26,7 @@ This project is free software distributed under the **MIT License**.

See: [LICENSE](LICENSE).

© 2022 [bemit UG (haftungsbeschränkt)](https://bemit.codes)
© 2024 [bemit UG (haftungsbeschränkt)](https://bemit.codes)

***

Expand Down
52 changes: 23 additions & 29 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
{
"presets": [
"@babel/preset-react",
[
"@babel/preset-react",
{
"runtime": "automatic"
}
],
"@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-proposal-private-methods",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-react-jsx",
"@babel/plugin-transform-template-literals",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-export-default-from",
"transform-es2015-template-literals",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator",
"react-loadable/babel",
[
"babel-plugin-named-asset-import",
{
Expand All @@ -23,20 +18,18 @@
}
}
}
],
[
"@babel/plugin-proposal-object-rest-spread",
{
"useBuiltIns": true
}
],
"@babel/plugin-proposal-class-properties"
]
],
"env": {
"cjs": {
"presets": [
"@babel/preset-env",
"@babel/preset-react",
[
"@babel/preset-react",
{
"runtime": "automatic"
}
],
"@babel/preset-typescript"
]
},
Expand All @@ -46,7 +39,7 @@
"@babel/preset-env",
{
"targets": {
"node": "14"
"node": "18"
},
"modules": false
}
Expand All @@ -55,16 +48,17 @@
"@babel/preset-typescript",
{
"targets": {
"node": "14"
"node": "18"
},
"modules": false
}
],
"@babel/preset-react"
],
"plugins": [
"transform-es2015-modules-commonjs",
"@babel/plugin-transform-runtime"
[
"@babel/preset-react",
{
"runtime": "automatic"
}
]
]
},
"node": {
Expand All @@ -73,7 +67,7 @@
"@babel/preset-env",
{
"targets": {
"node": "14"
"node": "18"
},
"modules": false
}
Expand All @@ -82,7 +76,7 @@
"@babel/preset-typescript",
{
"targets": {
"node": "14"
"node": "18"
},
"modules": false
}
Expand Down
68 changes: 68 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import type { Config } from '@jest/types'

const packages: string[] = [
'ctrls-progress',
]

const base: Partial<Config.InitialOptions> = {
transformIgnorePatterns: [
'node_modules/?!(@ui-controls)',
],
transform: {
'^.+\\.ts$': 'ts-jest',
'^.+\\.tsx$': 'ts-jest',
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
'^@ui-controls/progress(.*)$': '<rootDir>/packages/ctrls-progress/src$1',
},
moduleFileExtensions: [
'ts',
'tsx',
'js',
'jsx',
'json',
'node',
],
coveragePathIgnorePatterns: [
'(tests/.*.mock).(jsx?|tsx?|ts?|js?)$',
'.*.(test|spec).(js|ts|tsx)$',
'<rootDir>/packages/.+/demo',
],
testPathIgnorePatterns: [
'<rootDir>/dist',
'<rootDir>/packages/.+/build',
],
watchPathIgnorePatterns: [
'<rootDir>/.idea',
'<rootDir>/.git',
'<rootDir>/dist',
'<rootDir>/node_modules',
'<rootDir>/packages/.+/node_modules',
'<rootDir>/packages/.+/build',
],
modulePathIgnorePatterns: [
'<rootDir>/dist',
'<rootDir>/packages/.+/build',
],
}

const config: Config.InitialOptions = {
...base,
verbose: true,
collectCoverage: true,
projects: [
...packages.map(pkg => ({
displayName: 'test-' + pkg,
...base,
moduleDirectories: ['node_modules', '<rootDir>/packages/' + pkg + '/node_modules'],
testMatch: [
'<rootDir>/packages/' + pkg + '/src/**/*.(test|spec).(js|ts|tsx)',
'<rootDir>/packages/' + pkg + '/tests/**/*.(test|spec).(js|ts|tsx)',
],
})),
],
coverageDirectory: '<rootDir>/coverage',
}

export default config
Loading

0 comments on commit 781a5ec

Please sign in to comment.