-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
existing and new generator now claims to be "not installed" when it IS installed #234
Comments
Also had two other developers try it as well ... same result |
I think it should be |
A exception should be thrown at: environment/lib/environment.js Line 582 in 0bd0b95
When typeof Generator !== 'function'
|
Ok, this is helpful and reassuring to have a baseline to aim at. Now I need to understand why Typescript and Rollup transpilations have changed and how to ensure they get back to this contract. |
It would seem that you used to be able define a named export like so: import Base from "yeoman-generator";
export class Generator extends Base {
constructor(args: any[], opts: any) {
super(args, opts);
}
} and this would be usable but now you're required to export a default: export { Generator as default } from "./Generator" Not sure when this happened or whether it qualifies as a breaking change in semver but it feels like it probably should. Certainly broke my generator :) |
As I looked for an answer it may be that at some point I changed my import * as YeomanGenerator from "yeoman-generator";
import * as chalk from "chalk";
import { computerText, install } from "./private";
export class Generator extends YeomanGenerator {
constructor(args: any[], opts: any) {
super(args, opts);
}
initializing() {
console.log(computerText);
console.log(chalk`\nStarting the {green Lambda Typescript} generator. {italic For AWS functions with attitude!}\n`);
}
install() {
install(this);
}
} and my export { Generator as default } from "./Generator"; Is there anywhere in the docs that some baseline config would be helpful? |
I don't think yeoman is to blame about this, looks like yeoman-environment didn't supported
I don't think we have TS example at our docs, a full TS example would be helpful. |
I have a generator that i've used for years and a new one that's close to "out of the box" and they both are experiencing a mind-boggling error. I've created a video of this problem here:
https://www.screencast.com/t/2aY1Npmu
In a nutshell, both of my generators can be installed with
npm i -g generator-my-generator
and when I just runyo
they show up as options, they can also be updated via yo's interactive menu, but when I go to run them they say that the Generator is not installed!In my most recent case -- regarding the repo
generator-lambda-typescript
the exact message it says is:This suggestion of installing via
npm install generator-lambda-typescript:app
is clearly a syntax error as the:app
will not be recognized by NPM. Instead it seems to appear to be a reference to the "default generator" name ... which is defined in the repo.Where the transpiled version of
index.js
is as follows:CODE
I used Rollup (and the typescript plugin to rollup) to transpile but I also tried with transpiling with just Typescripts
tsc
and that behaved the same.The text was updated successfully, but these errors were encountered: