From 54408d3ec8999c9e4544e060c96722f75ce4194c Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 3 Dec 2025 22:24:30 +0200 Subject: [PATCH] chore(dayjs): address requested changes --- apps/client/src/services/bundle.spec.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/client/src/services/bundle.spec.ts b/apps/client/src/services/bundle.spec.ts index 70f574b01..5f9bb5dd8 100644 --- a/apps/client/src/services/bundle.spec.ts +++ b/apps/client/src/services/bundle.spec.ts @@ -23,7 +23,19 @@ function getBundle(script: string) { title: "Script note" }).noteId; const bundle: Bundle = { - script: `\napiContext.modules['${id}'] = { exports: {} };\nreturn await ((async function(exports, module, require, api) {\ntry {\n${script}\n;\n} catch (e) { throw new Error(\"Load of script note \\\"Client\\\" (${id}) failed with: \" + e.message); }\nfor (const exportKey in exports) module.exports[exportKey] = exports[exportKey];\nreturn module.exports;\n}).call({}, {}, apiContext.modules['${id}'], apiContext.require([]), apiContext.apis['${id}']));\n`, + script: [ + '', + `apiContext.modules['${id}'] = { exports: {} };`, + `return await ((async function(exports, module, require, api) {`, + `try {`, + `${script}`, + `;`, + `} catch (e) { throw new Error(\"Load of script note \\\"Client\\\" (${id}) failed with: \" + e.message); }`, + `for (const exportKey in exports) module.exports[exportKey] = exports[exportKey];`, + `return module.exports;`, + `}).call({}, {}, apiContext.modules['${id}'], apiContext.require([]), apiContext.apis['${id}']));`, + '' + ].join('\n'), html: "", noteId: id, allNoteIds: [ id ]