For working on atreyu itself.
You need to have the following installed on your system:
- Node.js (>=16). We recommend using a version manager like nvm (will be replaced with the deno node compatibility layer as soon as feasible)
- Yarn (>=1.22.10).
- Deno (1.14.2)
- IPFS Cli. Installation instructions are here.
2. Configure Deno scripts to be available on your PATH.
You can achieve that by adding export PATH="$HOME/.deno/bin:$PATH"
to your rc file.
yarn install
yarn build
This step installs the atreyu cli "ayu" on your system, which is a standard Deno script. Deno is properly sandboxed unlike nodejs, so its best to always add permissions explicitly, however you can also omit most these settings and use --allow-all. please keep in mind that the ESBUILD_BINARY_PATH (the one that includes esbuild-darwin-arm6) permission is currently hard coded, so you need to run this once with prompt and check your actual binary location and architecture.
Run (if you also want to use a standard release use -n ayudev to have both clis available):
TODO: new local cli installation with deno run --reload cli/install.js
deno install --allow-hrtime --allow-read --allow-env=DENO_DIR,HOME,ESBUILD_BINARY_PATH --allow-net=127.0.0.1:5001,api.cloudflare.com,api.pinata.cloud,registry.npmjs.org --allow-write="$TMPDIR","$HOME"/.atreyu,./,"$DENO_DIR" --allow-run=ipfs,npx,`which deno`,yarn --no-check --prompt --unstable -n ayu -f ./cli/mod.js
after initial exacution add the allow run path for the esbuild binary for example "$HOME"/Library/Caches/esbuild/bin/[email protected]
Permission Prompts are not enabled automatically by deno install
because of a current deno install bug, you need to add the --prompt
parameter to beginning of the script manually...
eg. to edit the deno sccript in vscode:
code `which ayu`
add --promt:
#!/bin/sh
# generated by deno install
-exec deno run --allow-read <...lots of other things...>
+exec deno run --prompt --allow-read <...lots of other things...>
If everything is green, you should have ayu
available on your terminal.
which ayu # prints the path for the binary
cat `which ayu` # is helpful to check the currently installed parameters
ayu info # prints the help text
Initializes atreyu dev configuration and an IPFS repo for all assets at ~/.atreyu
.
ayu init
6. Start atreyu local development build watcher and the dev daemon, that runs and serves the local dev setup.
ayu
The dev daemon can be killed after the success message when not working on atreyu internals.
TODO: setup node compat publishing https://deno.com/blog/dnt-oak