Skip to content

Commit

Permalink
chore(infra): unify config package (#278)
Browse files Browse the repository at this point in the history
* chore(infra): create a config package

* chore(infra): migrate typescript config

* chore(oauth): fix typescript migration leftovers

* chore(communicator): migrate whole eslint config

* chore(infra): delete eslint config and fix line command

* chore(infra): use eslint config from config package

* chore(infra): leftover package-lock

* fix(docs): fix all docs links

* release(npm): add typecheck and changesets

* chore(infra): change build output

* chore(docs): udpate docs
  • Loading branch information
barsukov authored Aug 28, 2024
1 parent 87e409c commit 8c06648
Show file tree
Hide file tree
Showing 50 changed files with 254 additions and 374 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-fans-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudoperators/juno-oauth": patch
---

Fix other typescript problems
5 changes: 5 additions & 0 deletions .changeset/green-years-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudoperators/juno-k8s-client": patch
---

Change the build name output
16 changes: 16 additions & 0 deletions .changeset/tall-spoons-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"@cloudoperators/juno-url-state-provider": patch
"@cloudoperators/juno-messages-provider": patch
"@cloudoperators/juno-url-state-router": patch
"@cloudoperators/juno-ui-components": patch
"@cloudoperators/juno-communicator": patch
"@cloudoperators/juno-k8s-client": patch
"@cloudoperators/juno-template": patch
"@cloudoperators/juno-config": patch
"@cloudoperators/juno-oauth": patch
"@cloudoperators/juno-utils": patch
"@cloudoperators/juno-app-template": patch
"@cloudoperators/juno-app-example": patch
---

Unify Typescript and Eslint config in one package
23 changes: 23 additions & 0 deletions .github/workflows/ci-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,29 @@ jobs:
- name: Run Linter
run: npm run lint

type-check:
needs: install-dependencies
runs-on: [default]
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20" # Specify the node version you need

- name: Cache npm
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
- name: Install Dependencies
run: npm ci
- name: Run Typecheck
run: npm run typecheck

format:
needs: install-dependencies
runs-on: [default]
Expand Down
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ Please include the following license header at the top of every source file:

This project uses **Husky** to enforce code quality checks and **commitlint** to ensure commit messages follow a consistent convention. Below are the details on how these are configured and how they work together.

## Setup Husky:

```bash
npm run prepare
```

For more details on the specific hooks and commitlint rules used in this project, see our [Husky and Commitlint Guide](docs/husky_commitlint_guide.md).

## Checks
Expand All @@ -68,4 +74,4 @@ Before submitting your pull request, please ensure your code passes the followin

## Release Guidelines

For detail release management on npm registry please check our detailed [Release Guidelines](./docs/RELEASE_GUIDELINES.mdx)
For detail release management on npm registry please check our detailed [Release Guidelines](./docs/releases_guidelines.md)
2 changes: 1 addition & 1 deletion apps/example/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import junoConfigs from "@cloudoperators/juno-eslint-config/juno.mjs"
import junoConfigs from "@cloudoperators/juno-config/eslint/juno.mjs"

export default [
...junoConfigs,
Expand Down
4 changes: 2 additions & 2 deletions apps/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@babel/core": "^7.20.2",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@cloudoperators/juno-eslint-config": "*",
"@cloudoperators/juno-config": "*",
"@svgr/core": "^7.0.0",
"@svgr/plugin-jsx": "^7.0.0",
"@tanstack/react-query": "4.28.0",
Expand Down Expand Up @@ -57,7 +57,7 @@
},
"scripts": {
"test": "jest",
"lint": "eslint .",
"lint": "eslint",
"dev": "NODE_ENV=development node esbuild.config.js --serve --watch",
"build": "NODE_ENV=production node esbuild.config.js"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/template/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import junoConfigs from "@cloudoperators/juno-eslint-config/juno.mjs"
import junoConfigs from "@cloudoperators/juno-config/eslint/juno.mjs"

export default [
...junoConfigs,
Expand Down
2 changes: 1 addition & 1 deletion apps/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@babel/core": "^7.20.2",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@cloudoperators/juno-eslint-config": "*",
"@cloudoperators/juno-config": "*",
"@svgr/core": "^7.0.0",
"@svgr/plugin-jsx": "^7.0.0",
"@tanstack/react-query": "4.28.0",
Expand Down
8 changes: 7 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ Before you begin, ensure you have the following software installed on your machi
npm install -f
```

3. **Available Turbo Commands:**
3. **Setup Husky:**

```bash
npm run prepare
```

4. **Available Turbo Commands:**
- **Build:**
```bash
npm run turbo build
Expand Down
2 changes: 1 addition & 1 deletion docs/releases_guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Every pull request that involves a change to a package should include a changese
To start the process, run the following command in your terminal:

```bash
turbo run changeset
npm run changeset
```

2. **Select the Package**
Expand Down
Loading

0 comments on commit 8c06648

Please sign in to comment.