Skip to content
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

improve type inference on things pulled from awilix #433

Merged
merged 1 commit into from
Nov 23, 2024
Merged

improve type inference on things pulled from awilix #433

merged 1 commit into from
Nov 23, 2024

Conversation

echo-bravo-yahoo
Copy link
Contributor

the types for the container were broken; this commit fixes them. as a result, typescript server can properly infer the type of things resolved off the awilix container. unfortunately, it's likely not going to work in all situations - for instance, i've noticed that JSDoc comments are dropped.

before, looking at something registered with asValue:
image

before, looking at something registered with asClass:
image

after, looking at something registered with asValue:
image

after, looking at something registered with asClass:
image

the types for the container were broken; this commit fixes them. as a
result, typescript server can properly infer the type of things resolved
off the awilix container. unfortunately, it's likely not going to work
in all situations - for instance, i've noticed that JSDoc comments are
dropped.
@echo-bravo-yahoo echo-bravo-yahoo requested a review from a team as a code owner November 23, 2024 00:31
Comment on lines -6 to -16
import keyCommand from "./commands/key.mjs";
import databaseCommand from "./commands/database/database.mjs";
import evalCommand from "./commands/eval.mjs";
import shellCommand from "./commands/shell.mjs";
import keyCommand from "./commands/key.mjs";
import loginCommand from "./commands/login.mjs";
import schemaCommand from "./commands/schema/schema.mjs";
import databaseCommand from "./commands/database/database.mjs";

import shellCommand from "./commands/shell.mjs";
import { authNZMiddleware } from "./lib/auth/authNZ.mjs";
import { checkForUpdates, fixPaths, logArgv } from "./lib/middleware.mjs";

/** @typedef {import('awilix').AwilixContainer<import('./config/setup-container.mjs').modifiedInjectables>} cliContainer */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ran linter which reordered the dependencies

@wildemat wildemat merged commit 40d10bd into v3 Nov 23, 2024
4 checks passed
@wildemat wildemat deleted the types branch November 23, 2024 02:30
@cleve-fauna cleve-fauna mentioned this pull request Dec 5, 2024
This was referenced Dec 6, 2024
@cleve-fauna cleve-fauna mentioned this pull request Dec 13, 2024
@wildemat wildemat mentioned this pull request Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants