diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 00000000..a26eef1e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,93 @@
+name: "Bug Report"
+description: Create a new ticket for a bug.
+title: "[BUG] -
"
+labels: ["bug"]
+body:
+ - type: textarea
+ id: description
+ attributes:
+ label: "Description"
+ description: Please enter an explicit description of your issue
+ placeholder: Short and explicit description of your incident...
+ validations:
+ required: true
+ - type: input
+ id: reprod-url
+ attributes:
+ label: "Reproduction URL"
+ description: Please enter your GitHub URL to provide a reproduction of the issue
+ placeholder: ex. https://github.com/USERNAME/REPO-NAME
+ validations:
+ required: true
+ - type: textarea
+ id: reprod
+ attributes:
+ label: "Reproduction steps"
+ description: Please enter an explicit description of your issue
+ value: |
+ 1. Go to '...'
+ 2. Click on '....'
+ 3. Scroll down to '....'
+ 4. See error
+ render: bash
+ validations:
+ required: true
+ - type: dropdown
+ id: next-router
+ attributes:
+ label: "Next router"
+ description: What nex router are you seeing the problem on ?
+ multiple: true
+ options:
+ - App router
+ - Page router
+ validations:
+ required: true
+ - type: input
+ id: nextadmin-version
+ attributes:
+ label: "Next Admin version"
+ description: Please give the version of next admin
+ placeholder: ex. 3.1.1
+ validations:
+ required: true
+ - type: textarea
+ id: screenshot
+ attributes:
+ label: "Screenshots"
+ description: If applicable, add screenshots to help explain your problem.
+ value: |
+ ![DESCRIPTION](LINK.png)
+ render: bash
+ validations:
+ required: false
+ - type: textarea
+ id: nextadmin-options
+ attributes:
+ label: "Next Admin options"
+ description: Please copy and paste any relevant Next Admin options. This will be automatically formatted into code, so no need for backticks.
+ render: ts
+ validations:
+ required: false
+ - type: textarea
+ id: logs
+ attributes:
+ label: "Logs"
+ description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
+ render: bash
+ validations:
+ required: false
+ - type: dropdown
+ id: browsers
+ attributes:
+ label: "Browsers"
+ description: What browsers are you seeing the problem on ?
+ multiple: true
+ options:
+ - Firefox
+ - Chrome
+ - Safari
+ - Microsoft Edge
+ - Opera
+ validations:
+ required: false
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 00000000..6d068db7
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,39 @@
+name: "Feature Request"
+description: Create a new ticket for a new feature request
+title: "[FEATURE] - "
+labels: [
+ "enhancement"
+]
+body:
+ - type: textarea
+ id: summary
+ attributes:
+ label: "Summary"
+ description: Provide a brief explanation of the feature
+ placeholder: Describe in a few lines your feature request
+ validations:
+ required: true
+ - type: textarea
+ id: basic_example
+ attributes:
+ label: "Basic Example"
+ description: Indicate here some basic examples of your feature.
+ placeholder: A few specific words about your feature request.
+ validations:
+ required: true
+ - type: textarea
+ id: drawbacks
+ attributes:
+ label: "Drawbacks"
+ description: What are the drawbacks/impacts of your feature request ?
+ placeholder: Identify the drawbacks and impacts while being neutral on your feature request
+ validations:
+ required: false
+ - type: textarea
+ id: unresolved_question
+ attributes:
+ label: "Unresolved questions"
+ description: What questions still remain unresolved ?
+ placeholder: Identify any unresolved issues.
+ validations:
+ required: false
\ No newline at end of file
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 00000000..1a7cc286
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,37 @@
+## Title
+
+[Provide a succinct and descriptive title for the pull request, e.g., "Improve caching mechanism for API calls"]
+
+## Type of Change
+
+- [ ] New feature
+- [ ] Bug fix
+- [ ] Documentation update
+- [ ] Refactoring
+- [ ] Hotfix
+- [ ] Security patch
+- [ ] UI/UX improvement
+
+## Issue
+
+[Linked issues]
+
+## Description
+
+[Provide a detailed explanation of the changes you have made. Include the reasons behind these changes and any relevant context. Link any related issues.]
+
+## Screenshots
+
+[Add screenshot of the changes you have made]
+
+## Testing
+
+[Detail the testing you have performed to ensure that these changes function as intended. Include information about any added tests.]
+
+## Impact
+
+[Discuss the impact of your changes on the project. This might include effects on performance, new dependencies, or changes in behaviour.]
+
+## Additional Information
+
+[Any additional information that reviewers should be aware of.]
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
index fa6b38b4..3c5c7177 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -1,4 +1,4 @@
-name: E2E tests
+name: E2E, Lint & Unit tests
on:
push:
branches:
@@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
- node-version: "18"
+ node-version: 18
cache: "yarn"
- name: Cache playwright dependencies
id: cache-playwright
@@ -23,14 +23,26 @@ jobs:
run: docker-compose up -d
- name: Install dependencies
run: yarn install
+ - name: Run linter
+ run: yarn lint
- name: Install playwright dependencies
if: steps.cache-playwright.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- - name: Build packages
- run: yarn build:example
- name: Fill database
run: yarn database
+ - name: Build packages
+ run: yarn build:example
- name: Start server
run: yarn start:example &
- name: Run tests
- run: yarn turbo test:e2e
+ run: |
+ yarn test
+ yarn turbo test:e2e
+ cd apps/example && yarn prisma db seed && cd -
+ BASE_URL=http://localhost:3000/pagerouter/admin yarn test:e2e
+ - uses: actions/upload-artifact@v3
+ if: always()
+ with:
+ name: playwright-report
+ path: playwright-report/
+ retention-days: 30
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index e46be390..0063ec3d 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -4,6 +4,7 @@ on:
push:
branches:
- main
+ - v[0-9]+
concurrency: ${{ github.workflow }}-${{ github.ref }}
@@ -26,11 +27,12 @@ jobs:
- name: Link
run: yarn lint
- - name: Create Release Pull Request or Publish
+ - name: Create Release Pull Request or Publish (${{ github.ref_name }})
uses: changesets/action@v1
with:
version: yarn changeset version
publish: yarn publish-package
+ title: ${{github.ref_name}} — Version Packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/.github/workflows/vercel-deploy.yml b/.github/workflows/vercel-deploy.yml
new file mode 100644
index 00000000..61b24097
--- /dev/null
+++ b/.github/workflows/vercel-deploy.yml
@@ -0,0 +1,59 @@
+name: Vercel deploy
+env:
+ VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
+
+on:
+ workflow_call:
+ inputs:
+ environment:
+ required: true
+ type: string
+ extra_args:
+ required: false
+ type: string
+
+jobs:
+ Deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18
+
+ - name: Install Dependencies
+ run: yarn install
+
+ - name: Install Vercel CLI
+ run: npm install --global vercel@latest
+
+ - name: Pull Vercel Environment Information (Docs)
+ run: vercel pull --yes --environment=${{ inputs.environment }} --token=${{ secrets.VERCEL_TOKEN }}
+ env:
+ VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_DOCS }}
+ - name: Build Project Artifacts (Docs)
+ run: vercel build ${{ inputs.extra_args }} --token=${{ secrets.VERCEL_TOKEN }}
+ env:
+ VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_DOCS }}
+ - name: Deploy Project Artifacts to Vercel (Docs)
+ run: vercel deploy ${{ inputs.extra_args }} --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
+ env:
+ VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_DOCS }}
+
+ - name: Intermediate cleanup
+ run: rm -rf .vercel
+
+ - name: Pull Vercel Environment Information (Example)
+ run: vercel pull --yes --environment=${{ inputs.environment }} --token=${{ secrets.VERCEL_TOKEN }}
+ env:
+ VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_EXAMPLE }}
+ - name: Build Project Artifacts (Example)
+ run: vercel build ${{ inputs.extra_args }} --token=${{ secrets.VERCEL_TOKEN }}
+ env:
+ VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_EXAMPLE }}
+ - name: Deploy Project Artifacts to Vercel (Example)
+ run: vercel deploy ${{ inputs.extra_args }} --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
+ env:
+ VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_EXAMPLE }}
diff --git a/.github/workflows/vercel-preview.yml b/.github/workflows/vercel-preview.yml
new file mode 100644
index 00000000..d5486def
--- /dev/null
+++ b/.github/workflows/vercel-preview.yml
@@ -0,0 +1,12 @@
+name: Vercel Preview Deployment
+
+on:
+ push:
+ branches-ignore:
+ - main
+jobs:
+ Deploy-Preview:
+ uses: ./.github/workflows/vercel-deploy.yml
+ secrets: inherit
+ with:
+ environment: preview
diff --git a/.github/workflows/vercel-prod.yml b/.github/workflows/vercel-prod.yml
new file mode 100644
index 00000000..7f6f2b86
--- /dev/null
+++ b/.github/workflows/vercel-prod.yml
@@ -0,0 +1,16 @@
+name: Vercel Production Deployment
+
+on:
+ pull_request:
+ types:
+ - closed
+ branches:
+ - "main"
+jobs:
+ Deploy-Production:
+ if: github.event.pull_request.merged == true && (startsWith(github.event.pull_request.head.ref, 'changeset-release/') || (!contains(github.event.pull_request.changed_files, 'packages/next-admin/') && contains(github.event.pull_request.changed_files, 'apps/')))
+ uses: ./.github/workflows/vercel-deploy.yml
+ secrets: inherit
+ with:
+ environment: production
+ extra_args: --prod