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
14 changes: 14 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail

# Docs: https://direnv.net/

if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8="
fi

nix_direnv_watch_file devenv.nix

use flake . --impure

layout node # adds PATH entry node_modules/.bin - https://github.com/direnv/direnv/blob/75d0e63c5bfa0b4b1e3b4b27a6198f2e2f8b79c7/stdlib.sh#L767
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ build
coverage
node_modules
package-lock.json
/.devenv/
/.direnv/
# auto-generated by devenv
/.pre-commit-config.yaml
25 changes: 15 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ If you are here to suggest a feature, first create an issue if it does not alrea
If you have been assigned to fix an issue or develop a new feature, please follow these steps to get started:

- Fork this repository.
- Install dependencies by running `$ npm install`.
- Build packages `$ npm run build`.
- Optional (if using nix and direnv), you can install all needed deps for building: `$ direnv allow`
- Install dependencies by running `$ pnpm install`
- Build packages `$ pnpm build`
- Implement your changes and tests to files in the `src/` directory and corresponding test files.
- To run examples, follow their individual directions.
- Document your changes in the appropriate doc page.
Expand All @@ -33,7 +34,7 @@ We have very precise rules over how our git commit messages can be formatted. Th

### Commit Message Format

Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type**, a **scope** and a **subject**:

```
Expand All @@ -55,12 +56,12 @@ Must be one of the following:
- **feat**: A new feature
- **fix**: A bug fix
- **docs**: Documentation only changes
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
semi-colons, etc)
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **perf**: A code change that improves performance
- **test**: Adding missing or correcting existing tests
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation
generation

### Scope
Expand Down Expand Up @@ -91,11 +92,15 @@ The footer should contain any information about **Breaking Changes** and is also

Here is an example of the release type that will be done based on a commit messages:

| Commit message | Release type |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
| `fix(pencil): stop graphite breaking when too much pressure applied` | Patch Release |
| `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
| `perf(pencil): remove graphiteWidth option`<br><br>`BREAKING CHANGE: The graphiteWidth option has been removed.`<br>`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release |
| Commit message | Release type |
| -------------------------------------------------------------------- | ----------------------- |
| `fix(pencil): stop graphite breaking when too much pressure applied` | Patch Release |
| `feat(pencil): add 'graphiteWidth' option` | ~Minor~ Feature Release |

| `perf(pencil): remove graphiteWidth option`

`BREAKING CHANGE: The graphiteWidth option has been removed.`
`The default graphite width of 10mm is always used for performance reasons.` | ~Major~ Breaking Release |

### Revert

Expand Down
43 changes: 43 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Docs: https://devenv.sh/basics/
{ pkgs, latest, ... }: {

languages = {
# Docs: https://devenv.sh/languages/
nix.enable = true;
javascript = {
enable = true; # source: https://github.com/cachix/devenv/blob/main/src/modules/languages/javascript.nix
#corepack.enable = true; # shim for npm/yarn/pnpm - https://github.com/nodejs/corepack#readme
#- but questionable: https://github.com/cachix/devenv/pull/475#issuecomment-1571879078
};
};

packages = with pkgs; [
# Search for packages: https://search.nixos.org/packages?channel=unstable&query=cowsay
# (note: this searches on unstable channel, be aware your nixpkgs flake input might be on a release channel)
gcc # needed for some npm packages

# remove whichever you don't need
yarn
latest.nodePackages.pnpm
];

scripts = {
# Docs: https://devenv.sh/scripts/
# yd.exec = ''yarn dev'';
};

difftastic.enable = true; # https://devenv.sh/integrations/difftastic/

pre-commit.hooks = {
# Docs: https://devenv.sh/pre-commit-hooks/
# available pre-configured hooks: https://devenv.sh/reference/options/#pre-commithooks
# adding hooks which are not included: https://github.com/cachix/pre-commit-hooks.nix/issues/31

nil.enable = true; # nix check
nixpkgs-fmt.enable = true; # nix formatting
eslint = {
enable = true;
fail_fast = true; # skip other pre-commit hooks if this one fails
};
};
}
Loading