Skip to content

Commit

Permalink
feat: It was compiled to javascript and the gland.d.ts file was delet…
Browse files Browse the repository at this point in the history
…ed in the types section. Added dist directory to gitignore and lib directory to npmignore
  • Loading branch information
m-mdy-m committed Aug 25, 2024
1 parent 87f2781 commit 31bb82a
Show file tree
Hide file tree
Showing 17 changed files with 265 additions and 66 deletions.
14 changes: 11 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/node_modules
dist
/dist
# Node modules
/node_modules/

# Compiled output
/dist/

# Logs
*.log

# Environment variables
.env
21 changes: 19 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Node modules
node_modules/

# Source directories (if included in the build output)
lib/

# Test and example directories
examples/
tests/

# Documentation
docs/
.github/
.prettierrc

# Git files
.git/

# Environment files
.env

# Local configuration files
.prettierrc
.eslintrc
2 changes: 1 addition & 1 deletion examples/CRUD/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import gland, { Context } from '../../';
import gland, { Context } from '../../dist';
const app = new gland();

// Define a dynamic route with `all` method
Expand Down
6 changes: 0 additions & 6 deletions examples/CRUD/db/db.json

This file was deleted.

Empty file added examples/CRUD/db/index.json
Empty file.
181 changes: 177 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.

5 changes: 4 additions & 1 deletion examples/CRUD/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"ejs": "^3.1.10"
},
"dependencies": {
"glands": "^1.0.2"
"@types/node": "^22.5.0",
"glands": "^1.0.3",
"ts-node": "^10.9.2",
"typescript": "^5.5.4"
}
}
2 changes: 1 addition & 1 deletion examples/CRUD/router/crud.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { exposed, Get, Route, Delete, Post, Put, Context } from '../../../index';
import { exposed, Get, Route, Delete, Post, Put, Context } from '../../../lib';
import p from 'path';
import * as fs from 'fs';
const db = p.join(__dirname, '..', 'db', 'db.json');
Expand Down
3 changes: 1 addition & 2 deletions examples/CRUD/test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import gland, { Context } from 'glands';
import { NxtFunction } from '../../lib/types';
import gland, { Context, NxtFunction } from 'glands';
const g = new gland();
async function log(ctx: Context, nxt: NxtFunction) {
console.log('Hello World');
Expand Down
2 changes: 1 addition & 1 deletion lib/core/middleware/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ServerUtils } from '../../helper';
import { Context, MidsFn, NxtFunction } from '../../types';
import { Gland } from '../../types/gland';
import { Gland } from '../../types';
import { Router } from '../router';
export namespace Gmid {
let mids: MidsFn[] = [];
Expand Down
2 changes: 1 addition & 1 deletion lib/core/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Parser } from '../../helper/parser';
import Reflect from '../../metadata';
import { METHODS } from 'http';
import { Context, RouteHandler } from '../../types';
import { Gland } from '../../types/gland';
import { Gland } from '../../types';
import { Gmid } from '../middleware';
export const routes: Map<string, RouteHandler> = new Map();
const methods = METHODS.reduce((acc: Record<string, Function>, method: string) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/core/server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IncomingMessage, Server, ServerResponse, METHODS } from 'http';
import { Parser } from '../helper/parser';
import { Gland } from '../types/gland';
import { Gland } from '../types';
import { ServerUtils } from '../helper';
import { WebContext } from './context';
import { Router } from './router';
Expand Down
2 changes: 1 addition & 1 deletion lib/helper/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { METHODS } from 'http';
import { Gland } from '../types/gland';
import { Gland } from '../types';
import { Logger } from './logger';
import { MidsFn } from '../types';
import { extname } from 'path';
Expand Down
39 changes: 0 additions & 39 deletions lib/types/gland.d.ts

This file was deleted.

Loading

0 comments on commit 31bb82a

Please sign in to comment.