Skip to content

Commit

Permalink
Finish convert to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
cregourd committed Oct 31, 2024
1 parent cf4d433 commit 16a9fdc
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 32 deletions.
66 changes: 48 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,54 @@ This turborepo has some additional tools already setup for you:
- [ESLint](https://eslint.org/) for code linting
- [Prettier](https://prettier.io) for code formatting

### Setup

To setup the project, run the following command:

```
pnpm install
```

Then you need to create a `.env` file in the root of the project with the following content:

```
DATABASE_URL="postgresql://user:password@localhost:5432/dbname"
```

And run the following command to setup the packages:

```
pnpm setup:packages
```

The `setup:packages` command will build packages, generate Prisma and then build `next-admin` package.

### Prisma (first time setup)

To setup the database, run the following command:

```
pnpm database
```

### Develop

To develop all apps and packages, run the following command:

```
pnpm dev
docker-compose up
cd apps/example && pnpm database
```

### Build

To build all apps and packages, run the following command:

```
pnpm build
```

### Workflow

The project workflow uses GitHub Actions to run tests, build, deploy (prod - preview - docs) and publish packages. To handle versioning up and publishing, we use [Changesets](https://github.com/changesets/changesets)
Expand Down Expand Up @@ -52,24 +100,6 @@ If you want to fix a previous major version, you can create a PR on the relative

Once a fix has been released, you can cherry-pick the fix on the `develop` branch if that fix is still relevant.

### Build

To build all apps and packages, run the following command:

```
pnpm build
```

### Develop

To develop all apps and packages, run the following command:

```
pnpm dev
docker-compose up
cd apps/example && pnpm database
```

### E2E

Tests are using Playwright to test directly with a browser.
Expand Down
1 change: 0 additions & 1 deletion apps/example/options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { prisma } from "./prisma";

export const options: NextAdminOptions = {
title: "⚡️ My Admin",

model: {
User: {
toString: (user) => `${user.name} (${user.email})`,
Expand Down
2 changes: 1 addition & 1 deletion apps/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@heroicons/react": "^2.0.18",
"@picocss/pico": "^1.5.7",
"@premieroctet/next-admin": "workspace:*",
"@premieroctet/next-admin-generator-prisma": "workspace:*",
"@prisma/client": "5.14.0",
"@tremor/react": "^3.2.2",
"next": "14.0.3",
Expand All @@ -32,7 +33,6 @@
},
"devDependencies": {
"@playwright/test": "^1.37.0",
"@premieroctet/next-admin-generator-prisma": "workspace:*",
"@types/node": "^17.0.12",
"@types/react": "^18.2.0",
"@types/react-datepicker": "^4.19.3",
Expand Down
4 changes: 2 additions & 2 deletions apps/example/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module.exports = {
content: [
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
"./../../node_modules/@tremor/**/*.{js,ts,jsx,tsx}",
"./../../node_modules/@premieroctet/next-admin/dist/**/*.{js,ts,jsx,tsx}",
"./node_modules/@tremor/**/*.{js,ts,jsx,tsx}",
"./node_modules/@premieroctet/next-admin/dist/**/*.{js,ts,jsx,tsx}",
"./app/**/*.{js,ts,jsx,tsx}",
"./options.{js,ts,jsx,tsx}",
"./pageRouterOptions.{js,ts,jsx,tsx}",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"build:example": "turbo run build --filter=example",
"build:next-admin": "turbo run build --filter=@premieroctet/next-admin",
"build:packages": "turbo run build --filter=@premieroctet/next-admin --filter=@premieroctet/next-admin-cli --filter=@premieroctet/next-admin-generator-prisma --filter=@premieroctet/next-admin-json-schema",
"setup:packages": "turbo run build --filter=@premieroctet/next-admin-cli --filter=@premieroctet/next-admin-generator-prisma --filter=@premieroctet/next-admin-json-schema && pnpm --filter example exec -- prisma generate && pnpm build:next-admin",
"dev": "turbo run dev",
"dev:docs": "turbo run dev --filter=docs",
"lint": "turbo run lint",
Expand Down
3 changes: 2 additions & 1 deletion packages/next-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
"prisma": ">=5",
"react": ">=17",
"react-dom": ">=17",
"typescript": ">=4"
"typescript": ">=4",
"tailwindcss": ">=3"
},
"dependencies": {
"@dnd-kit/core": "^6.1.0",
Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

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

0 comments on commit 16a9fdc

Please sign in to comment.