Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
group: ${{ github.event_name != 'pull_request' && 'group-pushmain' || github.run_id }}
cancel-in-progress: ${{ github.event_name != 'pull_request' }}

container:
image: mcr.microsoft.com/playwright:v1.45.3-jammy
# container:
# image: mcr.microsoft.com/playwright:v1.45.3-jammy

steps:
#
Expand All @@ -36,21 +36,22 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"
- run: npm ci
- uses: rharkor/caching-for-turbo@v1.5
- uses: pnpm/action-setup@v4
- run: pnpm install --frozen-lockfile
# - uses: rharkor/caching-for-turbo@v1.5

#
# Test
#
# - run: npm test
# env:
# BASE_PATH: ${{ steps.configurepages.outputs.base_path }}
- run: pnpm run lgtm

#
# Build (only for pushes on main)
#
- run: npm run build
- run: pnpm run build
if: github.event_name != 'pull_request'
env:
BASE_PATH: ${{ steps.configurepages.outputs.base_path }}
Expand Down
35 changes: 16 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $ code myproject

Prerequisites:

- Install [nvm](https://github.com/nvm-sh/nvm) - Node Version Manager, then:
- [Install nvm](https://github.com/nvm-sh/nvm), then:

```bash
$ nvm install
Expand All @@ -23,34 +23,29 @@ Prerequisites:
nb: if you want this node version to be your default nvm's one:
`nvm alias default node`

- Install [PNPM](https://pnpm.io/installation#using-corepack) - Package Manager,
with:

```sh
- ```sh
$ corepack enable
$ corepack prepare --activate # it reads "packageManager"
$ npm -v # make sure your version satisfies package.json#engines.npm
$ pnpm -v # make sure your version satisfies package.json#engines.pnpm
```

```
$ npm ci
```sh
$ pnpm install
```

# dev

```sh
$ npm run dev
$ pnpm run dev
```

# build

```sh
$ npm run build
$ pnpm run build
```

NB: `npm run build -- --force` to ignore turbo cache

Then `npx serve out`.
Then `pnpm run start`.

<details>

Expand Down Expand Up @@ -81,18 +76,20 @@ This will:

# test

> [!IMPORTANT] WIP

```sh
$ npm test
$ pnpm test
```

To update the snapshots: `npm test -- -- --update-snapshots`
To update the snapshots: `pnpm test -- -- --update-snapshots`

<details>

You can also:

```sh
$ BASE_PATH=/examples npm test
$ BASE_PATH=/examples pnpm test
```

</details>
Expand All @@ -110,16 +107,16 @@ $ docker run -it --rm \
#
# echo "Hey, I am acting like the CI"
#
# npm ci
# npm test
# corepack enable && pnpm install --frozen-lockfile
# pnpm test
```

or in one command to update snapshots:

```sh
docker run --rm \
-w /app -v "$(pwd)":/app -v /app/node_modules \
mcr.microsoft.com/playwright:v1.45.3-jammy /bin/sh -c "npm ci && npm test -- -- --update-snapshots"
mcr.microsoft.com/playwright:v1.45.3-jammy /bin/sh -c "corepack enable && pnpm install --frozen-lockfile && pnpm test -- -- --update-snapshots"
```

# Colophon
Expand Down
2 changes: 1 addition & 1 deletion apps/website/app/demos/[demoname]/Dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useRouter } from "next/navigation";
export function Dev({ demoname }: { demoname: string }) {
const { refresh } = useRouter();

const cmd = `npm run -w demos/${demoname} dev3`;
const cmd = `cd demos/${demoname} && pnpm run dev3`;

return (
<div className="Dev">
Expand Down
13 changes: 7 additions & 6 deletions apps/website/components/Image.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import NextImage, { ImageProps } from 'next/image'
import NextImage from "next/image";
import { ComponentProps } from "react";

const basePath = process.env.BASE_PATH
const basePath = process.env.BASE_PATH;

const Image = ({ src, ...rest }: ImageProps) => (
<NextImage src={`${basePath || ''}${src}`} {...rest} />
)
const Image = ({ src, ...rest }: ComponentProps<typeof NextImage>) => (
<NextImage src={`${basePath || ""}${src}`} {...rest} />
);

export default Image
export default Image;
Loading
Loading