Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to monorepo #139

Merged
merged 58 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f0bce25
Prepare lint rule for publish + add documentation
Apr 14, 2024
435ed3a
Add packages/react-obsidian/coverage to gitignore
Apr 15, 2024
8c86ae5
Delete React Native example app as its unmaintained
Apr 15, 2024
81c1b7c
git mv all files to packages/react-obsidian
Apr 15, 2024
1c3c132
Add package.json to root
Apr 15, 2024
9b39a19
git mv all files from eslint to new destination
Apr 15, 2024
cbb45c4
Add dependencies to eslint plugin folder
Apr 15, 2024
7a7f468
Create an a package for our ESLint plugin
Apr 16, 2024
7d51bd3
Tests pass on both packages + some work on the ESLint plugin in prepa…
May 9, 2024
f3ace3f
Use yarn 3 in workflows?
May 10, 2024
7c638c7
maybe enable corepack
May 10, 2024
952bdb5
f
May 10, 2024
40e4496
now?
May 10, 2024
9b8127d
This should work eventually
May 10, 2024
11b9524
Switch to node 18
May 10, 2024
c1eec97
Install workspace plugin
May 10, 2024
6c900a5
Commit yarn plugins since yarn doesn't install them
May 10, 2024
93b681f
Bump @types/react to fix build
May 10, 2024
25a40c3
Fix lint
May 10, 2024
c65c7f1
Fix tsc
May 10, 2024
e4364ef
ESLint should work locally and in CI
May 11, 2024
010a093
Temporarily disable the eslint plugin
May 11, 2024
0115651
ESLint works on both library and lint plugin
May 16, 2024
401244b
Add lint script to plugin repo
May 16, 2024
8fcf11b
Run tests in node 18
May 16, 2024
bfb0ce5
Maybe fix yarn install
May 16, 2024
26844ca
Update lock file
May 16, 2024
bc2a21c
Lock artifactory to public NPM
May 16, 2024
bf565e3
Update documentation lock file
May 16, 2024
d4d8e59
tsc passes in eslint plugin repo
May 17, 2024
2eeb7e4
ESLint plugin works in react-obsidian package
May 21, 2024
41dc596
Rename eslint-plugin package to eslint-plugin-obsidian
May 21, 2024
51b09fa
Update lock file
May 21, 2024
ab6d495
Fix lock file
May 22, 2024
5a53b58
Move obsidian to peer dependencies - maybe fix CI build
May 22, 2024
a791473
Explicitly build eslint plugin before lib
May 22, 2024
4044677
Update lock file
May 22, 2024
a56ff0d
Update lint plugin path in CI scripts
May 22, 2024
6e7ffec
Colorize yarn workspace foreach command
May 22, 2024
542af3c
Stop using ts-mockito in favor of jest-when and jest-mock-extended
May 22, 2024
aefcb7f
test covertage collection phase
May 22, 2024
6e5a7c0
f
May 22, 2024
6512190
Maybe run coverage on each commit to branch?
May 22, 2024
c490600
Trigger coverage on push to any branch
May 22, 2024
b4aacb2
now?
May 22, 2024
c5f273e
now?
May 22, 2024
97dbb88
?
May 22, 2024
1236be2
copy coverage report to root since the coverage badge action doesn't …
May 22, 2024
515abcf
f
May 22, 2024
4aefd64
amm this should work?
May 22, 2024
1093b54
print working dir
May 23, 2024
ddeedb8
f
May 23, 2024
f775661
Update coverage badge only when pushing to master
May 23, 2024
57dafa1
Prettify build log
May 23, 2024
cfe436d
oopsie woopsie
May 23, 2024
ae43c6b
add yarn3
igorgn Jun 9, 2024
e43daac
updat yarn.lock
igorgn Jun 9, 2024
9f94cd5
version bump
Jun 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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