Skip to content

Commit

Permalink
chore(types): fix types after merge with next
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalsadhu committed Aug 1, 2024
1 parent 03d5257 commit 953d021
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion classes/ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class Ping {

this.log.debug('Requesting ping from server');
try {
const result = await fetch(this.server);
const result = await fetch(/** @type {string}*/ (this.server));

if (!result.ok) {
const err = new Error('Ping unsuccessful');
Expand Down
2 changes: 1 addition & 1 deletion classes/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { typeSlug } from '../utils/index.js';
* @property {"package" | "npm" | "map"} [type="package"]
* @property {string} name
* @property {string} version
* @property {string} [level="patch"]
* @property {import("semver").ReleaseType} [level="patch"]
* @property {string} cwd
* @property {string[]} [map]
* @property {string} [out="./.eik"]
Expand Down
12 changes: 8 additions & 4 deletions commands/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,19 @@ export const handler = async (argv) => {

if (!s) {
await new Promise((resolve) => {
rl.question('Enter Eik server address > ', (input) => {
rl?.question('Enter Eik server address > ', (input) => {
s = input;
// @ts-expect-error
resolve();
});
});
}

if (!k) {
await new Promise((resolve) => {
rl.question(`Enter login key for ${s} > `, (input) => {
rl?.question(`Enter login key for ${s} > `, (input) => {
k = input;
// @ts-expect-error
resolve();
});
});
Expand All @@ -92,13 +94,14 @@ export const handler = async (argv) => {
try {
const token = await new Login({
logger: logger(spinner, debug),
debug,
key: k,
server: s,
}).run();

if (token) {
const meta = await json.read({ cwd: homedir, filename: '.eikrc' });
const meta = /** @type {{ tokens: any }} */ (
await json.read({ cwd: homedir, filename: '.eikrc' })
);

const tokens = new Map(meta.tokens);
tokens.set(s, token);
Expand All @@ -108,6 +111,7 @@ export const handler = async (argv) => {
success = true;
}
} catch (err) {
// @ts-expect-error
logger.warn(err.message);
}

Expand Down

0 comments on commit 953d021

Please sign in to comment.