add sampler script + samples folder with README

This commit is contained in:
Felix Roos 2024-03-30 04:42:45 +01:00
parent abe775c3fd
commit 8f355dcf96
7 changed files with 10 additions and 50 deletions

2
packages/sampler/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
samples/*
!samples/README.md

View file

@ -42,7 +42,7 @@ async function getBanks(directory) {
banks[bank].push(url);
return url;
});
banks._base = `http:localhost:5432`;
banks._base = `http://localhost:5432`;
return { banks, files };
}

View file

@ -0,0 +1,5 @@
# samples folder
1. copy any samples to this folder
2. run `npm run sampler`
3. add `samples('local:')` to your code

View file

@ -195,7 +195,7 @@ export const samples = async (sampleMap, baseUrl = sampleMap._base || '', option
sampleMap = githubPath(sampleMap, 'strudel.json');
}
if (sampleMap.startsWith('local:')) {
sampleMap = `/strudel.json`;
sampleMap = `http://localhost:5432`;
}
if (sampleMap.startsWith('shabda:')) {
let [_, path] = sampleMap.split('shabda:');