unify barrel exports
This commit is contained in:
parent
b59f36f40b
commit
fb2f63ee26
9 changed files with 20 additions and 16 deletions
|
|
@ -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
1
packages/eval/index.mjs
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from './evaluate.mjs';
|
||||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue