-
Notifications
You must be signed in to change notification settings - Fork 1.4k
chore: simplify config, deprecates npm_deps #644
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
// {src: 'jquery/dist/jquery.min.js', inject: 'libs'}, | ||
// {src: 'lodash/lodash.min.js', inject: 'libs'}, | ||
]; | ||
|
||
this.DEV_NPM_DEPENDENCIES = this.DEV_DEPENDENCIES.concat(normalizeDependencies(additional_deps)); | ||
this.PROD_NPM_DEPENDENCIES = this.PROD_NPM_DEPENDENCIES.concat(normalizeDependencies(additional_deps)); | ||
const oldDeps = this.NPM_DEPENDENCIES; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get what we are doing here but is there a better word than "oldDeps" to convey intent? I can see the future issue questions already. Perhaps "seedDeps" to be consistent in the seed/project theme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, seedDeps
sounds much better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update it tomorrow and assign the issue to you.
Outside of me knit picking naming conventions, I think it's a solid change. I have seen a few people modify the structure of the project.config (another concat iteration) to pull in other technologies. Something to keep in mind, this is a semver Minor but in reality it's a semver Major for a few projects I can think of off the top of my head. We should add a release note of some sort. |
I don't think it completely fixes #579 but looks good for dependencies. |
@ludohenin yes, it only partially solves it. It mostly deals with #629 |
I've mentioned it once already but I find it cleaner to remove the export class ProjectConfig extends SeedConfig {
PROJECT_TASKS_DIR = join(process.cwd(), this.TOOLS_DIR, 'tasks', 'project');
// APP_TITLE = 'Put name of your app here';
projectDeps: InjectableDependency[] = [
// {src: 'jquery/dist/jquery.min.js', inject: 'libs'},
// {src: 'lodash/lodash.min.js', inject: 'libs'},
];
seedDeps:InjectableDependency[] = this.NPM_DEPENDENCIES;
NPM_DEPENDENCIES = this.seedDeps.concat(this.projectDeps);
APP_ASSETS: InjectableDependency[] = [
// {src: `${this.ASSETS_SRC}/css/toastr.min.css`, inject: true},
// {src: `${this.APP_DEST}/assets/scss/global.css`, inject: true},
{ src: `${this.ASSETS_SRC}/main.css`, inject: true },
];
} |
fe12d34
to
50eee9e
Compare
@ludohenin yes, it looks cleaner. I don't like that |
oops, there are conflicts, would you rebase ? |
@mgechev Yes you're right about instance members. Then we have to keep has it is. |
@ludohenin in the current PR I don't like how we treat the |
50eee9e
to
986a4ac
Compare
@ludohenin I think it looks better now. Let me know if you find anything wrong. |
[key: string]: string; | ||
} | ||
|
||
const ENVIRONMENTS: Environments = { | ||
DEVELOPMENT: 'dev', | ||
PRODUCTION: 'prod' | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make ENVIRONMENTS
interface "usefull", we may have to move ENVIRONMENTS
constant as a class instance member, I suppose. And interface should be moved to seed.config.interfaces
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving ENVIRONMENTS
will allow extensibility.
@mgechev have added some comments. Otherwise LGTM. |
986a4ac
to
3b20c26
Compare
chore: simplify config, deprecates npm_deps
Fix #629
Still haven't implemented the setters since they will introduce breaking changes and we need to discuss them. Basically, each individual
InjectableDependency
already includesenv
andvendor
properties. By default all each dependency belongs to both environments (which could be more that is why is used a dependency array instead ofdev
,prod
andboth
). Once we intent to get the dependencies usingDEPENDENCIES
we resolve all of them which belong tonpm_modules
and merge the result with the ones fromAPP_ASSETS
that belong to the environment.@ludohenin @d3viant0ne let me know if you find anything wrong.
Also, lets discuss the setters for keeping backwards compatibility.