@synergenius/flow-weaver 0.21.19 → 0.21.20
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/cli/flow-weaver.mjs
CHANGED
|
@@ -9671,7 +9671,7 @@ var VERSION;
|
|
|
9671
9671
|
var init_generated_version = __esm({
|
|
9672
9672
|
"src/generated-version.ts"() {
|
|
9673
9673
|
"use strict";
|
|
9674
|
-
VERSION = "0.21.
|
|
9674
|
+
VERSION = "0.21.20";
|
|
9675
9675
|
}
|
|
9676
9676
|
});
|
|
9677
9677
|
|
|
@@ -93270,7 +93270,7 @@ function displayInstalledPackage(pkg) {
|
|
|
93270
93270
|
// src/cli/index.ts
|
|
93271
93271
|
init_logger();
|
|
93272
93272
|
init_error_utils();
|
|
93273
|
-
var version2 = true ? "0.21.
|
|
93273
|
+
var version2 = true ? "0.21.20" : "0.0.0-dev";
|
|
93274
93274
|
var program2 = new Command();
|
|
93275
93275
|
program2.name("fw").description("Flow Weaver Annotations - Compile and validate workflow files").option("-v, --version", "Output the current version").option("--no-color", "Disable colors").option("--color", "Force colors").on("option:version", () => {
|
|
93276
93276
|
logger.banner(version2);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.21.
|
|
1
|
+
export declare const VERSION = "0.21.20";
|
|
2
2
|
//# sourceMappingURL=generated-version.d.ts.map
|
package/dist/npm-packages.d.ts
CHANGED
|
@@ -31,8 +31,8 @@ export type TNpmNodeType = {
|
|
|
31
31
|
description: string;
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
|
-
* Get list of packages that have TypeScript declarations (.d.ts files).
|
|
35
|
-
*
|
|
34
|
+
* Get list of all packages that have TypeScript declarations (.d.ts files).
|
|
35
|
+
* Any package with types can be used as a node type in workflows.
|
|
36
36
|
* Excludes @types/* packages as they are type augmentations.
|
|
37
37
|
*
|
|
38
38
|
* @param workdir - Directory to start searching from
|
package/dist/npm-packages.js
CHANGED
|
@@ -11,34 +11,63 @@ import { extractFunctionLikes } from './function-like.js';
|
|
|
11
11
|
import { inferDataTypeFromTS } from './type-mappings.js';
|
|
12
12
|
import { getSharedProject } from './shared-project.js';
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
* Only includes `dependencies` (not devDependencies, peerDependencies, etc.)
|
|
16
|
-
* since those are the packages available at runtime in workflows.
|
|
14
|
+
* Find all node_modules directories starting from fromDir and walking up.
|
|
17
15
|
*/
|
|
18
|
-
function
|
|
19
|
-
|
|
16
|
+
function findNodeModulesDirs(fromDir) {
|
|
17
|
+
const dirs = [];
|
|
18
|
+
let current = path.resolve(fromDir);
|
|
20
19
|
const root = path.parse(current).root;
|
|
21
20
|
while (current !== root) {
|
|
22
|
-
const
|
|
23
|
-
if (fs.existsSync(
|
|
24
|
-
|
|
25
|
-
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8'));
|
|
26
|
-
return Object.keys(pkgJson.dependencies ?? {});
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
// malformed package.json, keep walking
|
|
30
|
-
}
|
|
21
|
+
const candidate = path.join(current, 'node_modules');
|
|
22
|
+
if (fs.existsSync(candidate) && fs.statSync(candidate).isDirectory()) {
|
|
23
|
+
dirs.push(candidate);
|
|
31
24
|
}
|
|
32
25
|
const parent = path.dirname(current);
|
|
33
26
|
if (parent === current)
|
|
34
27
|
break;
|
|
35
28
|
current = parent;
|
|
36
29
|
}
|
|
37
|
-
return
|
|
30
|
+
return dirs;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* List all packages in a node_modules directory (including scoped packages).
|
|
34
|
+
*/
|
|
35
|
+
function listPackagesInNodeModules(nmDir) {
|
|
36
|
+
const packages = [];
|
|
37
|
+
if (!fs.existsSync(nmDir))
|
|
38
|
+
return packages;
|
|
39
|
+
try {
|
|
40
|
+
const entries = fs.readdirSync(nmDir, { withFileTypes: true });
|
|
41
|
+
for (const entry of entries) {
|
|
42
|
+
if (!entry.isDirectory())
|
|
43
|
+
continue;
|
|
44
|
+
if (entry.name.startsWith('@')) {
|
|
45
|
+
const scopeDir = path.join(nmDir, entry.name);
|
|
46
|
+
try {
|
|
47
|
+
const scopedEntries = fs.readdirSync(scopeDir, { withFileTypes: true });
|
|
48
|
+
for (const scopedEntry of scopedEntries) {
|
|
49
|
+
if (scopedEntry.isDirectory()) {
|
|
50
|
+
packages.push(`${entry.name}/${scopedEntry.name}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
// Ignore permission errors
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
packages.push(entry.name);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
// Ignore permission errors
|
|
65
|
+
}
|
|
66
|
+
return packages;
|
|
38
67
|
}
|
|
39
68
|
/**
|
|
40
|
-
* Get list of packages that have TypeScript declarations (.d.ts files).
|
|
41
|
-
*
|
|
69
|
+
* Get list of all packages that have TypeScript declarations (.d.ts files).
|
|
70
|
+
* Any package with types can be used as a node type in workflows.
|
|
42
71
|
* Excludes @types/* packages as they are type augmentations.
|
|
43
72
|
*
|
|
44
73
|
* @param workdir - Directory to start searching from
|
|
@@ -46,14 +75,23 @@ function readDirectDependencies(workdir) {
|
|
|
46
75
|
* @returns Object with packages array, each containing name and typesPath
|
|
47
76
|
*/
|
|
48
77
|
export function getTypedPackages(workdir, nodeModulesOverride) {
|
|
49
|
-
const
|
|
78
|
+
const nodeModulesDirs = nodeModulesOverride
|
|
79
|
+
? [nodeModulesOverride]
|
|
80
|
+
: findNodeModulesDirs(workdir);
|
|
50
81
|
const typed = [];
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
82
|
+
const seenPackages = new Set();
|
|
83
|
+
for (const nmDir of nodeModulesDirs) {
|
|
84
|
+
const packages = listPackagesInNodeModules(nmDir);
|
|
85
|
+
for (const pkg of packages) {
|
|
86
|
+
if (pkg.startsWith('@types/'))
|
|
87
|
+
continue;
|
|
88
|
+
if (seenPackages.has(pkg))
|
|
89
|
+
continue;
|
|
90
|
+
seenPackages.add(pkg);
|
|
91
|
+
const typesPath = resolvePackageTypesPath(pkg, workdir, nodeModulesOverride);
|
|
92
|
+
if (typesPath) {
|
|
93
|
+
typed.push({ name: pkg, typesPath });
|
|
94
|
+
}
|
|
57
95
|
}
|
|
58
96
|
}
|
|
59
97
|
return { packages: typed };
|
package/package.json
CHANGED