Skip to content

feat(@angular/cli): add an eject command#4680

Closed
hansl wants to merge 8 commits into
angular:masterfrom
hansl:eject
Closed

feat(@angular/cli): add an eject command#4680
hansl wants to merge 8 commits into
angular:masterfrom
hansl:eject

Conversation

@hansl
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread tests/e2e_runner.ts Outdated
*/
const argv = minimist(process.argv.slice(2), {
'boolean': ['debug', 'nolink', 'nightly', 'noproject', 'verbose'],
'boolean': ['debug', 'nolink', 'nightly', 'noproject', 'verbose', 'webpack'],
Copy link
Copy Markdown
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
Copy Markdown
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
"name": {
"type": "string"
},
"ejected": {
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread tests/e2e/utils/fs.ts Outdated
}


export function rimRaf(path: string) {
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. Done.

Comment thread packages/@angular/cli/tasks/eject.ts Outdated
// an error already exists
.then(() => ts.sys.readFile('package.json'))
.then(packageJson => JSON.parse(packageJson))
.then(packageJson => {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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