Skip to content

Commit

Permalink
Merge pull request #2 from tractr/monorepo
Browse files Browse the repository at this point in the history
feat: configure monorepo and ci
  • Loading branch information
EdouardDem authored Nov 20, 2023
2 parents 22b19fd + d414134 commit 43b27e9
Show file tree
Hide file tree
Showing 152 changed files with 17,594 additions and 389 deletions.
26 changes: 26 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* eslint-env node */
module.exports = {
ignorePatterns: ['dist/', 'node_modules/', '*.js', '*.cjs', '*.mjs'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: [
'./packages/*/tsconfig.eslint.json',
]
},
plugins: ['@typescript-eslint'],
root: true,
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
}
};

20 changes: 20 additions & 0 deletions .github/workflows/check-pull-request-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Lint PR"

on:
pull_request:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pull request on main

on:
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run lint
- run: npm run test
- run: npm run build
27 changes: 27 additions & 0 deletions .github/workflows/release-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lerna version & publish

on:
push:
branches: [ main ]

jobs:
publish:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
- name: Use Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org/'
- run: npm install
- run: npm run lint
- run: npm run test
- run: npm run build
- run: npm run lerna version
- run: npm run lerna publish from-package
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea/
.DS_Store
node_modules/
dist/
.env
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run format
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/directus-sync.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/.prettierignore → .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules
dist
package-lock.json
.grafbase
File renamed without changes.
1 change: 1 addition & 0 deletions CHANGELOG.md
4 changes: 0 additions & 4 deletions api/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion api/src/api/index.ts

This file was deleted.

6 changes: 0 additions & 6 deletions cli/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions cli/.prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions cli/.prettierrc

This file was deleted.

37 changes: 0 additions & 37 deletions cli/src/lib/commands/push.ts

This file was deleted.

7 changes: 0 additions & 7 deletions cli/src/lib/services/collections/permissions/index.ts

This file was deleted.

7 changes: 0 additions & 7 deletions cli/src/lib/services/collections/roles/index.ts

This file was deleted.

7 changes: 0 additions & 7 deletions cli/src/lib/services/collections/settings/index.ts

This file was deleted.

7 changes: 0 additions & 7 deletions cli/src/lib/services/collections/webhooks/index.ts

This file was deleted.

1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
14 changes: 14 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "independent",
"command": {
"version": {
"conventionalCommits": true,
"message": "chore(release): bump version [skip ci]",
"yes": true
},
"publish": {
"yes": true
}
}
}
Loading

0 comments on commit 43b27e9

Please sign in to comment.