1 | # NodeJS / TypeScript Readium-2 "test app"
|
2 |
|
3 | Electron / 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 |
|
15 | Please note that this application is a test bed for Readium2 components, this is not aimed at end-users.
|
16 | This is not a full reading system, just a basic reader interface.
|
17 | Notably, this application lacks a local bookshelf, and a feed explorer for remote publications (OPDS).
|
18 |
|
19 | The pre-releases application installers/executables labelled "continuous test build" are generated automatically by TravisCI ( https://travis-ci.org/readium/r2-testapp-js ).
|
20 |
|
21 | https://github.com/readium/r2-testapp-js/releases
|
22 |
|
23 | ## Prerequisites
|
24 |
|
25 | 1) https://nodejs.org NodeJS >= 8, NPM >= 5 (check with command line `node --version` and `npm --version`)
|
26 | 2) OPTIONAL: https://yarnpkg.com Yarn >= 1.0 (check with command line `yarn --version`)
|
27 |
|
28 | ## GitHub repository
|
29 |
|
30 | https://github.com/readium/r2-testapp-js
|
31 |
|
32 | There 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 |
|
36 | https://www.npmjs.com/package/r2-testapp-js
|
37 |
|
38 | Command line install:
|
39 |
|
40 | `npm install r2-testapp-js`
|
41 | OR
|
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 |
|
51 | The JavaScript code distributed in the NPM package is usable as-is (no transpilation required), as it is automatically-generated from the TypeScript source.
|
52 |
|
53 | Several ECMAScript flavours are provided out-of-the-box: ES5, ES6-2015, ES7-2016, ES8-2017:
|
54 |
|
55 | https://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 |
|
59 | The JavaScript code is not bundled, and it uses `require()` statement for imports (NodeJS style).
|
60 |
|
61 | More information about NodeJS compatibility:
|
62 |
|
63 | http://node.green
|
64 |
|
65 | Note that web-browser Javascript is currently not supported (only NodeJS runtimes).
|
66 |
|
67 | The 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 |
|
71 | https://david-dm.org/readium/r2-testapp-js
|
72 |
|
73 | A [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 |
|
75 | A [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 |
|
79 | https://travis-ci.org/readium/r2-testapp-js
|
80 |
|
81 | TravisCI builds are triggered automatically at every Git "push" in the `develop` branch.
|
82 |
|
83 | ## Version(s), Git revision(s)
|
84 |
|
85 | NPM package (latest published):
|
86 |
|
87 | https://unpkg.com/r2-testapp-js/dist/gitrev.json
|
88 |
|
89 | Alternatively, GitHub mirror with semantic-versioning release tags:
|
90 |
|
91 | https://raw.githack.com/edrlab/r2-testapp-js-dist/develop/dist/gitrev.json
|
92 |
|
93 | ## Developer quick start
|
94 |
|
95 | Command line steps (NPM, but similar with YARN):
|
96 |
|
97 | 1) `cd r2-testapp-js`
|
98 | 2) `git status` (please ensure there are no local changes, especially in `package-lock.json` and the dependency versions in `package.json`)
|
99 | 3) `rm -rf node_modules` (to start from a clean slate)
|
100 | 4) `npm install`, or alternatively `npm ci` (both commands initialize the `node_modules` tree of package dependencies, based on the strict `package-lock.json` definition)
|
101 | 5) `npm run build:all` (invoke the main build script: clean, lint, compile)
|
102 | 6) `ls dist` (that's the build output which gets published as NPM package)
|
103 | 7) `npm run electron` (use the menu to open bundled EPUBs, or to choose arbitrary publications from the filesystem)
|
104 | 8) `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 |
|
108 | See:
|
109 |
|
110 | https://github.com/readium/r2-navigator-js/blob/develop/README.md#documentation
|
111 |
|
112 | https://github.com/readium/r2-streamer-js/blob/develop/README.md#documentation
|
113 |
|
114 | https://github.com/readium/r2-opds-js/blob/develop/README.md#documentation
|
115 |
|
116 | https://github.com/readium/r2-shared-js/blob/develop/README.md#documentation
|
117 |
|
118 | https://github.com/readium/r2-lcp-js/blob/develop/README.md#documentation
|
119 |
|
120 | https://github.com/readium/r2-utils-js/blob/develop/README.md#documentation
|