-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor pattern component wrappers #421
Changes from 20 commits
97e3d8f
94cdce0
80c14cb
c789b19
bfb5e40
9dabdab
0705d6a
731492d
ea80b03
96c3ae2
8290bae
7d37214
5b33f8f
5110b3f
6b38741
a05cfbb
b644328
db64580
6260069
8f67f09
cd5f527
7bd97b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v20.18.0 | ||
v22.12.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,19 +9,19 @@ | |
"types": "dist/types/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/types/index.d.ts", | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js", | ||
"types": "./dist/types/index.d.ts" | ||
"require": "./dist/cjs/index.js" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these keys became relevant with node 22. |
||
}, | ||
"./context": { | ||
"types": "./dist/types/context/index.d.ts", | ||
"import": "./dist/esm/context.js", | ||
"require": "./dist/cjs/context.js", | ||
"types": "./dist/types/context/index.d.ts" | ||
"require": "./dist/cjs/context.js" | ||
}, | ||
"./testing": { | ||
"types": "./dist/types/testing.d.ts", | ||
"import": "./dist/esm/testing.js", | ||
"require": "./dist/cjs/testing.js", | ||
"types": "./dist/types/testing.d.ts" | ||
"require": "./dist/cjs/testing.js" | ||
} | ||
}, | ||
"scripts": { | ||
|
@@ -33,7 +33,7 @@ | |
"dependencies": { | ||
"@atj/common": "workspace:*", | ||
"@types/pg": "^8.11.6", | ||
"better-sqlite3": "^11.1.2", | ||
"better-sqlite3": "^11.7.2", | ||
"knex": "^3.1.0", | ||
"kysely": "^0.27.4", | ||
"pg": "^8.12.0" | ||
|
@@ -42,6 +42,6 @@ | |
"@testcontainers/postgresql": "^10.13.2", | ||
"@types/better-sqlite3": "^7.6.11", | ||
"testcontainers": "^10.13.2", | ||
"vite-tsconfig-paths": "^4.3.2" | ||
"vite-tsconfig-paths": "^5.1.4" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,8 @@ import commonjs from '@rollup/plugin-commonjs'; | |
import json from '@rollup/plugin-json'; | ||
import typescript from 'rollup-plugin-typescript2'; | ||
|
||
import packageJson from './package.json' assert { type: 'json' }; | ||
import workspacePackageJson from '../../package.json' assert { type: 'json' }; | ||
import packageJson from './package.json' with { type: 'json' }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For node.js 22 compatibility |
||
import workspacePackageJson from '../../package.json' with { type: 'json' }; | ||
|
||
export default { | ||
//input: ['src/index.ts', 'src/context/index.ts', 'src/testing.ts'], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ const config: StorybookConfig = { | |
getAbsolutePath('@storybook/addon-interactions'), | ||
getAbsolutePath('@storybook/addon-a11y'), | ||
getAbsolutePath('@storybook/addon-coverage'), | ||
getAbsolutePath('@storybook/experimental-addon-test'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will hopefully come out of "experimental" status soon, but seems to be running pretty smoothly now. |
||
], | ||
core: { | ||
disableTelemetry: true, | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ import React from 'react'; | |
|
||
import { type FieldsetProps } from '@atj/forms'; | ||
|
||
import { type PatternComponent } from '../../../Form/index.js'; | ||
import { type PatternComponent } from '../../index.js'; | ||
import { renderPromptComponents } from '../../form-common.js'; | ||
|
||
const Fieldset: PatternComponent<FieldsetProps> = props => { | ||
return ( | ||
|
@@ -12,8 +13,7 @@ const Fieldset: PatternComponent<FieldsetProps> = props => { | |
{props.legend} | ||
</legend> | ||
)} | ||
|
||
{props.children} | ||
{renderPromptComponents(props.context, props.childComponents)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All the components that have children have been updated to call a function to render the child prompt component parts. This will enable rendering components with alternate preview props in the edit UI, which will be necessary for the logic UI. |
||
</fieldset> | ||
); | ||
}; | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import React from 'react'; | ||
import { type PatternComponent } from '../../index.js'; | ||
import { renderPromptComponents } from '../../form-common.js'; | ||
|
||
import { type PatternComponent } from '../../../Form/index.js'; | ||
|
||
const Sequence: PatternComponent = ({ children }) => { | ||
return <>{children}</>; | ||
const Sequence: PatternComponent = props => { | ||
return renderPromptComponents(props.context, props.childComponents); | ||
}; | ||
|
||
export default Sequence; |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
vitest.workspace.ts
now includes these tests.