@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxcide-ui/schema",
3
- "version": "0.0.3",
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.3"
25
+ "@oxcide-ui/icons": "0.0.4"
23
26
  },
24
27
  "devDependencies": {
25
28
  "@biomejs/biome": "^2.3.13",
@@ -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
- 
10
- 🚀 Starting type synchronization (Direct Mode)...
11
- 
12
- ⏳ Syncing badge.ts...
13
- ✅ Successfully synced badge.ts
14
- ⏳ Syncing box.ts...
15
- ✅ Successfully synced box.ts
16
- ⏳ Syncing button.ts...
17
- ✅ Successfully synced button.ts
18
- ⏳ Syncing checkbox.ts...
19
- ✅ Successfully synced checkbox.ts
20
- ⏳ Syncing dialog.ts...
21
- ✅ Successfully synced dialog.ts
22
- ⏳ Syncing icon.ts...
23
- ✅ Successfully synced icon.ts
24
- ⏳ Syncing input.ts...
25
- ✅ Successfully synced input.ts
26
- ⏳ Syncing radiobutton.ts...
27
- ✅ Successfully synced radiobutton.ts
28
- ⏳ Syncing stack.ts...
29
- ✅ Successfully synced stack.ts
30
- ⏳ Syncing switch.ts...
31
- ✅ Successfully synced switch.ts
32
- ⏳ Syncing tag.ts...
33
- ✅ Successfully synced tag.ts
34
- ⏳ Syncing toast.ts...
35
- ✅ Successfully synced toast.ts
36
- 
37
- ✨ Type synchronization complete! Updated 12 files.
38
- 
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
- CLI Building entry: src/index.ts
45
- CLI Using tsconfig: tsconfig.json
46
- CLI tsup v8.5.1
47
- CLI Target: esnext
48
- CLI Cleaning output folder
49
- ESM Build start
50
- CJS Build start
51
- ESM dist/index.js 12.34 KB
52
- ESM ⚡️ Build success in 67ms
53
- CJS dist/index.cjs 16.32 KB
54
- CJS ⚡️ Build success in 68ms
55
- DTS Build start
56
- DTS ⚡️ Build success in 2954ms
57
- DTS dist/index.d.ts 208.74 KB
58
- DTS dist/index.d.cts 208.74 KB
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
@@ -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
- })
@@ -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
- }
@@ -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 }