Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
KOBA789 authored and s-ylide committed Mar 28, 2024
1 parent 127946d commit 77c0444
Show file tree
Hide file tree
Showing 35 changed files with 6,862 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules/
/dist/
/Dockerfile
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/dist/
/crates/*/pkg
18 changes: 18 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
env:
es2021: true
browser: false
node: true
extends:
- eslint-config-love
- eslint:recommended
- plugin:@typescript-eslint/eslint-recommended
- prettier
overrides: []
parserOptions:
project: ["./tsconfig.json"]
ecmaVersion: latest
sourceType: module
rules:
"@typescript-eslint/consistent-type-definitions": off
"@typescript-eslint/explicit-function-return-type": off
"@typescript-eslint/no-non-null-assertion": off
19 changes: 19 additions & 0 deletions .github/workflows/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: reviewdog / actionlint

on:
pull_request:
paths:
- ".github/workflows/**"

jobs:
actionlint:
name: actionlint with reviewdog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: actionlint
uses: reviewdog/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
36 changes: 36 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: lint and test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Lint ESLint
run: yarn lint:eslint

- name: Lint Prettier
run: yarn lint:prettier

- name: TypeCheck
run: yarn typecheck

- name: Test
run: yarn test
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/node_modules/
.DS_Store
/dist/
/dist-ssr/
*.local

.env
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/dist/
/node_modules/
/deploy/
/crates/*/pkg
/crates/*/target
src/configFormat/json.js
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:20-bullseye-slim

WORKDIR /app

COPY package.json yarn.lock ./
RUN yarn install

COPY ./ ./
RUN yarn build

CMD ["npm", "start"]
77 changes: 77 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# autoproject

自動で Issue を Project に登録する

## config

サンプル:[test/readme_rule.yaml](/test/readme_rule.yaml)

スキーマは,typescript 的に次と同じ(型名は実際のものと異なる)

```ts
type RulesYaml = (Partial<Payload> & { project: Project })[];

type Project =
| number
| {
not: number | number[];
}
| Array<
| number
| {
not: number | number[];
}
>
| {
only: number | number[];
}
| {
reject: {};
};

type Payload = {
repo: Partial<Repo>;
issue: Partial<Issue>;
pr: Partial<PullRequest>;
on: Partial<EventTarget>;
};

type Repo = {
name: string | string[];
full_name: string | string[];
description: string | string[];
fork: boolean;
private: boolean;
topics: string | string[];
};

type Issue = {
assignees: string | string[];
labels: string | string[];
};

type PullRequest = {
reviewers: string | string[];
assignees: string | string[];
labels: string | string[];
head: {
label: string | string[];
ref: string | string[];
};
};

type EventTarget = {
issue:
| "any"
| "opened"
| "assigned"
| "labeled"
| ("opened" | "assigned" | "labeled")[];
pr:
| "any"
| "opened"
| "assigned"
| "labeled"
| ("opened" | "assigned" | "labeled")[];
};
```
53 changes: 53 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "autoproject",
"version": "0.1.0",
"license": "MIT",
"scripts": {
"autopjlint": "node dist/lint.js",
"start": "node dist/index.js",
"compileNearley": "echo '/* eslint-disable */' > src/configFormat/json.js && nearleyc src/configFormat/json.ne >> src/configFormat/json.js",
"build": "tsc",
"test": "vitest run",
"typecheck": "tsc --noEmit",
"lint:prettier": "prettier . --check",
"lint:eslint": "eslint . --format stylish",
"lint": "run-p lint:*",
"fix:prettier": "yarn lint:prettier --write",
"fix:eslint": "yarn lint:eslint --fix",
"fix": "run-s fix:prettier fix:eslint"
},
"dependencies": {
"@octokit/app": "14.0.2",
"@octokit/graphql-schema": "15.3.0",
"@prantlf/jsonlint": "14.0.3",
"dotenv": "16.4.5",
"fuse.js": "6.6.2",
"log4js": "6.9.1",
"mitt": "3.0.1",
"nearley": "2.20.1",
"yaml": "2.3.4",
"yargs": "17.7.2",
"zod": "3.22.4"
},
"devDependencies": {
"@octokit/types": "12.6.0",
"@tsconfig/node20": "20.1.4",
"@types/nearley": "2.11.5",
"@types/node": "20.11.30",
"@types/yargs": "17.0.32",
"@typescript-eslint/eslint-plugin": "6.4.0",
"@typescript-eslint/parser": "6.4.0",
"eslint": "8.57.0",
"eslint-config-love": "43.1.0",
"eslint-config-prettier": "8.10.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-n": "15.7.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-promise": "6.1.1",
"npm-run-all": "4.1.5",
"prettier": "2.8.8",
"ts-node": "10.9.2",
"typescript": "5.3.3",
"vitest": "1.4.0"
}
}
10 changes: 10 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["config:base"],
"packageRules": [
{
"updateTypes": ["minor", "patch"],
"automerge": true
}
],
"postUpdateOptions": ["yarnDedupeHighest"]
}
Loading

0 comments on commit 77c0444

Please sign in to comment.