-
Notifications
You must be signed in to change notification settings - Fork 11
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
Coffee Machine tutorial does not mention the removal of 3-4 lines in js code #16
Comments
I think that if one wants to compile their own example then they will find the readme file you've mentioned on how to do that. The initial purpose of the tutorial was to demonstrate the capabilities of WoT and the usage of node-wot API but not "how to create & compile your own code". |
But the way, when I was creating the example scripts I have created a simple shell script that automates the process you've mentioned @egekorkan. #!/usr/bin/env bash
cd $PATH_TO_PROJECT/thingweb.node-wot/packages/examples
npx tsc
cd - > /dev/null
cp $PATH_TO_PROJECT/thingweb.node-wot/packages/examples/dist/scripts/coffee-machine.js $PATH_TO_PROJECT/thingweb.node-wot/examples/scripts/
sed -i "/Object\.defineProperty(exports, \"__esModule\", { value: true })\;/d" $PATH_TO_PROJECT/thingweb.node-wot/examples/scripts/coffee-machine.js
sed -i "/require(\"wot-typescript-definitions\")\;/d" $PATH_TO_PROJECT/thingweb.node-wot/examples/scripts/coffee-machine.js
sed -i "/let WoT\;/d" $PATH_TO_PROJECT/thingweb.node-wot/examples/scripts/coffee-machine.js
sed -i "/let WoTHelpers\;/d" $PATH_TO_PROJECT/thingweb.node-wot/examples/scripts/coffee-machine.js
echo "Enjoy your drink!" |
I would say yes for this script! However, for the builds to work under windows, a node.js way would be better which allows the abstraction of the OS. Regarding where to put the above mentioned information, you should at least link to the readme that shows that this needs to be done. I actually had a student who did your tutorial but his compiled version simply didn't work and he didn't know that you should remove the 3-4 lines. You should think that your tutorial is how someone starts using node-wot for the first time ;) |
@egekorkan Okay, I will add that :) Regarding the script, I think it would be good to move it into a separate "feature-request" issue. Shall I create it or you do it yourself? |
Yes go for it! This PR was mentioning this |
This PR, among others, links the aforementioned readme file with the smart coffee machine tutorial. Regarding the automation script, I have found that there is already an open issue for that - eclipse-thingweb/node-wot#185. |
Correct, but on the script somebody still needs to work on ... |
@danielpeintner I currently have an active task from @sebastiankb. So if he approves I would gladly take this one as the next. |
So, @sebastiankb has approved, and I am starting to work on eclipse-thingweb/node-wot#185. |
@egekorkan shall we close this issue? |
There is still no mention of the need to remove those lines though? |
There is a link to the workflow which is better than mentioning the workflow again .. I think (tends to get out of sync easily) Note: thanks to @relu91 one can now also load ts files... |
A link would be a better solution but I don't see one in the tutorial :) |
Mhh, are we talking about the same? |
oopsie :) closing |
If one follows the Coffee Machine tutorial and compiles their own JavaScript files, the information that is in the README of the examples. So the tutorial seems to (and sort of does) produce non-executable code.
I think the information in the above-linked readme should be also present in the tutorial. @fatadel can you have a look?
The text was updated successfully, but these errors were encountered: