Skip to content

Commit 0967888

Browse files
authored
Merge pull request #42 from ixartz/update-3-58-1
feat: update de Next.js Boilerplate v3.58.1
2 parents e74cb70 + 37bde69 commit 0967888

File tree

96 files changed

+9184
-10387
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+9184
-10387
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
77

88
# Stripe
99
# If you need a real Stripe subscription payment with checkout page, customer portal, webhook, etc.
10-
# You can check out the Next.js Boilerplate Pro: https://nextjs-boilerplate.com/pro-saas-starter-kit
10+
# You can check out the Next.js Boilerplate Pro at: https://nextjs-boilerplate.com/pro-saas-starter-kit
1111
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_51PNk4fKOp3DEwzQle6Cx1j3IW1Lze5nFKZ4JBX0gLpNQ3hjFbMiT25gw7LEr369ge7JIsVA2qRhdKQm1NAmVehXl00FQxwRfh1
1212
# Use Stripe test mode price id or production price id
1313
BILLING_PLAN_ENV=dev

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 107 deletions
This file was deleted.

.github/FUNDING.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
github: ixartz
22
custom:
3-
[
4-
"https://nextjs-boilerplate.com/pro-saas-starter-kit",
5-
"https://nextlessjs.com",
6-
]
3+
- 'https://nextjs-boilerplate.com/pro-saas-starter-kit'
4+
- 'https://nextlessjs.com'

.github/workflows/CI.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
build:
1111
strategy:
1212
matrix:
13-
node-version: [20.x, 22.6]
13+
node-version: [20.x, 22.6] # Need to use 22.6 due to Next.js build errors: https://github.com/vercel/next.js/issues/69263
1414
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
1515

1616
name: Build with ${{ matrix.node-version }}
@@ -22,7 +22,7 @@ jobs:
2222
uses: actions/setup-node@v3
2323
with:
2424
node-version: ${{ matrix.node-version }}
25-
cache: "npm"
25+
cache: npm
2626
- run: npm ci
2727
- run: npm run build
2828

@@ -42,7 +42,7 @@ jobs:
4242
uses: actions/setup-node@v3
4343
with:
4444
node-version: ${{ matrix.node-version }}
45-
cache: "npm"
45+
cache: npm
4646
- run: npm ci
4747

4848
- name: Build Next.js for E2E tests
@@ -61,24 +61,55 @@ jobs:
6161
run: npm run check-types
6262

6363
- name: Run unit tests
64-
run: npm run test
64+
run: npm run test -- --coverage
6565

6666
- name: Upload coverage reports to Codecov
67-
uses: codecov/codecov-action@v3
67+
uses: codecov/codecov-action@v4
6868
env:
6969
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
7070

7171
- name: Install Playwright (used for Storybook and E2E tests)
7272
run: npx playwright install --with-deps
7373

74+
- name: Run storybook tests
75+
run: npm run test-storybook:ci
76+
7477
- name: Run E2E tests
7578
run: npx percy exec -- npm run test:e2e
7679
env:
7780
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
81+
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
7882

7983
- uses: actions/upload-artifact@v3
8084
if: always()
8185
with:
8286
name: test-results
8387
path: test-results/
8488
retention-days: 7
89+
90+
synchronize-with-crowdin:
91+
name: GitHub PR synchronize with Crowdin
92+
runs-on: ubuntu-latest
93+
94+
needs: [build, test]
95+
if: github.event_name == 'pull_request'
96+
97+
steps:
98+
- uses: actions/checkout@v4
99+
with:
100+
ref: ${{ github.event.pull_request.head.sha }} # Crowdin Actions needs to push commits to the PR branch, checkout HEAD commit instead of merge commit
101+
fetch-depth: 0
102+
103+
- name: crowdin action
104+
uses: crowdin/github-action@v2
105+
with:
106+
upload_sources: true
107+
upload_translations: true
108+
download_translations: true
109+
create_pull_request: false
110+
localization_branch_name: ${{ github.head_ref || github.ref_name }} # explanation here: https://stackoverflow.com/a/71158878
111+
commit_message: 'chore: new Crowdin translations by GitHub Action'
112+
env:
113+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
115+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

.github/workflows/checkly.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Checkly
2+
3+
on: [deployment_status]
4+
5+
env:
6+
CHECKLY_API_KEY: ${{ secrets.CHECKLY_API_KEY }}
7+
CHECKLY_ACCOUNT_ID: ${{ secrets.CHECKLY_ACCOUNT_ID }}
8+
CHECKLY_TEST_ENVIRONMENT: ${{ github.event.deployment_status.environment }}
9+
10+
jobs:
11+
test-e2e:
12+
strategy:
13+
matrix:
14+
node-version: [20.x]
15+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
16+
17+
# Only run when the deployment was successful
18+
if: github.event.deployment_status.state == 'success'
19+
20+
name: Test E2E on Checkly
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 10
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
ref: '${{ github.event.deployment_status.deployment.ref }}'
28+
fetch-depth: 0
29+
30+
- name: Set branch name # workaround to detect branch name in "deployment_status" actions
31+
run: echo "CHECKLY_TEST_REPO_BRANCH=$(git show -s --pretty=%D HEAD | tr -s ',' '\n' | sed 's/^ //' | grep -e 'origin/' | head -1 | sed 's/\origin\///g')" >> $GITHUB_ENV
32+
33+
- uses: actions/setup-node@v4
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
cache: npm
37+
38+
- name: Restore or cache node_modules
39+
id: cache-node-modules
40+
uses: actions/cache@v4
41+
with:
42+
path: node_modules
43+
key: node-modules-${{ hashFiles('package-lock.json') }}
44+
45+
- name: Install dependencies
46+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
47+
run: npm ci
48+
49+
- name: Run checks # run the checks passing in the ENVIRONMENT_URL and recording a test session.
50+
id: run-checks
51+
run: npx checkly test --reporter=github --record
52+
env:
53+
VERCEL_BYPASS_TOKEN: ${{ secrets.VERCEL_BYPASS_TOKEN }}
54+
ENVIRONMENT_URL: ${{ github.event.deployment_status.environment_url }}
55+
56+
- name: Create summary # export the markdown report to the job summary.
57+
id: create-summary
58+
run: cat checkly-github-report.md > $GITHUB_STEP_SUMMARY
59+
60+
- name: Deploy checks # if the test run was successful and we are on Production, deploy the checks
61+
id: deploy-checks
62+
if: steps.run-checks.outcome == 'success' && github.event.deployment_status.environment == 'Production'
63+
run: npx checkly deploy --force

.github/workflows/crowdin.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Crowdin Action
2+
3+
on:
4+
push:
5+
branches: [main] # Run on push to the main branch
6+
schedule:
7+
- cron: '0 5 * * *' # Run every day at 5am
8+
workflow_dispatch: # Run manually
9+
10+
jobs:
11+
synchronize-with-crowdin:
12+
name: Synchronize with Crowdin
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: crowdin action
19+
uses: crowdin/github-action@v2
20+
with:
21+
upload_sources: true
22+
upload_translations: true
23+
download_translations: true
24+
localization_branch_name: l10n_crowdin_translations
25+
create_pull_request: true
26+
pull_request_title: New Crowdin Translations
27+
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
28+
pull_request_base_branch_name: main
29+
commit_message: 'chore: new Crowdin translations by GitHub Action'
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
33+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Release
22

33
on:
44
workflow_run:
5-
workflows: ["CI"]
5+
workflows: [CI]
66
types:
77
- completed
88
branches:
@@ -23,14 +23,14 @@ jobs:
2323
pull-requests: write # to be able to comment on released pull requests
2424

2525
steps:
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727
with:
2828
fetch-depth: 0
2929
- name: Use Node.js ${{ matrix.node-version }}
30-
uses: actions/setup-node@v3
30+
uses: actions/setup-node@v4
3131
with:
3232
node-version: ${{ matrix.node-version }}
33-
cache: "npm"
33+
cache: npm
3434
- run: HUSKY=0 npm ci
3535

3636
- name: Release

.github/workflows/update-deps.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Update dependencies
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: "0 0 1 * *"
6+
- cron: '0 0 1 * *'
77

88
jobs:
99
update:
@@ -15,12 +15,12 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
- name: Use Node.js ${{ matrix.node-version }}
20-
uses: actions/setup-node@v3
20+
uses: actions/setup-node@v4
2121
with:
2222
node-version: ${{ matrix.node-version }}
23-
cache: "npm"
23+
cache: npm
2424
- run: npm ci
2525

2626
- run: npx npm-check-updates -u # Update dependencies
@@ -29,5 +29,5 @@ jobs:
2929
- name: Create Pull Request
3030
uses: peter-evans/create-pull-request@v4
3131
with:
32-
commit-message: "build: update dependencies to the latest version"
32+
commit-message: 'build: update dependencies to the latest version'
3333
title: Update dependencies to the latest version

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22
# Disable concurent to run `check-types` after ESLint in lint-staged
3-
cd "$(dirname "$0")/.." && npx lint-staged --concurrent false
3+
cd "$(dirname "$0")/.." && npx --no lint-staged --concurrent false

0 commit comments

Comments
 (0)