Skip to content

Commit

Permalink
fix: change project structre and fix support ES6 module
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mdy-m committed Aug 25, 2024
1 parent 9b4c897 commit 87f2781
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/node_modules
/node_modules
dist
/dist
8 changes: 4 additions & 4 deletions examples/CRUD/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/CRUD/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"ejs": "^3.1.10"
},
"dependencies": {
"glands": "^1.0.1"
"glands": "^1.0.2"
}
}
3 changes: 1 addition & 2 deletions lib/core/server.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { IncomingMessage, Server, ServerResponse } from 'http';
import { IncomingMessage, Server, ServerResponse, METHODS } from 'http';
import { Parser } from '../helper/parser';
import { Gland } from '../types/gland';
import { ServerUtils } from '../helper';
import { WebContext } from './context';
import { Router } from './router';
import { LoadModules } from '../helper/load';
import { Context } from '../types';
import { METHODS } from 'http';
import { midManager } from './middleware';
export class WebServer extends Server implements Gland.Listener, Gland.APP {
private middlewares: Gland.Middleware[] = [];
Expand Down
14 changes: 7 additions & 7 deletions index.ts → lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { WebServer } from './lib/core/server';
import { Qiu } from './lib/cli/Qiu';
import { DbTypes, Context } from './lib/types';
import { Logger } from './lib/helper/logger';
import { exposed, Route } from './lib/core/decorators';
import { Delete, Get, Head, Options, Patch, Post, Put } from './lib/core/router/index';
import { NxtFunction } from './lib/types/index';
import { WebServer } from './core/server';
import { Qiu } from './cli/Qiu';
import { DbTypes, Context } from './types';
import { Logger } from './helper/logger';
import { exposed, Route } from './core/decorators';
import { Delete, Get, Head, Options, Patch, Post, Put } from './core/router/index';
import { NxtFunction } from './types/index';
export { Context, NxtFunction };
export default class gland extends WebServer {
constructor() {
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "glands",
"version": "1.0.2",
"version": "1.0.3",
"description": "Glands is a lightweight framework for Node.js designed for simplicity and high performance.",
"main": "index.ts",
"main": "lib/index.ts",
"type": "module",
"types": "index.ts",
"directories": {
"doc": "docs",
"lib": "lib",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"resolveJsonModule": true,
"typeRoots": ["node_modules/@types", "lib/types"]
},
"include": ["lib/**/*.ts", "/*.ts", "lib/types/gland.d.ts"]
"include": ["lib/**/*.ts", "lib/types/*.d.ts"],
"exclude": ["node_modules", "dist"]
}

0 comments on commit 87f2781

Please sign in to comment.