Skip to content

Commit 0fd1651

Browse files
authored
Merge pull request #1 from gren-lang/file-locking
File locking
2 parents dc84759 + 7665bfc commit 0fd1651

File tree

10 files changed

+495
-42
lines changed

10 files changed

+495
-42
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: gren-lang

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
run-tests:
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, macos-latest]
14+
15+
runs-on: ${{ matrix.os }}
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Install devbox
21+
uses: jetify-com/[email protected]
22+
with:
23+
enable-cache: true
24+
25+
- name: Cache npm cache
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.npm
29+
key: ${{ runner.os }}-npm
30+
31+
- name: Verify formatting
32+
run: devbox run format:check
33+
34+
- name: Run tests
35+
run: devbox run test

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.json
2+
integration-tests/bin/app
3+
tests/app

devbox.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,31 @@
22
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.7/.schema/devbox.schema.json",
33
"packages": [
44
"nodejs@20",
5-
"github:gren-lang/nix/0.5.2"
5+
"github:gren-lang/nix/0.5.2",
6+
"nodePackages.prettier@latest"
67
],
78
"shell": {
8-
"init_hook": [
9-
"echo 'Welcome to devbox!' > /dev/null"
10-
],
119
"scripts": {
1210
"build": [
1311
"gren make"
1412
],
13+
"format": [
14+
"prettier . --write"
15+
],
16+
"format:check": [
17+
"prettier . --check"
18+
],
1519
"test": [
20+
"devbox run test:unit",
21+
"devbox run test:integration"
22+
],
23+
"test:unit": [
1624
"cd tests/",
1725
"./run-tests.sh"
26+
],
27+
"test:integration": [
28+
"cd integration-tests/",
29+
"make test"
1830
]
1931
}
2032
}

devbox.lock

Lines changed: 62 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,116 @@
11
{
22
"lockfile_version": "1",
33
"packages": {
4+
"nodePackages.prettier@latest": {
5+
"last_modified": "2025-01-25T23:17:58Z",
6+
"resolved": "github:NixOS/nixpkgs/b582bb5b0d7af253b05d58314b85ab8ec46b8d19#nodePackages.prettier",
7+
"source": "devbox-search",
8+
"version": "3.3.3",
9+
"systems": {
10+
"aarch64-darwin": {
11+
"outputs": [
12+
{
13+
"name": "out",
14+
"path": "/nix/store/7018mdjp14qr7vf66jwdxvxaxjvl48hn-prettier-3.3.3",
15+
"default": true
16+
}
17+
],
18+
"store_path": "/nix/store/7018mdjp14qr7vf66jwdxvxaxjvl48hn-prettier-3.3.3"
19+
},
20+
"aarch64-linux": {
21+
"outputs": [
22+
{
23+
"name": "out",
24+
"path": "/nix/store/pysxyhskhjjsxiac0ha8zi08p2814rpi-prettier-3.3.3",
25+
"default": true
26+
}
27+
],
28+
"store_path": "/nix/store/pysxyhskhjjsxiac0ha8zi08p2814rpi-prettier-3.3.3"
29+
},
30+
"x86_64-darwin": {
31+
"outputs": [
32+
{
33+
"name": "out",
34+
"path": "/nix/store/79qbg2kgcvji7k8whvw9k29cc84wvj3w-prettier-3.3.3",
35+
"default": true
36+
}
37+
],
38+
"store_path": "/nix/store/79qbg2kgcvji7k8whvw9k29cc84wvj3w-prettier-3.3.3"
39+
},
40+
"x86_64-linux": {
41+
"outputs": [
42+
{
43+
"name": "out",
44+
"path": "/nix/store/rrmdwy79qyc61lxmrggvrpmdmrq3zym7-prettier-3.3.3",
45+
"default": true
46+
}
47+
],
48+
"store_path": "/nix/store/rrmdwy79qyc61lxmrggvrpmdmrq3zym7-prettier-3.3.3"
49+
}
50+
}
51+
},
452
"nodejs@20": {
5-
"last_modified": "2024-12-23T21:10:33Z",
53+
"last_modified": "2025-01-25T23:17:58Z",
654
"plugin_version": "0.0.2",
7-
"resolved": "github:NixOS/nixpkgs/de1864217bfa9b5845f465e771e0ecb48b30e02d#nodejs_20",
55+
"resolved": "github:NixOS/nixpkgs/b582bb5b0d7af253b05d58314b85ab8ec46b8d19#nodejs_20",
856
"source": "devbox-search",
957
"version": "20.18.1",
1058
"systems": {
1159
"aarch64-darwin": {
1260
"outputs": [
1361
{
1462
"name": "out",
15-
"path": "/nix/store/q49zbi0pzjhg4zn085h9hyz9m1k3hvpb-nodejs-20.18.1",
63+
"path": "/nix/store/3m2ls02m9saryyfzgmpa4931v6zqwsa1-nodejs-20.18.1",
1664
"default": true
1765
},
1866
{
1967
"name": "libv8",
20-
"path": "/nix/store/l08rljd2yr7i1q4x778qazcys2l4ja23-nodejs-20.18.1-libv8"
68+
"path": "/nix/store/gp5cn9v1w8dhrhln0hzakj9yks0apnb6-nodejs-20.18.1-libv8"
2169
}
2270
],
23-
"store_path": "/nix/store/q49zbi0pzjhg4zn085h9hyz9m1k3hvpb-nodejs-20.18.1"
71+
"store_path": "/nix/store/3m2ls02m9saryyfzgmpa4931v6zqwsa1-nodejs-20.18.1"
2472
},
2573
"aarch64-linux": {
2674
"outputs": [
2775
{
2876
"name": "out",
29-
"path": "/nix/store/4m1ql1hsd6kqmzr8a657qhipjgssrr0c-nodejs-20.18.1",
77+
"path": "/nix/store/9zv75vg1ca6h8hmkqz26mrs9bc890jfv-nodejs-20.18.1",
3078
"default": true
3179
},
3280
{
3381
"name": "libv8",
34-
"path": "/nix/store/r8s1xalb4rpy1r44i413j84i4ny6mnsc-nodejs-20.18.1-libv8"
82+
"path": "/nix/store/6q3i53q3hhqjjab40ari4ifmjy26djq4-nodejs-20.18.1-libv8"
3583
}
3684
],
37-
"store_path": "/nix/store/4m1ql1hsd6kqmzr8a657qhipjgssrr0c-nodejs-20.18.1"
85+
"store_path": "/nix/store/9zv75vg1ca6h8hmkqz26mrs9bc890jfv-nodejs-20.18.1"
3886
},
3987
"x86_64-darwin": {
4088
"outputs": [
4189
{
4290
"name": "out",
43-
"path": "/nix/store/7ky0mn6k33731jwzhsxq6a6dsbjqamqs-nodejs-20.18.1",
91+
"path": "/nix/store/b8hyl1920fxqv1gmphx766ablrc64rj8-nodejs-20.18.1",
4492
"default": true
4593
},
4694
{
4795
"name": "libv8",
48-
"path": "/nix/store/jw62k3wxl38r8fcbvxaxrm696ivv3imr-nodejs-20.18.1-libv8"
96+
"path": "/nix/store/0s6zkr34k1isj4annpr8qrarfgs6mkhi-nodejs-20.18.1-libv8"
4997
}
5098
],
51-
"store_path": "/nix/store/7ky0mn6k33731jwzhsxq6a6dsbjqamqs-nodejs-20.18.1"
99+
"store_path": "/nix/store/b8hyl1920fxqv1gmphx766ablrc64rj8-nodejs-20.18.1"
52100
},
53101
"x86_64-linux": {
54102
"outputs": [
55103
{
56104
"name": "out",
57-
"path": "/nix/store/j7dx1n6m5axf9r2bvly580x2ixx546wq-nodejs-20.18.1",
105+
"path": "/nix/store/864nd9lys37waw3i5wxy42lp4as51x5s-nodejs-20.18.1",
58106
"default": true
59107
},
60108
{
61109
"name": "libv8",
62-
"path": "/nix/store/qljmc2skrldj0g94rib6nl4jq84193fa-nodejs-20.18.1-libv8"
110+
"path": "/nix/store/nqj2gr66cd2wan2pn510ymrz1p20xcsg-nodejs-20.18.1-libv8"
63111
}
64112
],
65-
"store_path": "/nix/store/j7dx1n6m5axf9r2bvly580x2ixx546wq-nodejs-20.18.1"
113+
"store_path": "/nix/store/864nd9lys37waw3i5wxy42lp4as51x5s-nodejs-20.18.1"
66114
}
67115
}
68116
}

gren.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"Compiler.PackageName",
1515
"Compiler.Paths",
1616
"Compiler.License",
17+
"FileSystem.Lock",
1718
"SemanticVersion",
1819
"SemanticVersionRange",
1920
"String.EditDistance"

integration-tests/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
app: Makefile gren.json node_modules
22
npx gren make src/Main.gren --output=bin/app
3+
chmod +x bin/app
34

45
.PHONY: test
56
test: app node_modules
67
npm test
78

89
node_modules: package.json package-lock.json
9-
npm install
10+
npm ci
1011

1112
.PHONY: clean
1213
clean:

0 commit comments

Comments
 (0)