@walkeros/cli 4.0.1-next-1778284185788 → 4.0.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/CHANGELOG.md +21 -5
- package/dist/cli.js +206 -201
- package/dist/index.js +19 -10
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -4178,7 +4178,7 @@ function planSimulate(flags) {
|
|
|
4178
4178
|
// src/commands/push/dispatch-simulate.ts
|
|
4179
4179
|
function dispatchSimulate(flags) {
|
|
4180
4180
|
const plan = planSimulate(flags);
|
|
4181
|
-
return {
|
|
4181
|
+
return { kind: plan.kind, ids: plan.ids };
|
|
4182
4182
|
}
|
|
4183
4183
|
|
|
4184
4184
|
// src/commands/push/run.ts
|
|
@@ -4201,7 +4201,7 @@ async function runPushCommand(options) {
|
|
|
4201
4201
|
});
|
|
4202
4202
|
}
|
|
4203
4203
|
let result;
|
|
4204
|
-
switch (plan.
|
|
4204
|
+
switch (plan.kind) {
|
|
4205
4205
|
case "none":
|
|
4206
4206
|
result = await push(config, resolvedEvent, {
|
|
4207
4207
|
flow: options.flow,
|
|
@@ -4296,10 +4296,7 @@ function resolveBeforeChain(before, transformers, ingest, event) {
|
|
|
4296
4296
|
if (!resolved) return [];
|
|
4297
4297
|
return walkChain(resolved, extractTransformerNextMap(transformers));
|
|
4298
4298
|
}
|
|
4299
|
-
return walkChain(
|
|
4300
|
-
next,
|
|
4301
|
-
extractTransformerNextMap(transformers)
|
|
4302
|
-
);
|
|
4299
|
+
return walkChain(next, extractTransformerNextMap(transformers));
|
|
4303
4300
|
}
|
|
4304
4301
|
async function pushCore(inputPath, event, options = {}) {
|
|
4305
4302
|
const logger = createCLILogger({
|
|
@@ -6189,11 +6186,23 @@ function validateFlow(input, options = {}) {
|
|
|
6189
6186
|
details
|
|
6190
6187
|
};
|
|
6191
6188
|
}
|
|
6189
|
+
function flattenRouteTargets(spec) {
|
|
6190
|
+
if (!spec) return [];
|
|
6191
|
+
if (typeof spec === "string") return [spec];
|
|
6192
|
+
if (!Array.isArray(spec) || spec.length === 0) return [];
|
|
6193
|
+
if (typeof spec[0] === "string") {
|
|
6194
|
+
return spec.filter((s) => typeof s === "string");
|
|
6195
|
+
}
|
|
6196
|
+
const routes = spec;
|
|
6197
|
+
return Array.from(
|
|
6198
|
+
new Set(routes.flatMap((r) => flattenRouteTargets(r.next)))
|
|
6199
|
+
);
|
|
6200
|
+
}
|
|
6192
6201
|
function buildConnectionGraph(config) {
|
|
6193
6202
|
const connections = [];
|
|
6194
6203
|
for (const [name, source] of Object.entries(config.sources || {})) {
|
|
6195
6204
|
if (!source.next || !source.examples) continue;
|
|
6196
|
-
const nextNames =
|
|
6205
|
+
const nextNames = flattenRouteTargets(source.next);
|
|
6197
6206
|
for (const nextName of nextNames) {
|
|
6198
6207
|
const transformer = config.transformers?.[nextName];
|
|
6199
6208
|
if (transformer?.examples) {
|
|
@@ -6210,7 +6219,7 @@ function buildConnectionGraph(config) {
|
|
|
6210
6219
|
}
|
|
6211
6220
|
for (const [name, transformer] of Object.entries(config.transformers || {})) {
|
|
6212
6221
|
if (!transformer.next || !transformer.examples) continue;
|
|
6213
|
-
const nextNames =
|
|
6222
|
+
const nextNames = flattenRouteTargets(transformer.next);
|
|
6214
6223
|
for (const nextName of nextNames) {
|
|
6215
6224
|
const nextTransformer = config.transformers?.[nextName];
|
|
6216
6225
|
if (nextTransformer?.examples) {
|
|
@@ -6231,7 +6240,7 @@ function buildConnectionGraph(config) {
|
|
|
6231
6240
|
}
|
|
6232
6241
|
for (const [name, dest] of Object.entries(config.destinations || {})) {
|
|
6233
6242
|
if (!dest.before || !dest.examples) continue;
|
|
6234
|
-
const beforeNames =
|
|
6243
|
+
const beforeNames = flattenRouteTargets(dest.before);
|
|
6235
6244
|
for (const beforeName of beforeNames) {
|
|
6236
6245
|
const transformer = config.transformers?.[beforeName];
|
|
6237
6246
|
if (transformer?.examples) {
|
|
@@ -6376,7 +6385,7 @@ function validateMapping(input) {
|
|
|
6376
6385
|
// src/commands/validate/validators/entry.ts
|
|
6377
6386
|
import Ajv from "ajv";
|
|
6378
6387
|
import { fetchPackageSchema } from "@walkeros/core";
|
|
6379
|
-
var CLIENT_HEADER = "walkeros-cli/4.0.
|
|
6388
|
+
var CLIENT_HEADER = "walkeros-cli/4.0.2";
|
|
6380
6389
|
var SECTIONS = ["destinations", "sources", "transformers"];
|
|
6381
6390
|
function resolveEntry(path20, flowConfig) {
|
|
6382
6391
|
const flows = flowConfig.flows;
|