Skip to content

Commit bc021aa

Browse files
Copilothotlong
andcommitted
feat: Complete re-exports and validate package build (v4.0.0-alpha.1)
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 0c3fee3 commit bc021aa

5 files changed

Lines changed: 203 additions & 19 deletions

File tree

packages/foundation/types/TYPE_MIGRATION.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,22 @@ These types will be re-exported for backward compatibility but users should impo
5959
|----------------|--------------|----------------|------------------|
6060
| `FilterCondition` | query.ts | @objectstack/spec | ✅ Re-export added |
6161
| `RuntimePlugin` | config.ts | @objectstack/runtime | ✅ Re-export added |
62-
| `DriverInterface` | (none yet) | @objectstack/spec | ⏳ TODO |
63-
| `MetadataRegistry` | registry.ts | @objectstack/types | ⏳ TODO |
64-
| `ObjectConfig` | object.ts | @objectstack/types | ⏳ TODO |
65-
| `FieldConfig` | field.ts | @objectstack/types | ⏳ TODO |
66-
| `ObjectQLContext` | context.ts | @objectstack/types | ⏳ TODO |
67-
| `HookHandler` | hook.ts | @objectstack/runtime | ⏳ TODO |
68-
| `ActionHandler` | action.ts | @objectstack/runtime | ⏳ TODO |
69-
70-
**Status**: 2/9 re-exports added
62+
| `DriverInterface` | (none yet) | @objectstack/spec | ✅ Re-export added |
63+
| `RuntimeContext` | (none yet) | @objectstack/runtime | ✅ Re-export added |
64+
| `ObjectStackKernel` | (none yet) | @objectstack/runtime | ✅ Re-export added |
65+
| `ObjectStackRuntimeProtocol` | (none yet) | @objectstack/runtime | ✅ Re-export added |
66+
| `MetadataRegistry` | registry.ts | @objectstack/types | ⏳ When available in @objectstack |
67+
| `ObjectConfig` | object.ts | @objectstack/types | ⏳ When available in @objectstack |
68+
| `FieldConfig` | field.ts | @objectstack/types | ⏳ When available in @objectstack |
69+
| `ObjectQLContext` | context.ts | @objectstack/types | ⏳ When available in @objectstack |
70+
| `HookHandler` | hook.ts | @objectstack/runtime | ⏳ When available in @objectstack |
71+
| `ActionHandler` | action.ts | @objectstack/runtime | ⏳ When available in @objectstack |
72+
73+
**Status**: 6/12 re-exports added (50%)
74+
75+
**Note**: Some types (MetadataRegistry, ObjectConfig, etc.) are still defined in @objectql/types
76+
and will be moved to @objectstack packages in future releases. Re-exports will be added once
77+
the types are available in @objectstack.
7178

7279
---
7380

packages/foundation/types/package-lock.json

Lines changed: 33 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/foundation/types/src/index.ts

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,82 @@ export type { FilterCondition } from '@objectstack/spec';
7777
*/
7878
export type { RuntimePlugin } from '@objectstack/runtime';
7979

80-
// TODO: Add remaining re-exports in future commits
81-
// - DriverInterface from @objectstack/spec
82-
// - MetadataRegistry from @objectstack/types (when available)
83-
// - ObjectConfig from @objectstack/types (when available)
84-
// - FieldConfig from @objectstack/types (when available)
85-
// - ObjectQLContext from @objectstack/types (when available)
86-
// - HookHandler from @objectstack/runtime (when available)
87-
// - ActionHandler from @objectstack/runtime (when available)
80+
/**
81+
* @deprecated Import from @objectstack/spec directly.
82+
*
83+
* This re-export will be removed in v5.0.0.
84+
* Note: DriverInterface is the standard driver interface in @objectstack.
85+
* The legacy Driver interface in this package is kept for backward compatibility.
86+
*
87+
* @example
88+
* ```typescript
89+
* // Old (v3.x)
90+
* import { Driver } from '@objectql/types';
91+
*
92+
* // New (v4.0+ - recommended)
93+
* import { DriverInterface } from '@objectstack/spec';
94+
* ```
95+
*/
96+
export type { DriverInterface } from '@objectstack/spec';
97+
98+
/**
99+
* @deprecated Import from @objectstack/runtime directly.
100+
*
101+
* This re-export will be removed in v5.0.0.
102+
*
103+
* @example
104+
* ```typescript
105+
* // Old (v3.x)
106+
* import { RuntimeContext } from '@objectql/types';
107+
*
108+
* // New (v4.0+ - recommended)
109+
* import { RuntimeContext } from '@objectstack/runtime';
110+
* ```
111+
*/
112+
export type { RuntimeContext } from '@objectstack/runtime';
113+
114+
/**
115+
* @deprecated Import from @objectstack/runtime directly.
116+
*
117+
* This re-export will be removed in v5.0.0.
118+
*
119+
* @example
120+
* ```typescript
121+
* // Old (v3.x)
122+
* import { ObjectStackKernel } from '@objectql/types';
123+
*
124+
* // New (v4.0+ - recommended)
125+
* import { ObjectStackKernel } from '@objectstack/runtime';
126+
* ```
127+
*/
128+
export type { ObjectStackKernel } from '@objectstack/runtime';
129+
130+
/**
131+
* @deprecated Import from @objectstack/runtime directly.
132+
*
133+
* This re-export will be removed in v5.0.0.
134+
*
135+
* @example
136+
* ```typescript
137+
* // Old (v3.x)
138+
* import { ObjectStackRuntimeProtocol } from '@objectql/types';
139+
*
140+
* // New (v4.0+ - recommended)
141+
* import { ObjectStackRuntimeProtocol } from '@objectstack/runtime';
142+
* ```
143+
*/
144+
export type { ObjectStackRuntimeProtocol } from '@objectstack/runtime';
145+
146+
// Note: The following types are currently defined in @objectql/types but may
147+
// move to @objectstack packages in future releases:
148+
// - MetadataRegistry (may move to @objectstack/types)
149+
// - ObjectConfig (may move to @objectstack/types)
150+
// - FieldConfig (may move to @objectstack/types)
151+
// - ObjectQLContext (may move to @objectstack/types)
152+
// - HookHandler (may move to @objectstack/runtime)
153+
// - ActionHandler (may move to @objectstack/runtime)
154+
//
155+
// These will be added as re-exports once they are available in @objectstack packages.
88156

89157

90158
// ============================================================================

packages/foundation/types/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"rootDir": "./src"
66
},
77
"include": ["src/**/*"],
8+
"exclude": ["src/**/__tests__/**/*", "src/**/*.test.ts", "src/**/*.spec.ts"],
89
"references": []
910
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/bin/bash
2+
3+
echo "======================================================================"
4+
echo "ObjectQL Types Package - Build Validation"
5+
echo "======================================================================"
6+
echo ""
7+
8+
# Check if dist folder exists
9+
if [ ! -d "dist" ]; then
10+
echo "❌ ERROR: dist folder not found"
11+
exit 1
12+
fi
13+
14+
echo "✅ dist folder exists"
15+
16+
# Check main files
17+
if [ ! -f "dist/index.js" ]; then
18+
echo "❌ ERROR: dist/index.js not found"
19+
exit 1
20+
fi
21+
echo "✅ dist/index.js exists"
22+
23+
if [ ! -f "dist/index.d.ts" ]; then
24+
echo "❌ ERROR: dist/index.d.ts not found"
25+
exit 1
26+
fi
27+
echo "✅ dist/index.d.ts exists"
28+
29+
# Count re-exports
30+
echo ""
31+
echo "======================================================================"
32+
echo "Re-export Validation"
33+
echo "======================================================================"
34+
reexport_count=$(grep -c "export.*from.*@objectstack" dist/index.d.ts || true)
35+
echo "Re-exports from @objectstack: $reexport_count"
36+
37+
if [ "$reexport_count" -ge 6 ]; then
38+
echo "✅ Expected re-exports present (6+)"
39+
else
40+
echo "⚠️ Warning: Expected at least 6 re-exports, found $reexport_count"
41+
fi
42+
43+
# List re-exports
44+
echo ""
45+
echo "Re-exported types:"
46+
grep "export.*from.*@objectstack" dist/index.d.ts | sed 's/^/ - /'
47+
48+
# Check query-specific types
49+
echo ""
50+
echo "======================================================================"
51+
echo "Query-Specific Types Validation"
52+
echo "======================================================================"
53+
54+
for type in "UnifiedQuery" "Filter" "AggregateOption" "IntrospectedTable"; do
55+
if grep -q "$type" dist/query.d.ts 2>/dev/null || grep -q "$type" dist/driver.d.ts 2>/dev/null; then
56+
echo "$type found"
57+
else
58+
echo "⚠️ $type not found in expected files"
59+
fi
60+
done
61+
62+
# Package size
63+
echo ""
64+
echo "======================================================================"
65+
echo "Package Size"
66+
echo "======================================================================"
67+
total_size=$(du -sh dist | cut -f1)
68+
echo "Total dist size: $total_size"
69+
70+
# File count
71+
file_count=$(find dist -name "*.d.ts" | wc -l)
72+
echo "Type definition files: $file_count"
73+
74+
echo ""
75+
echo "======================================================================"
76+
echo "Build Validation Complete ✅"
77+
echo "======================================================================"

0 commit comments

Comments
 (0)