Skip to content

Commit

Permalink
docs: Stabilise Lighthouse line numbers (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia authored Jun 6, 2024
1 parent 9985b4f commit 56d11b0
Show file tree
Hide file tree
Showing 5 changed files with 608 additions and 508 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/audits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ jobs:
workspace:
- deno
- hotchocolate
- lighthouse
- postgraphile
# TODO: speed up build process
# - pioneer
# TODO: ensure consistant results
# - lighthouse
env:
PORT: 4000
steps:
Expand Down
22 changes: 18 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,36 @@ Every implementation is expected to contain a `package.json` file with at least
"name": "implementation-name", // should be equivalent to the directory name
"url": "https://implementation-name.example", // the official project URL
"scripts": {
"start": "node ." | "docker-compose up -d" // depending if the server can be run through node or Docker
"start": "node ." | "docker compose up" // depending if the server can be run through Node.js or Docker
}
}
```

Depending on how your server is run, add it to the appropriate section of [.github/workflows/audits.yml](.github/workflows/audits.yml):

- `node .`: `jobs.javascript.strategy.matrix.workspace`
- `docker-compose up -d`: `jobs.docker.strategy.matrix.workspace`
- Node.js: `jobs.javascript.strategy.matrix.workspace`
- Docker: `jobs.docker.strategy.matrix.workspace`

The script run in `start` is expected to bring up an HTTP server that listens to the port defined in the environment variable `$PORT`.

After adding your directory and `package.json`, run `yarn install` to include the workspace.

You may run the audit on your implementation locally by first bringing up the server:

```shell
PORT=4000 yarn workspace <implementation> start
```

Then open another shell or move the prior process to the background and run:

```shell
PORT=4000 yarn tsx scripts/audit-implementation.ts implementations/<implementation>
```

## Code formatting

Run the following script to ensure the automatic code formatting is applied:

yarn run lint:fix
```shell
yarn run lint:fix
```
23 changes: 16 additions & 7 deletions implementations/lighthouse/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
FROM php:8.1.21-cli

WORKDIR /app
# See https://hub.docker.com/_/php/tags?page=&page_size=&ordering=&name=cli.
FROM php:8.2.19-cli

# See https://getcomposer.org.
COPY --from=composer /usr/bin/composer /usr/bin/composer

RUN apt-get update && \
apt-get install --yes \
# Required to make the composer installations work.
RUN apt-get update \
&& apt-get install --yes \
git \
libzip-dev \
zip \
&& docker-php-ext-install \
zip \
&& rm -rf /var/lib/apt/lists/*
RUN composer create-project laravel/laravel /app
RUN composer require nuwave/lighthouse 6.14.0

# Creating a project following https://laravel.com/docs/installation#creating-a-laravel-project.
# See https://github.com/laravel/laravel/releases for new versions.
WORKDIR /app
RUN composer create-project laravel/laravel=11.1.1 /app

# See https://github.com/nuwave/lighthouse/releases for new versions.
RUN composer require nuwave/lighthouse:6.36.3

# Following https://lighthouse-php.com/6/getting-started/installation.html#publish-the-default-schema.
RUN php artisan vendor:publish --tag=lighthouse-schema
Loading

0 comments on commit 56d11b0

Please sign in to comment.