Skip to content

Commit

Permalink
Merge pull request #66 from gentlementlegen/fix/remove-allow-command
Browse files Browse the repository at this point in the history
fix: remove allow command
  • Loading branch information
gentlementlegen authored Jan 5, 2025
2 parents 3b5a250 + ed5aaf3 commit 3e33352
Show file tree
Hide file tree
Showing 40 changed files with 145 additions and 968 deletions.
2 changes: 0 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"**/*.log",
"**/*.toml",
"**/*.http",
"src/adapters/supabase/types/database.ts",
"bun.lockb",
"dist/**"
],
Expand All @@ -24,7 +23,6 @@
"devpool",
"outdir",
"servedir",
"supabase",
"typebox",
"typeguards",
"mswjs",
Expand Down
2 changes: 0 additions & 2 deletions .dev.vars.example
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
SUPABASE_URL=
SUPABASE_KEY=
KERNEL_PUBLIC_KEY=
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
SUPABASE_URL=
SUPABASE_KEY=
KERNEL_PUBLIC_KEY=
6 changes: 1 addition & 5 deletions .github/knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ import type { KnipConfig } from "knip";
const config: KnipConfig = {
entry: ["src/index.ts"],
project: ["src/**/*.ts"],
ignore: ["src/types/config.ts", "src/adapters/supabase/types/database.ts"],
ignore: ["src/types/config.ts"],
ignoreExportsUsedInFile: true,
ignoreDependencies: [
"ts-node",
"@types/jest",
"@eslint/js",
"typescript-eslint",
"eslint-plugin-sonarjs",
"eslint-plugin-prettier",
"eslint-plugin-check-file",
"eslint-config-prettier",
"@typescript-eslint/parser",
"@typescript-eslint/eslint-plugin",
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/compute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,5 @@ jobs:
- name: Calling action
uses: ./
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
PLUGIN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KERNEL_PUBLIC_KEY: ${{ secrets.KERNEL_PUBLIC_KEY }}
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit "$1"
bun commitlint --edit "$1"
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
bun lint-staged
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Example of valid configuration:
publicAccessControl:
setLabel: true
fundExternalClosedIssue: false
protectLabels:
- price
- time
- priority
globalConfigUpdate:
excludeRepos: ["devpool-directory", "devpool-directory-private"]
```
Expand All @@ -55,7 +59,7 @@ supabase start
Start the Worker by running

```shell
yarn worker
bun run worker
```

### Make requests
Expand Down Expand Up @@ -83,5 +87,5 @@ For convenience you can find an `.http` file with a valid request [here](/tests/
To start Jest tests, run

```shell
yarn test
bun run test
```
Binary file modified bun.lockb
Binary file not shown.
12 changes: 6 additions & 6 deletions dist/index.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default tsEslint.config({
"@typescript-eslint": tsEslint.plugin,
"check-file": checkFile,
},
ignores: [".github/knip.ts", "src/adapters/supabase/types/database.ts", ".wrangler/**", "dist/**", "coverage/**"],
ignores: [".github/knip.ts", ".wrangler/**", "dist/**", "coverage/**"],
extends: [eslint.configs.recommended, ...tsEslint.configs.recommended, sonarjs.configs.recommended],
languageOptions: {
parser: tsEslint.parser,
Expand Down Expand Up @@ -74,6 +74,7 @@ export default tsEslint.config({
"sonarjs/function-return-type": "off",
"sonarjs/no-misleading-array-reverse": "off",
"sonarjs/slow-regex": "off",
"sonarjs/no-nested-template-literals": "off",
"@typescript-eslint/naming-convention": [
"error",
{
Expand Down
31 changes: 8 additions & 23 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,6 @@
"name": "Assistive pricing",
"description": "Handles assistive pricing, and allows for users to modify labels.",
"ubiquity:listeners": ["repository.created", "issues.opened", "issues.labeled", "issues.unlabeled", "label.edited", "issue_comment.created", "push"],
"commands": {
"allow": {
"ubiquity:example": "/allow @user1 label",
"description": "Allows the user to modify the given label type.",
"parameters": {
"type": "object",
"properties": {
"username": {
"type": "string",
"description": "The user that will be allowed to change the label"
},
"labelTypes": {
"type": "array",
"description": "Array of label types that user will be allowed to change, it can be empty to remove access from all labels",
"items": {
"type": "string",
"enum": ["time", "priority"]
}
}
}
}
}
},
"configuration": {
"default": {},
"type": "object",
Expand Down Expand Up @@ -98,6 +75,14 @@
"fundExternalClosedIssue": {
"default": false,
"type": "boolean"
},
"protectLabels": {
"default": ["priority", "price", "time"],
"uniqueItems": true,
"type": "array",
"items": {
"type": "string"
}
}
}
}
Expand Down
13 changes: 2 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@
},
"scripts": {
"worker": "wrangler dev --env dev --port 4001",
"start": "tsx src/index.ts",
"format": "run-s format:lint format:prettier format:cspell",
"format:lint": "eslint --fix .",
"format:prettier": "prettier --write .",
"format:cspell": "cspell **/*",
"knip": "knip --config .github/knip.ts",
"knip-ci": "knip --no-exit-code --reporter json --config .github/knip.ts",
"prepare": "husky install",
"test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --setupFiles dotenv/config --coverage",
"supabase:generate:local": "supabase gen types typescript --local > src/adapters/supabase/types/database.ts",
"supabase:generate:remote": "dotenv -- cross-env-shell supabase gen types typescript --project-id $SUPABASE_PROJECT_ID --schema public > src/adapters/supabase/types/database.ts"
"test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --setupFiles dotenv/config --coverage"
},
"keywords": [
"typescript",
Expand All @@ -31,13 +28,10 @@
"open-source"
],
"dependencies": {
"@commander-js/extra-typings": "12.0.1",
"@octokit/rest": "^20.1.0",
"@sinclair/typebox": "0.34.3",
"@supabase/supabase-js": "2.43.1",
"@ubiquity-os/plugin-sdk": "^1.1.1",
"@ubiquity-os/ubiquity-os-logger": "^1.3.2",
"commander": "12.0.0",
"decimal.js": "^10.4.3",
"dotenv": "^16.4.5",
"hono": "^4.6.7"
Expand All @@ -57,7 +51,6 @@
"@typescript-eslint/parser": "^8.14.0",
"cross-env": "7.0.3",
"cspell": "^8.4.0",
"dotenv-cli": "7.4.2",
"eslint": "9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-check-file": "^2.8.0",
Expand All @@ -71,17 +64,15 @@
"lint-staged": "^15.2.2",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.5",
"supabase": "^1.207.9",
"ts-jest": "29.1.2",
"ts-node": "10.9.2",
"tsx": "^4.7.1",
"typescript": "5.6.2",
"typescript-eslint": "^8.14.0",
"wrangler": "^3.87.0"
},
"lint-staged": {
"*.ts": [
"yarn prettier --write",
"prettier --write",
"eslint --fix"
],
"src/**.{ts,json}": [
Expand Down
17 changes: 0 additions & 17 deletions src/adapters/index.ts

This file was deleted.

52 changes: 0 additions & 52 deletions src/adapters/supabase/helpers/tables/access.ts

This file was deleted.

56 changes: 0 additions & 56 deletions src/adapters/supabase/helpers/tables/label.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/adapters/supabase/helpers/tables/super.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/adapters/supabase/helpers/tables/user.ts

This file was deleted.

Loading

0 comments on commit 3e33352

Please sign in to comment.