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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

x-prompt should support an array of defaults for lists #16104

Closed
d-koppenhagen opened this issue Nov 7, 2019 · 1 comment 路 Fixed by #16113
Closed

x-prompt should support an array of defaults for lists #16104

d-koppenhagen opened this issue Nov 7, 2019 · 1 comment 路 Fixed by #16113
Labels
area: devkit/core freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@d-koppenhagen
Copy link

馃殌 Feature request

Command (mark with an x)

- [x] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [x] add
- [x] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Description

A clear and concise description of the problem or missing capability...

Within angular-cli 9.0.0-rc.0 it's possible to create schematics that will allow to use x-prompts with multi selection like this way:

{
  "$schema": "http://json-schema.org/schema",
  "id": "ngx-semantic-version",
  "title": "ngx-semantic-version Schema",
  "description": "configure commitlint, husky, commitizen and standard-version configuration",
  "type": "object",
  "properties": {
    "packages": {
      "type": "array",
      "description": "select the packages that should to be installed and configured",
      "uniqueItems": true,
      "items": {
        "type": "string"
      },
      "x-prompt": {
        "message": "What packages do you want to be installed and configured?",
        "type": "list",
        "multiselect": true,
        "items": ["commitlint", "commitizen", "husky", "standard-version"]
      }
    },
  },
  "required": ["packages"]
}

As the result of the x-prompt will lead into an array of values instead of a single selected value or input, it should be also supported to configure and array of default values.

Describe the solution you'd like

It should be possible to configure "default": ["foo", "bar"], inside the properties:

{
  "$schema": "http://json-schema.org/schema",
  "id": "ngx-semantic-version",
  "title": "ngx-semantic-version Schema",
  "description": "configure commitlint, husky, commitizen and standard-version configuration",
  "type": "object",
  "properties": {
    "packages": {
      "type": "array",
      "description": "select the packages that should to be installed and configured",
      "uniqueItems": true,
      "items": {
        "type": "string"
      },
      "default": ["commitlint", "commitizen", "husky", "standard-version"],
      "x-prompt": {
        "message": "What packages do you want to be installed and configured?",
        "type": "list",
        "multiselect": true,
        "items": ["commitlint", "commitizen", "husky", "standard-version"]
      }
    },
  },
  "required": ["packages"]
}

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?
@alan-agius4 alan-agius4 added area: devkit/schematics feature Issue that requests a new feature labels Nov 7, 2019
@ngbot ngbot bot added this to the Backlog milestone Nov 7, 2019
@clydin clydin added area: devkit/core freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix and removed area: devkit/schematics feature Issue that requests a new feature labels Nov 8, 2019
clydin added a commit to clydin/angular-cli that referenced this issue Nov 8, 2019
d-koppenhagen added a commit to d-koppenhagen/ngx-semantic-version that referenced this issue Nov 10, 2019
let users select the tools to install by using x-prompt or provide the
option
`packages=<list='commitlint'|'commitizen'|'husky'|'standard-version'>`
This is currently blocked by angular/angular-cli#16104

BREAKING CHANGE: `--husky=<false|true>`, `--commitizen=<false|true>`, `--standardVersion=<false|true>` are not supported anymore| use `--packages=commitizen,husky,commitlint,standard-version` instead.
By default all packaged will be added.

relates to #11
@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 Dec 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: devkit/core freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants