Skip to content

Commit fc1b3e3

Browse files
authored
Merge pull request #3 from function-artisans/devenv
Add a devenv setup and switch to pnpm
2 parents a26a2d0 + 03337c8 commit fc1b3e3

16 files changed

Lines changed: 1532 additions & 1423 deletions

‎.editorconfig‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
max_line_length = 120
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

‎.envrc‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
eval "$(devenv direnvrc)"
4+
use devenv

‎.eslintrc.json‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎.github/workflows/ci.yml‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,21 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v5
1515

16+
# The action reads the pnpm version from the packageManager field in package.json.
17+
- name: Install pnpm
18+
uses: pnpm/action-setup@v6
19+
1620
- name: Use Node.js
1721
uses: actions/setup-node@v4
1822
with:
1923
node-version: "22"
20-
cache: "npm"
21-
22-
- name: Cache node modules
23-
uses: actions/cache@v4
24-
with:
25-
path: node_modules
26-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
27-
restore-keys: |
28-
${{ runner.os }}-node-
24+
cache: "pnpm"
2925

3026
- name: Install dependencies
31-
run: npm ci
27+
run: pnpm install --frozen-lockfile
3228

3329
- name: Run lint
34-
run: npm run lint
30+
run: pnpm run lint
3531

3632
- name: Run build
37-
run: npm run build
33+
run: pnpm run build

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
# devenv
1313
.devenv
1414
.devenv.flake.nix
15+
.pre-commit-config.yaml

‎.prettierignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pnpm-lock.yaml
2+
devenv.lock

‎.prettierrc‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎README.md‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Formats source code from stdin and writes the formatted code to stdout.
55
## Install
66

77
```sh
8-
npm install
9-
npm run build
10-
npm link
8+
pnpm install
9+
pnpm run build
10+
pnpm add --global "$PWD"
1111
```
1212

1313
## Usage
@@ -46,3 +46,15 @@ open "Format JSON.shortcut"
4646
```
4747

4848
To see all the options, run `format-code shortcuts --help`.
49+
50+
## Development
51+
52+
The project uses [devenv](https://devenv.sh) to install Node.js and pnpm. To
53+
enter the dev shell, run:
54+
55+
```sh
56+
devenv shell
57+
```
58+
59+
If you use [direnv](https://direnv.net), run `direnv allow` one time. Then
60+
direnv loads the dev shell when you enter the folder.

0 commit comments

Comments
 (0)