Skip to content

Commit

Permalink
Merge pull request #28 from jackdbd/canary
Browse files Browse the repository at this point in the history
Setup nix dev shell
  • Loading branch information
jackdbd authored Jan 3, 2024
2 parents 5714ae1 + 3f8455e commit 1bcbced
Show file tree
Hide file tree
Showing 18 changed files with 8,963 additions and 5,851 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# dependencies
**/node_modules/

# environment variables
**/.envrc

# secrets
secrets/*
!secrets/README.md
Expand Down
19 changes: 0 additions & 19 deletions .husky/pre-commit

This file was deleted.

14 changes: 0 additions & 14 deletions .husky/pre-push

This file was deleted.

27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Monorepo for my [Eleventy](https://www.11ty.dev/) plugins.

> 📦 **CJS only:**
>
>
> All libraries of this monorepo are published to npmjs as CommonJS.
>
> At the moment none of these packages has a ESM build.
Expand All @@ -23,14 +23,22 @@ Clone the repo:

```shell
git clone [email protected]:jackdbd/undici.git
```

This project defines a virtual environment with all the necessary dependencies. This environment is declared by the `mkShell` function in the `flake.nix` file you can find in the root directory of this monorepo. Thanks to nix, direnv and the `.envrc` file, you can activate this environment just by entering this monorepo (e.g. with `cd undici`).

If you don't use nix, ensure you have a Node.js version supported by this project. You could use a Node.js version manager like [nvm](https://github.com/nvm-sh/nvm), [asdf](https://github.com/asdf-vm/asdf-nodejs) or [volta](https://volta.sh/).

cd undici
Install all dependencies from npm.js (by passing `--include dev` we can be sure that we are installing `devDependencies` even when `NODE_ENV` is set to `production`):

```sh
npm install --include dev --include prod
```

Install all dependencies from npm.js and setup git hooks with [husky](https://typicode.github.io/husky/):
If you don't use nix, install [zx](https://github.com/google/zx) globally.

```sh
npm install
npm install --global zx
```

## Development
Expand Down Expand Up @@ -69,6 +77,12 @@ npm run dev

Note: you will still need to refresh the browser (this might change when [Eleventy 2.0 will add a dev server](https://www.11ty.dev/docs/watch-serve/)).

If you want to [update your git hooks](https://github.com/toplenboren/simple-git-hooks?tab=readme-ov-file#update-git-hooks-command) edit the `simple-git-hooks` section in `package.json`, then run:

```sh
npx simple-git-hooks
```

## Test

Run all tests on all packages:
Expand All @@ -81,10 +95,15 @@ Run tests on a single package:

```sh
npm run test -w packages/eleventy-plugin-content-security-policy

npm run test -w packages/eleventy-plugin-ensure-env-vars

npm run test -w packages/eleventy-plugin-permissions-policy

npm run test -w packages/eleventy-plugin-plausible

npm run test -w packages/eleventy-plugin-telegram

npm run test -w packages/eleventy-plugin-text-to-speech
```

Expand Down
Loading

0 comments on commit 1bcbced

Please sign in to comment.