How to compose existing generators in our own ESM-based generator

12 views Asked by At

I’m authoring a custom ESM generator using TypeScript. I’m having a hard time finding documentation for composing existing generator.

Is there any documentation available ? Is this possible ? If so how one would achieve such features.

I have created a simple generator-readme to demonstrate the issue I have.

I’m having a hard time trying to compose with the existing generator-license generator:

import GeneratorLicense, { LicenseOptions } from 'generator-license';

export class App extends Generator<AppOptions> {

  …

  public async default() {

    if (this.options.license) {
      console.log(import.meta.url);
      const path = resolve('generator-license', import.meta.url);
      console.log(path);
      const licenseOpts: LicenseOptions = {
        publish: false,
      };
      this.composeWith<GeneratorLicense>('license', [], licenseOpts);
    }
  }
  …
}
0

There are 0 answers