@primero-ai/temporal-graph-tools 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/bundler.d.ts.map +1 -1
- package/dist/src/bundler.js +9 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../src/bundler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../src/bundler.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkB,mBAAmB,EAA0B,MAAM,YAAY,CAAA;AAC7F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAIpE,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,uBAAuB,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,cAAc,EAAE,yBAAyB,CAAA;IACzC,cAAc,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAoCD,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,uBAAuB,CAAC,CAkClC;AAED,wBAAsB,eAAe,CACnC,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,qBAAqB,CAAC,CAqChC"}
|
package/dist/src/bundler.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { isAbsolute, resolve } from 'node:path';
|
|
1
|
+
import { isAbsolute, resolve, join } from 'node:path';
|
|
2
|
+
import { mkdtemp, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { pathToFileURL } from 'node:url';
|
|
2
5
|
import { buildWorkflowBundleCode } from './workflow-bundler.js';
|
|
3
6
|
import { collectWorkflowBuildResults } from './workflow/collection.js';
|
|
4
7
|
let cachedEsbuild;
|
|
@@ -27,8 +30,10 @@ export async function loadActivitiesFromBundle(bundle) {
|
|
|
27
30
|
throw new Error('Activity bundle code must be a non-empty string.');
|
|
28
31
|
}
|
|
29
32
|
const source = ensureActivityInlineSourceMap(bundle.code, bundle.map);
|
|
30
|
-
const
|
|
31
|
-
const
|
|
33
|
+
const tempDir = await mkdtemp(join(tmpdir(), 'temporal-graph-tools-'));
|
|
34
|
+
const tempFile = join(tempDir, `activities-${Date.now()}-${Math.random().toString(16).slice(2)}.mjs`);
|
|
35
|
+
await writeFile(tempFile, source, 'utf8');
|
|
36
|
+
const moduleUrl = pathToFileURL(tempFile).href;
|
|
32
37
|
const moduleNamespace = (await import(moduleUrl));
|
|
33
38
|
const activitiesExport = moduleNamespace.activities;
|
|
34
39
|
if (isActivityImplementations(activitiesExport)) {
|
|
@@ -94,7 +99,7 @@ async function bundleActivitiesWithEsbuild(bundles, options = {}) {
|
|
|
94
99
|
throw new Error('bundleActivities requires at least one entrypoint.');
|
|
95
100
|
}
|
|
96
101
|
const filename = ((_b = options.filename) !== null && _b !== void 0 ? _b : 'activities.bundle.mjs').trim();
|
|
97
|
-
const externals = new Set();
|
|
102
|
+
const externals = new Set(['@swc/*']);
|
|
98
103
|
((_c = options.externals) !== null && _c !== void 0 ? _c : []).forEach((name) => {
|
|
99
104
|
if (typeof name === 'string' && name.trim().length > 0) {
|
|
100
105
|
externals.add(name.trim());
|
package/package.json
CHANGED