-
Notifications
You must be signed in to change notification settings - Fork 39
support requiring json files #62
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
Conversation
Hmm, in this particular case, maybe it's me being stuck in my old test-layout. I should probably move the tests into the respective components instead. I still imagine json support to be quite nice though. |
+1 for this "scripts": [
"index.js",
"data.json"
] |
I closed it because it seemed nobody was interested and I solved my particular issue another way. I still think it would be quite useful and natural though |
May be reopen? |
Yeah maybe, but I'm not sure tj wants it, and I think there's plans for bigger changes in the builder right now that makes it unlikely to get a pull request merged for the time being. |
im ok with it, we'd probably want to add a |
Plugin option means that |
yeah, I dont disagree, just mentioning the options. I don't think it's crucial json is valid js, just stick a |
Lib for builder's new |
I would also find JSON support useful for NoFlo. We need a way for components to declare what NoFlo components and graphs they provide, and at what include paths. On Node.js we utilize package.json for that:
Since some components are bound to be available only for browser, and others only for Node.js, it would make sense to expose the Node-compatible components in package.json, and browser-compatible components in component.json, and then just add the component JSON into the "scripts" or "json" key of itself. So, two things I'd need here:
One acceptable solution to 2. would be to make require.modules public. |
Related: componentjs/component#275 In the meanwhile, https://github.com/CamShaft/component-json may work as a workaround. |
I'm not against the idea but why don't you use javascript by sticking an object on |
👍 For the |
I actually had one more usecase for this today. I was making a (third party) node module into a component (again..) and it happened to do a With json support in component I would only need to maintain a patch to add a component.json file, without it it gets a bit more ugly. |
I think json support is quite natural, partly because it is supported in npm, but also because in practice, it is a core part of javascript.
My use case:
In my component.json for my tests i have
and I'd like to be able to do this in
index.js