Skip to content

Commit

Permalink
feat: update to get parity (#19)
Browse files Browse the repository at this point in the history
* feat: update to get parity

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: fix deploy

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: fix directory

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: add in codecov

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

---------

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>
  • Loading branch information
iamnewton authored Nov 10, 2024
1 parent b7edbb5 commit ae691b7
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 25 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Dependabot auto-merge
on:
name: Dependencies

on: # yamllint disable-line rule:truthy
- pull_request

permissions:
Expand All @@ -10,13 +11,11 @@ jobs:
dependabot:
name: Update the dependencies
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'theholocron/nextjs-template'
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- uses: dependabot/fetch-metadata@4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d
- uses: dependabot/fetch-metadata@v2
name: Fetch Dependabot metadata
id: metadata
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- run: gh pr merge --auto --merge "$PR_URL"
name: Enable auto-merge for Dependabot PRs
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
greeting:
name: Greet new interactions
runs-on: ubuntu-latest
if: github.event.issue.user.login != 'iamnewton' || github.event.pull_request.user.login != 'iamnewton'
steps:
- uses: actions/first-interaction@v1
with:
Expand All @@ -21,7 +22,7 @@ jobs:
Your patience is much appreciated and we will get back to you as
quickly as possible.
pr-message: >
Hey @${{ github.event.issue.user.login }}!
Hey @${{ github.event.pull_request.user.login }}!
We really appreciate you taking the time to help out with this PR.
The collaborators on this project attempt to help as many people as
possible, but we are a limited number of volunteers, so it is
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ jobs:
# VALIDATE_YAML_PRETTIER: true => turning it off because its writing 4 spaces instead of 2
YAML_CONFIG_FILE: "yamllint.config.yml"

- uses: crazy-max/ghaction-import-gpg@v6
name: Import GPG Key
with:
git_user_signingkey: true
git_commit_gpgsign: true
GPG_PRIVATE_KEY: ${{ secrets.SUPER_LINTER_GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.SUPER_LINTER_GPG_PASSPHRASE }}

- uses: stefanzweifel/git-auto-commit-action@v5
name: Commit and push linting fixes
# Run only on:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:

- run: npm ci
name: Install dependencies
env:
HUSKY: 0

- run: npm publish
name: Publish to GitHub
Expand All @@ -49,6 +51,8 @@ jobs:

- run: npm ci
name: Install dependencies
env:
HUSKY: 0

- run: npm publish --access public
name: Publish to GitHub Packages
Expand Down
37 changes: 36 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,41 @@ on: # yamllint disable-line rule:truthy
- push

jobs:
unit:
name: Run tests and collect coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout repository
with:
fetch-depth: 0

- uses: actions/setup-node@v4
name: Setup Node.js @v20
with:
cache: npm
node-version: 20.x

- run: npm ci
name: Install dependencies

- run: npx playwright install --with-deps
name: Install Playwright

- run: npm run build:storybook -- --quiet --output-dir=docs
name: Build Storybook

- run: |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"npx http-server docs --port 6006 --silent" \
"npx wait-on tcp:6006 && npm run test:storybook -- --coverage"
name: Run tests with coverage
- uses: codecov/codecov-action@v4
name: Upload results to Codecov
with:
token: ${{ secrets.CODECOV_TOKEN }}

# Run visual and composition tests with Chromatic
visual-and-composition:
name: Test Visual and Composition
Expand Down Expand Up @@ -52,7 +87,7 @@ jobs:
- run: npx playwright install --with-deps
name: Install Playwright

- run: npm run build:storybook --quiet
- run: npm run build:storybook -- --quiet --output-dir=docs
name: Build Storybook

- run: |
Expand Down
27 changes: 27 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
coverage:
status:
# Apply default rules for flags coverage not uploaded
default_rules:
flag_coverage_not_uploaded_behavior: exclude

# Set project-specific coverage targets
project:
array:
target: auto
threshold: 1% # PR fails if coverage drops by 1% or more
misc:
target: auto
threshold: 1%
storage:
target: auto
threshold: 1%
string:
target: auto
threshold: 1%
uri:
target: auto
threshold: 1%

comment:
layout: "reach, diff, flags, files"
behavior: default
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
"devDependencies": {
"@codesandbox/storybook-addon": "^0.2.0",
"@storybook/nextjs": "^8.2.5",
"@theholocron/commitlint-config": "^3.4.4",
"@theholocron/eslint-config": "^3.4.4",
"@theholocron/jest-config": "^3.4.4",
"@theholocron/lint-staged-config": "^3.4.4",
"@theholocron/prettier-config": "^3.4.4",
"@theholocron/storybook-config": "^3.4.4",
"@theholocron/stylelint-config": "^3.4.4",
"@theholocron/tsconfig": "^3.4.4",
"@theholocron/commitlint-config": "^3.5.1",
"@theholocron/eslint-config": "^3.5.1",
"@theholocron/jest-config": "^3.5.1",
"@theholocron/lint-staged-config": "^3.5.1",
"@theholocron/prettier-config": "^3.5.1",
"@theholocron/storybook-config": "^3.5.1",
"@theholocron/stylelint-config": "^3.5.1",
"@theholocron/tsconfig": "^3.5.1",
"@tsconfig/next": "^2.0.3",
"@types/node": "^22.9.0",
"@types/react": "^18.3.12",
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import react from "@vitejs/plugin-react";
* @see https://vitejs.dev/config/
*/
export default defineConfig({
plugins: [react()],
build: {
lib: {
entry: path.resolve(__dirname, "src/index.ts"), // Entry point of your library
Expand All @@ -24,6 +23,7 @@ export default defineConfig({
},
},
},
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"), // Example alias, adjust as needed
Expand Down

0 comments on commit ae691b7

Please sign in to comment.