Skip to content

Commit

Permalink
Switch to monorepo (#139)
Browse files Browse the repository at this point in the history
The PR changes the structure of the project to a monorepo. The project will be split into two packages:
1. `react-obsidian` - The library
2. `eslint-plugin-obsidian` - an ESLint plugin with various rules to enhance DX and prevent bugs.

## Motivation
This change will allow us to publish the ESLint plugin we wrote a few months ago.

Co-authored-by: Guy Carmeli <>
Co-authored-by: Igor Gnatyuk <[email protected]>
  • Loading branch information
guyca and igorgn authored Jun 11, 2024
1 parent 15f2b23 commit 2a6023f
Show file tree
Hide file tree
Showing 217 changed files with 20,621 additions and 37,318 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

23 changes: 16 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,29 @@ jobs:

strategy:
matrix:
node-version: [16.14.x]
node-version: [18]


env:
NPM_EMAIL: ''
NPM_TOKEN: ''

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: yarn install
- run: yarn build-local
- run: yarn lint
- run: yarn test

- name: Install
run: yarn --frozen-lockfile
- name: Build
run: |
yarn workspace react-obsidian run build
yarn workspace eslint-plugin-obsidian run build
- name: Lint
run: yarn lint
- name: Test
run: yarn test
17 changes: 11 additions & 6 deletions .github/workflows/collect-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ jobs:
update-code-coverage-badge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: "18"

- name: Install
run: yarn
run: yarn --frozen-lockfile
- name: Build
run: yarn build-local
run: yarn workspace react-obsidian run build
- name: Test and collect coverage
run: yarn test-coverage
run: yarn workspace react-obsidian run test-coverage
- name: Create badge and publish to gh-pages
uses: nolleh/jest-badge-deploy-action@latest
uses: nolleh/jest-badge-deploy-action@latest
with:
coverage-summary-path: packages/react-obsidian/coverage/coverage-summary.json
8 changes: 5 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ jobs:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
cache: yarn
cache-dependency-path: documentation/yarn.lock

Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@ jobs:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
cache: yarn
cache-dependency-path: documentation/yarn.lock

- name: Install dependencies
working-directory: ./documentation
run: yarn install --frozen-lockfile
run: yarn --frozen-lockfile
- name: Test build documentation
working-directory: ./documentation
run: yarn build
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,8 @@ index.android.bundle.map
.eslintcache
**/.docusaurus
coverage/*
packages/react-obsidian/coverage/
.yarn/cache
.yarn/install-state.gz
documentation/.yarn/cache
documentation/.yarn/install-state.gz
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.20.0
18.12.0
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
"cSpell.words": [
"estree",
"TSES",
"unmagler"
"unmagler",
"Middlewares",
"MVVM",
"preconfigured",
"unmagler",
"unsubscribers"
]
],
"eslint.ignoreUntitled": true,
"eslint.format.enable": true,
"eslint.workingDirectories": [ {"pattern": "packages/*"} ]
}
28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.4.1.cjs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
nodeLinker: node-modules

npmRegistryServer: "https://registry.npmjs.org/"

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.4.1.cjs
21 changes: 21 additions & 0 deletions documentation/docs/documentation/meta/eslint.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
sidebar_position: 2
title: "Lint rules"
---

## @obsidian/unresolved-dependencies
Ensure dependencies requested by providers can be resolved.

When a provider requests a dependency that is not provided by the graph or its subgraphs, this rule will trigger a lint error.

```ts
@Graph()
class SomeGraph extends ObjectGraph {
@Provides()
someService(someDependency: SomeDependency) {
// ^ Since SomeDependency is not provided by the graph, this will trigger a lint error.
return new SomeService(someDependency);
}
}
```

Loading

0 comments on commit 2a6023f

Please sign in to comment.