Skip to content

Commit b44448b

Browse files
relu91JKRhbegekorkandanielpeintner
authored
Improve readme (#1114)
* docs(README): move license as last section * docs(readme): improve overall description * docs(README): add logo * docs(REDME): use github alerts syntax Co-authored-by: Jan Romann <[email protected]> * docs(README): improve examples introduction Co-authored-by: Jan Romann <[email protected]> * docs(README): minor typos Co-authored-by: Jan Romann <[email protected]> * docs(README): fix small typo Co-authored-by: Jan Romann <[email protected]> * docs(REAMDE): fix typos Co-authored-by: Ege Korkan <[email protected]> * docs(REAMDE): use information model instead of metamodel Co-authored-by: Ege Korkan <[email protected]> * docs(README): fix eg. * docs(README): use uppercase title Co-authored-by: danielpeintner <[email protected]> * docs(README): fix width attribute in the logo Co-authored-by: danielpeintner <[email protected]> * Move "development internals" to bottom * Fix linting issue * Update CONTRIBUTING.md Co-authored-by: Cristiano Aguzzi <[email protected]> --------- Co-authored-by: Jan Romann <[email protected]> Co-authored-by: Ege Korkan <[email protected]> Co-authored-by: danielpeintner <[email protected]>
1 parent b8aeef6 commit b44448b

File tree

2 files changed

+259
-236
lines changed

2 files changed

+259
-236
lines changed

CONTRIBUTING.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,88 @@ Thus, before your contribution can be accepted by the project team, contributors
3333
For more information, please see the Eclipse Committer Handbook:
3434
https://www.eclipse.org/projects/handbook/#resources-commit
3535

36+
## Clone and build
37+
38+
Clone the repository:
39+
40+
```
41+
git clone https://github.com/eclipse-thingweb/node-wot
42+
```
43+
44+
Go into the repository:
45+
46+
```
47+
cd node-wot
48+
```
49+
50+
Install root dependencies (locally installs tools such as [typescript](https://www.npmjs.com/package/typescript)):
51+
52+
```
53+
npm ci
54+
```
55+
56+
Use `tsc` to transcompile TS code to JS in the `dist` directory for each package:
57+
_Note: This step automatically calls `npm run bootstrap`._
58+
59+
```
60+
npm run build
61+
```
62+
63+
#### Optional steps
64+
65+
###### Link Packages
66+
67+
Make all packages available on your local machine (as symlinks). You can then use each package in its local version via `npm link <module>` instead of `npm install <module>` (see also https://docs.npmjs.com/cli/link). This is also useful if you want to test the CLI with a local script.
68+
69+
```
70+
sudo npm run link
71+
```
72+
73+
(On Windows omit `sudo`)
74+
75+
##### Link Local wot-typescript-definitions
76+
77+
When experimenting with new APIs, developers might need to change the [wot-typescript-definitions](https://www.npmjs.com/package/wot-typescript-definitions). If you want to use your own version of wot-types-defitions you can link your local copy using the following steps.
78+
Use npm link for this as well:
79+
80+
```
81+
git clone https://github.com/w3c/wot-scripting-api/
82+
cd wot-scripting-api/typescript/
83+
sudo npm link
84+
```
85+
86+
(On Windows omit `sudo`)
87+
88+
In each node-wot package, link the local version made available in the previous step:
89+
90+
```
91+
sudo npm link wot-typescript-definitions
92+
```
93+
94+
(On Windows omit `sudo`)
95+
96+
##### Optimization
97+
98+
To reduce the size of the installation from about 800 MByte down to about 200 MByte, you can run the following commands (currently only tested on Linux):
99+
`npm prune --production`
100+
101+
#### Troubleshooting
102+
103+
- Build error about `No matching version found for @node-wot/...` or something about `match`
104+
- try `npm run unlock` from the project root before building
105+
- `sudo npm run link` does not work
106+
- try `npm run unlock` from the project root before calling `[sudo] npm run link`
107+
- try `npm link` in each package directory in this order: td-tools, core, binding-\*, cli, demo-servients
108+
- Error mesage for `npm link @node-wot/<module>`
109+
`ELOOP: too many symbolic links encountered, stat '/usr/lib/node_modules/@node-wot/<module>`
110+
1. Run `npm run link` in `thingweb.node-wot` again
111+
2. Remove `node_modules` in the targeted project
112+
3. Remove all `@node-wot/<module>` dependencies in your `package.json`
113+
4. Run `npm i` again
114+
5. Install the packages with `npm link @node-wot/<module>`
115+
- Build error around `prebuild: npm run bootstrap`
116+
- This has been seen failing on WSL. Try using a more recent Node.js version
117+
36118
## Adding a New Protocol Binding
37119

38120
In order to add support for a new protocol binding, you need to implement the protocol interfaces defined in the `core` package.

0 commit comments

Comments
 (0)