Skip to content

Commit

Permalink
1.2.0-alpha.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yakovmeister authored and Jacob Baring committed Jul 29, 2018
1 parent 2f7502f commit 68e9c8f
Show file tree
Hide file tree
Showing 19 changed files with 781 additions and 339 deletions.
9 changes: 0 additions & 9 deletions .babelrc

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/node_modules
/package-lock.json
*.log*
*.log*
.nyc_output
.rpt2_cache
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/src
/test
.nyc_output
.rpt2_cache
.travis.yml
.gitignore
rollup.config.js
tsconfig.json
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
language: node_js
node_js:
- 7.10.0
- 8.0.0
- 9.1.0
1 change: 1 addition & 0 deletions dist/index.min.js

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

116 changes: 0 additions & 116 deletions dist/router.js

This file was deleted.

47 changes: 0 additions & 47 deletions dist/router.js.map

This file was deleted.

24 changes: 24 additions & 0 deletions dist/src/router.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* A recursive function that takes a required route as an argument,
* then calls itself if it's an array, otherwise returns the
* translated route.
* @param {mixed} route array or object containing the route information
* @param {func} middleware middleware of the endpoint/group
* @param {string} prefix prepended to the beginning of endpoint
* @returns object containing the translated route
*/
export declare function routeTranslator(route: any, middleware?: any, prefix?: any): any;
/**
* Flatten your route, takes care of your middleware and everything.
* @param routes
* @return Array
*/
export declare function transformRoutes(routes: any): any;
/**
* takes a restify server as an argument, returns a function
* that takes an array of object.
* @param {Server} server restify server
* @param {boolean} verbose log routing
* @returns routing function
*/
export default function configureRoutes(server: any, verbose?: boolean, logger?: (message?: any, ...optionalParams: any[]) => void): (routes: any) => void;
29 changes: 29 additions & 0 deletions dist/src/sorts.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* sorts the given routes
* @param {array} routes array of routes
* @returns sorted routes
*/
export declare function sortRoutes(routes: Array<any>): any;
/**
* Group sorted routes based on wildcards
* @param routes
* @return grouped routes
*/
export declare function groupSortWildcards(routes: Array<any>): any;
/**
* function for sorting based on slash count
* @param previous previous element
* @param current current element
*/
export declare function slashCount(previous: any, current: any): number;
/**
* Group routes based on its slash count
* @param array routes
*/
export declare function groupBySlashes(array: Array<any>): any;
/**
* function for sorting based on wildcards
* @param previous previous element
* @param current current element
*/
export declare function wildCard(previous: any, current: any): number;
1 change: 1 addition & 0 deletions dist/test/router.test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 0 additions & 1 deletion index.js

This file was deleted.

60 changes: 38 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,55 @@
{
"name": "restify-route-config",
"version": "0.1.0",
"description": "",
"main": "index.js",
"name": "restify-router-config",
"version": "1.2.0-alpha.0",
"description": "The laziest way to route your restify app.",
"main": "dist/index.min.js",
"types": "dist/src/router.d.ts",
"scripts": {
"clean:assets": "rimraf ./public/assets",
"postinstall": "npm run compile",
"clean": "rm -rf dist && mkdir dist",
"clean:compile": "rm -rf dist/compiled",
"compile:babel": "babel-compile -p env src:dist",
"compile:minify": "minify dist/compiled -d dist",
"compile": "npm run clean && npm run compile:babel",
"dev": "nodemon server.js --exec babel-node --presets=env,stage-0,stage-1,stage-2 --watch",
"test": "_mocha test --require babel-polyfill --require babel-register"
"test": "nyc --check-coverage --lines 10 mocha -r ts-node/register test/**.test.ts",
"rollup": "rollup -c",
"clean": "rimraf ./dist",
"build": "npm run clean && npm run rollup"
},
"keywords": [
"restify",
"restify-router",
"express",
"express-router-config",
"express-router",
"router",
"config",
"react",
"inspired"
],
"nyc": {
"include": [
"src/**/*.ts"
],
"extension": [
".ts",
".tsx"
],
"require": [
"ts-node/register"
]
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-compile": "^2.0.0",
"babel-core": "^6.26.0",
"babel-minify": "^0.2.0",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-0": "^6.24.1",
"babel-preset-stage-1": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"@types/chai": "^4.1.3",
"@types/mocha": "^5.2.0",
"@types/node": "^10.1.0",
"@types/restify": "^7.2.0",
"chai": "^4.1.2",
"mocha": "^5.1.1",
"nyc": "^11.8.0",
"rimraf": "^2.6.2",
"xo": "^0.18.2"
"rollup": "^0.58.2",
"rollup-plugin-alias": "^1.4.0",
"rollup-plugin-typescript2": "^0.14.0",
"rollup-plugin-uglify": "^4.0.0",
"ts-node": "^6.0.3",
"typescript": "^2.8.3",
"uglify-js": "^3.3.25"
}
}
Loading

0 comments on commit 68e9c8f

Please sign in to comment.