Create a CLI to scaffold Nodes #86
Replies: 8 comments 5 replies
-
this tool could even scaffold collections: |
Beta Was this translation helpful? Give feedback.
-
What are you thoughts on this @sammachin @knolleary |
Beta Was this translation helpful? Give feedback.
-
Another idea is to use yo like verdaccio does |
Beta Was this translation helpful? Give feedback.
-
My Thoughts: In general this seems like a good idea, having tooling to help with developing better quality package; I think this should be a part of the Looking at the proposed structure I think things could be simplified a fair bit, while we want to encourage people to have well structured code we don't want to overburden them with folders and tools: On the package.json contents again I think this could be stripped back, just adding the node-red bits along with the engines to what npm init does seems like the basics, on the engines front we should ask the developer what they want with a default option of the minimum supported by the current node-red release, I think the real value in the tool though would come from speeding up the creation of actual nodes with boilerplate, otherwise this is really just a skeleton package which could be done with a static GitHub repo people just fork. I don't think there's any value in adding flows or collections to this tool, this should be about developing packages FOR node-red not about building flows WITH node-red, they are usually very different groups of users and ways of working. Just to summarise then the workflow for creating a new package with node-red-dev should be something like.
|
Beta Was this translation helpful? Give feedback.
-
node-red-admin is used for managing installations of Node-RED, where the users want to build a flow out of nodes.
node-red-dev is for people that want to develop nodes for Node-RED.
The first group is much larger than the second group of people.
…On Sat, 7 Oct 2023, at 12:40, Allan Oricil wrote:
That is fine to me.
Why are node red admin and dev cli separated? What are the arguments for not having a single `node-red` bin?
—
Reply to this email directly, view it on GitHub <#86 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABNZ7JOZU5ZGKKZ4GGKGGTX6E5URAVCNFSM6AAAAAA5S7ZTNWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TEMJWHEYDK>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
As for pre defined dev dependencies, I'm fine not having them as default, but I insist making them available for a dev to opt-in when running
|
Beta Was this translation helpful? Give feedback.
-
A folder for each node inside |
Beta Was this translation helpful? Give feedback.
-
The command is `node-red-dev` -cli is just the repo name.
Try using it.
…On Sat, 7 Oct 2023, at 15:16, Allan Oricil wrote:
Ok, now it makes sense to me. But I want to insist in removing the `-cli` from the bin name. I don't like it, i have to type more and I don't want to be forced to create an alias after installing it
—
Reply to this email directly, view it on GitHub <#86 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABNZ7OMCWOCIHCAVUDMD4LX6FP2FAVCNFSM6AAAAAA5S7ZTNWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TEMJXGU4DA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
The idea is to create some cli commands that would help people to start a new Node-red Node project.
obs: I'm trying to follow the same thing salesforce cli (sfdx) does. Command topics start with the resource name.
obs: we will need to have something to distinguish Node-red projects from others. In sfdx they use they own proprietary manifest called "sfdx-project.json". Why we need this? to later create a vscode extension that runs "when: node-red-project.json" exists in the cwd.
nodered node create --name my-new-node --description "my new amazing node"
or
or
Running this command would scaffold a new node-red Node project with some pre-defined files and folder structure (to be defined).
As a suggestion, this could be the default folder structure:
./package.json
./nodes/my-new-node/index.js
./nodes/my-new-node/index.html
./.gitignore
node_modules *.lock
./.husky
has the common husky hooks for running commitlint, lint-staged, and tests before commiting./test/my-new-node/index.spec.js
has a pre defined code scaffold for writting test specs for the node./examples
is used to store examples using this node./nodes/assets
is used for sharing assets across multiple nodes./nodes/my-new-node/assets
is used for storing assets that belong to a single nodeBeta Was this translation helpful? Give feedback.
All reactions