Skip to content

Commit 8231117

Browse files
committed
Remove LiquidJS views and related server code
Eliminates LiquidJS templating and all server-side view files, controllers, and dependencies. The server now serves only static assets and API endpoints, simplifying the backend and removing unused view logic.
1 parent 71fc10d commit 8231117

File tree

10 files changed

+12
-1050
lines changed

10 files changed

+12
-1050
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"examples/*"
77
],
88
"scripts": {
9+
"start": "npm run start --workspace=@objectql/server",
910
"server": "npm run dev --workspace=@objectql/server",
1011
"client": "npm run dev --workspace=@objectql/client",
1112
"build": "tsc -b && npm run build --workspaces",

packages/server/nest-cli.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
"collection": "@nestjs/schematics",
44
"sourceRoot": "src",
55
"compilerOptions": {
6-
"deleteOutDir": true,
7-
"assets": [
8-
{
9-
"include": "views/**/*",
10-
"watchAssets": true
11-
}
12-
]
6+
"deleteOutDir": true
137
}
148
}

packages/server/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"start": "nest start",
99
"start:debug": "nest start --debug --watch",
1010
"start:prod": "node dist/main",
11-
"test": "echo \"No tests specified\" && exit 0"
11+
"test": "echo \"No tests specified\" && exit 0",
12+
"build:client": "npm run build --workspace=@objectql/client"
1213
},
1314
"dependencies": {
1415
"@example/project-management": "*",
@@ -22,7 +23,6 @@
2223
"@objectql/driver-knex": "*",
2324
"@objectql/driver-mongo": "*",
2425
"better-auth": "^1.4.10",
25-
"liquidjs": "^10.24.0",
2626
"pg": "^8.11.3",
2727
"reflect-metadata": "^0.1.13",
2828
"rxjs": "^7.8.1"

packages/server/src/app.module.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Module, MiddlewareConsumer, RequestMethod } from '@nestjs/common';
22
import { AppController } from './app.controller';
33
import { AppService } from './app.service';
4-
import { ViewsController } from './views/views.controller';
54
import { ObjectQLModule } from './objectql/objectql.module';
65
import { AuthModule } from './auth/auth.module';
76
import { ServeStaticModule } from '@nestjs/serve-static';
@@ -12,12 +11,11 @@ import { join } from 'path';
1211
ObjectQLModule,
1312
AuthModule,
1413
ServeStaticModule.forRoot({
15-
rootPath: join(__dirname, '../../ui/dist'),
16-
serveRoot: '/assets/ui',
17-
renderPath: '/assets/ui/*' // Prevent fallback to index.html for api or other routes
14+
rootPath: join(__dirname, '../../client/dist'),
15+
exclude: ['/api/(.*)', '/docs/(.*)'],
1816
}),
1917
],
20-
controllers: [AppController, ViewsController],
18+
controllers: [AppController],
2119
providers: [AppService],
2220
})
2321
export class AppModule {}

packages/server/src/main.ts

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,14 @@
11
import { NestFactory } from '@nestjs/core';
22
import { AppModule } from './app.module';
3-
import { NestExpressApplication } from '@nestjs/platform-express';
4-
import { Liquid } from 'liquidjs';
5-
import { join, resolve } from 'path';
6-
import { existsSync } from 'fs';
73

84
async function bootstrap() {
9-
const app = await NestFactory.create<NestExpressApplication>(AppModule);
5+
const app = await NestFactory.create(AppModule);
106

11-
// Try to find views directory in likely locations
12-
let viewsPath = join(__dirname, 'views');
13-
if (!existsSync(viewsPath)) {
14-
const upOne = join(__dirname, '..', 'views');
15-
if (existsSync(upOne)) {
16-
viewsPath = upOne;
17-
}
18-
}
19-
20-
console.log('Views path resolved to:', viewsPath);
21-
22-
const engine = new Liquid({
23-
root: viewsPath,
24-
extname: '.liquid'
7+
app.enableCors({
8+
origin: ['http://localhost:5173', 'http://localhost:3000'],
9+
credentials: true
2510
});
26-
app.engine('liquid', engine.express());
27-
app.setViewEngine('liquid');
28-
app.setBaseViewsDir(viewsPath);
29-
11+
3012
// NestJS by default listens on 3000
3113
await app.listen(3000);
3214
console.log(`Application is running on: ${await app.getUrl()}`);

0 commit comments

Comments
 (0)