Skip to content
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

Conversion error caused by multiple CLI apps comes too late #134

Closed
JamesHenry opened this issue Dec 4, 2017 · 1 comment · Fixed by #136
Closed

Conversion error caused by multiple CLI apps comes too late #134

JamesHenry opened this issue Dec 4, 2017 · 1 comment · Fixed by #136
Labels

Comments

@JamesHenry
Copy link
Collaborator

Background

We do not support converting projects which have multiple apps within their .angular-cli.json file.

Currently we check for this in updateAngularCLIJson() and throw:

if (angularCliJson.apps.length !== 1) {
  throw new Error('Can only convert projects with one app');
}

Issue

The problem is that updateAngularCLIJson() does not come until the fourth step in the conversion process:

export default function(schema: Schema): Rule {
  const options = { ...schema, name: toFileName(schema.name) };
  return chain([
    moveFiles(options),
    branchAndMerge(chain([mergeWith(apply(url('./files'), []))])),
    updatePackageJson(),
    updateAngularCLIJson(options), // <-- we don't throw until here
// ...etc...

This means that we move the user's files around and perform all kinds of modifications only to end up exiting early. This leaves the repo in a mess, which the user has to manually restore to where they started.

Proposed Solution

We introduce a new first step to the pipeline which contains relevant fundamental checks for whether or not the conversion should be possible.

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant