Skip to content

Commit c675b26

Browse files
committed
feat: deprecate serve and start commands; update handlers and tsconfig references
1 parent 517cd50 commit c675b26

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

packages/tools/cli/src/commands/serve.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import { ObjectQL } from '@objectql/core';
1010
import { SqlDriver } from '@objectql/driver-sql';
1111
import { ObjectLoader, loadModules } from '@objectql/platform-node';
12-
import { createNodeHandler, createGraphQLHandler } from '@objectql/server';
12+
// import { createNodeHandler, createGraphQLHandler } from '@objectql/server';
1313
import { createServer } from 'http';
1414
import * as path from 'path';
1515
import * as fs from 'fs';
@@ -129,10 +129,12 @@ export async function serve(options: {
129129
}
130130

131131
// 3. Create Handler
132-
const internalHandler = createNodeHandler(app);
133-
const graphqlHandler = createGraphQLHandler(app);
132+
// const internalHandler = createNodeHandler(app);
133+
// const graphqlHandler = createGraphQLHandler(app);
134+
throw new Error('This command is deprecated. Please use "objectstack serve" instead.');
134135

135136
// 4. Start Server
137+
/*
136138
const server = createServer(async (req, res) => {
137139
// Serve API Docs at Root (Default)
138140
if (req.method === 'GET' && (req.url === '/' || req.url === '/docs' || req.url === '/docs/')) {
@@ -191,4 +193,5 @@ export async function serve(options: {
191193
};
192194
193195
tryListen(startPort);
196+
*/
194197
}

packages/tools/cli/src/commands/start.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import { ObjectQL } from '@objectql/core';
1010
import { SqlDriver } from '@objectql/driver-sql';
1111
import { ObjectLoader, loadModules } from '@objectql/platform-node';
12-
import { createNodeHandler } from '@objectql/server';
12+
// import { createNodeHandler } from '@objectql/server';
1313
import { createServer } from 'http';
1414
import * as path from 'path';
1515
import * as fs from 'fs';
@@ -103,8 +103,10 @@ export async function start(options: StartOptions) {
103103
}
104104

105105
// Create Handler
106-
const handler = createNodeHandler(app);
106+
// const handler = createNodeHandler(app);
107+
throw new Error('This command is deprecated. Please use "objectstack serve" instead.');
107108

109+
/*
108110
// Start Server
109111
const server = createServer(async (req, res) => {
110112
await handler(req, res);
@@ -124,4 +126,5 @@ export async function start(options: StartOptions) {
124126
});
125127
});
126128
});
129+
*/
127130
}

packages/tools/cli/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{ "path": "../../foundation/types" },
1010
{ "path": "../../foundation/plugin-validator" },
1111
{ "path": "../../foundation/core" },
12-
{ "path": "../../runtime/server" },
12+
{ "path": "../../protocols/rest" },
1313
{ "path": "../../foundation/platform-node" },
1414
{ "path": "../../drivers/sql" }
1515
]

0 commit comments

Comments
 (0)