@oxcide-ui/schema 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +73 -73
- package/dist/index.d.ts +73 -73
- package/package.json +5 -2
- package/.turbo/turbo-build.log +0 -58
- package/CHANGELOG.md +0 -15
- package/scripts/sync-types.ts +0 -105
- package/src/components/badge.ts +0 -31
- package/src/components/box.ts +0 -18
- package/src/components/button.ts +0 -1333
- package/src/components/checkbox.ts +0 -715
- package/src/components/dialog.ts +0 -720
- package/src/components/icon.ts +0 -665
- package/src/components/index.ts +0 -12
- package/src/components/input.ts +0 -1330
- package/src/components/radiobutton.ts +0 -67
- package/src/components/stack.ts +0 -38
- package/src/components/switch.ts +0 -1326
- package/src/components/tag.ts +0 -670
- package/src/components/toast.ts +0 -69
- package/src/index.ts +0 -2
- package/src/registry.ts +0 -52
- package/tsconfig.json +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxcide-ui/schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -17,9 +17,12 @@
|
|
|
17
17
|
"main": "./dist/index.cjs",
|
|
18
18
|
"module": "./dist/index.js",
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
20
23
|
"dependencies": {
|
|
21
24
|
"zod": "3.25.76",
|
|
22
|
-
"@oxcide-ui/icons": "0.0.
|
|
25
|
+
"@oxcide-ui/icons": "0.0.4"
|
|
23
26
|
},
|
|
24
27
|
"devDependencies": {
|
|
25
28
|
"@biomejs/biome": "^2.3.13",
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @oxcide-ui/schema@0.0.3 build /home/runner/work/oxcide-ui/oxcide-ui/packages/schema
|
|
3
|
-
> pnpm type-sync && tsup src/index.ts --format esm,cjs --dts --clean
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
> @oxcide-ui/schema@0.0.3 type-sync /home/runner/work/oxcide-ui/oxcide-ui/packages/schema
|
|
7
|
-
> tsx scripts/sync-types.ts && pnpm lint:fix
|
|
8
|
-
|
|
9
|
-
[36m
|
|
10
|
-
🚀 Starting type synchronization (Direct Mode)...
|
|
11
|
-
[39m
|
|
12
|
-
[34m⏳[39m Syncing [1m[37mbadge.ts[39m[22m...
|
|
13
|
-
[32m✅ Successfully synced [1mbadge.ts[22m[39m
|
|
14
|
-
[34m⏳[39m Syncing [1m[37mbox.ts[39m[22m...
|
|
15
|
-
[32m✅ Successfully synced [1mbox.ts[22m[39m
|
|
16
|
-
[34m⏳[39m Syncing [1m[37mbutton.ts[39m[22m...
|
|
17
|
-
[32m✅ Successfully synced [1mbutton.ts[22m[39m
|
|
18
|
-
[34m⏳[39m Syncing [1m[37mcheckbox.ts[39m[22m...
|
|
19
|
-
[32m✅ Successfully synced [1mcheckbox.ts[22m[39m
|
|
20
|
-
[34m⏳[39m Syncing [1m[37mdialog.ts[39m[22m...
|
|
21
|
-
[32m✅ Successfully synced [1mdialog.ts[22m[39m
|
|
22
|
-
[34m⏳[39m Syncing [1m[37micon.ts[39m[22m...
|
|
23
|
-
[32m✅ Successfully synced [1micon.ts[22m[39m
|
|
24
|
-
[34m⏳[39m Syncing [1m[37minput.ts[39m[22m...
|
|
25
|
-
[32m✅ Successfully synced [1minput.ts[22m[39m
|
|
26
|
-
[34m⏳[39m Syncing [1m[37mradiobutton.ts[39m[22m...
|
|
27
|
-
[32m✅ Successfully synced [1mradiobutton.ts[22m[39m
|
|
28
|
-
[34m⏳[39m Syncing [1m[37mstack.ts[39m[22m...
|
|
29
|
-
[32m✅ Successfully synced [1mstack.ts[22m[39m
|
|
30
|
-
[34m⏳[39m Syncing [1m[37mswitch.ts[39m[22m...
|
|
31
|
-
[32m✅ Successfully synced [1mswitch.ts[22m[39m
|
|
32
|
-
[34m⏳[39m Syncing [1m[37mtag.ts[39m[22m...
|
|
33
|
-
[32m✅ Successfully synced [1mtag.ts[22m[39m
|
|
34
|
-
[34m⏳[39m Syncing [1m[37mtoast.ts[39m[22m...
|
|
35
|
-
[32m✅ Successfully synced [1mtoast.ts[22m[39m
|
|
36
|
-
[36m
|
|
37
|
-
✨ Type synchronization complete! Updated [1m12[22m files.
|
|
38
|
-
[39m
|
|
39
|
-
|
|
40
|
-
> @oxcide-ui/schema@0.0.3 lint:fix /home/runner/work/oxcide-ui/oxcide-ui/packages/schema
|
|
41
|
-
> biome check --write .
|
|
42
|
-
|
|
43
|
-
Checked 17 files in 68ms. Fixed 12 files.
|
|
44
|
-
[34mCLI[39m Building entry: src/index.ts
|
|
45
|
-
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
46
|
-
[34mCLI[39m tsup v8.5.1
|
|
47
|
-
[34mCLI[39m Target: esnext
|
|
48
|
-
[34mCLI[39m Cleaning output folder
|
|
49
|
-
[34mESM[39m Build start
|
|
50
|
-
[34mCJS[39m Build start
|
|
51
|
-
[32mESM[39m [1mdist/index.js [22m[32m12.34 KB[39m
|
|
52
|
-
[32mESM[39m ⚡️ Build success in 67ms
|
|
53
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m16.32 KB[39m
|
|
54
|
-
[32mCJS[39m ⚡️ Build success in 68ms
|
|
55
|
-
[34mDTS[39m Build start
|
|
56
|
-
[32mDTS[39m ⚡️ Build success in 2954ms
|
|
57
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m208.74 KB[39m
|
|
58
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[32m208.74 KB[39m
|
package/CHANGELOG.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# @oxcide-ui/schema
|
|
2
|
-
|
|
3
|
-
## 0.0.3
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- @oxcide-ui/icons@0.0.3
|
|
8
|
-
|
|
9
|
-
## 0.0.2
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- 04c4ff6: feat: initial public release setup with automated CI/CD pipeline.
|
|
14
|
-
- Updated dependencies [04c4ff6]
|
|
15
|
-
- @oxcide-ui/icons@0.0.2
|
package/scripts/sync-types.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { Project } from 'ts-morph'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import { fileURLToPath } from 'node:url'
|
|
4
|
-
import pc from 'picocolors'
|
|
5
|
-
|
|
6
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
7
|
-
const rootPath = path.resolve(__dirname, '../src/components')
|
|
8
|
-
|
|
9
|
-
async function syncTypes() {
|
|
10
|
-
console.log(pc.cyan('\n🚀 Starting type synchronization (Direct Mode)...\n'))
|
|
11
|
-
|
|
12
|
-
const project = new Project({
|
|
13
|
-
tsConfigFilePath: path.resolve(__dirname, '../tsconfig.json'),
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
const files = project.getSourceFiles(path.join(rootPath, '*.ts'))
|
|
17
|
-
let updatedCount = 0
|
|
18
|
-
|
|
19
|
-
for (const sourceFile of files) {
|
|
20
|
-
const filePath = sourceFile.getFilePath()
|
|
21
|
-
const fileName = path.basename(filePath)
|
|
22
|
-
|
|
23
|
-
if (fileName === 'index.ts' || fileName.endsWith('.d.ts')) continue
|
|
24
|
-
|
|
25
|
-
// Find the schema name (e.g., buttonPropsSchema)
|
|
26
|
-
const schemaVar = sourceFile.getVariableDeclaration((v) => v.getName().endsWith('PropsSchema'))
|
|
27
|
-
if (!schemaVar) {
|
|
28
|
-
if (!fileName.includes('types')) {
|
|
29
|
-
console.warn(pc.yellow(`⚠️ Could not find a variable ending with 'PropsSchema' in ${fileName}. Skipping.`))
|
|
30
|
-
}
|
|
31
|
-
continue
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const schemaName = schemaVar.getName()
|
|
35
|
-
const baseName = schemaName.replace('PropsSchema', '')
|
|
36
|
-
const capitalizedBaseName = baseName.charAt(0).toUpperCase() + baseName.slice(1)
|
|
37
|
-
|
|
38
|
-
console.log(`${pc.blue('⏳')} Syncing ${pc.bold(pc.white(fileName))}...`)
|
|
39
|
-
|
|
40
|
-
let content = sourceFile.getFullText()
|
|
41
|
-
|
|
42
|
-
// 1. Detect existing sync block
|
|
43
|
-
const syncBlockRegex = new RegExp(
|
|
44
|
-
`\\/\\* @oxcide-sync:source[\\s\\S]*?@oxcide-sync:end \\*\\/[\\s\\S]*?(?=export function|$)`,
|
|
45
|
-
'g',
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
// 2. Detect original Zod inference lines
|
|
49
|
-
const originalRegex = new RegExp(
|
|
50
|
-
`export type ${capitalizedBaseName}Props = z\\.input<typeof ${schemaName}>;?\\s+` +
|
|
51
|
-
`export type ${capitalizedBaseName}ResolvedProps = z\\.infer<typeof ${schemaName}>;?`,
|
|
52
|
-
'g',
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
// Create temporary types to resolve the expansion
|
|
56
|
-
const tempInputType = sourceFile.addTypeAlias({
|
|
57
|
-
name: `__Temp${capitalizedBaseName}Input`,
|
|
58
|
-
type: `z.input<typeof ${schemaName}>`,
|
|
59
|
-
})
|
|
60
|
-
const tempResolvedType = sourceFile.addTypeAlias({
|
|
61
|
-
name: `__Temp${capitalizedBaseName}Resolved`,
|
|
62
|
-
type: `z.infer<typeof ${schemaName}>`,
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
const inputTypeText = tempInputType.getType().getApparentType().getText(tempInputType)
|
|
66
|
-
const resolvedTypeText = tempResolvedType.getType().getApparentType().getText(tempResolvedType)
|
|
67
|
-
|
|
68
|
-
tempInputType.remove()
|
|
69
|
-
tempResolvedType.remove()
|
|
70
|
-
|
|
71
|
-
const newSyncBlock = [
|
|
72
|
-
`/* @oxcide-sync:source`,
|
|
73
|
-
`export type ${capitalizedBaseName}Props = z.input<typeof ${schemaName}>`,
|
|
74
|
-
`export type ${capitalizedBaseName}ResolvedProps = z.infer<typeof ${schemaName}>`,
|
|
75
|
-
`@oxcide-sync:end */`,
|
|
76
|
-
`export interface ${capitalizedBaseName}Props ${inputTypeText}`,
|
|
77
|
-
`export type ${capitalizedBaseName}ResolvedProps = ${resolvedTypeText}`,
|
|
78
|
-
'\n',
|
|
79
|
-
].join('\n')
|
|
80
|
-
|
|
81
|
-
let newContent = ''
|
|
82
|
-
if (syncBlockRegex.test(content)) {
|
|
83
|
-
newContent = content.replace(syncBlockRegex, newSyncBlock)
|
|
84
|
-
} else if (originalRegex.test(content)) {
|
|
85
|
-
newContent = content.replace(originalRegex, newSyncBlock)
|
|
86
|
-
} else {
|
|
87
|
-
// If none found, find the schema and append after it
|
|
88
|
-
console.warn(pc.yellow(`❓ Could not find target declarations in ${fileName}. Appending.`))
|
|
89
|
-
newContent = content + '\n' + newSyncBlock
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
sourceFile.replaceWithText(newContent)
|
|
93
|
-
sourceFile.formatText({ indentSize: 2 })
|
|
94
|
-
await sourceFile.save()
|
|
95
|
-
console.log(pc.green(`✅ Successfully synced ${pc.bold(fileName)}`))
|
|
96
|
-
updatedCount++
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
console.log(pc.cyan(`\n✨ Type synchronization complete! Updated ${pc.bold(updatedCount)} files.\n`))
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
syncTypes().catch((error) => {
|
|
103
|
-
console.error(pc.red(`\n❌ Type sync failed: ${error.message}\n`))
|
|
104
|
-
process.exit(1)
|
|
105
|
-
})
|
package/src/components/badge.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
export const badgePropsSchema = z.object({
|
|
4
|
-
/** Severity / semantic color */
|
|
5
|
-
severity: z
|
|
6
|
-
.enum(['primary', 'secondary', 'success', 'info', 'warning', 'danger', 'help', 'contrast'])
|
|
7
|
-
.default('primary'),
|
|
8
|
-
/** Size */
|
|
9
|
-
size: z.enum(['xs', 'sm', 'md', 'lg', 'xl']).default('md'),
|
|
10
|
-
/** Value to display */
|
|
11
|
-
value: z.union([z.string(), z.number()]).optional()
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
/* @oxcide-sync:source
|
|
15
|
-
export type BadgeProps = z.input<typeof badgePropsSchema>
|
|
16
|
-
export type BadgeResolvedProps = z.infer<typeof badgePropsSchema>
|
|
17
|
-
@oxcide-sync:end */
|
|
18
|
-
export interface BadgeProps {
|
|
19
|
-
severity?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'help' | 'contrast' | undefined
|
|
20
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | undefined
|
|
21
|
-
value?: string | number | undefined
|
|
22
|
-
}
|
|
23
|
-
export type BadgeResolvedProps = {
|
|
24
|
-
severity: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'help' | 'contrast'
|
|
25
|
-
size: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
26
|
-
value?: string | number | undefined
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function getBadgeDefaults(props: BadgeProps = {}): BadgeResolvedProps {
|
|
30
|
-
return badgePropsSchema.parse(props)
|
|
31
|
-
}
|
package/src/components/box.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
export const boxPropsSchema = z.object({
|
|
4
|
-
as: z.string().default('div')
|
|
5
|
-
})
|
|
6
|
-
|
|
7
|
-
export function getBoxDefaults(props: BoxProps = {}): BoxResolvedProps {
|
|
8
|
-
return boxPropsSchema.parse(props)
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/* @oxcide-sync:source
|
|
12
|
-
export type BoxProps = z.input<typeof boxPropsSchema>
|
|
13
|
-
export type BoxResolvedProps = z.infer<typeof boxPropsSchema>
|
|
14
|
-
@oxcide-sync:end */
|
|
15
|
-
export interface BoxProps {
|
|
16
|
-
as?: string | undefined
|
|
17
|
-
}
|
|
18
|
-
export type BoxResolvedProps = { as: string }
|