-
Notifications
You must be signed in to change notification settings - Fork 81
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
refactor: update documentation about generating JS examples #1348
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
"use strict"; | ||
/******************************************************************************** | ||
* Copyright (c) 2022 Contributors to the Eclipse Foundation | ||
* Copyright (c) 2021 Contributors to the Eclipse Foundation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These license changes are ok? should we maybe update the ones coming from TS ? are they good? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed that also, but I think we should not bother too much. I think updating according to TS files is fine... |
||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
|
@@ -12,7 +13,6 @@ | |
* | ||
* SPDX-License-Identifier: EPL-2.0 OR W3C-20150513 | ||
********************************************************************************/ | ||
|
||
function uuidv4() { | ||
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { | ||
const r = (Math.random() * 16) | 0; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,25 @@ | ||
# node-wot Examples | ||
|
||
## Script Examples | ||
## Examples | ||
|
||
Script examples are located in | ||
Examples are located in | ||
|
||
- `src\scripts` | ||
- `src\testthing` | ||
- `src\scripts` | ||
- `src\testthing` | ||
- ... | ||
|
||
The idea of these folders is to use TypeScript to work on the examples which offers support in being up-to-date with the current API. | ||
|
||
see https://github.com/eclipse-thingweb/node-wot/issues/171. | ||
|
||
### Workflow | ||
## Workflow for generating JS examples | ||
|
||
1. Run `npm run build` | ||
2. Remove the following 3/4 lines in JS files of folder `dist/` | ||
|
||
``` | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
require("wot-typescript-definitions"); | ||
let WoT; | ||
let WoTHelpers; | ||
``` | ||
2. Copy the according JS file(s) from `<node-wot>/packages/examples/dist` to | ||
|
||
3. Copy the according JS file(s) to | ||
- `<node-wot>/examples/scripts` | ||
- `<node-wot>/examples/testthing` | ||
- ... | ||
|
||
- `<node-wot>/examples/scripts` | ||
- `<node-wot>/examples/testthing` | ||
|
||
## Test Thing | ||
|
||
Test thing and client is located in `src\testthing`. | ||
3. Run `npm run format` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be there (according to the tests that I did in the past), I'll double-check locally to understand why it generates this line now.