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

fix(deps): update dependency netlify to v10 #3737

Merged
merged 2 commits into from
Nov 30, 2021
Merged
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
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ module.exports = {
'fp/no-this': 0,
'import/max-dependencies': 0,
'node/no-sync': 0,
// TODO: remove once bug in eslint-plugin-node is fixed:
// https://github.com/mysticatea/eslint-plugin-node/issues/250
'node/no-unsupported-features/es-syntax': [2, { ignores: ['modules', 'dynamicImport'] }],
'sort-destructure-keys/sort-destructure-keys': 2,
'unicorn/consistent-destructuring': 0,
// TODO: harmonize with filename snake_case in other Netlify Dev projects
Expand Down
69 changes: 61 additions & 8 deletions npm-shrinkwrap.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
"minimist": "^1.2.5",
"mock-require": "^3.0.3",
"multiparty": "^4.2.1",
"netlify": "^9.0.0",
"netlify": "^10.0.0",
"netlify-headers-parser": "^5.0.0",
"netlify-redirect-parser": "^12.0.0",
"netlify-redirector": "^0.2.1",
Expand Down
5 changes: 4 additions & 1 deletion src/commands/api.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const oclif = require('@oclif/command')
const AsciiTable = require('ascii-table')
const chalk = require('chalk')
const { methods } = require('netlify')

// TODO: use static `import` after migrating this repository to pure ES modules
const jsClient = import('netlify')

const { isEmptyCommand } = require('../utils/check-command-inputs')
const Command = require('../utils/command')
Expand All @@ -17,6 +19,7 @@ class APICommand extends Command {
if (isEmptyCommand(flags, args) || flags.list) {
const table = new AsciiTable(`Netlify API Methods`)
table.setHeading('API Method', 'Docs Link')
const { methods } = await jsClient
methods.forEach((method) => {
const { operationId } = method
table.addRow(operationId, `https://open-api.netlify.com/#operation/${operationId}`)
Expand Down
7 changes: 5 additions & 2 deletions src/utils/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ const resolveConfig = require('@netlify/config')
const { flags: flagsLib } = require('@oclif/command')
const oclifParser = require('@oclif/parser')
const merge = require('lodash/merge')
const API = require('netlify')

// TODO: use static `import` after migrating this repository to pure ES modules
const jsClient = import('netlify')

const { getAgent } = require('../lib/http-agent')

Expand Down Expand Up @@ -57,9 +59,10 @@ class BaseCommand extends TrackedCommand {
const apiOpts = { ...apiUrlOpts, agent }
const globalConfig = await getGlobalConfig()

const { NetlifyAPI } = await jsClient
this.netlify = {
// api methods
api: new API(token || '', apiOpts),
api: new NetlifyAPI(token || '', apiOpts),
repositoryRoot,
// current site context
site: {
Expand Down