Skip to content

Commit

Permalink
Merge pull request #74 from dipiash/bump-core-deps
Browse files Browse the repository at this point in the history
Bump core deps and remove pnpm
  • Loading branch information
dipiash authored Oct 23, 2024
2 parents 8706c54 + 22420b6 commit dd54995
Show file tree
Hide file tree
Showing 29 changed files with 39,506 additions and 24,486 deletions.
16 changes: 10 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,24 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": [
"plugin:nimbus-clean/recommended",
"plugin:@nx/typescript"
],
"extends": ["plugin:nimbus-clean/recommended", "plugin:@nx/typescript"],
"plugins": ["react-refresh"],
"rules": {
"react-refresh/only-export-components": "error"
"react-refresh/only-export-components": "error",
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
},
{
"files": ["*.graphql"],
"extends": "plugin:@graphql-eslint/operations-all",
"rules": {
"@graphql-eslint/match-document-filename": ["error", { "query": "PascalCase" }]
"@graphql-eslint/match-document-filename": [
"error",
{
"query": "PascalCase"
}
]
}
}
],
Expand Down
70 changes: 37 additions & 33 deletions .github/workflows/CheckPullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,36 @@ jobs:
cache-and-install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Cache data for pnpm and node_modules
uses: actions/cache@v3
with:
path: |
~/.pnpm-store
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/[email protected]

- uses: actions/setup-node@v4
with:
version: 8
run_install: true
node-version: 20.16.0
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Install dependencies
run: npm ci --prefer-offline

type-check:
runs-on: ubuntu-latest
needs:
- cache-and-install
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Reusable Action for PNPM and NX
uses: dipiash/pnpm-nx-reusable-action@v8
- run: npm ci --prefer-offline
- uses: nrwl/nx-set-shas@v4

- name: type-check PR
if: github.ref != 'refs/heads/main'
Expand All @@ -61,15 +56,18 @@ jobs:
needs:
- cache-and-install
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Reusable Action for PNPM and NX
uses: dipiash/pnpm-nx-reusable-action@v8
- run: npm ci --prefer-offline
- uses: nrwl/nx-set-shas@v4

- name: lint PR
if: github.ref != 'refs/heads/main'
Expand All @@ -83,15 +81,18 @@ jobs:
needs:
- cache-and-install
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Reusable Action for PNPM and NX
uses: dipiash/pnpm-nx-reusable-action@v8
- run: npm ci --prefer-offline
- uses: nrwl/nx-set-shas@v4

- name: stylelint PR
if: github.ref != 'refs/heads/main'
Expand All @@ -105,15 +106,18 @@ jobs:
needs:
- cache-and-install
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Reusable Action for PNPM and NX
uses: dipiash/pnpm-nx-reusable-action@v8
- run: npm ci --prefer-offline
- uses: nrwl/nx-set-shas@v4

- name: test PR
if: github.ref != 'refs/heads/main'
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/Deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Reusable Action for PNPM and NX
uses: dipiash/pnpm-nx-reusable-action@v8
- run: npm ci --prefer-offline

- name: Install and Build 🔧
run: npx nx build main
Expand Down
47 changes: 0 additions & 47 deletions .github/workflows/codeql.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ coverage
!.env.example

.nx/cache
.nx/workspace-data
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm dlx nx affected --target=type-check --uncommitted=true && node_modules/.bin/lint-staged
npx nx affected --target=type-check --uncommitted=true && node_modules/.bin/lint-staged
4 changes: 2 additions & 2 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm dlx nx affected --target=lint
pnpm dlx nx affected --target=type-check
npx nx affected --target=lint
npx nx affected --target=type-check
9 changes: 9 additions & 0 deletions .huskyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This loads nvm.sh, sets the correct PATH before running hook, and ensures the project version of Node
export NVM_DIR="$HOME/.nvm"

[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

# If you have an .nvmrc file, we use the relevant node version
if [ -f ".nvmrc" ]; then
nvm use
fi
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
save-exact=true
legacy-peer-deps=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.16.0
1 change: 1 addition & 0 deletions .nxignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vercel
16 changes: 11 additions & 5 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Add files here to ignore them from prettier formatting
.assets
.nx
.idea
.vscode
.husky
dist
build
coverage
node_modules
.vercel

/dist
/coverage

/.nx/cache
/.nx/cache
14 changes: 0 additions & 14 deletions .storybook/main.ts

This file was deleted.

14 changes: 0 additions & 14 deletions .storybook/tsconfig.json

This file was deleted.

6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Welcome to our project! We're thrilled that you're considering contributing. Her

1. Fork the repository to your GitHub account.
2. Clone the forked repository to your local machine.
3. Run `pnpm install` to install the project dependencies.
3. Run `npm install` to install the project dependencies.
4. Familiarize yourself with the project's structure and codebase.

## Branching
Expand All @@ -20,8 +20,8 @@ Welcome to our project! We're thrilled that you're considering contributing. Her
2. To configure environment variables:
- Copy `cp ./packages/graphql/env.example ./packages/graphql/.env.local` and add your GitHub token as indicated in step 1.
- Copy `cp ./apps/main/env.example ./apps/main/.env.local` and add your GitHub token in the same way.
3. If needed, you can generate code from the GraphQL schema using: `pnpm codegen:graphql`
4. To start the application: `pnpm dev`
3. If needed, you can generate code from the GraphQL schema using: `npm run codegen:graphql`
4. To start the application: `npm run dev`
5. Open your browser and navigate to http://localhost:3000 to view the app.

## Committing
Expand Down
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@

### Prerequisites

```sh
# Install pnpm
npx pnpm add -g pnpm
```

```sh
# Install NX
npm install -g nx

# Init project
pnpm run init-project
npm run init-project
```

### Development
Expand All @@ -39,11 +34,11 @@ pnpm run init-project
and add your GitHub token (see step 1)
5. _[Optional step]_ Generate code from GraphQL schema
```sh
pnpm codegen:graphql
npm run codegen:graphql
```
6. Start the app
```sh
pnpm dev
npm run dev
```
and open the page http://localhost:3000/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react'
import { describe, expect, it } from 'vitest'

import { MockedProvider } from '@apollo/client/testing'
import { MockedResponse } from '@apollo/react-testing'
import { ListRepositoriesDocument } from '@nx-vite-react-ts-mantine-boilerplate/graphql'
import { ThemeProvider } from '@nx-vite-react-ts-mantine-boilerplate/ui-kit'
import { act, render, screen } from '@testing-library/react'
Expand All @@ -22,11 +21,7 @@ const queryString = [
].join(' ')
const limitItems = 10

const mocks: {
success: readonly MockedResponse[]
empty: readonly MockedResponse[]
error: readonly MockedResponse[]
} = {
const mocks = {
empty: [
{
request: {
Expand Down
Loading

0 comments on commit dd54995

Please sign in to comment.