single-spa / create-single-spa

https://single-spa.js.org/docs/create-single-spa
Other
132 stars 59 forks source link

Having trouble skipping install when composing this with another generator #363

Closed tony-luisi closed 2 years ago

tony-luisi commented 2 years ago

Hello,

I'm attempting to create a custom generator and compose this generator as part of it. I'm keen to skip the install as my preference is to get the user to do it manually at the end. I've tried the following:

  this.composeWith(
    {
      Generator: SingleSpaGenerator,
      path: "generator-single-spa/src/generator-single-spa.js",
    },
    {
      dir: this.destinationRoot(),
      framework: "react",
      packageManager: "npm",
      typescript: true,
      orgName: "org-name",
      projectName: projectName,
      arguments: ["--skipInstall", "--skip-install"], // this does not work
      skipInstall: true, // neither does this
    }
  );

Happy to dig around the source code, but wonder if i'm doing something wrong in the first instance.

filoxo commented 2 years ago

Looking at yeoman's composeWith signature, I wonder if you're actually needing to pass those in as a third parameter (options) instead, since this generator doesn't really make use of args.

this.composeWith(
  {
    Generator: SingleSpaGenerator,
    path: "generator-single-spa/src/generator-single-spa.js",
  },
  {}, // args
  {
    dir: this.destinationRoot(),
    framework: "react",
    packageManager: "npm",
    typescript: true,
    orgName: "org-name",
    projectName: projectName,
    skipInstall: true,
  }
);
filoxo commented 2 years ago

Closing due to inactivity.