From f3c89e1f253ad23624c6ac63cec7935fbee2b2aa Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Halili Date: Tue, 23 Jul 2024 03:17:18 +0800 Subject: [PATCH] chore(global): format on things and update README Signed-off-by: Andrei Jiroh Halili --- .github/dependabot.yml | 6 +-- .github/workflows/bump-all-packages.yml | 6 +-- .github/workflows/wrangler-deploy.yml | 14 +++---- .prettierrc | 14 +++---- .vscode/extensions.json | 20 +++++----- .vscode/settings.json | 53 ++++++++++++++----------- README.md | 11 ++++- apps/golinks-v2/dev-manifest.yml | 12 +++--- jsconfig.json | 35 ++++++++-------- scripts/get-commit-url | 14 +++++-- 10 files changed, 103 insertions(+), 82 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a67c284..0af8ad7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,9 +2,9 @@ version: 2 enable-beta-ecosystems: true updates: - directories: - - / - - apps/** - - packages/** + - / + - apps/** + - packages/** open-pull-requests-limit: 5 rebase-strategy: auto package-ecosystem: npm diff --git a/.github/workflows/bump-all-packages.yml b/.github/workflows/bump-all-packages.yml index b64e835..4310b83 100644 --- a/.github/workflows/bump-all-packages.yml +++ b/.github/workflows/bump-all-packages.yml @@ -1,8 +1,8 @@ name: Bump all packages on: - workflow_dispatch: - schedule: - - cron: 30 12 * * 6 + workflow_dispatch: + schedule: + - cron: 30 12 * * 6 permissions: contents: write pull-requests: write diff --git a/.github/workflows/wrangler-deploy.yml b/.github/workflows/wrangler-deploy.yml index bc1cde6..7b86486 100644 --- a/.github/workflows/wrangler-deploy.yml +++ b/.github/workflows/wrangler-deploy.yml @@ -10,13 +10,13 @@ jobs: outputs: golinks-next: ${{ steps.filter.outputs.golinks-next }} steps: - - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - golinks-next: - - 'apps/golinks-v2/**' + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + golinks-next: + - 'apps/golinks-v2/**' golinks-next: name: Deploy golinks-next to staging environment: diff --git a/.prettierrc b/.prettierrc index ddcb42b..c05f8a7 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,9 +1,9 @@ { - "printWidth": 140, - "singleQuote": false, - "semi": true, - "useTabs": false, - "endOfLine": "lf", - "tabWidth": 2, - "arrowParens": "always" + "printWidth": 140, + "singleQuote": false, + "semi": true, + "useTabs": false, + "endOfLine": "lf", + "tabWidth": 2, + "arrowParens": "always" } diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 2251ef6..ee13996 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,11 +1,13 @@ { - "recommendations": [ - "arcanis.vscode-zipfs", - "esbenp.prettier-vscode", - "prisma.prisma", - "redhat.vscode-yaml", - "codiium.wrangler", - "ms-vscode-remote.remote-containers", - "ms-azuretools.vscode-docker" - ] + "recommendations": [ + "arcanis.vscode-zipfs", + "esbenp.prettier-vscode", + "prisma.prisma", + "redhat.vscode-yaml", + "codiium.wrangler", + "ms-vscode-remote.remote-containers", + "ms-azuretools.vscode-docker", + "mtxr.sqltools-driver-sqlite", + "mtxr.sqltools" + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index ce8b99a..2d1b0ed 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,26 +1,31 @@ { - "search.exclude": { - "**/.yarn": true, - "**/.pnp.*": true - }, - "git.alwaysSignOff": true, - "gitlens.remotes": [ - { - "domain": "mau.dev", - "type": "GitLab" - } - ], - "yaml.schemas": { - "https://raw.githubusercontent.com/devfile/api/v2.2.0/schemas/latest/devfile.json": ".devfile.yml", - "https://raw.githubusercontent.com/slackapi/manifest-schema/main/manifest.schema.json": [ - "apps/golinks-v2/app-manifest.yml", - "apps/golinks-v2/dev-manifest.yml" - ] - }, - "conventionalCommits.scopes": [ - "golinks", - "global", - "github-actions" - ], - "dotenv.enableAutocloaking": false + "search.exclude": { + "**/.yarn": true, + "**/.pnp.*": true + }, + "git.alwaysSignOff": true, + "gitlens.remotes": [ + { + "domain": "mau.dev", + "type": "GitLab" + } + ], + "yaml.schemas": { + "https://raw.githubusercontent.com/devfile/api/v2.2.0/schemas/latest/devfile.json": ".devfile.yml", + "https://raw.githubusercontent.com/slackapi/manifest-schema/main/manifest.schema.json": [ + "apps/golinks-v2/app-manifest.yml", + "apps/golinks-v2/dev-manifest.yml" + ] + }, + "conventionalCommits.scopes": ["golinks", "global", "github-actions"], + "dotenv.enableAutocloaking": false, + "sqltools.connections": [ + { + "previewLimit": 50, + "driver": "SQLite", + "database": "${workspaceFolder:api-servers}/apps/golinks-v2/.wrangler/state/v3/d1/miniflare-D1DatabaseObject/0c387ee1750819f278da29686bfd9e894e71486eed5952c4c869b0b96c99e1d0.sqlite", + "name": "d1-localdev-go" + } + ], + "sqltools.useNodeRuntime": true } diff --git a/README.md b/README.md index 58ca594..7b07341 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,9 @@ -# api-servers -Monorepo for different Cloudflare Workers and Deno Deploy hosted APIs I build +# `@andreijiroh-dev/api-servers` + +Monorepo for different Cloudflare Workers and Deno Deploy hosted APIs I build. +Licensed under MPL-2.0 + +## CI + +- [Dependabot Updates](https://github.com/andreijiroh-dev/api-servers/actions/workflows/dependabot/dependabot-updates) + on GitHub Actions, although I do the updates myself via `yarn-upgrade-all` command. diff --git a/apps/golinks-v2/dev-manifest.yml b/apps/golinks-v2/dev-manifest.yml index f743a13..2635748 100644 --- a/apps/golinks-v2/dev-manifest.yml +++ b/apps/golinks-v2/dev-manifest.yml @@ -1,5 +1,5 @@ display_information: - name: localdev.go.andreijiroh.xyz + name: slack-staging.go-next.ajhalili2006 description: Access Andrei Jiroh's golinks service API via Slack background_color: "#1710e3" long_description: "Access @ajhalili2006's golinks API service via /go Slack @@ -20,13 +20,13 @@ features: slash_commands: - command: /go-dev url: https://stellapent-cier.fawn-cod.ts.net/api/slack/slash-commands/go - description: Access the golinks service API via Slack + description: Access the golinks service API via Slack on dev environment usage_hint: "[command] [args]" should_escape: true - command: /ping-dev url: https://stellapent-cier.fawn-cod.ts.net/api/slack/slash-commands/ping - description: Check if everything's up - should_escape: false + description: Check if everything's up from dev environment + should_escape: true - command: /go-stg url: https://staging.go-next.andreijiroh.xyz/api/slack/slash-commands/go description: Access the golinks service API via Slack from staging environment. @@ -38,7 +38,9 @@ features: should_escape: true oauth_config: redirect_urls: - - https://stellapent-cier.fawn-cod.ts.net/slack/callback + - https://stellapent-cier.fawn-cod.ts.net/auth/slack/callback + - https://staging.go-next.andreijiroh.xyz/auth/slack/callback + - https://golinks-next-staging.ajhalili2006.workers.dev/auth/slack/callback scopes: bot: - commands diff --git a/jsconfig.json b/jsconfig.json index 8a62627..1a885d9 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,20 +1,17 @@ { - "compilerOptions": { - "module": "ESNext", - "moduleResolution": "Bundler", - "target": "ES2020", - "jsx": "react", - "allowImportingTsExtensions": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "sourceMap": true, - "checkJs": true - }, - "exclude": [ - "node_modules", - "**/node_modules/*" - ], - "buildOptions": { - "verbose": true - } -} \ No newline at end of file + "compilerOptions": { + "module": "ESNext", + "moduleResolution": "Bundler", + "target": "ES2020", + "jsx": "react", + "allowImportingTsExtensions": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "sourceMap": true, + "checkJs": true + }, + "exclude": ["node_modules", "**/node_modules/*"], + "buildOptions": { + "verbose": true + } +} diff --git a/scripts/get-commit-url b/scripts/get-commit-url index 25af410..c787e69 100755 --- a/scripts/get-commit-url +++ b/scripts/get-commit-url @@ -1,8 +1,16 @@ #!/usr/bin/env bash -set -e +set -ex GIT_ROOTDIR=$(git rev-parse --show-toplevel) REMOTE_NAME=${1:-"origin"} -GIT_REPO_URL=$(git config remote.${REMOTE_NAME}.url) +GIT_REPO_URL=$(git -C ${GIT_ROOTDIR} config --get remote.${REMOTE_NAME}.url) +CURRENT_COMMIT=$(git rev-parse HEAD) +COMPARE_HEAD=${2:-"${REMOTE_NAME}/main"} +if [[ $COMPARE_HEAD == "${REMOTE_NAME}/main" ]]; then + export COMPARE_HASH=$(git rev-parse ${COMPARE_HEAD}) +else + export COMPARE_HASH=$(git rev-parse HEAD~${COMPARE_HEAD}) +fi -echo "Commit head: $GIT_REPO_URL/commit/$(git rev-parse HEAD)" +echo "Commit head: $GIT_REPO_URL/commit/$CURRENT_COMMIT" +echo "Compare link: $GIT_REPO_URL/compare/$COMPARE_HASH...$CURRENT_COMMIT" -- knotmirror 0.0.1