0.1.5 • Published 4 years ago

@typedefs/goa v0.1.5

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

@goa/koa

npm version

This is the source code for the @goa/koa repository that actually compiles this source code. Please navigate there for the documentation.

@goa/koa is the Koa web-sever compiled and optimised with Google Closure Compiler so that it has only 1 dependency (mime-db, for easy access to upgrades). The types are written as JSDoc and don't require installing typings. The aim of this project is to demonstrate how to modernise the old-school NPM package making, including starting to use import/export statements without Babel, restoring to pure JSDoc without TypeScript, and compiling the code into the single executable using the compiler, and testing the code with Zoroaster testing framework which is twice as fast and weighs 500KB against 50MB compared with Jest (as used in the original repository).

yarn add @goa/koa

Table Of Contents

Goa

Goa is the same application, as Koa. It has the same interface for the app object, as well as context, request and response API.

import Goa from '@goa/goa'

const app = new Goa()
app.use((ctx) => {
  ctx.body = 'hello world'
})
hello world

Types

The types detailed information can be found here. This is a detailed breakdown of type annotations that was used for compilation, therefore it's rather raw because it's meant for generates externs and typedefs for JSDoc. The Koa documentation can be found on its page.

Packages

The Koa dependencies as packages had to be rewritten in ES6. Some of them were created as separate packages, and some were included in the source code (repository) in the modules directory.

DependencyType
cache-content-typemodule
content-dispositionmodule
delegatesmodule
ee-firstmodule
error-injectmodule
escape-htmlmodule
freshmodule
http-assertmodule
http-errorsmodule
koa-composemodule
koa-is-jsonmodule
on-finishedmodule
onlymodule
parseurlmodule
statusesmodule

The external modules were created with tests also written to ensure their source and compiled versions work as expected.

DependencyDepDescription
@goa/acceptsdevHigher-Level Content Negotiation.
@goa/content-typedevCreate and parse HTTP Content-Type header according to RFC 7231.
@goa/cookiesdevSigned And Unsigned Cookies Based On Keygrip.
@goa/is-generator-functiondevChecks If The Function Is An ES6 Generator.
@goa/mime-typesdevThe Ultimate Javascript Content-Type Utility.
@goa/negotiatordevHTTP Content Negotiation.
@goa/type-isdevInfer The Content-Type Of A Request.
@goa/varydevManipulate The HTTP Vary header.
@idio/debugdevLog Debugging Information.
mime-dbprodInstalled Via @goa/mime-types.

Tests

The tests were updated for context testing and include all original Koa tests.

View 326 tests

Copyright

The Koa web server by its authors.


0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago