Skip to content

Commit

Permalink
fix: fixed errors in npn run build
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Lane <[email protected]>
Co-authored-by: Thomas Lane <[email protected]>
  • Loading branch information
3 people committed Nov 1, 2024
1 parent 6936461 commit c5054d7
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/commands/addons/addons-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const addonsAuth = async (addonName: string, options: OptionValues, comma
log()
log(addon.auth_url)
log()
// @ts-expect-error TS(2345) FIXME: Argument of type '{ url: any; }' is not assignable... Remove this comment to see the full error message
await openBrowser({ url: addon.auth_url })
exit()
}
5 changes: 2 additions & 3 deletions src/commands/functions/functions-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import type {
HandleOnCompleteParams,
HandleAddonDidInstallParams,
} from './types.js'
import { $TSFixMe } from '../types.js'

const require = createRequire(import.meta.url)

Expand Down Expand Up @@ -119,7 +120,6 @@ const filterRegistry = function (registry: RegistryElement[], input: string) {
* @param {string} lang
* @param {'edge' | 'serverless'} funcType
*/
//// @ts-expect-error TS(7006) FIXME: Parameter 'lang' implicitly has an 'any' type.
const formatRegistryArrayForInquirer = async function (lang: string, funcType: FuncType) {
const folders = await readdir(path.join(templatesDir, lang), { withFileTypes: true })

Expand Down Expand Up @@ -204,7 +204,7 @@ const pickTemplate = async function ({ language: languageFromFlag }: OptionValue
language = languageFromPrompt
}

let templatesForLanguage
let templatesForLanguage: $TSFixMe

try {
templatesForLanguage = await formatRegistryArrayForInquirer(language, funcType)
Expand All @@ -226,7 +226,6 @@ const pickTemplate = async function ({ language: languageFromFlag }: OptionValue

if (!input || input === '') {
// show separators
// // @ts-expect-error TS(7005) FIXME: Variable 'templatesForLanguage' implicitly has an ... Remove this comment to see the full error message
return [...templatesForLanguage, ...parsedSpecialCommands]
}
// only show filtered results sorted by score
Expand Down
19 changes: 10 additions & 9 deletions src/commands/integration/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,23 @@ function logScopeConfirmationMessage(localScopes: LocalTypeScope[], remoteScopes
log(chalk.yellow('if you continue. This will only affect future installations of the integration.'))
}

function formatScopesToWrite(registeredIntegrationScopes: RegisteredIntegrationScopes[]): ScopePermissions {
let scopesToWrite: ScopeWriter = {}
// @ts-expect-error TS(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
function formatScopesToWrite(registeredIntegrationScopes) {
let scopesToWrite = {}

for (const scope of registeredIntegrationScopes) {
const [resource, permission] = scope.split(':') as [ScopeResource | 'all', ScopePermission]
const [resource, permission] = scope.split(':')
if (resource === 'all') {
scopesToWrite = { all: true }
break
} else {
const resourceKey = resource
if (!scopesToWrite[resourceKey]) {
scopesToWrite[resourceKey] = []
}
if (Array.isArray(scopesToWrite[resourceKey])) {
scopesToWrite[resourceKey].push(permission)
// @ts-expect-error TS(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
if (!scopesToWrite[resource]) {
// @ts-expect-error TS(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
scopesToWrite[resource] = []
}
// @ts-expect-error TS(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
scopesToWrite[resource].push(permission)
}
}
return scopesToWrite
Expand Down
1 change: 0 additions & 1 deletion src/commands/open/open-admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export const openAdmin = async (options: OptionValues, command: BaseCommand) =>
log(`Opening "${siteInfo.name}" site admin UI:`)
log(`> ${siteInfo.admin_url}`)

// @ts-expect-error TS(2345) FIXME: Argument of type '{ url: any; }' is not assignable... Remove this comment to see the full error message
await openBrowser({ url: siteInfo.admin_url })
exit()
}
1 change: 0 additions & 1 deletion src/commands/open/open-site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const openSite = async (options: OptionValues, command: BaseCommand) => {
log(`Opening "${siteInfo.name}" site url:`)
log(`> ${url}`)

// @ts-expect-error TS(2345) FIXME: Argument of type '{ url: any; }' is not assignable... Remove this comment to see the full error message
await openBrowser({ url })
exit()
}
1 change: 0 additions & 1 deletion src/commands/watch/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const waitForBuildFinish = async function (api, siteId, spinner) {
// @TODO implement build error messages into this

if (!currentBuilds || currentBuilds.length === 0) {
// @ts-expect-error TS(2345) FIXME: Argument of type '{ spinner: any; }' is not assign... Remove this comment to see the full error message
stopSpinner({ spinner })
return true
}
Expand Down
2 changes: 0 additions & 2 deletions src/utils/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ import {
GetAddonsInformationParams,
GetAddonsInformationResult,
getAddonsParams,
GetSiteAccount,
GetSiteAccountParams,
GetSiteInformationParams,
ValidateSiteInfoParams,
} from './types.js'
import { ExtendedNetlifyAPI } from '../types/api/api.js'

// Possible sources of environment variables. For the purpose of printing log messages only. Order does not matter.
const ENV_VAR_SOURCES = {
Expand Down
3 changes: 1 addition & 2 deletions src/utils/env/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ export const findValueInValues = (values, context) =>
* @param {enum<general,account,addons,ui,configFile>} source - The source of the environment variable
* @returns {object} The dictionary of env vars that match the given source
*/
export const filterEnvBySource = (env: EnviromentVariables, source: EnvironmentVariableSource): ProcessedEnvVars =>
// @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'.
export const filterEnvBySource = (env: EnviromentVariables, source: EnvironmentVariableSource) =>
Object.fromEntries(Object.entries(env).filter(([, variable]) => variable.sources[0] === source))

// Fetches data from Envelope
Expand Down
1 change: 0 additions & 1 deletion src/utils/gh-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export const authWithNetlify = async () => {
})
const url = `${webUI}/cli?${urlParams.toString()}`

// @ts-expect-error TS(2345) FIXME: Argument of type '{ url: string; }' is not assigna... Remove this comment to see the full error message
await openBrowser({ url })

return deferredPromise
Expand Down

0 comments on commit c5054d7

Please sign in to comment.