-
Notifications
You must be signed in to change notification settings - Fork 19
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
JavaScript projects #61
Comments
I agree. As much as I dislike bower too I guess it is still quite popular. What
|
I am not quite sure what you mean |
So, let's say we have a "JavaScript" based project to replace "NodeJS". At the moment the requirement is a |
Ah but there's more... If they have a This would all mean introducing two new concepts:
|
And if the project has both? I think I've opened up pandoras box 😱 😰 😲 |
This one at least is someone easy. It doesn't require ex. for conditional rules: module.exports = {
name: 'Node JS',
files: {
'package.json file':{
path:/^package\.json/i,
dependant-rules:['No node_modules folder']
}
'No node_modules folder': {
path: /^node_modules/i,
shouldExist: false,
type:'tree'
}
}
}; Don't have any great ideas on how to prevent the dependent rules from running - maybe store them in another object other then |
Hahah! No it's all godo! I think we just want to support both at the same time. If it's a node and bower project (as disgusting as that is to me), then requirements for both should be respected. As for your suggestion on the structure... we could either embed the rule within the rule like: module.exports = {
name: 'Node JS',
files: {
'package.json file': {
path: /^package\.json/i,
'dependent-rules': {
'No node_modules folder': {
path: /^node_modules/i,
shouldExist: false,
type: 'tree'
}
}
}
}
}; But this could easily get out of hand if we start putting dependents of dependents. Easier to build, but harder to maintain. |
In a follow up to my one-way gitter convo:
@M-Zuber suggested this as the syntax: module.exports = {
name: 'JavaScript',
rules: {
'No node_modules folder': {
path: /^node_modules/i,
shouldExist: false,
type: 'tree'
}
},
files: {
'package.json file': {
path: /^package\.json/i,
'dependant-rules': ['No node_modules folder']
}
}
}; The naming of In a similar way to how Therefore what I'd propose is something like this for module.exports = {
name: 'JavaScript',
rules: {
'No node_modules folder': {
path: /^node_modules/i,
shouldExist: false,
type: 'tree'
},
'npm tags match git tags': function (tags, next) {
// Does the logic then executes next, which is a function
}
},
files: {
'package.json file': {
path: /^package\.json/i,
dependentRules: {
files : ['No node_modules folder'],
tags : ['npm tags match git tags']
}
}
}
}; Of course, as I said, we can discuss the logic behind how tags-related functions works in more detail in #30 but for now, just to make it clear that the @M-Zuber Whaddya think?! Am I overcomplicating it? I am convinced we need to make these distinctions - whether I'm suggesting a good way to do it is something I am not sure of. |
Overall your proposal seems quite fine.
|
We currently treat projects written in JavaScript as NodeJs based projects.
That does not cover all the cases. One example being front end projects that rely on Bower.
The way I see things, we should just change
node
to bejavascript
and lump everything together.So that leaves us with two things:
The text was updated successfully, but these errors were encountered: