-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
How to compose generators in our own ESM-based generator #1505
Comments
|
|
Would you please help me out ? I have not been able to make your suggestions work.
public async default() {
if (this.options.license) {
const path = resolve('generator-license', import.meta.url);
const licenseOpts: LicenseOptions = {
publish: false,
};
await this.composeWith<GeneratorLicense>(path, licenseOpts);
}
} I would like to compose with an embedded generator included as a dependency, rather than relying on the user having to install the required generator themselves. |
If path is an url you should convert to file path. |
|
I don’t know if you understood, but resolve return is an url. |
Hello @mshima thanks for clarifying. I have indeed converted the import { fileURLToPath } from 'node:url';
…
public async default() {
if (this.options.license) {
const path = resolve('generator-license', import.meta.url);
const localPath = fileURLToPath(path);
console.log(localPath);
const licenseOpts: LicenseOptions = {
publish: false,
};
await this.composeWith<GeneratorLicense>(localPath, licenseOpts);
}
} I’m still having a hard time figuring out how to compose generators. |
This issue is stale because it has been open with no activity. Remove stale label or comment or this will be closed |
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:The text was updated successfully, but these errors were encountered: