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 · 0 comments 路 Fixed by #16113

Comments

@d-koppenhagen
Copy link

@d-koppenhagen d-koppenhagen commented Nov 7, 2019

馃殌 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?
@ngbot ngbot bot added this to the Backlog milestone Nov 7, 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
mgechev added a commit that referenced this issue Nov 12, 2019
mgechev added a commit that referenced this issue Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can鈥檛 perform that action at this time.