-
Notifications
You must be signed in to change notification settings - Fork 8
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
Future Admin Generator: parse config using ts-morph to support inline functions and direct imports #3297
Open
nsams
wants to merge
25
commits into
next
Choose a base branch
from
admingen-tsmorph
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Future Admin Generator: parse config using ts-morph to support inline functions and direct imports #3297
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
baa70ae
Future Admin Generator PoC: parse config using ts-morph to support in…
nsams 5096614
Add support for variable declaration with initializer
nsams 22a0e09
Implement grid renderCell defined as arrow function
nsams 6bfb78a
Add support for using imported components (or anything else) in rende…
nsams 8977d18
Add unit tests for tsMorphHelpers
nsams 04b25ea
Remove support for explicit {name, import} config, support new import…
nsams 81b5033
eslint
nsams e2c96e0
Restrict parsing import/inline-code to paths where we have support fo…
nsams 14b6ae0
Fix merge errors an others
nsams 651e400
re-add accidentally removed file
nsams 69c8161
update ts-morph to latest version
nsams 07c9dd5
Fix import
nsams f07a811
Merge branch 'next' into admingen-tsmorph
nsams 24608cd
convert merged cometGen to new api
nsams e2d25ba
quick workaround for nested fields
nsams 0687518
Don't export internal function
nsams 75fb2c5
knip: cometGen now can also be tsx
nsams 74332ce
Use type from final-from for validate function
nsams d68b1ec
Improve typing: Type Guard used by generator runtime for places where…
nsams 0b9d639
Update comment, that's not a todo anymore
nsams 7733d9c
Add poor-mans recursion support for nested fields with up to 5 levels…
nsams 174a6cc
merge next into admingen-tsmorph
manuelblum e89e799
format: pre.json
manuelblum 6055350
Fix wrong type in supportedImportPaths
nsams a4bcf14
fix knip issues
nsams File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,81 @@ | ||
{ | ||
"mode": "pre", | ||
"tag": "beta", | ||
"initialVersions": { | ||
"comet-demo-admin": "1.0.0", | ||
"comet-demo-admin-server": "1.0.0", | ||
"comet-demo-api": "1.0.0", | ||
"comet-demo-site": "1.0.0", | ||
"comet-demo-site-pages": "1.0.0", | ||
"comet-docs": "0.0.0", | ||
"@comet/admin": "7.13.0", | ||
"@comet/admin-babel-preset": "7.13.0", | ||
"@comet/admin-color-picker": "7.13.0", | ||
"@comet/admin-date-time": "7.13.0", | ||
"@comet/admin-icons": "7.13.0", | ||
"@comet/admin-rte": "7.13.0", | ||
"@comet/admin-theme": "7.13.0", | ||
"@comet/cms-admin": "7.13.0", | ||
"@comet/cms-api": "7.13.0", | ||
"@comet/cli": "7.13.0", | ||
"@comet/eslint-config": "7.13.0", | ||
"@comet/eslint-plugin": "7.13.0", | ||
"@comet/cms-site": "7.13.0", | ||
"comet-storybook": "1.0.0", | ||
"@comet/admin-generator": "7.14.0", | ||
"@comet/api-generator": "7.14.0" | ||
}, | ||
"changesets": [ | ||
"chatty-pets-serve", | ||
"clean-dots-pull", | ||
"cyan-ghosts-smoke", | ||
"dirty-brooms-beam", | ||
"eighty-rockets-yell", | ||
"fast-plums-tickle", | ||
"fifty-buses-hope", | ||
"five-games-refuse", | ||
"four-cobras-mate", | ||
"four-forks-call", | ||
"four-houses-taste", | ||
"giant-teachers-tease", | ||
"grumpy-fishes-live", | ||
"heavy-games-marry", | ||
"hot-cheetahs-juggle", | ||
"khaki-zebras-roll", | ||
"late-hats-explain", | ||
"lazy-pears-shout", | ||
"little-students-attend", | ||
"lucky-books-thank", | ||
"lucky-doors-raise", | ||
"nasty-pets-check", | ||
"nervous-otters-hunt", | ||
"new-cherries-provide", | ||
"nice-bananas-press", | ||
"nice-masks-invite", | ||
"old-adults-whisper", | ||
"perfect-mangos-greet", | ||
"polite-chairs-join", | ||
"popular-seals-promise", | ||
"purple-pants-tell", | ||
"rich-spiders-trade", | ||
"rude-laws-pretend", | ||
"seven-wasps-jump", | ||
"sharp-apes-visit", | ||
"sharp-dryers-happen", | ||
"shiny-ads-fix", | ||
"six-suns-join", | ||
"soft-horses-ring", | ||
"soft-taxis-train", | ||
"spicy-bottles-admire", | ||
"spotty-stingrays-camp", | ||
"sweet-guests-poke", | ||
"sweet-ways-relax", | ||
"tame-ligers-enjoy", | ||
"tasty-goats-explode", | ||
"ten-onions-wash", | ||
"thick-windows-cover", | ||
"thirty-moles-invite", | ||
"two-humans-decide", | ||
"wicked-coins-work" | ||
] | ||
"mode": "pre", | ||
"tag": "beta", | ||
"initialVersions": { | ||
"comet-demo-admin": "1.0.0", | ||
"comet-demo-admin-server": "1.0.0", | ||
"comet-demo-api": "1.0.0", | ||
"comet-demo-site": "1.0.0", | ||
"comet-demo-site-pages": "1.0.0", | ||
"comet-docs": "0.0.0", | ||
"@comet/admin": "7.13.0", | ||
"@comet/admin-babel-preset": "7.13.0", | ||
"@comet/admin-color-picker": "7.13.0", | ||
"@comet/admin-date-time": "7.13.0", | ||
"@comet/admin-icons": "7.13.0", | ||
"@comet/admin-rte": "7.13.0", | ||
"@comet/admin-theme": "7.13.0", | ||
"@comet/cms-admin": "7.13.0", | ||
"@comet/cms-api": "7.13.0", | ||
"@comet/cli": "7.13.0", | ||
"@comet/eslint-config": "7.13.0", | ||
"@comet/eslint-plugin": "7.13.0", | ||
"@comet/cms-site": "7.13.0", | ||
"comet-storybook": "1.0.0", | ||
"@comet/admin-generator": "7.14.0", | ||
"@comet/api-generator": "7.14.0" | ||
}, | ||
"changesets": [ | ||
"chatty-pets-serve", | ||
"clean-dots-pull", | ||
"cyan-ghosts-smoke", | ||
"dirty-brooms-beam", | ||
"eighty-rockets-yell", | ||
"fast-plums-tickle", | ||
"fifty-buses-hope", | ||
"five-games-refuse", | ||
"four-cobras-mate", | ||
"four-forks-call", | ||
"four-houses-taste", | ||
"giant-teachers-tease", | ||
"grumpy-fishes-live", | ||
"heavy-games-marry", | ||
"hot-cheetahs-juggle", | ||
"khaki-zebras-roll", | ||
"late-hats-explain", | ||
"lazy-pears-shout", | ||
"little-students-attend", | ||
"lucky-books-thank", | ||
"lucky-doors-raise", | ||
"nasty-pets-check", | ||
"nervous-otters-hunt", | ||
"new-cherries-provide", | ||
"nice-bananas-press", | ||
"nice-masks-invite", | ||
"old-adults-whisper", | ||
"perfect-mangos-greet", | ||
"polite-chairs-join", | ||
"popular-seals-promise", | ||
"purple-pants-tell", | ||
"rich-spiders-trade", | ||
"rude-laws-pretend", | ||
"seven-wasps-jump", | ||
"sharp-apes-visit", | ||
"sharp-dryers-happen", | ||
"shiny-ads-fix", | ||
"six-suns-join", | ||
"soft-horses-ring", | ||
"soft-taxis-train", | ||
"spicy-bottles-admire", | ||
"spotty-stingrays-camp", | ||
"sweet-guests-poke", | ||
"sweet-ways-relax", | ||
"tame-ligers-enjoy", | ||
"tasty-goats-explode", | ||
"ten-onions-wash", | ||
"thick-windows-cover", | ||
"thirty-moles-invite", | ||
"two-humans-decide", | ||
"wicked-coins-work" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function ProductTitle({ title }: { title: string }) { | ||
return <div>Product: {title}</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,6 @@ import { FormSpy } from "react-final-form"; | |
import { FormattedMessage } from "react-intl"; | ||
|
||
import { FutureProductNotice } from "../../helpers/FutureProductNotice"; | ||
import { validateTitle } from "../validateTitle"; | ||
import { | ||
type GQLManufacturersSelectQuery, | ||
type GQLManufacturersSelectQueryVariables, | ||
|
@@ -213,7 +212,14 @@ export function ProductForm({ id }: FormProps) { | |
fullWidth | ||
name="title" | ||
label={<FormattedMessage id="product.title" defaultMessage="Titel" />} | ||
validate={validateTitle} | ||
validate={(value: string) => | ||
value.length < 3 ? ( | ||
<FormattedMessage | ||
id="product.validate.titleMustBe3CharsLog" | ||
defaultMessage="Title must be at least 3 characters long" | ||
/> | ||
) : undefined | ||
} | ||
/> | ||
|
||
<TextField | ||
|
@@ -423,14 +429,14 @@ export function ProductForm({ id }: FormProps) { | |
name="priceList" | ||
label={<FormattedMessage id="product.priceList" defaultMessage="Price List" />} | ||
variant="horizontal" | ||
maxFileSize={4194304} | ||
maxFileSize={1024 * 1024 * 4} | ||
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. here we also can keep the non-evaluated version (good) |
||
/> | ||
<FileUploadField | ||
name="datasheets" | ||
label={<FormattedMessage id="product.datasheets" defaultMessage="Datasheets" />} | ||
variant="horizontal" | ||
multiple | ||
maxFileSize={4194304} | ||
maxFileSize={1024 * 1024 * 4} | ||
/> | ||
<DateTimeField | ||
variant="horizontal" | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why is this change necessary? Was the usage incorrect?
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.
yes, the first param is the row type: https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/models/params/gridCellParams.ts#L18, the second is the value.
(this was swapped in mui-x)