-
Notifications
You must be signed in to change notification settings - Fork 12k
feat(@angular/cli): add an eject command #4680
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
3be7060
to
5c4034a
Compare
1df7a64
to
3e8ee8a
Compare
7bac885
to
835b0ff
Compare
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.
Reviewed everything but packages/@angular/cli/tasks/eject.ts
.
} | ||
}, | ||
"exclude": [ | ||
"test.ts", |
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 think you won't be able to get some IDE support in tests if you exclude these.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be referenced from baseBuildCommandOptions
in commands/build.ts
.
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.
Done.
}; | ||
} | ||
|
||
(sort as any).entryPoints = entryPoints; |
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.
Can you add a comment about how this is needed for eject?
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.
Done
tests/e2e_runner.ts
Outdated
@@ -39,7 +39,7 @@ Error.stackTraceLimit = Infinity; | |||
* If unnamed flags are passed in, the list of tests will be filtered to include only those passed. | |||
*/ | |||
const argv = minimist(process.argv.slice(2), { | |||
'boolean': ['debug', 'nolink', 'nightly', 'noproject', 'verbose'], | |||
'boolean': ['debug', 'nolink', 'nightly', 'noproject', 'verbose', 'webpack'], |
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.
webpack
-> eject
.
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.
Right, thanks!
@@ -13,6 +13,10 @@ | |||
}, | |||
"name": { | |||
"type": "string" | |||
}, | |||
"ejected": { |
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.
Please add a description
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.
Good catch. Done.
tests/e2e/utils/fs.ts
Outdated
@@ -41,6 +42,19 @@ export function deleteFile(path: string) { | |||
} | |||
|
|||
|
|||
export function rimRaf(path: string) { |
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.
These names are SO close, maybe import via: import * as rimrafPackage from 'rimraf';
? Then rename the exported function rimraf
.
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. Done.
packages/@angular/cli/tasks/eject.ts
Outdated
// an error already exists | ||
.then(() => ts.sys.readFile('package.json')) | ||
.then(packageJson => JSON.parse(packageJson)) | ||
.then(packageJson => { |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.