Skip to content

Commit 52352fc

Browse files
committed
progress
1 parent 9c4d477 commit 52352fc

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

__fixtures__/test-project-rsc-kitchen-sink/web/src/lib/formatters.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import humanize from 'humanize-string'
44

55
const MAX_STRING_LENGTH = 150
66

7+
export const bigIntDisplay = (value: bigint) => {
8+
return value.toString()
9+
}
10+
711
export const formatEnum = (values: string | string[] | null | undefined) => {
812
let output = ''
913

__fixtures__/test-project/web/src/lib/formatters.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import humanize from 'humanize-string'
44

55
const MAX_STRING_LENGTH = 150
66

7+
export const bigIntDisplay = (value: bigint) => {
8+
return value.toString()
9+
}
10+
711
export const formatEnum = (values: string | string[] | null | undefined) => {
812
let output = ''
913

packages/cli/src/commands/generate/scaffold/scaffold.js

+5
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ const modelRelatedVariables = (model) => {
306306
listDisplayFunction: 'formatEnum',
307307
displayFunction: 'formatEnum',
308308
},
309+
BigInt: {
310+
componentName: 'TextField',
311+
displayFunction: 'bigIntDisplay',
312+
listDisplayFunction: 'truncate',
313+
},
309314
Boolean: {
310315
componentName: 'CheckboxField',
311316
defaultProp: 'defaultChecked',

packages/cli/src/commands/generate/scaffold/templates/lib/formatters.tsx.template

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import humanize from 'humanize-string'
44

55
const MAX_STRING_LENGTH = 150
66

7+
export const bigIntDisplay = (value: bigint) => {
8+
return value.toString()
9+
}
10+
711
export const formatEnum = (values: string | string[] | null | undefined) => {
812
let output = ''
913

0 commit comments

Comments
 (0)