Skip to content

Commit e0a8cf9

Browse files
committed
fix: Storybook enum options
1 parent 0e4b19f commit e0a8cf9

4 files changed

Lines changed: 19 additions & 19 deletions

File tree

features/app-core/routes/document.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { useServerInsertedHTML } from 'next/navigation'
66
import RootLayout from './layout'
77
// Styles
88
import { getInjectableMediaQueries } from 'aetherspace/styles'
9+
// Constants
10+
import { getBaseUrl } from 'aetherspace/utils/envUtils'
911

1012
/* --- Styles ---------------------------------------------------------------------------------- */
1113

@@ -91,6 +93,7 @@ const Document = (props: { children: React.ReactNode }) => {
9193
return (
9294
<html>
9395
<head>
96+
<link rel="canonical" href={getBaseUrl()} />
9497
{/* - Icons - */}
9598
<link rel="icon" href="/favicon.ico" sizes="any" />
9699
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />

packages/@aetherspace/schemas/aetherStoryDocs.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,16 @@ const aetherSchemaArgTypes = (aetherSchema) => {
6060
},
6161
control: { type: controlType },
6262
}
63-
// Fill in extra table values
64-
if (dataType === 'enum') argType.options = Object.values(schemaConfig.schema)
65-
if (schemaConfig?.defaultValue) argType.table.defaultValue = { summary: schemaConfig.defaultValue } // prettier-ignore
63+
// Provide options from schema?
64+
if (dataType === 'enum') {
65+
argType.options = Object.values(schemaConfig.schema).filter((opt) => {
66+
return !['displayName', '__docgenInfo'].includes(opt as string)
67+
})
68+
}
69+
// Fill in default value?
70+
if (schemaConfig?.defaultValue) {
71+
argType.table.defaultValue = { summary: schemaConfig.defaultValue }
72+
}
6673
// Return final result
6774
return argType
6875
}

packages/@aetherspace/scripts/link-routes.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ const linkRoutes = () => {
7575
const importPath = `${workspaceImport}/routes${routeSegments}index`
7676
const expoExportLine = `export { ${expoExports.join(', ')} } from '${importPath}'\n`
7777
const nextExportLine = `'use client'\nexport { ${nextExports.join(', ')} } from '${importPath}'\n` // prettier-ignore
78-
console.log(` ✅ ${routeSegments} -- Generated from "${pth}"`)
7978
fs.mkdirSync(`../../apps/expo/app/(generated)${routeSegments}`, { recursive: true })
8079
fs.writeFileSync(`../../apps/expo/app/(generated)${routeSegments}index.tsx`, expoExportLine, {}) // prettier-ignore
80+
console.log(` ✅ ${routeSegments} -- Generated from "${pth}"`)
8181
console.log(` └── /apps/expo/app/(generated)${routeSegments}index.tsx`)
8282
fs.mkdirSync(`../../apps/next/app/(generated)${routeSegments}`, { recursive: true })
8383
fs.writeFileSync(`../../apps/next/app/(generated)${routeSegments}page.tsx`, nextExportLine)
@@ -92,9 +92,9 @@ const linkRoutes = () => {
9292
const importPath = `${workspaceImport}/routes${routeSegments}${routeParam}`
9393
const expoExportLine = `export { ${expoExports.join(', ')} } from '${importPath}'\n`
9494
const nextExportLine = `'use client'\nexport { ${nextExports.join(', ')} } from '${importPath}'\n` // prettier-ignore
95-
console.log(` ✅ ${routeSegments}${routeParam}/ -- Generated from "${pth}"`)
9695
fs.mkdirSync(`../../apps/expo/app/(generated)${routeSegments}${routeParam}`, { recursive: true }) // prettier-ignore
9796
fs.writeFileSync(`../../apps/expo/app/(generated)${routeSegments}${routeParam}/index.tsx`, expoExportLine) // prettier-ignore
97+
console.log(` ✅ ${routeSegments}${routeParam}/ -- Generated from "${pth}"`)
9898
console.log(` └── /apps/expo/app/(generated)${routeSegments}${routeParam}/index.tsx`)
9999
fs.mkdirSync(`../../apps/next/app/(generated)${routeSegments}${routeParam}`, { recursive: true }) // prettier-ignore
100100
fs.writeFileSync(`../../apps/next/app/(generated)${routeSegments}${routeParam}/page.tsx`, nextExportLine) // prettier-ignore
@@ -111,9 +111,9 @@ const linkRoutes = () => {
111111
if (!isRootLayout) {
112112
const importPath = `${workspaceImport}/routes${routeSegments}layout`
113113
const exportLine = `'use client'\nexport { default } from '${importPath}'\n`
114-
console.log(` ✅ ${routeSegments} -- Layout from "${pth}"`)
115114
fs.mkdirSync(`../../apps/expo/app/(generated)${routeSegments}`, { recursive: true })
116115
fs.writeFileSync(`../../apps/expo/app/(generated)${routeSegments}_layout.tsx`, exportLine)
116+
console.log(` ✅ ${routeSegments} -- Layout from "${pth}"`)
117117
console.log(` └── /apps/expo/app/(generated)${routeSegments}_layout.tsx`)
118118
fs.mkdirSync(`../../apps/next/app/(generated)${routeSegments}`, { recursive: true })
119119
fs.writeFileSync(`../../apps/next/app/(generated)${routeSegments}layout.tsx`, exportLine)
@@ -128,9 +128,9 @@ const linkRoutes = () => {
128128
if (!isRootLayout) {
129129
const importPath = `${workspaceImport}/routes${routeSegments}template`
130130
const exportLine = `'use client'\nexport { default } from '${importPath}'\n`
131-
console.log(` ✅ ${routeSegments} -- Template from "${pth}"`)
132131
fs.mkdirSync(`../../apps/expo/app/(generated)${routeSegments}`, { recursive: true })
133132
fs.writeFileSync(`../../apps/expo/app/(generated)${routeSegments}_layout.tsx`, exportLine)
133+
console.log(` ✅ ${routeSegments} -- Template from "${pth}"`)
134134
console.log(` └── /apps/expo/app/(generated)${routeSegments}_layout.tsx`)
135135
fs.mkdirSync(`../../apps/next/app/(generated)${routeSegments}`, { recursive: true })
136136
fs.writeFileSync(`../../apps/next/app/(generated)${routeSegments}template.tsx`, exportLine)
@@ -143,9 +143,9 @@ const linkRoutes = () => {
143143
const routeSegments = routeParts.split('head.ts')[0]
144144
const importPath = `${workspaceImport}/routes${routeSegments}head`
145145
const exportLine = `export { default } from '${importPath}'\n`
146-
console.log(` ✅ ${routeSegments} -- Head from "${pth}"`)
147146
fs.mkdirSync(`../../apps/next/app/(generated)${routeSegments}`, { recursive: true })
148147
fs.writeFileSync(`../../apps/next/app/(generated)${routeSegments}head.tsx`, exportLine)
148+
console.log(` ✅ ${routeSegments} -- Head from "${pth}"`)
149149
console.log(` └── /apps/next/app/(generated)${routeSegments}head.tsx`)
150150
})
151151

@@ -157,9 +157,9 @@ const linkRoutes = () => {
157157
const routeSegments = routeParts.split('route.ts')[0]
158158
const importPath = `${workspaceImport}/routes${routeSegments}route`
159159
const nextExportLine = `export { ${nextExports.join(', ')} } from '${importPath}'\n` // prettier-ignore
160-
console.log(` ✅ ${routeSegments} -- API Route from "${pth}"`)
161160
fs.mkdirSync(`../../apps/next/app/(generated)${routeSegments}`, { recursive: true })
162161
fs.writeFileSync(`../../apps/next/app/(generated)${routeSegments}route.ts`, nextExportLine)
162+
console.log(` ✅ ${routeSegments} -- API Route from "${pth}"`)
163163
console.log(` └── /apps/next/app/(generated)${routeSegments}route.ts`)
164164
})
165165
} catch (err) {

packages/@registries/iconz.generated.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)