Skip to content

Commit 99c05ca

Browse files
authored
Increase heap size in validation workflow and fix type errors (#23)
1 parent 19dc525 commit 99c05ca

22 files changed

Lines changed: 51 additions & 45 deletions

File tree

.github/workflows/_validate.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ jobs:
9999
- name: Initialize Terraform CDK configuration
100100
shell: bash
101101
working-directory: infra/cdktf
102+
env:
103+
NODE_OPTIONS: --max-old-space-size=4096
102104
run: |
103105
pnpm cdktf get
104106
pnpm build:tsc

e2e/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"scripts": {
66
"auth": "pnpm --filter=@flexion/forms-cli cli e2e create-test-session -p ../../packages/server/src/main.db -o ../../e2e/.env",
7+
"clean": "rimraf coverage test-results playwright-report",
78
"dev": "tsc -w",
89
"test:e2e:ci": "pnpm auth && pnpm playwright test --headed",
910
"test:e2e:dev": "pnpm auth && pnpm playwright test --ui-port=8080 --ui-host=0.0.0.0"

infra/aws-cdk/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"build:typescript": "tsc",
2323
"build:synth": "cdk synth",
2424
"cdk": "cdk",
25+
"clean": "rimraf dist cdk.out tsconfig.tsbuildinfo coverage",
2526
"test": "echo 'no tests'",
2627
"watch": "tsc -w"
2728
},

packages/design/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"build:storybook": "storybook build",
2626
"build:styles": "gulp update",
2727
"clean": "pnpm clean:lib && pnpm clean:styles",
28-
"clean:lib": "rimraf dist",
28+
"clean:lib": "rimraf dist tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo coverage storybook-static",
2929
"clean:styles": "rimraf static",
3030
"dev": "run-p dev:*",
3131
"dev:lib": "vite",

packages/forms/src/blueprint.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ import {
66
generatePatternId,
77
getPatternMap,
88
removeChildPattern,
9-
} from './pattern';
9+
} from './pattern.js';
1010
import {
1111
type FieldsetPattern,
1212
type FormSummaryPattern,
1313
type PagePattern,
1414
type PageSetPattern,
1515
type RepeaterPattern,
1616
type SequencePattern,
17-
} from './patterns';
18-
import { type Blueprint, type FormOutput, type FormSummary } from './types';
17+
} from './patterns/index.js';
18+
import { type Blueprint, type FormOutput, type FormSummary } from './types.js';
1919

2020
export const nullBlueprint: Blueprint = {
2121
summary: {

packages/forms/src/builder/parse-form.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as z from 'zod';
22

33
import { failure, success, type Result } from '@flexion/forms-common';
4-
import type { FormConfig } from '../pattern';
5-
import type { Blueprint } from '../types';
4+
import type { FormConfig } from '../pattern.js';
5+
import type { Blueprint } from '../types.js';
66

77
/**
88
* Parses and validates an object against a form schema defined by the given configuration.

packages/forms/src/pattern.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as r from '@flexion/forms-common';
2-
import set from 'set-value';
32

43
import { type CreatePrompt } from './components.js';
54
import { type FormError, type FormErrors } from './error.js';
@@ -249,6 +248,9 @@ export const getFirstPattern = (
249248
): Pattern => {
250249
if (!pattern) {
251250
pattern = form.patterns[form.root];
251+
if (!pattern) {
252+
throw new Error(`Root pattern with id ${form.root} not found`);
253+
}
252254
}
253255
const elemConfig = getPatternConfig(config, pattern.type);
254256
const children = elemConfig.getChildren(pattern, form.patterns);

packages/forms/src/patterns/attachment/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { z } from 'zod';
22
import { enLocale as message } from '@flexion/forms-common';
33
import { ParsePatternConfigData, type Pattern } from '../../pattern.js';
44
import { safeZodParseFormErrors } from '../../util/zod.js';
5-
import { attachmentFileTypeMimes } from './file-type-options';
5+
import { attachmentFileTypeMimes } from './file-type-options.js';
66

77
export type AttachmentPattern = Pattern<AttachmentConfigSchema>;
88

packages/forms/src/patterns/attachment/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { type PatternConfig } from '../../pattern.js';
55
import { parseConfigData, type AttachmentPattern } from './config.js';
66
import { createPrompt } from './prompt.js';
77
import { type AttachmentPatternOutput, parseUserInput } from './response.js';
8-
import { attachmentFileTypeMimes } from './file-type-options';
8+
import { attachmentFileTypeMimes } from './file-type-options.js';
99

1010
export const attachmentConfig: PatternConfig<
1111
AttachmentPattern,

packages/forms/src/patterns/name/name.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from 'vitest';
2-
import { createNameSchema, nameConfig, type NamePattern } from './index';
2+
import { createNameSchema, nameConfig, type NamePattern } from './index.js';
33

44
describe('NamePattern tests', () => {
55
describe('createNameSchema', () => {

0 commit comments

Comments
 (0)