Skip to content

refactor: type global configuration file #7227

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 79 additions & 100 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@
"uuid": "11.1.0",
"wait-port": "1.1.0",
"write-file-atomic": "5.0.1",
"ws": "8.18.1"
"ws": "8.18.1",
"zod": "^3.24.3"
},
"devDependencies": {
"@babel/preset-react": "7.26.3",
Expand Down Expand Up @@ -208,6 +209,7 @@
"temp-dir": "3.0.0",
"tree-kill": "1.2.2",
"tsx": "^4.19.3",
"type-fest": "4.40.0",
"typescript": "5.8.3",
"typescript-eslint": "^8.26.0",
"verdaccio": "6.1.2",
Expand Down
5 changes: 5 additions & 0 deletions src/commands/logs/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export const logsBuild = async (options: OptionValues, command: BaseCommand) =>
const { id: siteId } = site
const userId = command.netlify.globalConfig.get('userId')

if (!userId) {
log('You must authenticate before attempting to view deploy logs')
return
}

if (!siteId) {
log('You must link a site before attempting to view deploy logs')
return
Expand Down
4 changes: 2 additions & 2 deletions src/commands/status/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type BaseCommand from '../base-command.js'

export const status = async (options: OptionValues, command: BaseCommand) => {
const { accounts, api, globalConfig, site, siteInfo } = command.netlify
const currentUserId = globalConfig.get('userId') as string | undefined
const currentUserId = globalConfig.get('userId')
const [accessToken] = await getToken()

if (!accessToken) {
Expand Down Expand Up @@ -48,7 +48,7 @@ export const status = async (options: OptionValues, command: BaseCommand) => {

const ghuser =
currentUserId != null
? (globalConfig.get(`users.${currentUserId}.auth.github.user`) as string | undefined)
? (globalConfig.get(`users.${currentUserId}.auth.github.user`))
: undefined
const accountData = {
Name: user.full_name,
Expand Down
Loading
Loading