UNPKG

4.86 kBMarkdownView Raw
1# NodeJS / TypeScript Readium-2 "test app"
2
3Electron / NodeJS implementation (written in TypeScript) of a test app for the Readium2 architecture ( https://github.com/readium/architecture/ ).
4
5[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](/LICENSE)
6
7## Build status
8
9[![NPM](https://img.shields.io/npm/v/r2-testapp-js.svg)](https://www.npmjs.com/package/r2-testapp-js) [![David](https://david-dm.org/readium/r2-testapp-js/status.svg)](https://david-dm.org/readium/r2-testapp-js) [![Travis](https://travis-ci.org/readium/r2-testapp-js.svg?branch=develop)](https://travis-ci.org/readium/r2-testapp-js)
10
11[Changelog](/CHANGELOG.md)
12
13## Downloadable executables
14
15Please note that this application is a test bed for Readium2 components, this is not aimed at end-users.
16This is not a full reading system, just a basic reader interface.
17Notably, this application lacks a local bookshelf, and a feed explorer for remote publications (OPDS).
18
19The pre-releases application installers/executables labelled "continuous test build" are generated automatically by TravisCI ( https://travis-ci.org/readium/r2-testapp-js ).
20
21https://github.com/readium/r2-testapp-js/releases
22
23## Prerequisites
24
251) https://nodejs.org NodeJS >= 8, NPM >= 5 (check with command line `node --version` and `npm --version`)
262) OPTIONAL: https://yarnpkg.com Yarn >= 1.0 (check with command line `yarn --version`)
27
28## GitHub repository
29
30https://github.com/readium/r2-testapp-js
31
32There is no [github.io](https://readium.github.io/r2-testapp-js) site for this project (no [gh-pages](https://github.com/readium/r2-testapp-js/tree/gh-pages) branch).
33
34## NPM package
35
36https://www.npmjs.com/package/r2-testapp-js
37
38Command line install:
39
40`npm install r2-testapp-js`
41OR
42`yarn add r2-testapp-js`
43
44...or manually add in your `package.json`:
45```json
46 "dependencies": {
47 "r2-testapp-js": "latest"
48 }
49```
50
51The JavaScript code distributed in the NPM package is usable as-is (no transpilation required), as it is automatically-generated from the TypeScript source.
52
53Several ECMAScript flavours are provided out-of-the-box: ES5, ES6-2015, ES7-2016, ES8-2017:
54
55https://unpkg.com/r2-testapp-js/dist/
56
57(alternatively, GitHub mirror with semantic-versioning release tags: https://github.com/edrlab/r2-testapp-js-dist/tree/develop/dist/ )
58
59The JavaScript code is not bundled, and it uses `require()` statement for imports (NodeJS style).
60
61More information about NodeJS compatibility:
62
63http://node.green
64
65Note that web-browser Javascript is currently not supported (only NodeJS runtimes).
66
67The type definitions (aka "typings") are included as `*.d.ts` files in `./node_modules/r2-testapp-js/dist/**`, so this package can be used directly in a TypeScript project.
68
69## Dependencies
70
71https://david-dm.org/readium/r2-testapp-js
72
73A [package-lock.json](https://github.com/readium/r2-testapp-js/blob/develop/package-lock.json) is provided (modern NPM replacement for `npm-shrinkwrap.json`).
74
75A [yarn.lock](https://github.com/readium/r2-testapp-js/blob/develop/yarn.lock) file is currently *not* provided at the root of the source tree.
76
77## Continuous Integration
78
79https://travis-ci.org/readium/r2-testapp-js
80
81TravisCI builds are triggered automatically at every Git "push" in the `develop` branch.
82
83## Version(s), Git revision(s)
84
85NPM package (latest published):
86
87https://unpkg.com/r2-testapp-js/dist/gitrev.json
88
89Alternatively, GitHub mirror with semantic-versioning release tags:
90
91https://raw.githack.com/edrlab/r2-testapp-js-dist/develop/dist/gitrev.json
92
93## Developer quick start
94
95Command line steps (NPM, but similar with YARN):
96
971) `cd r2-testapp-js`
982) `git status` (please ensure there are no local changes, especially in `package-lock.json` and the dependency versions in `package.json`)
993) `rm -rf node_modules` (to start from a clean slate)
1004) `npm install`, or alternatively `npm ci` (both commands initialize the `node_modules` tree of package dependencies, based on the strict `package-lock.json` definition)
1015) `npm run build:all` (invoke the main build script: clean, lint, compile)
1026) `ls dist` (that's the build output which gets published as NPM package)
1037) `npm run electron` (use the menu to open bundled EPUBs, or to choose arbitrary publications from the filesystem)
1048) `npm run electron PATH_TO_PACKED_OR_EXPLODED_EPUB_FILE_OR_URI` (gets added to the graphical menu, for re-use later)
105
106## Documentation
107
108See:
109
110https://github.com/readium/r2-navigator-js/blob/develop/README.md#documentation
111
112https://github.com/readium/r2-streamer-js/blob/develop/README.md#documentation
113
114https://github.com/readium/r2-opds-js/blob/develop/README.md#documentation
115
116https://github.com/readium/r2-shared-js/blob/develop/README.md#documentation
117
118https://github.com/readium/r2-lcp-js/blob/develop/README.md#documentation
119
120https://github.com/readium/r2-utils-js/blob/develop/README.md#documentation