-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
8,087 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
use flake | ||
ls -t .direnv | grep -P '^flake-profile-.*-link$' | tail --lines=+5 | xargs --no-run-if-empty -I{} rm "$(direnv_layout_dir)/{}" | ||
nix profile wipe-history --profile "$(direnv_layout_dir)/flake-profile" --older-than 14d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: builder | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Nix Setup | ||
run: | | ||
set -x | ||
sudo mkdir /nix | ||
sudo chown $USER /nix | ||
mkdir -p $HOME/.config/nix | ||
echo 'experimental-features = nix-command flakes' > $HOME/.config/nix/nix.conf | ||
- name: Cache Nix DevEnv | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: cache-nix-dev-env | ||
with: | ||
path: | | ||
/nix | ||
/home/runner/.bash_profile | ||
/home/runner/.nix-profile | ||
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/flake.nix', '**/flake.lock') }} | ||
|
||
- name: Build | ||
run: | | ||
[ -f /home/runner/.nix-profile/etc/profile.d/nix.sh ] || sh <(curl -L https://nixos.org/nix/install) --no-daemon | ||
. /home/runner/.nix-profile/etc/profile.d/nix.sh | ||
eval "$(nix print-dev-env)" | ||
parallel --line-buffer --ctagstring "{}>\033[0m" scripts/{} ::: \ | ||
check-nix-pkg.sh \ | ||
check-npm-deps-hash.sh \ | ||
check-npm.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.direnv | ||
/dist | ||
/coverage | ||
/node_modules | ||
tsconfig.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.direnv | ||
/node_modules | ||
/dist | ||
package-lock.json | ||
/.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Building & Testing | ||
|
||
```bash | ||
# Install dependencies: | ||
npm ci | ||
|
||
# Building: | ||
# This will build TypeScript srouces from `src/*.ts` and place the resulting files into the `dist` folder | ||
npm run build | ||
# Same as `build`, but will watch changes in the `src` folder and continuously update the `dist` folder. | ||
npm run build-watch | ||
|
||
# Testing: | ||
# This runs all tests once | ||
npm run test | ||
# This runs tests continuously every time sources in the `src` folder change | ||
npm run test-watch | ||
|
||
# Formatting: | ||
npm run fmt | ||
``` | ||
|
||
# Debugging | ||
|
||
1. Use the `Debug: JavaScript Debug Terminal` action and VSCode will open a new terminal. | ||
2. Now set a breakpoint somewhere in your code. | ||
3. Run tests with `npm run test` and VSCode will break at the given breakpoint. | ||
|
||
## Updating dependencies | ||
|
||
Update the version of NodeJS: | ||
|
||
```bash | ||
nix flake update | ||
``` | ||
|
||
Update the version of JavaScript dependencies: | ||
|
||
```bash | ||
npm update | ||
``` | ||
|
||
Finally, update the dependencies hash: | ||
|
||
```bash | ||
scripts/update-npm-deps-hash.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# nixjs-rt | ||
|
||
Nix JavaScript Run-time, an implementation of nix language semantics in TypeScript. | ||
|
||
This library is intended for use in transpiling the Nix language to JavaScript. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"preset": "ts-jest", | ||
"testEnvironment": "node", | ||
"modulePathIgnorePatterns": ["dist"] | ||
} |
Oops, something went wrong.