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

Coffee Machine tutorial does not mention the removal of 3-4 lines in js code #16

Closed
egekorkan opened this issue May 26, 2020 · 15 comments
Closed

Comments

@egekorkan
Copy link
Member

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?

@fatadel
Copy link
Contributor

fatadel commented May 29, 2020

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".
Anyway, I can definitely add that information to the tutorial. However, I would also ask @sebastiankb's opinion on that.

@fatadel
Copy link
Contributor

fatadel commented May 29, 2020

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.
Could we maybe adapt and integrate it somehow in node-wot?

#!/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!"

@egekorkan
Copy link
Member Author

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 ;)

@fatadel
Copy link
Contributor

fatadel commented May 29, 2020

@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?

@egekorkan
Copy link
Member Author

Yes go for it! This PR was mentioning this

@fatadel
Copy link
Contributor

fatadel commented Jun 11, 2020

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.

@danielpeintner
Copy link
Member

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 ...

@fatadel
Copy link
Contributor

fatadel commented Jun 11, 2020

@danielpeintner I currently have an active task from @sebastiankb. So if he approves I would gladly take this one as the next.

@fatadel
Copy link
Contributor

fatadel commented Jun 15, 2020

So, @sebastiankb has approved, and I am starting to work on eclipse-thingweb/node-wot#185.
@egekorkan I think this issue can be closed now.

@danielpeintner
Copy link
Member

@egekorkan shall we close this issue?

@egekorkan
Copy link
Member Author

There is still no mention of the need to remove those lines though?

@danielpeintner
Copy link
Member

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...

@egekorkan
Copy link
Member Author

A link would be a better solution but I don't see one in the tutorial :)

@danielpeintner
Copy link
Member

Mhh, are we talking about the same?
On http://www.thingweb.io/smart-coffee-machine.html I see
"If you want to add your own example scripts be sure to follow the workflow".

@egekorkan
Copy link
Member Author

oopsie :) closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants