-
Notifications
You must be signed in to change notification settings - Fork 67
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
Use correct pkg runner to run pkgs #1181
Conversation
Once we finish with renaming should check if all links to `https://github.com/....` to code inside other Gel repos are correct.
I'll add test explanations in the morning.
CLI still doesn't recognise [gel] inside gel.toml. So I updated our `gel.toml` files inside test folders to use `egdedb`. Do we want to run some CI tests on Windows machines? All tests we have run on ubuntu. At the end I reverted tests to use `edgedb` for the CLI (`edgedb migrate` etc...) in order to use the current `setup-edgedb` action.
export class ProjectManager { | ||
public packageManager: PackageManager; | ||
|
||
constructor() { | ||
this.packageManager = getPackageManager(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two ways we can go here, and I'm fine with either, with a slight preference for the first:
Return a ProjectManager
instance in _base/index.ts
So, roughly:
const packageManager = new PackageManager();
Only instantiate this class when needed
Remove all of the packageManager
stuff from BaseOptions
and the base recipe, and update any recipes that use the packageManager
option to instantiate it themselves.
Either way we will want to stop exporting the type PackageManager
(let's rename it or inline it so it doesn't conflict with the class PackageManager
) and the function getPackageManager
. We probably want to add a toString
method to the class to maybe return the package manager string, too. Just to make it cleaner when logging.
public toString(): string {
return this.packageManager;
}
this.packageManager = getPackageManager(); | ||
} | ||
|
||
private getPackageRunner(): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit: since this value isn't actually dynamic, we can move this to the constructor:
const PM_TO_RUNNER_MAP = {
"yarn": "yarn dlx",
// etc.
} as const;
// in constructor:
this.runner = PM_TO_RUNNER_MAP[this.packageManager];
Or something like that. Then just ${this.runner}
in your string builder.
Too many conflicts after renaming packages/driver to packages/gel. It is easier to create a new PR. |
No description provided.