Skip to content

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

Closed
wants to merge 8 commits into from
Closed

Conversation

hansl
Copy link
Contributor

@hansl hansl commented Feb 14, 2017

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.

@hansl hansl force-pushed the eject branch 2 times, most recently from 3be7060 to 5c4034a Compare February 14, 2017 03:26
@hansl hansl force-pushed the eject branch 26 times, most recently from 1df7a64 to 3e8ee8a Compare February 16, 2017 06:42
@hansl hansl force-pushed the eject branch 4 times, most recently from 7bac885 to 835b0ff Compare February 16, 2017 17:19
Copy link
Contributor

@filipesilva filipesilva left a 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",
Copy link
Contributor

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.

Copy link
Contributor Author

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 = [
Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -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'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webpack -> eject.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, thanks!

Brocco
Brocco previously requested changes Feb 16, 2017
@@ -13,6 +13,10 @@
},
"name": {
"type": "string"
},
"ejected": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Done.

@@ -41,6 +42,19 @@ export function deleteFile(path: string) {
}


export function rimRaf(path: string) {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Done.

// an error already exists
.then(() => ts.sys.readFile('package.json'))
.then(packageJson => JSON.parse(packageJson))
.then(packageJson => {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

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.
@hansl hansl dismissed Brocco’s stale review February 17, 2017 00:05

He approved manually on slack, can't approve on his phone.

@zackarychapple
Copy link
Contributor

Very excited to see this! great work @hansl

asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this pull request Apr 12, 2017
@hansl hansl deleted the eject branch August 2, 2018 19:59
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants