Skip to content

Commit

Permalink
Removed deprecation warnings and messages in node v22 or greater (#1552)
Browse files Browse the repository at this point in the history
* Removed deprecation warnings and messages in node v22 or greater

* Upgraded sinon package version
  • Loading branch information
sunil-lakshman authored Sep 16, 2024
1 parent 8d7340f commit b976fc4
Show file tree
Hide file tree
Showing 23 changed files with 313 additions and 459 deletions.
505 changes: 172 additions & 333 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions packages/contentstack-audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/cli-audit/1.7.0 darwin-arm64 node-v22.2.0
@contentstack/cli-audit/1.7.1 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down Expand Up @@ -269,7 +269,7 @@ EXAMPLES
$ csdx plugins
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.6/src/commands/plugins/index.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/index.ts)_

## `csdx plugins:add PLUGIN`

Expand Down Expand Up @@ -343,7 +343,7 @@ EXAMPLES
$ csdx plugins:inspect myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.6/src/commands/plugins/inspect.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/inspect.ts)_

## `csdx plugins:install PLUGIN`

Expand Down Expand Up @@ -392,7 +392,7 @@ EXAMPLES
$ csdx plugins:install someuser/someplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.6/src/commands/plugins/install.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/install.ts)_

## `csdx plugins:link PATH`

Expand Down Expand Up @@ -422,7 +422,7 @@ EXAMPLES
$ csdx plugins:link myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.6/src/commands/plugins/link.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/link.ts)_

## `csdx plugins:remove [PLUGIN]`

Expand Down Expand Up @@ -463,7 +463,7 @@ FLAGS
--reinstall Reinstall all plugins after uninstalling.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.6/src/commands/plugins/reset.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/reset.ts)_

## `csdx plugins:uninstall [PLUGIN]`

Expand Down Expand Up @@ -491,7 +491,7 @@ EXAMPLES
$ csdx plugins:uninstall myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.6/src/commands/plugins/uninstall.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/uninstall.ts)_

## `csdx plugins:unlink [PLUGIN]`

Expand Down Expand Up @@ -535,5 +535,5 @@ DESCRIPTION
Update installed plugins.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.6/src/commands/plugins/update.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/update.ts)_
<!-- commandsstop -->
4 changes: 2 additions & 2 deletions packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-audit",
"version": "1.7.0",
"version": "1.7.1",
"description": "Contentstack audit plugin",
"author": "Contentstack CLI",
"homepage": "https://github.com/contentstack/cli",
Expand Down Expand Up @@ -45,7 +45,7 @@
"nyc": "^15.1.0",
"oclif": "^3",
"shx": "^0.3.4",
"sinon": "^17.0.0",
"sinon": "^19.0.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"tslib": "^2.5.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-auth
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-auth/1.3.20 darwin-arm64 node-v22.2.0
@contentstack/cli-auth/1.3.21 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-auth",
"description": "Contentstack CLI plugin for authentication activities",
"version": "1.3.20",
"version": "1.3.21",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand Down Expand Up @@ -49,7 +49,7 @@
"nyc": "^15.1.0",
"oclif": "^3.8.1",
"rimraf": "^2.7.1",
"sinon": "^15.0.1",
"sinon": "^19.0.0",
"tmp": "^0.2.2",
"ts-node": "^10.9.1",
"typescript": "^4.9.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-branches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $ npm install -g @contentstack/cli-cm-branches
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-branches/1.1.2 darwin-arm64 node-v22.2.0
@contentstack/cli-cm-branches/1.1.3 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-branches/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-branches",
"description": "Contentstack CLI plugin to do branches operations",
"version": "1.1.2",
"version": "1.1.3",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down Expand Up @@ -41,7 +41,7 @@
"mocha": "10.1.0",
"nyc": "^15.1.0",
"oclif": "^3.1.2",
"sinon": "^15.0.1",
"sinon": "^19.0.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-clone
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-clone/1.11.0 darwin-arm64 node-v22.2.0
@contentstack/cli-cm-clone/1.11.1 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-clone",
"description": "Contentstack stack clone plugin",
"version": "1.11.0",
"version": "1.11.1",
"author": "Contentstack",
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
Expand Down Expand Up @@ -32,7 +32,7 @@
"mocha": "^10.0.0",
"nyc": "^15.1.0",
"oclif": "^3.8.1",
"sinon": "^15.0.1"
"sinon": "^19.0.0"
},
"engines": {
"node": ">=14.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-command/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-command",
"description": "Contentstack CLI plugin for configuration",
"version": "1.3.0",
"version": "1.3.1",
"author": "Contentstack",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -34,7 +34,7 @@
"mocha": "10.1.0",
"nyc": "^15.1.0",
"rimraf": "^2.7.1",
"sinon": "^15.0.1",
"sinon": "^19.0.0",
"ts-node": "^8.10.2",
"typescript": "^4.9.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-config
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-config/1.7.0 darwin-arm64 node-v22.2.0
@contentstack/cli-config/1.7.1 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-config/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-config",
"description": "Contentstack CLI plugin for configuration",
"version": "1.7.0",
"version": "1.7.1",
"author": "Contentstack",
"scripts": {
"build": "npm run clean && npm run compile",
Expand Down Expand Up @@ -47,7 +47,7 @@
"nyc": "^15.1.0",
"oclif": "^3.8.1",
"rimraf": "^2.7.1",
"sinon": "^15.0.1",
"sinon": "^19.0.0",
"tmp": "^0.2.2",
"ts-node": "^10.9.1",
"typescript": "^4.9.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $ npm install -g @contentstack/cli-cm-export
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-export/1.12.0 darwin-arm64 node-v22.2.0
@contentstack/cli-cm-export/1.12.1 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-export",
"description": "Contentstack CLI plugin to export content from stack",
"version": "1.12.0",
"version": "1.12.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down Expand Up @@ -43,7 +43,7 @@
"mocha": "10.1.0",
"nyc": "^15.1.0",
"oclif": "^3.8.1",
"sinon": "^15.0.1",
"sinon": "^19.0.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-import/1.17.0 darwin-arm64 node-v22.2.0
@contentstack/cli-cm-import/1.17.1 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-import",
"description": "Contentstack CLI plugin to import content into stack",
"version": "1.17.0",
"version": "1.17.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down Expand Up @@ -46,7 +46,7 @@
"nyc": "^15.1.0",
"oclif": "^3.8.1",
"rimraf": "^2.7.1",
"sinon": "^11.1.1",
"sinon": "^19.0.0",
"tmp": "^0.2.2",
"ts-node": "^10.9.1",
"typescript": "^4.9.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-migrate-rte/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-migrate-rte
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-migrate-rte/1.4.18 darwin-arm64 node-v22.2.0
@contentstack/cli-cm-migrate-rte/1.4.19 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-migrate-rte/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-migrate-rte",
"description": "Contentstack CLI plugin to migrate HTML RTE to JSON RTE",
"version": "1.4.18",
"version": "1.4.19",
"author": "contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand All @@ -15,7 +15,7 @@
"lodash": "^4.17.21",
"nock": "^13.1.0",
"omit-deep-lodash": "^1.1.5",
"sinon": "^15.0.1",
"sinon": "^19.0.0",
"uuid": "^9.0.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-utilities/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-utilities",
"version": "1.7.2",
"version": "1.7.3",
"description": "Utilities for contentstack projects",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -78,7 +78,7 @@
"nock": "^13.1.0",
"nyc": "^15.1.0",
"rimraf": "^2.7.1",
"sinon": "^15.0.1",
"sinon": "^19.0.0",
"tmp": "^0.2.2",
"ts-node": "^10.9.1",
"tslib": "^1.13.0",
Expand Down
14 changes: 7 additions & 7 deletions packages/contentstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3525,7 +3525,7 @@ EXAMPLES
$ csdx plugins
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.6/src/commands/plugins/index.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/index.ts)_

## `csdx plugins:add PLUGIN`

Expand Down Expand Up @@ -3599,7 +3599,7 @@ EXAMPLES
$ csdx plugins:inspect myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.6/src/commands/plugins/inspect.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/inspect.ts)_

## `csdx plugins:install PLUGIN`

Expand Down Expand Up @@ -3648,7 +3648,7 @@ EXAMPLES
$ csdx plugins:install someuser/someplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.6/src/commands/plugins/install.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/install.ts)_

## `csdx plugins:link PATH`

Expand Down Expand Up @@ -3678,7 +3678,7 @@ EXAMPLES
$ csdx plugins:link myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.6/src/commands/plugins/link.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/link.ts)_

## `csdx plugins:remove [PLUGIN]`

Expand Down Expand Up @@ -3719,7 +3719,7 @@ FLAGS
--reinstall Reinstall all plugins after uninstalling.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.6/src/commands/plugins/reset.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/reset.ts)_

## `csdx plugins:uninstall [PLUGIN]`

Expand Down Expand Up @@ -3747,7 +3747,7 @@ EXAMPLES
$ csdx plugins:uninstall myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.6/src/commands/plugins/uninstall.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/uninstall.ts)_

## `csdx plugins:unlink [PLUGIN]`

Expand Down Expand Up @@ -3791,7 +3791,7 @@ DESCRIPTION
Update installed plugins.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.6/src/commands/plugins/update.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/update.ts)_

## `csdx tokens`

Expand Down
16 changes: 14 additions & 2 deletions packages/contentstack/bin/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,20 @@

// Override process.emitWarning to filter out the punycode deprecation warning
process.emitWarning = (warning, type, code, ...args) => {
if (type === 'DeprecationWarning' && typeof warning === 'string' && warning.includes('punycode')) {
// Ignore punycode deprecation warning
// List of libraries for which deprecation warnings should be ignored
const ignoreWarningLibraries = ['punycode', 'bluebird', 'eslint-plugin-node', 'lodash'];
const ignoreWarningMessages = [
'The `util.isArray` API is deprecated. Please use `Array.isArray()` instead.'
];
// Check if the warning belongs to any of the ignored libraries
const libraryWarning = ignoreWarningLibraries.some(library =>
type === 'DeprecationWarning' && typeof warning === 'string' && warning.includes(library)
);
const specificWarning = ignoreWarningMessages.some(msg =>
typeof warning === 'string' && warning.includes(msg)
);
// If the warning is in the list of libraries to ignore, return early
if (libraryWarning || specificWarning) {
return;
}
// Call the original emitWarning function for other warnings
Expand Down
Loading

0 comments on commit b976fc4

Please sign in to comment.