diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index b835896d0..4fcde0ea3 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,11 +1,10 @@ -name: "Bug Report" -labels: ["bug"] +name: 'Bug Report' +labels: ['bug'] description: Create a bug report to help us improve body: - type: markdown attributes: - value: - Thank you for reporting an issue. + value: Thank you for reporting an issue. Please fill in as much of the form below as you're able to. - type: textarea attributes: diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index f323f9475..ab21e8828 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -1,9 +1,9 @@ -name: "Feature Request" +name: 'Feature Request' description: Suggest a new idea or enhancement for this project body: - type: markdown attributes: - value: Please provide a clear and concise title for your feature request + value: Please provide a clear and concise title for your feature request - type: textarea attributes: label: Feature Description @@ -32,4 +32,4 @@ body: - label: I have provided a detailed description of the requested feature. - label: I have explained the use case or scenario for this feature. - label: I have included any relevant technical details or design suggestions. - - label: I understand that this is a suggestion and that there is no guarantee of implementation. \ No newline at end of file + - label: I understand that this is a suggestion and that there is no guarantee of implementation. diff --git a/.github/ISSUE_TEMPLATE/improvement.yml b/.github/ISSUE_TEMPLATE/improvement.yml index bebcb4cb5..058a025e7 100644 --- a/.github/ISSUE_TEMPLATE/improvement.yml +++ b/.github/ISSUE_TEMPLATE/improvement.yml @@ -1,4 +1,4 @@ -name: "General Improvement" +name: 'General Improvement' description: Suggest a minor enhancement or improvement for this project body: - type: markdown @@ -32,4 +32,4 @@ body: - label: I have provided a clear description of the improvement being suggested. - label: I have explained the rationale behind this improvement. - label: I have included any relevant technical details or design suggestions. - - label: I understand that this is a suggestion and that there is no guarantee of implementation. \ No newline at end of file + - label: I understand that this is a suggestion and that there is no guarantee of implementation. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d9013f408..9a20ae923 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,29 +4,29 @@ updates: - package-ecosystem: 'github-actions' directory: '/' schedule: - interval: "weekly" - target-branch: "main" + interval: 'weekly' + target-branch: 'main' labels: - - "ci dependencies" - - "ci" + - 'ci dependencies' + - 'ci' open-pull-requests-limit: 0 - - package-ecosystem: "npm" - directory: "/apps/marketing" + - package-ecosystem: 'npm' + directory: '/apps/marketing' schedule: - interval: "weekly" - target-branch: "main" + interval: 'weekly' + target-branch: 'main' labels: - - "npm dependencies" - - "frontend" + - 'npm dependencies' + - 'frontend' open-pull-requests-limit: 0 - - package-ecosystem: "npm" - directory: "/apps/web" + - package-ecosystem: 'npm' + directory: '/apps/web' schedule: - interval: "weekly" - target-branch: "main" + interval: 'weekly' + target-branch: 'main' labels: - - "npm dependencies" - - "frontend" + - 'npm dependencies' + - 'frontend' open-pull-requests-limit: 0 diff --git a/.github/pr-labeler.yml b/.github/pr-labeler.yml new file mode 100644 index 000000000..e6ad018a3 --- /dev/null +++ b/.github/pr-labeler.yml @@ -0,0 +1,21 @@ +'apps: marketing': + - apps/marketing/** + +'apps: web': + - apps/web/** + +'version bump 👀': + - '**/package.json' + - '**/package-lock.json' + +'🚨 migrations 🚨': + - packages/prisma/migrations/**/migration.sql + +'🚨 e2e changes 🚨': + - packages/app-tests/e2e/** + +'🚨 .env changes 🚨': + - .env.example + +'pkg: ee changes': + - packages/ee/** diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa29ae591..deda53ff0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,10 @@ -name: "Continuous Integration" +name: 'Continuous Integration' on: push: - branches: [ "main" ] + branches: ['main'] pull_request: - branches: [ "main" ] + branches: ['main'] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -19,12 +19,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 2 - name: Install Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 cache: npm @@ -43,10 +43,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 2 - name: Build Docker Image run: ./docker/build.sh - diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d47c37a00..465041c0a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,11 +1,11 @@ -name: "CodeQL" +name: 'CodeQL' on: workflow_dispatch: push: - branches: [ "main" ] + branches: ['main'] pull_request: - branches: [ "main" ] + branches: ['main'] jobs: analyze: @@ -19,30 +19,30 @@ jobs: strategy: fail-fast: true matrix: - language: [ 'javascript' ] + language: ['javascript'] steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v4 - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: npm + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: npm - - name: Install Dependencies - run: npm ci + - name: Install Dependencies + run: npm ci - - name: Copy env - run: cp .env.example .env + - name: Copy env + run: cp .env.example .env - - name: Build Documenso - run: npm run build + - name: Build Documenso + run: npm run build - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..80d188964 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,24 @@ +name: Deploy to Production + +on: + push: + tags: + - '*' + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: main + fetch-depth: 0 + token: ${{ secrets.GH_TOKEN }} + + - name: Push to release branch + run: | + git checkout release || git checkout -b release + git merge --ff-only main + git push origin release diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index a37f001d1..7b05458d9 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -1,51 +1,50 @@ name: Playwright Tests on: push: - branches: [ "main" ] + branches: ['main'] pull_request: - branches: [ "main" ] + branches: ['main'] jobs: e2e_tests: + name: "E2E Tests" timeout-minutes: 60 runs-on: ubuntu-latest - services: - postgres: - image: postgres - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 + cache: npm - name: Install dependencies run: npm ci + - name: Copy env run: cp .env.example .env + + - name: Start Services + run: npm run dx:up + - name: Install Playwright Browsers run: npx playwright install --with-deps + - name: Generate Prisma Client run: npm run prisma:generate -w @documenso/prisma + - name: Create the database run: npm run prisma:migrate-dev + + - name: Seed the database + run: npm run prisma:seed + - name: Run Playwright tests run: npm run ci + - uses: actions/upload-artifact@v3 if: always() with: - name: playwright-report - path: playwright-report/ + name: test-results + path: "packages/app-tests/**/test-results/*" retention-days: 30 env: - NEXT_PRIVATE_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/documenso - NEXT_PRIVATE_DIRECT_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/documenso TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} TURBO_TEAM: ${{ vars.TURBO_TEAM }} diff --git a/.github/workflows/first-interaction.yml b/.github/workflows/first-interaction.yml new file mode 100644 index 000000000..5f53eb280 --- /dev/null +++ b/.github/workflows/first-interaction.yml @@ -0,0 +1,29 @@ +name: 'Welcome New Contributors' + +on: + pull_request: + types: ['opened'] + issues: + types: ['opened'] + +permissions: + pull-requests: write + issues: write + +jobs: + welcome-message: + name: Welcome Contributors + if: github.event.action == 'opened' + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/first-interaction@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + pr-message: | + Thank you for creating your first Pull Request and for being a part of the open signing revolution! 💚🚀 +
Feel free to hop into our community in [Discord](https://documen.so/discord) + issue-message: | + Thank you for opening your first issue and for being a part of the open signing revolution! +
One of our team members will review it and get back to you as soon as it possible 💚 +
Meanwhile, please feel free to hop into our community in [Discord](https://documen.so/discord) diff --git a/.github/workflows/issue-assignee-check.yml b/.github/workflows/issue-assignee-check.yml new file mode 100644 index 000000000..1ce7a02be --- /dev/null +++ b/.github/workflows/issue-assignee-check.yml @@ -0,0 +1,59 @@ +name: 'Issue Assignee Check' + +on: + issues: + types: ['assigned'] + +permissions: + issues: write + +jobs: + countIssues: + if: ${{ github.event.issue.assignee }} && github.event.action == 'assigned' && github.event.sender.type == 'User' + runs-on: ubuntu-latest + steps: + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: npm + + - name: Install Octokit + run: npm install @octokit/rest@18 + + - name: Check Assigned User's Issue Count + id: parse-comment + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { Octokit } = require("@octokit/rest"); + const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN }); + + const username = context.payload.issue.assignee.login; + console.log(`Username Extracted: ${username}`); + + const { data: issues } = await octokit.issues.listForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + assignee: username, + state: 'open' + }); + + const issueCount = issues.length; + console.log(`Issue Count For ${username}: ${issueCount}`); + + if (issueCount > 3) { + let issueCountMessage = `### 🚨 Documenso Police 🚨`; + issueCountMessage += `\n@${username} has ${issueCount} open issues assigned already. Consider whether this issue should be assigned to them or left open for another contributor.`; + + await octokit.request('POST /repos/{owner}/{repo}/issues/{issue_number}/comments', { + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: issueCountMessage, + headers: { + 'Authorization': `token ${{ secrets.GITHUB_TOKEN }}`, + } + }); + } diff --git a/.github/workflows/issue-opened.yml b/.github/workflows/issue-opened.yml new file mode 100644 index 000000000..ed9f2811a --- /dev/null +++ b/.github/workflows/issue-opened.yml @@ -0,0 +1,21 @@ +name: 'Label Issues' + +on: + issues: + types: ['opened', 'reopened'] + +jobs: + label_issues: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - uses: actions/github-script@v6 + with: + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["needs triage"] + }) diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml new file mode 100644 index 000000000..1a5afd359 --- /dev/null +++ b/.github/workflows/pr-labeler.yml @@ -0,0 +1,20 @@ +name: 'PR Labeler' + +on: + - pull_request_target + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v4 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + sync-labels: '' diff --git a/.github/workflows/pr-review-reminder.yml b/.github/workflows/pr-review-reminder.yml new file mode 100644 index 000000000..cc272fbfe --- /dev/null +++ b/.github/workflows/pr-review-reminder.yml @@ -0,0 +1,60 @@ +name: 'PR Review Reminder' + +on: + pull_request: + types: ['opened', 'reopened', 'ready_for_review', 'review_requested'] + +permissions: + pull-requests: write + +jobs: + checkPRs: + if: ${{ github.event.pull_request.user.login }} && github.event.action == ('opened' || 'reopened' || 'ready_for_review' || 'review_requested') + runs-on: ubuntu-latest + steps: + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: npm + + - name: Install Octokit + run: npm install @octokit/rest@18 + + - name: Check user's PRs awaiting review + id: parse-prs + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { Octokit } = require("@octokit/rest"); + const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN }); + + const username = context.payload.pull_request.user.login; + console.log(`Username Extracted: ${username}`); + + const { data: pullRequests } = await octokit.pulls.list({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + sort: 'created', + direction: 'asc', + }); + + const userPullRequests = pullRequests.filter(pr => pr.user.login === username && (pr.state === 'open' || pr.state === 'ready_for_review')); + const prCount = userPullRequests.length; + console.log(`PR Count for ${username}: ${prCount}`); + + if (prCount > 3) { + let prReminderMessage = `🚨 @${username} has ${prCount} pull requests awaiting review. Please consider reviewing them when possible. 🚨`; + + await octokit.request('POST /repos/{owner}/{repo}/issues/{issue_number}/comments', { + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + body: prReminderMessage, + headers: { + 'Authorization': `token ${{ secrets.GITHUB_TOKEN }}`, + } + }); + } diff --git a/.github/workflows/semantic-pull-requests.yml b/.github/workflows/semantic-pull-requests.yml index af6e624c6..ef0a87542 100644 --- a/.github/workflows/semantic-pull-requests.yml +++ b/.github/workflows/semantic-pull-requests.yml @@ -17,5 +17,28 @@ jobs: runs-on: ubuntu-latest steps: - uses: amannn/action-semantic-pull-request@v5 + id: lint_pr_title env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: marocchino/sticky-pull-request-comment@v2 + if: always() && (steps.lint_pr_title.outputs.error_message != null) + with: + header: pr-title-lint-error + message: | + Hey There! and thank you for opening this pull request! 📝👋🏼 + + We require pull request titles to follow the [Conventional Commits Spec](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted. + + Details: + + ``` + ${{ steps.lint_pr_title.outputs.error_message }} + ``` + + - if: ${{ steps.lint_pr_title.outputs.error_message == null }} + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: pr-title-lint-error + message: | + Thank you for following the naming conventions for pull request titles! 💚🚀 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..82beed6e2 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,25 @@ +name: 'Mark Stale Issues and PRs' + +on: + schedule: + - cron: '0 */8 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + + steps: + - uses: actions/stale@v4 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-pr-stale: 30 + days-before-issue-stale: 30 + stale-issue-message: 'This issue has not seen activity for a while. It will be closed in 30 days unless further activity is detected' + stale-pr-message: 'This PR has not seen activitiy for a while. It will be closed in 30 days unless further activity is detected.' + close-issue-message: 'This issue has been closed because of inactivity.' + close-pr-message: 'This PR has been closed because of inactivity.' + exempt-pr-labels: 'WIP,on-hold,needs review' + exempt-issue-labels: 'WIP,on-hold,needs review,roadmap' diff --git a/.vscode/settings.json b/.vscode/settings.json index 38d6f1e73..97d5d1948 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,5 +6,8 @@ "eslint.validate": ["typescript", "typescriptreact", "javascript", "javascriptreact"], "javascript.preferences.importModuleSpecifier": "non-relative", "javascript.preferences.useAliasesForRenames": false, - "typescript.enablePromptUseWorkspaceTsdk": true + "typescript.enablePromptUseWorkspaceTsdk": true, + "files.eol": "\n", + "editor.tabSize": 2, + "editor.insertSpaces": true } diff --git a/apps/marketing/content/careers.mdx b/apps/marketing/content/careers.mdx new file mode 100644 index 000000000..69433e127 --- /dev/null +++ b/apps/marketing/content/careers.mdx @@ -0,0 +1,13 @@ +--- +title: Careers at Documenso +--- + +# Careers at Documenso + +So you love Documenso and all the things that we do and now you want to work with us to unlock the future of open signing? + +--- + +## Open Positions + +Unfortunately we have no open positions available at the moment. Our team has grown and so we must grow with it, please check back from time to time as now is not forever and we may be hiring again in the future. diff --git a/apps/marketing/src/app/(marketing)/layout.tsx b/apps/marketing/src/app/(marketing)/layout.tsx index 365d8a5d1..248414b33 100644 --- a/apps/marketing/src/app/(marketing)/layout.tsx +++ b/apps/marketing/src/app/(marketing)/layout.tsx @@ -29,7 +29,7 @@ export default function MarketingLayout({ children }: MarketingLayoutProps) { return (
@@ -41,7 +41,7 @@ export default function MarketingLayout({ children }: MarketingLayoutProps) {
-
{children}
+
{children}