Skip to content

Commit

Permalink
Start merging page and page-set, by putting them into a subdirectory.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnaab committed Nov 15, 2024
1 parent 7068890 commit 11546bc
Show file tree
Hide file tree
Showing 19 changed files with 47 additions and 47 deletions.
4 changes: 2 additions & 2 deletions packages/forms/src/builder/builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { defaultFormConfig } from '../patterns/index.js';
import { type FieldsetPattern } from '../patterns/fieldset/config.js';
import { type FormSummaryPattern } from '../patterns/form-summary.js';
import { type InputPattern } from '../patterns/input/config.js';
import { type PagePattern } from '../patterns/page/config.js';
import { type PageSetPattern } from '../patterns/page-set/config.js';
import { type PagePattern } from '../patterns/pages/page/config.js';
import { type PageSetPattern } from '../patterns/pages/page-set/config.js';
import { type RadioGroupPattern } from '../patterns/radio-group.js';

import { BlueprintBuilder } from './index.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/builder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
type PatternMap,
} from '../pattern.js';
import { type FieldsetPattern } from '../patterns/fieldset/config.js';
import { type PageSetPattern } from '../patterns/page-set/config.js';
import { type PageSetPattern } from '../patterns/pages/page-set/config.js';
import type { Blueprint, FormSummary } from '../types.js';

export class BlueprintBuilder {
Expand Down
4 changes: 2 additions & 2 deletions packages/forms/src/documents/__tests__/document.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { describe, expect, it } from 'vitest';
import { getPattern } from '../../index.js';
import { BlueprintBuilder } from '../../builder/index.js';
import { defaultFormConfig } from '../../patterns/index.js';
import { type PageSetPattern } from '../../patterns/page-set/config.js';
import { type PagePattern } from '../../patterns/page/config.js';
import { type PageSetPattern } from '../../patterns/pages/page-set/config.js';
import { type PagePattern } from '../../patterns/pages/page/config.js';

import { addDocument } from '../document.js';
import { loadSamplePDF } from './sample-data.js';
Expand Down
4 changes: 2 additions & 2 deletions packages/forms/src/documents/pdf/parsing-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import * as z from 'zod';

import { type FieldsetPattern } from '../../patterns/fieldset/config.js';
import { type InputPattern } from '../../patterns/input/config.js';
import { PagePattern } from '../../patterns/page/config.js';
import { PageSetPattern } from '../../patterns/page-set/config.js';
import { PagePattern } from '../../patterns/pages/page/config.js';
import { PageSetPattern } from '../../patterns/pages/page-set/config.js';
import { type ParagraphPattern } from '../../patterns/paragraph.js';
import { type CheckboxPattern } from '../../patterns/checkbox.js';
import { type RadioGroupPattern } from '../../patterns/radio-group.js';
Expand Down
12 changes: 6 additions & 6 deletions packages/forms/src/patterns/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { fieldsetConfig } from './fieldset/index.js';
import { formSummaryConfig } from './form-summary.js';
import { inputConfig } from './input/index.js';
import { packageDownloadConfig } from './package-download/index.js';
import { pageConfig } from './page/index.js';
import { pageSetConfig } from './page-set/index.js';
import { pageConfig } from './pages/page/index.js';
import { pageSetConfig } from './pages/page-set/index.js';
import { paragraphConfig } from './paragraph.js';
import { radioGroupConfig } from './radio-group.js';
import { richTextConfig } from './rich-text.js';
Expand Down Expand Up @@ -46,10 +46,10 @@ export * from './form-summary.js';
export * from './input/index.js';
export { type InputPattern } from './input/config.js';
export * from './package-download/index.js';
export * from './page/index.js';
export { type PagePattern } from './page/config.js';
export * from './page-set/index.js';
export { type PageSetPattern } from './page-set/config.js';
export * from './pages/page/index.js';
export { type PagePattern } from './pages/page/config.js';
export * from './pages/page-set/index.js';
export { type PageSetPattern } from './pages/page-set/config.js';
export * from './paragraph.js';
export * from './radio-group.js';
export * from './select-dropdown/select-dropdown.js';
Expand Down
4 changes: 2 additions & 2 deletions packages/forms/src/patterns/package-download/submit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { type Blueprint, type FormSession, defaultFormConfig } from '../..';

import { downloadPackageHandler } from './submit';
import { PackageDownload } from './builder';
import { PageSet } from '../page-set/builder';
import { Page } from '../page/builder';
import { PageSet } from '../pages/page-set/builder';
import { Page } from '../pages/page/builder';
import { Input } from '../input/builder';
import { loadSamplePDF } from '../../documents/__tests__/sample-data';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Blueprint } from '../..';
import { PatternBuilder } from '../../pattern';
import { type Blueprint } from '../../..';
import { PatternBuilder } from '../../../pattern';
import { type Page } from '../page/builder';
import { type PageSetPattern } from './config';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from 'zod';

import { type Pattern, type ParsePatternConfigData } from '../../pattern.js';
import { safeZodParseFormErrors } from '../../util/zod.js';
import { type Pattern, type ParsePatternConfigData } from '../../../pattern.js';
import { safeZodParseFormErrors } from '../../../util/zod.js';

const configSchema = z.object({
pages: z.array(z.string()),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type PatternConfig, type PatternId } from '../../pattern.js';
import { type PatternConfig, type PatternId } from '../../../pattern.js';

import { type PageSetPattern, parseConfigData } from './config.js';
import { createPrompt } from './prompt.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { describe, expect, it } from 'vitest';

import { defaultFormConfig } from '..';
import { createFormSession } from '../../session';
import { defaultFormConfig } from '../..';
import { createFormSession } from '../../../session';

import { Input } from '../input/builder';
import { Input } from '../../input/builder';
import { Page } from '../page/builder';
import type { Blueprint } from '../../types';
import type { Blueprint } from '../../../types';

import { PageSet } from './builder';
import { createPrompt } from './prompt';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { z } from 'zod';

import { type RouteData } from '../../route-data.js';
import { safeZodParseFormErrors } from '../../util/zod.js';
import { type RouteData } from '../../../route-data.js';
import { safeZodParseFormErrors } from '../../../util/zod.js';

import { type PagePattern } from '../page/config.js';
import { type ActionName, getActionString } from '../../submission.js';
import { type ActionName, getActionString } from '../../../submission.js';
import {
type CreatePrompt,
type PageSetProps,
type PromptAction,
createPromptForPattern,
} from '../../components.js';
import { getPattern } from '../../pattern.js';
import { type FormSession } from '../../session.js';
} from '../../../components.js';
import { getPattern } from '../../../pattern.js';
import { type FormSession } from '../../../session.js';

import { type PageSetPattern } from './config.js';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PatternBuilder } from '../../pattern';
import { PatternBuilder } from '../../../pattern';
import { type PagePattern } from './config';

export class Page extends PatternBuilder<PagePattern> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from 'zod';

import { type Pattern, type ParsePatternConfigData } from '../../pattern.js';
import { safeZodParseFormErrors } from '../../util/zod.js';
import { type Pattern, type ParsePatternConfigData } from '../../../pattern.js';
import { safeZodParseFormErrors } from '../../../util/zod.js';

const configSchema = z.object({
title: z.string(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type PatternConfig } from '../../pattern.js';
import { type PatternConfig } from '../../../pattern.js';

import { type PagePattern, parseConfigData } from './config.js';
import { createPrompt } from './prompt.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
type CreatePrompt,
type PageProps,
createPromptForPattern,
} from '../../components.js';
import { getPattern } from '../../pattern.js';
} from '../../../components.js';
import { getPattern } from '../../../pattern.js';

import { type PagePattern } from './config.js';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it } from 'vitest';

import { type Blueprint, defaultFormConfig } from '../..';
import { Input } from '../input/builder';
import { type Blueprint, defaultFormConfig } from '../../..';
import { Input } from '../../input/builder';
import { Page } from '../page/builder';
import { createFormSession } from '../../session';
import { createFormSession } from '../../../session';

import { PageSet } from './builder';
import { submitPage } from './submit';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
getPatternConfig,
getPatternSafely,
validatePatternAndChildren,
} from '../../pattern';
import { type FormSession } from '../../session';
import { type SubmitHandler } from '../../submission';
} from '../../../pattern';
import { type FormSession } from '../../../session';
import { type SubmitHandler } from '../../../submission';
import { type PagePattern } from '../page/config';
import { type PageSetPattern } from './config';

Expand Down
8 changes: 4 additions & 4 deletions packages/forms/src/services/submit-form.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import {
} from '../documents/__tests__/test-documents.js';
import { createFormSession } from '../session.js';
import { createForm } from '../blueprint.js';
import { type PageSetPattern } from '../patterns/page-set/config.js';
import { type PagePattern } from '../patterns/page/config.js';
import { type PageSetPattern } from '../patterns/pages/page-set/config.js';
import { type PagePattern } from '../patterns/pages/page/config.js';
import { type InputPattern } from '../patterns/input/config.js';
import { type Blueprint } from '../types.js';
import { Checkbox } from '../patterns/checkbox.js';
import { FieldSet } from '../patterns/fieldset/builder.js';
import { Page } from '../patterns/page/builder.js';
import { Form, PageSet } from '../patterns/page-set/builder.js';
import { Page } from '../patterns/pages/page/builder.js';
import { Form, PageSet } from '../patterns/pages/page-set/builder.js';

describe('submitForm', () => {
it('fails with missing action string', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/services/submit-form.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { failure, success, type Result } from '@atj/common';

import { type FormServiceContext } from '../context/index.js';
import { submitPage } from '../patterns/page-set/submit';
import { submitPage } from '../patterns/pages/submit';
import { downloadPackageHandler } from '../patterns/package-download/submit';
import { type FormRoute } from '../route-data.js';
import { SubmissionRegistry } from '../submission';
Expand Down

0 comments on commit 11546bc

Please sign in to comment.