Skip to content

Commit 4690f2e

Browse files
flow type
1 parent 91ab4c4 commit 4690f2e

File tree

21 files changed

+1173
-487
lines changed

21 files changed

+1173
-487
lines changed

packages/cli/examples/flow-order-complete.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"flow": {
3-
"platform": "web",
3+
"web": {},
44
"destinations": {
55
"demo": {
66
"code": "destinationDemo",

packages/cli/examples/flow-simple.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"flow": {
3-
"platform": "web",
3+
"web": {},
44
"destinations": {
55
"demo": {
66
"code": "destinationDemo",

packages/cli/examples/flow.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"flow": {
3-
"platform": "web",
3+
"web": {},
44
"destinations": {
55
"ga4": {
66
"code": "destinationGtag",

packages/cli/examples/server-collect.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"flow": {
3-
"platform": "server",
3+
"server": {},
44
"sources": {
55
"http": {
66
"code": "sourceExpress",

packages/cli/examples/web-serve.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"flow": {
3-
"platform": "web",
3+
"web": {
4+
"windowCollector": "collector",
5+
"windowElb": "elb"
6+
},
47
"sources": {
58
"demo": {
69
"code": "sourceDemo",
@@ -68,8 +71,6 @@
6871
}
6972
},
7073
"minify": true,
71-
"output": "web-serve.js",
72-
"windowCollector": "collector",
73-
"windowElb": "elb"
74+
"output": "web-serve.js"
7475
}
7576
}

packages/cli/src/__tests__/config-loader.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,12 @@ describe('Config Loader', () => {
310310
build: { packages: {}, code: 'export {};', output: '' },
311311
};
312312

313+
// Invalid platform value causes config to fail format detection
313314
expect(() =>
314315
loadBundleConfig(invalidConfig, {
315316
configPath: '/test/config.json',
316317
}),
317-
).toThrow('Invalid platform "invalid". Must be "web" or "server".');
318+
).toThrow('Invalid configuration format');
318319
});
319320

320321
test('throws error for missing required fields', () => {

packages/cli/src/__tests__/push/fixtures/configs/server-basic.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"flow": {
3-
"platform": "server",
3+
"server": {},
44
"destinations": {
55
"demo": {
66
"code": "destinationDemo"

packages/cli/src/__tests__/push/fixtures/configs/web-basic.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"flow": {
3-
"platform": "web",
3+
"web": {},
44
"destinations": {
55
"demo": {
66
"code": "destinationDemo"

packages/cli/src/commands/push/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import path from 'path';
22
import os from 'os';
33
import { JSDOM, VirtualConsole } from 'jsdom';
44
import fs from 'fs-extra';
5-
import type { Elb } from '@walkeros/core';
5+
import { getPlatform, type Elb } from '@walkeros/core';
66
import {
77
createCommandLogger,
88
createLogger,
@@ -71,7 +71,7 @@ export async function pushCommand(options: PushCommandOptions): Promise<void> {
7171
logger,
7272
});
7373

74-
const platform = flowConfig.platform;
74+
const platform = getPlatform(flowConfig);
7575

7676
// Step 3: Bundle to temp file
7777
logger.info('🔨 Bundling flow configuration...');

packages/cli/src/commands/run/__tests__/run.integration.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ describe('Run Command Integration', () => {
4242
const config = require(configPath);
4343
expect(config.flow).toBeDefined();
4444
expect(config.build).toBeDefined();
45-
expect(config.flow.platform).toBe('server');
45+
// New format uses server: {} key instead of platform property
46+
expect(config.flow.server).toBeDefined();
4647
});
4748
});
4849

0 commit comments

Comments
 (0)