Skip to content

Commit

Permalink
chore: fix some more types
Browse files Browse the repository at this point in the history
  • Loading branch information
Skn0tt committed Dec 14, 2023
1 parent 9acefe4 commit e2536db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/utils/detect-server-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ import { EOL } from 'os'
import { dirname, relative, resolve } from 'path'

import { getFramework, getSettings } from '@netlify/build-info'
import { OptionValues } from 'commander'
import getPort from 'get-port'

import BaseCommand from '../commands/base-command.js'
import { DevConfig } from '../commands/dev/types.js'

import { detectFrameworkSettings } from './build-info.js'
import { NETLIFYDEVWARN, chalk, log } from './command-helpers.js'
import { acquirePort } from './dev.js'
import { getPluginsToAutoInstall } from './init/utils.js'
import { ServerSettings } from './types.js'

/** @param {string} str */
// @ts-expect-error TS(7006) FIXME: Parameter 'str' implicitly has an 'any' type.
Expand Down Expand Up @@ -282,14 +287,9 @@ const handleForcedFramework = async ({ devConfig, project, workingDir, workspace

/**
* Get the server settings based on the flags and the devConfig
* @param {import('../commands/dev/types.js').DevConfig} devConfig
* @param {import('commander').OptionValues} flags
* @param {import('../commands/base-command.js').default} command
* @returns {Promise<import('./types.js').ServerSettings>}
*/

// @ts-expect-error TS(7006) FIXME: Parameter 'devConfig' implicitly has an 'any' type... Remove this comment to see the full error message
const detectServerSettings = async (devConfig, flags, command) => {
const detectServerSettings = async (devConfig: DevConfig, flags: OptionValues, command: BaseCommand): Promise<ServerSettings> => {
validateProperty(devConfig, 'framework', 'string')

/** @type {Partial<import('./types.js').BaseServerSettings>} */
Expand Down
4 changes: 3 additions & 1 deletion src/utils/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export type ServerSettings = BaseServerSettings & {
jwtSecret: string
/** default 'app_metadata.authorization.roles' */
jwtRolePath: string
/** The port where the functions are running on */
/** The port where the dev server is running on */
port: number
/** The port where the functions are running on */
functionsPort: number
https?: { key: string; cert: string; keyFilePath: string; certFilePath: string }
}

0 comments on commit e2536db

Please sign in to comment.