added shell.nix + minor changes

This commit is contained in:
Leon van Kammen 2025-10-23 09:28:05 +02:00
parent de75414af7
commit 86885bb147
5 changed files with 41 additions and 3 deletions

2
.env Normal file
View file

@ -0,0 +1,2 @@
which bun || nix-shell
which npm || nix-shell

View file

@ -15,5 +15,6 @@ import {...} from 'xrf/level0'
| function | example |
|------------------------|-------------------------------------------------------------------------|
| fetchSideCarFiles(...) | fetchSideCarFiles("https://f.org/a.glb") // ["https://f.org/a.png",...] |
| sideCarFiles(...) | sideCarFiles("https://f.org/a.glb") `// ["https://f.org/a.png",...]` |
| fetchSideCarFiles(...) | await fetchSideCarFiles("https://f.org/a.glb") `// [{code:200},...]` |

View file

@ -3,7 +3,8 @@
*
* | function | example |
* |------------------------|-------------------------------------------------------------------------|
* | fetchSideCarFiles(...) | fetchSideCarFiles("https://f.org/a.glb") // ["https://f.org/a.png",...] |
* | sideCarFiles(...) | sideCarFiles("https://f.org/a.glb") `// ["https://f.org/a.png",...]` |
* | fetchSideCarFiles(...) | await fetchSideCarFiles("https://f.org/a.glb") `// [{code:200},...]` |
*
*/
import * as http from './scheme/http.js'
@ -31,7 +32,7 @@ async function fetchSideCarFiles(urlString, opts){
fetch( urlString.replace(ext, sext[i] ), { method:'HEAD'} )
})
)
await Promise.all(p)
await Promise.allSettled(p)
}
export {pollSideCarFiles}

11
package.json Normal file
View file

@ -0,0 +1,11 @@
{
"name": "xrf",
"version": "0.0.1",
"description": "XR Fragment utilities",
"main": "level0.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "MIT"
}

23
shell.nix Normal file
View file

@ -0,0 +1,23 @@
#let
# pkgs = import (builtins.fetchGit {
# name = "nixos-23.05";
# url = "https://github.com/nixos/nixpkgs/";
# ref = "refs/heads/nixos-unstable";
# rev = "ef99fa5c5ed624460217c31ac4271cfb5cb2502c";
# }) {};
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
# nativeBuildInputs is usually what you want -- tools you need to run
nativeBuildInputs = with pkgs.buildPackages; [
nodejs_20
bun
];
shellHook = ''
export NIX_XRF=1
'';
}