Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #16

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ https://github.com/readium/r2-opds-js/blob/develop/src/opds/init-globals.ts
```typescript
// npm install r2-opds-js
// "@opds" is a dist path alias, for example EcmaScript6/ES2015 'node_modules/r2-opds-js/dist/es6-es2015/src/opds/'
// Tips!: see https://www.npmjs.com/package/tsconfig-paths to execute the compiled files with node
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you say "the compiled files", do you actually mean the "uncompiled" / "non-transpiled" TS files?

Note that r2-opds-js has a basic ts-node setup for unit tests (via Ava). As you can see, we already use tsconfig-paths:

r2-opds-js/package.json

Lines 72 to 73 in e410866

"ts-node": "^9.1.1",
"tsconfig-paths": "^3.9.0",

"testTS": "cross-env DEBUG=r2:* TYPESCRIPT=1 ava",

r2-opds-js/ava.config.js

Lines 38 to 49 in e410866

if (ts) {
conf.environmentVariables = {
"TS_NODE_CACHE": "true",
"TS_NODE_CACHE_DIRECTORY": "./ava-ts/",
"TS_NODE_PRETTY": "true",
"TS_NODE_COMPILER_OPTIONS": "{\"typeRoots\" : [\"./node_modules/@types\", \"./test/@types\"]}"
};
conf.require = [
"ts-node/register",
"tsconfig-paths/register"
];
}

Same with r2-shared-js:

https://github.com/readium/r2-shared-js/blob/18da7da29a3649e62915abd32329b9b5eb5e731b/package.json#L81-L82

https://github.com/readium/r2-shared-js/blob/18da7da29a3649e62915abd32329b9b5eb5e731b/package.json#L132

https://github.com/readium/r2-shared-js/blob/18da7da29a3649e62915abd32329b9b5eb5e731b/ava.config.js#L38-L49

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add it in the readme ? , whatever the way

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should all r2-xxx-js repositories be updated? (i.e. r2-utils-js, r2-lcp-js, r2-shared-js, r2-opds-js, r2-streamer-js, r2-navigator-js, r2-testapp-js)

import { initGlobalConverters_GENERIC, initGlobalConverters_OPDS } from "@opds/init-globals";

initGlobalConverters_GENERIC();
Expand Down