Skip to content

Commit

Permalink
Added support for both es and cjs modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miloš Brajević committed Nov 6, 2019
1 parent 6ef2284 commit 6e256af
Show file tree
Hide file tree
Showing 27 changed files with 32 additions and 341 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,7 @@ dist

# TernJS port file
.tern-port

# Build-generated files
es
lib
3 changes: 0 additions & 3 deletions handler.js

This file was deleted.

3 changes: 0 additions & 3 deletions index.js

This file was deleted.

3 changes: 0 additions & 3 deletions link.js

This file was deleted.

16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{
"name": "next-universal-route",
"version": "0.6.1",
"version": "0.7.0",
"description": "Universal Next.js Route",
"main": "index.js",
"main": "./lib/index.js",
"module": "./es/index.js",
"modules.root": "./es",
"types": "./lib/index.d.ts",
"author": "Miloš Brajević <[email protected]>",
"repository": "brajevicm/next-universal-route",
"license": "MIT",
"scripts": {
"lint": "tslint -c tslint.json --project tsconfig.json",
"test": "jest --config jest.config.json && codecov",
"test:watch": "jest --config jest.config.json --watchAll",
"build": "rimraf ./dist && tsc"
"build": " rimraf ./dist && npm run build:es && npm run build:lib",
"build:es": "tsc --module es2015 --target es5 --outDir es",
"build:lib": "tsc --module commonjs --target es5 --outDir lib"
},
"typings": "./dist/index.d.ts",
"keywords": [
"react",
"next",
Expand Down Expand Up @@ -46,8 +50,8 @@
"typescript": "^3.6.4"
},
"peerDependencies": {
"next": "^9",
"react": "^16"
"next": ">=2",
"react": "^15.4.2 || ^16"
},
"dependencies": {
"path-to-regexp": "^3.1.0",
Expand Down
3 changes: 0 additions & 3 deletions router.js

This file was deleted.

36 changes: 0 additions & 36 deletions src/Link.tsx

This file was deleted.

52 changes: 0 additions & 52 deletions src/NextRoute.ts

This file was deleted.

119 changes: 0 additions & 119 deletions src/Route.ts

This file was deleted.

46 changes: 0 additions & 46 deletions src/Router.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/Routes.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/getRequestHandler.ts

This file was deleted.

6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Link } from './lib/Link';
import { Router } from './lib/Router';
import { Route } from './lib/Route';
import { getRequestHandler } from './lib/getRequestHandler';

export { getRequestHandler, Route, Router, Link };
27 changes: 0 additions & 27 deletions src/lib/deepClone.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions tests/Route.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Routes } from './../src/Routes';
import { Route } from '../src/Route';
import { Route } from '../src/lib/Route';

test('should construct NextRoute', () => {
const testRoute = new Route('/', 'index');
Expand Down
Loading

0 comments on commit 6e256af

Please sign in to comment.