feat(@angular/cli): add an eject command#4680
Conversation
3be7060 to
5c4034a
Compare
1df7a64 to
3e8ee8a
Compare
7bac885 to
835b0ff
Compare
filipesilva
left a comment
There was a problem hiding this comment.
Reviewed everything but packages/@angular/cli/tasks/eject.ts.
| } | ||
| }, | ||
| "exclude": [ | ||
| "test.ts", |
There was a problem hiding this comment.
I think you won't be able to get some IDE support in tests if you exclude these.
There was a problem hiding this comment.
Mmmh... Then I'll have to add it when ejecting.
| const Command = require('../ember-cli/lib/models/command'); | ||
|
|
||
| // defaults for BuildOptions | ||
| export const baseEjectCommandOptions: any = [ |
There was a problem hiding this comment.
These should be referenced from baseBuildCommandOptions in commands/build.ts.
| }; | ||
| } | ||
|
|
||
| (sort as any).entryPoints = entryPoints; |
There was a problem hiding this comment.
Can you add a comment about how this is needed for eject?
| */ | ||
| const argv = minimist(process.argv.slice(2), { | ||
| 'boolean': ['debug', 'nolink', 'nightly', 'noproject', 'verbose'], | ||
| 'boolean': ['debug', 'nolink', 'nightly', 'noproject', 'verbose', 'webpack'], |
| "name": { | ||
| "type": "string" | ||
| }, | ||
| "ejected": { |
| } | ||
|
|
||
|
|
||
| export function rimRaf(path: string) { |
There was a problem hiding this comment.
These names are SO close, maybe import via: import * as rimrafPackage from 'rimraf';? Then rename the exported function rimraf.
| // an error already exists | ||
| .then(() => ts.sys.readFile('package.json')) | ||
| .then(packageJson => JSON.parse(packageJson)) | ||
| .then(packageJson => { |
There was a problem hiding this comment.
Consider making packageJson of type any which will allow for direct property access instead of strings in case someone creates a type later on.
There was a problem hiding this comment.
We should have a type of package.json, or at least a schema. Food for 2.0 thoughts. Done.
It takes multiple paths and not the content, which is cleaner in a configuration.
Before it was only a string with stdout.
The command will generate a webpack.config.js and will add scripts to the package.json.
And show the CLI config version if its different.
He approved manually on slack, can't approve on his phone.
|
Very excited to see this! great work @hansl |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The command will generate a webpack.config.js and will add scripts to the package.json.
Also fix a bug with how the mainPath is resolved.