@outputai/core 0.16.1-next.d850344.0 → 0.17.1-next.78fc808.0
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/package.json
CHANGED
package/src/helpers/path.js
CHANGED
|
@@ -7,16 +7,18 @@ const transformSeparators = path => path.replaceAll( '/', SEP );
|
|
|
7
7
|
|
|
8
8
|
const defaultIgnorePaths = [
|
|
9
9
|
'/@outputai/core/',
|
|
10
|
-
'/sdk/core/',
|
|
11
10
|
'node:internal/',
|
|
12
11
|
'evalmachine.',
|
|
13
12
|
'webpack/bootstrap'
|
|
14
13
|
];
|
|
15
14
|
|
|
15
|
+
const ownFileSuffix = `helpers${SEP}path.js`;
|
|
16
|
+
|
|
16
17
|
/**
|
|
17
18
|
* Return the first immediate directory of the file invoking the code that called this function.
|
|
18
19
|
*
|
|
19
|
-
* Excludes `@outputai/core
|
|
20
|
+
* Excludes `@outputai/core` (located via this file's own frame, so it works from any install or monorepo path),
|
|
21
|
+
* node, other internal paths, and any additional ignore paths.
|
|
20
22
|
*
|
|
21
23
|
* @param {string[]} [additionalIgnorePaths]
|
|
22
24
|
* @returns {string}
|
|
@@ -26,7 +28,11 @@ export const resolveInvocationDir = ( additionalIgnorePaths = [] ) => {
|
|
|
26
28
|
const lines = stackTraceParser.parse( stack );
|
|
27
29
|
const ignorePaths = [ ...additionalIgnorePaths, ...defaultIgnorePaths ].map( transformSeparators );
|
|
28
30
|
|
|
29
|
-
const
|
|
31
|
+
const ownFile = lines[0]?.file ?? '';
|
|
32
|
+
const coreSrcDir = ownFile.endsWith( ownFileSuffix ) ? ownFile.slice( 0, -ownFileSuffix.length ) : null;
|
|
33
|
+
const isIgnored = file => ( coreSrcDir && file.startsWith( coreSrcDir ) ) || ignorePaths.some( p => file.includes( p ) );
|
|
34
|
+
|
|
35
|
+
const frame = lines.find( l => !isIgnored( l.file ) );
|
|
30
36
|
if ( !frame ) {
|
|
31
37
|
throw new Error( `Invocation dir resolution via stack trace failed. Stack: ${stack}` );
|
|
32
38
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from './loader/tools.js';
|
|
8
8
|
|
|
9
9
|
const __dirname = dirname( fileURLToPath( import.meta.url ) );
|
|
10
|
-
const workerDir = __dirname; //
|
|
10
|
+
const workerDir = __dirname; // projects/core/src/worker
|
|
11
11
|
const interfaceDir = join( __dirname, '..', 'interface' );
|
|
12
12
|
const packagesWithWorkflowsMap = new Map();
|
|
13
13
|
|