unify barrel exports

This commit is contained in:
Felix Roos 2022-05-17 21:38:47 +02:00
parent b59f36f40b
commit fb2f63ee26
9 changed files with 20 additions and 16 deletions

View file

@ -20,7 +20,13 @@ export const evalScope = async (...args) => {
console.warn('@strudel.cycles/eval evalScope was called more than once.');
}
scoped = true;
const modules = await Promise.all(args);
const results = await Promise.allSettled(args);
const modules = results.filter((result) => result.status === 'fulfilled').map((r) => r.value);
results.forEach((result, i) => {
if (result.status === 'rejected') {
console.warn(`evalScope: module with index ${i} could not be loaded:`, result.reason);
}
});
Object.assign(globalThis, ...modules, Pattern.prototype.bootstrap());
};

1
packages/eval/index.mjs Normal file
View file

@ -0,0 +1 @@
export * from './evaluate.mjs';

View file

@ -2,7 +2,8 @@
"name": "@strudel.cycles/eval",
"version": "0.0.5",
"description": "Code evaluator for strudel",
"main": "evaluate.mjs",
"main": "index.mjs",
"type": "module",
"directories": {
"test": "test"
},
@ -13,7 +14,6 @@
"type": "git",
"url": "git+https://github.com/tidalcycles/strudel.git"
},
"type": "module",
"keywords": [
"tidalcycles",
"strudel",