Skip to content

Commit

Permalink
fix(deps): update dependency netlify to v10 (#3737)
Browse files Browse the repository at this point in the history
* fix(deps): update dependency netlify to v10

* fix: new js-client major release

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: ehmicky <ehmicky@gmail.com>
  • Loading branch information
3 people authored Nov 30, 2021
1 parent 8e3d9e7 commit 1173c57
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 12 deletions.
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

1 comment on commit 1173c57

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

Package size: 365 MB

Please sign in to comment.