File tree Expand file tree Collapse file tree
packages/tools/cli/src/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 * LICENSE file in the root directory of this source tree.
77 */
88
9- import { ObjectQL } from '@objectql/core' ;
109import { ObjectLoader } from '@objectql/platform-node' ;
10+ import { MetadataRegistry } from '@objectql/types' ;
1111import { generateTypes } from './generate' ;
1212import * as path from 'path' ;
1313import * as fs from 'fs' ;
@@ -36,8 +36,8 @@ export async function build(options: BuildOptions) {
3636 console . log ( chalk . cyan ( '1️⃣ Validating metadata files...' ) ) ;
3737
3838 try {
39- const app = new ObjectQL ( { datasources : { } } ) ;
40- const loader = new ObjectLoader ( app . metadata ) ;
39+ const registry = new MetadataRegistry ( ) ;
40+ const loader = new ObjectLoader ( registry ) ;
4141 loader . load ( rootDir ) ;
4242 console . log ( chalk . green ( ' ✅ Metadata validation passed\n' ) ) ;
4343 } catch ( e : any ) {
Original file line number Diff line number Diff line change 66 * LICENSE file in the root directory of this source tree.
77 */
88
9- import { ObjectQL } from '@objectql/core' ;
109import { ObjectLoader } from '@objectql/platform-node' ;
11- import { ObjectConfig , FieldConfig } from '@objectql/types' ;
10+ import { MetadataRegistry , ObjectConfig , FieldConfig } from '@objectql/types' ;
1211import * as path from 'path' ;
1312import chalk from 'chalk' ;
1413
@@ -31,13 +30,13 @@ export async function lint(options: LintOptions) {
3130 let hasWarnings = false ;
3231
3332 try {
34- const app = new ObjectQL ( { datasources : { } } ) ;
35- const loader = new ObjectLoader ( app . metadata ) ;
33+ const registry = new MetadataRegistry ( ) ;
34+ const loader = new ObjectLoader ( registry ) ;
3635
3736 console . log ( chalk . cyan ( 'Loading metadata files...' ) ) ;
3837 loader . load ( rootDir ) ;
3938
40- const objects = app . metadata . list ( 'object' ) ;
39+ const objects = registry . list ( 'object' ) ;
4140
4241 console . log ( chalk . green ( `✅ Found ${ objects . length } object(s)\n` ) ) ;
4342
Original file line number Diff line number Diff line change @@ -73,7 +73,8 @@ export async function startRepl(configPath?: string) {
7373 r . context . object = ( name : string ) => app . getObject ( name ) ;
7474
7575 // Helper to get a repo quickly: tasks.find() instead of app.object('tasks').find()
76- const objects = app . metadata . list < { name : string } > ( 'object' ) ;
76+ const configs = app . getConfigs ( ) ;
77+ const objects = Object . values ( configs ) as Array < { name : string } > ;
7778 for ( const obj of objects ) {
7879 // Inject repositories as top-level globals if valid identifiers
7980 if ( / ^ [ a - z A - Z _ $ ] [ a - z A - Z 0 - 9 _ $ ] * $ / . test ( obj . name ) ) {
You can’t perform that action at this time.
0 commit comments