Skip to content

Commit

Permalink
refactor: onerepo prerelease
Browse files Browse the repository at this point in the history
  • Loading branch information
paularmstrong committed Jan 22, 2024
1 parent fe76e2c commit a8a7026
Show file tree
Hide file tree
Showing 13 changed files with 209 additions and 419 deletions.
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @generated SignedSource<<925cadd58f83cc3dc04af9cddfbc19be>>

# paularmstrong-dev
@paularmstrong

2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- uses: paularmstrong/onerepo/actions/get-tasks@main
id: tasks # important!: this must match the ID used in the output
with:
cli: ./bin/dev.mjs
packageManager: yarn
lifecycle: pre-merge
verbosity: 2

Expand Down
4 changes: 2 additions & 2 deletions .husky/post-checkout → .hooks/post-checkout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
. "$(dirname -- "$0")/_/hooks.sh"

# If the third argument is "1", then we have switched branches
if [ $3 = '1' ]; then
./bin/dev.mjs tasks -c post-checkout
one tasks --lifecycle=post-checkout
fi
4 changes: 4 additions & 0 deletions .hooks/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/hooks.sh"

one tasks --lifecycle=post-merge
4 changes: 4 additions & 0 deletions .hooks/post-rewrite
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/hooks.sh"

one tasks --lifecycle=post-checkout
4 changes: 4 additions & 0 deletions .hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/hooks.sh"

one tasks --lifecycle=pre-commit
4 changes: 0 additions & 4 deletions .husky/post-rewrite

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

24 changes: 0 additions & 24 deletions bin/dev.mjs

This file was deleted.

19 changes: 0 additions & 19 deletions onerepo.config.js

This file was deleted.

45 changes: 45 additions & 0 deletions onerepo.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import type { Config } from 'onerepo';
import { eslint } from '@onerepo/plugin-eslint';
import { prettier } from '@onerepo/plugin-prettier';
import { typescript } from '@onerepo/plugin-typescript';

export default {
root: true,

codeowners: {
'.': ['@paularmstrong'],
},

dependencies: {
mode: 'loose',
dedupe: true,
},

tasks: {
'pre-commit': {
parallel: [['$0 lint --add', '$0 format --add'], { cmd: '$0 astro -- check', match: '**/*.astro' }],
serial: [{ cmd: '$0 astro -- sync', match: 'src/content/**' }, '$0 tsc'],
},
'pre-merge': {
serial: ['$0 lint --all --no-fix', '$0 format --check', '$0 tsc', '$0 tasks -c build', '$0 astro -- check'],
},
'post-checkout': {
serial: ['yarn'],
},
build: {
serial: ['$0 astro -- build'],
},
},

plugins: [
eslint({ name: ['lint', 'eslint'], extensions: ['ts', 'tsx', 'js', 'jsx', 'cjs', 'mjs', 'astro'] }),
prettier({ name: ['format', 'prettier'] }),
typescript({ tsconfig: 'tsconfig.json', useProjectReferences: false }),
],

vcs: {
autoSyncHooks: true,
},

templateDir: './config/templates',
} satisfies Config;
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
},
"devDependencies": {
"@astrojs/check": "^0.3.1",
"@onerepo/plugin-eslint": "^0.6.4",
"@onerepo/plugin-prettier": "^0.5.4",
"@onerepo/plugin-typescript": "^0.3.4",
"@onerepo/plugin-eslint": "0.0.0-pre-eb88bdd",
"@onerepo/plugin-prettier": "0.0.0-pre-eb88bdd",
"@onerepo/plugin-typescript": "0.0.0-pre-eb88bdd",
"@types/debounce": "^1.2.4",
"@types/mdast": "^4.0.3",
"@types/react": "^18.2.38",
Expand All @@ -43,7 +43,7 @@
"eslint-plugin-tailwindcss": "^3.13.0",
"husky": "^8.0.3",
"netlify-cli": "^17.7.0",
"onerepo": "^0.15.2",
"onerepo": "0.0.0-pre-eb88bdd",
"prettier": "^3.1.0",
"prettier-plugin-astro": "^0.12.2",
"shiki": "^0.14.5",
Expand Down
Loading

0 comments on commit a8a7026

Please sign in to comment.