Skip to content

Commit

Permalink
Merge pull request #2 from xinpianchang/thy
Browse files Browse the repository at this point in the history
Thy
  • Loading branch information
dailynodejs authored Aug 25, 2020
2 parents 294ecb2 + 4bbbe67 commit b48faa8
Show file tree
Hide file tree
Showing 55 changed files with 24 additions and 4 deletions.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified app.d.ts
100644 → 100755
Empty file.
Empty file modified app.js
100644 → 100755
Empty file.
Empty file modified config.d.ts
100644 → 100755
Empty file.
Empty file modified config.js
100644 → 100755
Empty file.
Empty file modified deferred.d.ts
100644 → 100755
Empty file.
Empty file modified deferred.js
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var child_process = require('child_process')
child_process.exec('npm run dev')
Empty file modified getstate.d.ts
100644 → 100755
Empty file.
Empty file modified getstate.js
100644 → 100755
Empty file.
Empty file modified jest.config.js
100644 → 100755
Empty file.
Empty file modified layout.d.ts
100644 → 100755
Empty file.
Empty file modified layout.js
100644 → 100755
Empty file.
11 changes: 8 additions & 3 deletions package.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "next-koa",
"version": "2.0.3",
"version": "2.1.0",
"description": "A koa middleware and some tools for next.js",
"main": "dist/server/index.js",
"types": "dist/server/index.d.ts",
"scripts": {
"dev": "node -r ./test/next-koa/server/register ./node_modules/.bin/micro-dev ./test/next-koa/server/index.ts -p 8008 --silent --watch ./test/next-koa/server",
"test": "HEADLESS=true jest",
"type-check": "tsc --noEmit",
"type-check:watch": "npm run type-check -- --watch",
Expand Down Expand Up @@ -45,6 +46,10 @@
"layout.js"
],
"devDependencies": {
"@babel/runtime-corejs2": "^7.8.7",
"micro": "^9.3.4",
"micro-dev": "^3.0.0",
"@babel/register": "^7.8.6",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.6",
"@babel/plugin-proposal-class-properties": "^7.8.3",
Expand Down Expand Up @@ -91,13 +96,13 @@
},
"dependencies": {
"delegates": "^1.0.0",
"next-transpile-modules": "^3.0.2"
"next-transpile-modules": "4.1.0"
},
"engines": {
"node": ">= 8.0.0"
},
"peerDependencies": {
"koa": "^2.11.0",
"next": "^9.2.2"
"next": "9.5.2"
}
}
Empty file modified plugin.js
100644 → 100755
Empty file.
Empty file modified redirect.d.ts
100644 → 100755
Empty file.
Empty file modified redirect.js
100644 → 100755
Empty file.
Empty file modified src/client/.babelrc
100644 → 100755
Empty file.
Empty file modified src/client/config.ts
100644 → 100755
Empty file.
Empty file modified src/client/deferred.ts
100644 → 100755
Empty file.
Empty file modified src/client/delegates.d.ts
100644 → 100755
Empty file.
Empty file modified src/client/getstate.ts
100644 → 100755
Empty file.
Empty file modified src/client/layout.tsx
100644 → 100755
Empty file.
Empty file modified src/client/redirect.ts
100644 → 100755
Empty file.
Empty file modified src/pages/.babelrc
100644 → 100755
Empty file.
Empty file modified src/pages/app.tsx
100644 → 100755
Empty file.
Empty file modified src/server/.babelrc
100644 → 100755
Empty file.
Empty file modified src/server/index.ts
100644 → 100755
Empty file.
Empty file modified test/jest-environment.js
100644 → 100755
Empty file.
Empty file modified test/jest-global-setup.js
100644 → 100755
Empty file.
Empty file modified test/jest-global-teardown.js
100644 → 100755
Empty file.
Empty file modified test/jest.babelconfig.js
100644 → 100755
Empty file.
Empty file modified test/jest.setup.js
100644 → 100755
Empty file.
Empty file modified test/next-koa-test-utils.ts
100644 → 100755
Empty file.
Empty file modified test/next-koa/.babelrc
100644 → 100755
Empty file.
Empty file modified test/next-koa/layout/ItalicLayout.tsx
100644 → 100755
Empty file.
Empty file modified test/next-koa/layout/Layout.tsx
100644 → 100755
Empty file.
Empty file modified test/next-koa/layout/LayoutModel.ts
100644 → 100755
Empty file.
Empty file modified test/next-koa/next-env.d.ts
100644 → 100755
Empty file.
Empty file modified test/next-koa/next.config.js
100644 → 100755
Empty file.
Empty file modified test/next-koa/pages/_app.tsx
100644 → 100755
Empty file.
Empty file modified test/next-koa/pages/about.tsx
100644 → 100755
Empty file.
Empty file modified test/next-koa/pages/api/hello.ts
100644 → 100755
Empty file.
Empty file modified test/next-koa/pages/index.tsx
100644 → 100755
Empty file.
Empty file modified test/next-koa/pages/redirect.tsx
100644 → 100755
Empty file.
11 changes: 10 additions & 1 deletion test/next-koa/server/index.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import http from 'http'
import path from 'path'
import Router from 'koa2-router'

import { IncomingMessage, ServerResponse } from 'http'

const dir = path.resolve(__dirname, '..')

const app = new Koa()
Expand All @@ -29,4 +31,11 @@ const server = http.createServer(app.callback())
const port = process.env.PORT || 3000
server.listen(process.env.PORT || 3000, () => {
console.info('server is ready on port', port)
})
})


const callback = app.callback()

export default async (req: IncomingMessage, res: ServerResponse) => {
callback(req, res)
}
4 changes: 4 additions & 0 deletions test/next-koa/server/register.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require('@babel/register')({
extensions: ['.ts', '.tsx'],
sourceMaps: true,
})
Empty file modified test/next-koa/test/index.test.tsx
100644 → 100755
Empty file.
Empty file modified test/next-koa/tsconfig.json
100644 → 100755
Empty file.
Empty file modified test/next-test-utils.ts
100644 → 100755
Empty file.
Empty file modified test/next-webdriver.ts
100644 → 100755
Empty file.
Empty file modified test/tsconfig.json
100644 → 100755
Empty file.
Empty file modified tsconfig.json
100644 → 100755
Empty file.
Empty file modified tslint.json
100644 → 100755
Empty file.

0 comments on commit b48faa8

Please sign in to comment.