@pgflow/dsl 0.0.5 → 0.0.7
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 → dist/CHANGELOG.md} +2 -0
- package/package.json +10 -8
- package/__tests__/runtime/flow.test.ts +0 -121
- package/__tests__/runtime/steps.test.ts +0 -183
- package/__tests__/runtime/utils.test.ts +0 -149
- package/__tests__/types/dsl-types.test-d.ts +0 -103
- package/__tests__/types/example-flow.test-d.ts +0 -76
- package/__tests__/types/extract-flow-input.test-d.ts +0 -71
- package/__tests__/types/extract-flow-steps.test-d.ts +0 -74
- package/__tests__/types/getStepDefinition.test-d.ts +0 -65
- package/__tests__/types/step-input.test-d.ts +0 -212
- package/__tests__/types/step-output.test-d.ts +0 -55
- package/brainstorming/condition/condition-alternatives.md +0 -219
- package/brainstorming/condition/condition-with-flexibility.md +0 -303
- package/brainstorming/condition/condition.md +0 -139
- package/brainstorming/condition/implementation-plan.md +0 -372
- package/brainstorming/dsl/cli-json-schema.md +0 -225
- package/brainstorming/dsl/cli.md +0 -179
- package/brainstorming/dsl/create-compilator.md +0 -25
- package/brainstorming/dsl/dsl-analysis-2.md +0 -166
- package/brainstorming/dsl/dsl-analysis.md +0 -512
- package/brainstorming/dsl/dsl-critique.md +0 -41
- package/brainstorming/fanouts/fanout-subflows-flattened-vs-subruns.md +0 -213
- package/brainstorming/fanouts/fanouts-task-index.md +0 -150
- package/brainstorming/fanouts/fanouts-with-conditions-and-subflows.md +0 -239
- package/brainstorming/subflows/branching.ts.md +0 -38
- package/brainstorming/subflows/subflows-callbacks.ts.md +0 -124
- package/brainstorming/subflows/subflows-classes.ts.md +0 -83
- package/brainstorming/subflows/subflows-flattening-versioned.md +0 -119
- package/brainstorming/subflows/subflows-flattening.md +0 -138
- package/brainstorming/subflows/subflows.md +0 -118
- package/brainstorming/subflows/subruns-table.md +0 -282
- package/brainstorming/subflows/subruns.md +0 -315
- package/brainstorming/versioning/breaking-and-non-breaking-flow-changes.md +0 -259
- package/docs/refactor-edge-worker.md +0 -146
- package/docs/versioning.md +0 -19
- package/eslint.config.cjs +0 -22
- package/out-tsc/vitest/__tests__/runtime/flow.test.d.ts +0 -2
- package/out-tsc/vitest/__tests__/runtime/flow.test.d.ts.map +0 -1
- package/out-tsc/vitest/__tests__/runtime/steps.test.d.ts +0 -2
- package/out-tsc/vitest/__tests__/runtime/steps.test.d.ts.map +0 -1
- package/out-tsc/vitest/__tests__/runtime/utils.test.d.ts +0 -2
- package/out-tsc/vitest/__tests__/runtime/utils.test.d.ts.map +0 -1
- package/out-tsc/vitest/__tests__/types/dsl-types.test-d.d.ts +0 -2
- package/out-tsc/vitest/__tests__/types/dsl-types.test-d.d.ts.map +0 -1
- package/out-tsc/vitest/__tests__/types/example-flow.test-d.d.ts +0 -2
- package/out-tsc/vitest/__tests__/types/example-flow.test-d.d.ts.map +0 -1
- package/out-tsc/vitest/__tests__/types/extract-flow-input.test-d.d.ts +0 -2
- package/out-tsc/vitest/__tests__/types/extract-flow-input.test-d.d.ts.map +0 -1
- package/out-tsc/vitest/__tests__/types/extract-flow-steps.test-d.d.ts +0 -2
- package/out-tsc/vitest/__tests__/types/extract-flow-steps.test-d.d.ts.map +0 -1
- package/out-tsc/vitest/__tests__/types/getStepDefinition.test-d.d.ts +0 -2
- package/out-tsc/vitest/__tests__/types/getStepDefinition.test-d.d.ts.map +0 -1
- package/out-tsc/vitest/__tests__/types/step-input.test-d.d.ts +0 -2
- package/out-tsc/vitest/__tests__/types/step-input.test-d.d.ts.map +0 -1
- package/out-tsc/vitest/__tests__/types/step-output.test-d.d.ts +0 -2
- package/out-tsc/vitest/__tests__/types/step-output.test-d.d.ts.map +0 -1
- package/out-tsc/vitest/tsconfig.spec.tsbuildinfo +0 -1
- package/out-tsc/vitest/vite.config.d.ts +0 -3
- package/out-tsc/vitest/vite.config.d.ts.map +0 -1
- package/project.json +0 -28
- package/prompts/edge-worker-refactor.md +0 -105
- package/src/dsl.ts +0 -318
- package/src/example-flow.ts +0 -67
- package/src/index.ts +0 -1
- package/src/utils.ts +0 -84
- package/tsconfig.json +0 -13
- package/tsconfig.lib.json +0 -26
- package/tsconfig.spec.json +0 -35
- package/typecheck.log +0 -120
- package/vite.config.ts +0 -57
package/src/example-flow.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Flow } from './dsl.ts';
|
|
2
|
-
|
|
3
|
-
// Provide a type for the input of the Flow
|
|
4
|
-
type Input = {
|
|
5
|
-
url: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const AnalyzeWebsite = new Flow<Input>({
|
|
9
|
-
slug: 'analyze_website',
|
|
10
|
-
maxAttempts: 3,
|
|
11
|
-
baseDelay: 5,
|
|
12
|
-
timeout: 10,
|
|
13
|
-
})
|
|
14
|
-
.step(
|
|
15
|
-
{ slug: 'website' },
|
|
16
|
-
async (input) => await scrapeWebsite(input.run.url)
|
|
17
|
-
)
|
|
18
|
-
.step(
|
|
19
|
-
{ slug: 'sentiment', dependsOn: ['website'], timeout: 30, maxAttempts: 5 },
|
|
20
|
-
async (input) => await analyzeSentiment(input.website.content)
|
|
21
|
-
)
|
|
22
|
-
.step(
|
|
23
|
-
{ slug: 'summary', dependsOn: ['website'] },
|
|
24
|
-
async (input) => await summarizeWithAI(input.website.content)
|
|
25
|
-
)
|
|
26
|
-
.step(
|
|
27
|
-
{ slug: 'saveToDb', dependsOn: ['sentiment', 'summary'] },
|
|
28
|
-
async (input) => {
|
|
29
|
-
const results = await saveToDb({
|
|
30
|
-
websiteUrl: input.run.url,
|
|
31
|
-
sentiment: input.sentiment.score,
|
|
32
|
-
summary: input.summary.aiSummary,
|
|
33
|
-
});
|
|
34
|
-
return results.status;
|
|
35
|
-
}
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
/***********************************************************************
|
|
39
|
-
****** functions *******************************************************
|
|
40
|
-
***********************************************************************/
|
|
41
|
-
|
|
42
|
-
async function scrapeWebsite(url: string) {
|
|
43
|
-
return {
|
|
44
|
-
content: `Lorem ipsum ${url.length}`,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const analyzeSentiment = async (_content: string) => {
|
|
49
|
-
return {
|
|
50
|
-
score: Math.random(),
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
const summarizeWithAI = async (content: string) => {
|
|
54
|
-
return {
|
|
55
|
-
aiSummary: `Lorem ipsum ${content.length}`,
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const saveToDb = async (_input: {
|
|
60
|
-
websiteUrl: string;
|
|
61
|
-
sentiment: number;
|
|
62
|
-
summary: string;
|
|
63
|
-
}) => {
|
|
64
|
-
return {
|
|
65
|
-
status: 'success',
|
|
66
|
-
};
|
|
67
|
-
};
|
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dsl.ts';
|
package/src/utils.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validates a slug string according to the following rules:
|
|
3
|
-
* - Cannot start with a number
|
|
4
|
-
* - Cannot start with an underscore
|
|
5
|
-
* - Cannot contain spaces
|
|
6
|
-
* - Cannot contain special characters like /, :, ?, #
|
|
7
|
-
* - Cannot be longer than 128 characters
|
|
8
|
-
*
|
|
9
|
-
* @param slug The slug string to validate
|
|
10
|
-
* @throws Error if the slug is invalid
|
|
11
|
-
*/
|
|
12
|
-
export function validateSlug(slug: string): void {
|
|
13
|
-
if (slug.length > 128) {
|
|
14
|
-
throw new Error(`Slug cannot be longer than 128 characters`);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (/^\d/.test(slug)) {
|
|
18
|
-
throw new Error(`Slug cannot start with a number`);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (/^_/.test(slug)) {
|
|
22
|
-
throw new Error(`Slug cannot start with an underscore`);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (/\s/.test(slug)) {
|
|
26
|
-
throw new Error(`Slug cannot contain spaces`);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (/[/:#\-?]/.test(slug)) {
|
|
30
|
-
throw new Error(
|
|
31
|
-
`Slug cannot contain special characters like /, :, ?, #, -`
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Options for validating runtime options
|
|
38
|
-
*/
|
|
39
|
-
export interface ValidateRuntimeOptionsOpts {
|
|
40
|
-
optional?: boolean;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Validates runtime options according to the following rules:
|
|
45
|
-
* - maxAttempts should be >= 1
|
|
46
|
-
* - baseDelay should be >= 1
|
|
47
|
-
* - timeout should be >= 3
|
|
48
|
-
*
|
|
49
|
-
* @param options The runtime options to validate
|
|
50
|
-
* @param opts Configuration options for validation
|
|
51
|
-
* @param opts.optional If true, allows options to be null or undefined
|
|
52
|
-
* @throws Error if any runtime option is invalid
|
|
53
|
-
*/
|
|
54
|
-
export function validateRuntimeOptions(
|
|
55
|
-
options: { maxAttempts?: number; baseDelay?: number; timeout?: number },
|
|
56
|
-
opts: ValidateRuntimeOptionsOpts = { optional: false }
|
|
57
|
-
): void {
|
|
58
|
-
const { maxAttempts, baseDelay, timeout } = options;
|
|
59
|
-
|
|
60
|
-
// If optional is true, skip validation for undefined/null values
|
|
61
|
-
if (maxAttempts !== undefined && maxAttempts !== null) {
|
|
62
|
-
if (maxAttempts < 1) {
|
|
63
|
-
throw new Error('maxAttempts must be greater than or equal to 1');
|
|
64
|
-
}
|
|
65
|
-
} else if (!opts.optional) {
|
|
66
|
-
throw new Error('maxAttempts is required');
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (baseDelay !== undefined && baseDelay !== null) {
|
|
70
|
-
if (baseDelay < 1) {
|
|
71
|
-
throw new Error('baseDelay must be greater than or equal to 1');
|
|
72
|
-
}
|
|
73
|
-
} else if (!opts.optional) {
|
|
74
|
-
throw new Error('baseDelay is required');
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (timeout !== undefined && timeout !== null) {
|
|
78
|
-
if (timeout < 3) {
|
|
79
|
-
throw new Error('timeout must be greater than or equal to 3');
|
|
80
|
-
}
|
|
81
|
-
} else if (!opts.optional) {
|
|
82
|
-
throw new Error('timeout is required');
|
|
83
|
-
}
|
|
84
|
-
}
|
package/tsconfig.json
DELETED
package/tsconfig.lib.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "dist",
|
|
5
|
-
"tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo",
|
|
6
|
-
"emitDeclarationOnly": false,
|
|
7
|
-
"types": ["node", "vite/client"],
|
|
8
|
-
"allowImportingTsExtensions": true
|
|
9
|
-
},
|
|
10
|
-
"include": ["src/**/*.ts"],
|
|
11
|
-
"references": [],
|
|
12
|
-
"exclude": [
|
|
13
|
-
"vite.config.ts",
|
|
14
|
-
"vite.config.mts",
|
|
15
|
-
"vitest.config.ts",
|
|
16
|
-
"vitest.config.mts",
|
|
17
|
-
"src/**/*.test.ts",
|
|
18
|
-
"src/**/*.spec.ts",
|
|
19
|
-
"src/**/*.test.tsx",
|
|
20
|
-
"src/**/*.spec.tsx",
|
|
21
|
-
"src/**/*.test.js",
|
|
22
|
-
"src/**/*.spec.js",
|
|
23
|
-
"src/**/*.test.jsx",
|
|
24
|
-
"src/**/*.spec.jsx"
|
|
25
|
-
]
|
|
26
|
-
}
|
package/tsconfig.spec.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "./out-tsc/vitest",
|
|
5
|
-
"types": [
|
|
6
|
-
"vitest/globals",
|
|
7
|
-
"vitest/importMeta",
|
|
8
|
-
"vite/client",
|
|
9
|
-
"node",
|
|
10
|
-
"vitest"
|
|
11
|
-
],
|
|
12
|
-
"allowImportingTsExtensions": true
|
|
13
|
-
},
|
|
14
|
-
"include": [
|
|
15
|
-
"vite.config.ts",
|
|
16
|
-
"vite.config.mts",
|
|
17
|
-
"vitest.config.ts",
|
|
18
|
-
"vitest.config.mts",
|
|
19
|
-
"src/**/*.test.ts",
|
|
20
|
-
"src/**/*.spec.ts",
|
|
21
|
-
"src/**/*.test.tsx",
|
|
22
|
-
"src/**/*.spec.tsx",
|
|
23
|
-
"src/**/*.test.js",
|
|
24
|
-
"src/**/*.spec.js",
|
|
25
|
-
"src/**/*.test.jsx",
|
|
26
|
-
"src/**/*.spec.jsx",
|
|
27
|
-
"src/**/*.d.ts",
|
|
28
|
-
"__tests__/**/*.ts"
|
|
29
|
-
],
|
|
30
|
-
"references": [
|
|
31
|
-
{
|
|
32
|
-
"path": "./tsconfig.lib.json"
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
}
|
package/typecheck.log
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> nx run dsl:typecheck
|
|
3
|
-
|
|
4
|
-
> tsc --build --emitDeclarationOnly --pretty --verbose
|
|
5
|
-
|
|
6
|
-
[[90m9:57:14 PM[0m] Projects in this build:
|
|
7
|
-
* tsconfig.lib.json
|
|
8
|
-
* tsconfig.spec.json
|
|
9
|
-
* tsconfig.json
|
|
10
|
-
|
|
11
|
-
[[90m9:57:14 PM[0m] Project 'tsconfig.lib.json' is up to date because newest input 'src/dsl.ts' is older than output 'dist/tsconfig.lib.tsbuildinfo'
|
|
12
|
-
|
|
13
|
-
[[90m9:57:14 PM[0m] Project 'tsconfig.spec.json' is out of date because buildinfo file 'out-tsc/vitest/tsconfig.spec.tsbuildinfo' indicates that program needs to report errors.
|
|
14
|
-
|
|
15
|
-
[[90m9:57:14 PM[0m] Building project '/home/jumski/Code/pgflow-dev/pgflow/pkgs/dsl/tsconfig.spec.json'...
|
|
16
|
-
|
|
17
|
-
[96m__tests__/types/dsl-types.test-d.ts[0m:[93m112[0m:[93m37[0m - [91merror[0m[90m TS2344: [0mType 'Flow<{ input: string; }, EmptySteps & { step1: { value: number; text: string; }; } & { step2: { flag: true; }; } & { step3: "plain string"; }, EmptyDeps & { step1: never[]; } & { ...; } & { ...; }>' does not satisfy the constraint 'AnyFlow'.
|
|
18
|
-
The types returned by 'getStepDefinition(...)' are incompatible between these types.
|
|
19
|
-
Type 'StepDefinition<{ [x: string]: any; run: { input: string; }; }, any>' is not assignable to type 'StepDefinition<{ [x: string]: Json; run: Json; }, Json>'.
|
|
20
|
-
Type '{ [x: string]: Json; run: Json; }' is not assignable to type '{ [x: string]: any; run: { input: string; }; }'.
|
|
21
|
-
Types of property 'run' are incompatible.
|
|
22
|
-
Type 'Json' is not assignable to type '{ input: string; }'.
|
|
23
|
-
Type 'null' is not assignable to type '{ input: string; }'.
|
|
24
|
-
|
|
25
|
-
[7m112[0m type Step1Output = StepOutput<typeof flow, 'step1'>;
|
|
26
|
-
[7m [0m [91m ~~~~~~~~~~~[0m
|
|
27
|
-
|
|
28
|
-
[96m__tests__/types/dsl-types.test-d.ts[0m:[93m113[0m:[93m49[0m - [91merror[0m[90m TS2344: [0mType '{ value: number; text: string; }' does not satisfy the constraint '"Expected: ..., Actual: never"'.
|
|
29
|
-
|
|
30
|
-
[7m113[0m expectTypeOf<Step1Output>().toMatchTypeOf<{
|
|
31
|
-
[7m [0m [91m ~[0m
|
|
32
|
-
[7m114[0m value: number;
|
|
33
|
-
[7m [0m [91m~~~~~~~~~~~~~~~~~~~~~~[0m
|
|
34
|
-
[7m115[0m text: string;
|
|
35
|
-
[7m [0m [91m~~~~~~~~~~~~~~~~~~~~~[0m
|
|
36
|
-
[7m116[0m }>();
|
|
37
|
-
[7m [0m [91m~~~~~~~[0m
|
|
38
|
-
|
|
39
|
-
[96m__tests__/types/dsl-types.test-d.ts[0m:[93m118[0m:[93m37[0m - [91merror[0m[90m TS2344: [0mType 'Flow<{ input: string; }, EmptySteps & { step1: { value: number; text: string; }; } & { step2: { flag: true; }; } & { step3: "plain string"; }, EmptyDeps & { step1: never[]; } & { ...; } & { ...; }>' does not satisfy the constraint 'AnyFlow'.
|
|
40
|
-
The types returned by 'getStepDefinition(...)' are incompatible between these types.
|
|
41
|
-
Type 'StepDefinition<{ [x: string]: any; run: { input: string; }; }, any>' is not assignable to type 'StepDefinition<{ [x: string]: Json; run: Json; }, Json>'.
|
|
42
|
-
Type '{ [x: string]: Json; run: Json; }' is not assignable to type '{ [x: string]: any; run: { input: string; }; }'.
|
|
43
|
-
Types of property 'run' are incompatible.
|
|
44
|
-
Type 'Json' is not assignable to type '{ input: string; }'.
|
|
45
|
-
Type 'null' is not assignable to type '{ input: string; }'.
|
|
46
|
-
|
|
47
|
-
[7m118[0m type Step2Output = StepOutput<typeof flow, 'step2'>;
|
|
48
|
-
[7m [0m [91m ~~~~~~~~~~~[0m
|
|
49
|
-
|
|
50
|
-
[96m__tests__/types/dsl-types.test-d.ts[0m:[93m119[0m:[93m49[0m - [91merror[0m[90m TS2344: [0mType '{ flag: boolean; }' does not satisfy the constraint '"Expected: ..., Actual: never"'.
|
|
51
|
-
|
|
52
|
-
[7m119[0m expectTypeOf<Step2Output>().toMatchTypeOf<{ flag: boolean }>();
|
|
53
|
-
[7m [0m [91m ~~~~~~~~~~~~~~~~~[0m
|
|
54
|
-
|
|
55
|
-
[96m__tests__/types/dsl-types.test-d.ts[0m:[93m121[0m:[93m37[0m - [91merror[0m[90m TS2344: [0mType 'Flow<{ input: string; }, EmptySteps & { step1: { value: number; text: string; }; } & { step2: { flag: true; }; } & { step3: "plain string"; }, EmptyDeps & { step1: never[]; } & { ...; } & { ...; }>' does not satisfy the constraint 'AnyFlow'.
|
|
56
|
-
The types returned by 'getStepDefinition(...)' are incompatible between these types.
|
|
57
|
-
Type 'StepDefinition<{ [x: string]: any; run: { input: string; }; }, any>' is not assignable to type 'StepDefinition<{ [x: string]: Json; run: Json; }, Json>'.
|
|
58
|
-
Type '{ [x: string]: Json; run: Json; }' is not assignable to type '{ [x: string]: any; run: { input: string; }; }'.
|
|
59
|
-
Types of property 'run' are incompatible.
|
|
60
|
-
Type 'Json' is not assignable to type '{ input: string; }'.
|
|
61
|
-
Type 'null' is not assignable to type '{ input: string; }'.
|
|
62
|
-
|
|
63
|
-
[7m121[0m type Step3Output = StepOutput<typeof flow, 'step3'>;
|
|
64
|
-
[7m [0m [91m ~~~~~~~~~~~[0m
|
|
65
|
-
|
|
66
|
-
[96m__tests__/types/dsl-types.test-d.ts[0m:[93m122[0m:[93m49[0m - [91merror[0m[90m TS2344: [0mType 'string' does not satisfy the constraint '"Expected: string, Actual: never"'.
|
|
67
|
-
|
|
68
|
-
[7m122[0m expectTypeOf<Step3Output>().toMatchTypeOf<string>();
|
|
69
|
-
[7m [0m [91m ~~~~~~[0m
|
|
70
|
-
|
|
71
|
-
[96m__tests__/types/dsl-types.test-d.ts[0m:[93m124[0m:[93m43[0m - [91merror[0m[90m TS2344: [0mType 'Flow<{ input: string; }, EmptySteps & { step1: { value: number; text: string; }; } & { step2: { flag: true; }; } & { step3: "plain string"; }, EmptyDeps & { step1: never[]; } & { ...; } & { ...; }>' does not satisfy the constraint 'AnyFlow'.
|
|
72
|
-
The types returned by 'getStepDefinition(...)' are incompatible between these types.
|
|
73
|
-
Type 'StepDefinition<{ [x: string]: any; run: { input: string; }; }, any>' is not assignable to type 'StepDefinition<{ [x: string]: Json; run: Json; }, Json>'.
|
|
74
|
-
Type '{ [x: string]: Json; run: Json; }' is not assignable to type '{ [x: string]: any; run: { input: string; }; }'.
|
|
75
|
-
Types of property 'run' are incompatible.
|
|
76
|
-
Type 'Json' is not assignable to type '{ input: string; }'.
|
|
77
|
-
Type 'null' is not assignable to type '{ input: string; }'.
|
|
78
|
-
|
|
79
|
-
[7m124[0m type NonExistentOutput = StepOutput<typeof flow, 'nonExistentStep'>;
|
|
80
|
-
[7m [0m [91m ~~~~~~~~~~~[0m
|
|
81
|
-
|
|
82
|
-
[96m__tests__/types/dsl-types.test-d.ts[0m:[93m144[0m:[93m43[0m - [91merror[0m[90m TS2344: [0mType 'Flow<{ id: number; }, EmptySteps & { complexStep: { data: { items: { id: number; name: string; }[]; metadata: { count: number; lastUpdated: string; }; }; }; }, EmptyDeps & { complexStep: never[]; }>' does not satisfy the constraint 'AnyFlow'.
|
|
83
|
-
The types returned by 'getStepDefinition(...)' are incompatible between these types.
|
|
84
|
-
Type 'StepDefinition<{ [x: string]: any; run: { id: number; }; }, any>' is not assignable to type 'StepDefinition<{ [x: string]: Json; run: Json; }, Json>'.
|
|
85
|
-
Type '{ [x: string]: Json; run: Json; }' is not assignable to type '{ [x: string]: any; run: { id: number; }; }'.
|
|
86
|
-
Types of property 'run' are incompatible.
|
|
87
|
-
Type 'Json' is not assignable to type '{ id: number; }'.
|
|
88
|
-
Type 'null' is not assignable to type '{ id: number; }'.
|
|
89
|
-
|
|
90
|
-
[7m144[0m type ComplexStepOutput = StepOutput<typeof complexFlow, 'complexStep'>;
|
|
91
|
-
[7m [0m [91m ~~~~~~~~~~~~~~~~~~[0m
|
|
92
|
-
|
|
93
|
-
[96m__tests__/types/dsl-types.test-d.ts[0m:[93m145[0m:[93m55[0m - [91merror[0m[90m TS2344: [0mType '{ data: { items: { id: number; name: string; }[]; metadata: { count: number; lastUpdated: string; }; }; }' does not satisfy the constraint '"Expected: ..., Actual: never"'.
|
|
94
|
-
|
|
95
|
-
[7m145[0m expectTypeOf<ComplexStepOutput>().toMatchTypeOf<{
|
|
96
|
-
[7m [0m [91m ~[0m
|
|
97
|
-
[7m146[0m data: {
|
|
98
|
-
[7m [0m [91m~~~~~~~~~~~~~~~[0m
|
|
99
|
-
[7m...[0m
|
|
100
|
-
[7m152[0m };
|
|
101
|
-
[7m [0m [91m~~~~~~~~~~[0m
|
|
102
|
-
[7m153[0m }>();
|
|
103
|
-
[7m [0m [91m~~~~~~~[0m
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
Found 9 errors.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
NX Running target typecheck for project dsl failed
|
|
112
|
-
|
|
113
|
-
Failed tasks:
|
|
114
|
-
|
|
115
|
-
- dsl:typecheck
|
|
116
|
-
|
|
117
|
-
Hint: run the command with --verbose for more details.
|
|
118
|
-
|
|
119
|
-
View structured, searchable error logs at https://nx.app/runs/7SrNf6iuVJ
|
|
120
|
-
|
package/vite.config.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/// <reference types='vitest' />
|
|
2
|
-
import { defineConfig } from 'vite';
|
|
3
|
-
import dts from 'vite-plugin-dts';
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
6
|
-
|
|
7
|
-
export default defineConfig({
|
|
8
|
-
root: __dirname,
|
|
9
|
-
cacheDir: '../../node_modules/.vite/pkgs/dsl',
|
|
10
|
-
plugins: [
|
|
11
|
-
tsconfigPaths(),
|
|
12
|
-
dts({
|
|
13
|
-
entryRoot: 'src',
|
|
14
|
-
tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
|
|
15
|
-
}),
|
|
16
|
-
],
|
|
17
|
-
// Uncomment this if you are using workers.
|
|
18
|
-
// worker: {
|
|
19
|
-
// plugins: [ nxViteTsPaths() ],
|
|
20
|
-
// },
|
|
21
|
-
// Configuration for building your library.
|
|
22
|
-
// See: https://vitejs.dev/guide/build.html#library-mode
|
|
23
|
-
build: {
|
|
24
|
-
outDir: './dist',
|
|
25
|
-
emptyOutDir: true,
|
|
26
|
-
reportCompressedSize: true,
|
|
27
|
-
commonjsOptions: {
|
|
28
|
-
transformMixedEsModules: true,
|
|
29
|
-
},
|
|
30
|
-
lib: {
|
|
31
|
-
// Could also be a dictionary or array of multiple entry points.
|
|
32
|
-
entry: 'src/index.ts',
|
|
33
|
-
name: '@pgflow/dsl',
|
|
34
|
-
fileName: 'index',
|
|
35
|
-
// Change this to the formats you want to support.
|
|
36
|
-
// Don't forget to update your package.json as well.
|
|
37
|
-
formats: ['es'],
|
|
38
|
-
},
|
|
39
|
-
rollupOptions: {
|
|
40
|
-
// External packages that should not be bundled into your library.
|
|
41
|
-
external: [],
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
test: {
|
|
45
|
-
watch: false,
|
|
46
|
-
globals: true,
|
|
47
|
-
environment: 'node',
|
|
48
|
-
include: [
|
|
49
|
-
'{src,__tests__}/**/*.{test,spec,test-d,spec-d}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
|
|
50
|
-
],
|
|
51
|
-
reporters: ['default'],
|
|
52
|
-
coverage: {
|
|
53
|
-
reportsDirectory: './test-output/vitest/coverage',
|
|
54
|
-
provider: 'v8',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
});
|