Update dependency yargs to v18 (#5704)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
14
scripts/checks/compare-layout.js
Normal file → Executable file
14
scripts/checks/compare-layout.js
Normal file → Executable file
@ -1,10 +1,18 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const fs = require('fs');
|
||||
const { getStorageUpgradeReport } = require('@openzeppelin/upgrades-core/dist/storage');
|
||||
|
||||
const { ref, head } = require('yargs').argv;
|
||||
const { hideBin } = require('yargs/helpers');
|
||||
const { argv } = require('yargs/yargs')(hideBin(process.argv))
|
||||
.env('')
|
||||
.options({
|
||||
ref: { type: 'string', required: true },
|
||||
head: { type: 'string', required: true },
|
||||
});
|
||||
|
||||
const oldLayout = JSON.parse(fs.readFileSync(ref));
|
||||
const newLayout = JSON.parse(fs.readFileSync(head));
|
||||
const oldLayout = JSON.parse(fs.readFileSync(argv.ref));
|
||||
const newLayout = JSON.parse(fs.readFileSync(argv.head));
|
||||
|
||||
for (const name in oldLayout) {
|
||||
if (name in newLayout) {
|
||||
|
||||
@ -2,8 +2,10 @@
|
||||
|
||||
const fs = require('fs');
|
||||
const chalk = require('chalk');
|
||||
const { argv } = require('yargs')
|
||||
.env()
|
||||
|
||||
const { hideBin } = require('yargs/helpers');
|
||||
const { argv } = require('yargs/yargs')(hideBin(process.argv))
|
||||
.env('')
|
||||
.options({
|
||||
style: {
|
||||
type: 'string',
|
||||
|
||||
@ -2,7 +2,8 @@ const fs = require('fs');
|
||||
const { findAll, astDereferencer, srcDecoder } = require('solidity-ast/utils');
|
||||
const { extractStorageLayout } = require('@openzeppelin/upgrades-core/dist/storage/extract');
|
||||
|
||||
const { _ } = require('yargs').argv;
|
||||
const { hideBin } = require('yargs/helpers');
|
||||
const { argv } = require('yargs/yargs')(hideBin(process.argv));
|
||||
|
||||
const skipPath = ['contracts/mocks/', 'contracts-exposed/'];
|
||||
const skipKind = ['interface', 'library'];
|
||||
@ -35,4 +36,4 @@ function extractLayouts(path) {
|
||||
return layout;
|
||||
}
|
||||
|
||||
console.log(JSON.stringify(Object.assign(..._.map(extractLayouts))));
|
||||
console.log(JSON.stringify(Object.assign(...argv._.map(extractLayouts))));
|
||||
|
||||
@ -4,7 +4,7 @@ const path = require('path');
|
||||
const graphlib = require('graphlib');
|
||||
const match = require('micromatch');
|
||||
const { findAll } = require('solidity-ast/utils');
|
||||
const { _: artifacts } = require('yargs').argv;
|
||||
const { _: artifacts } = require('yargs/yargs')().argv;
|
||||
|
||||
// files to skip
|
||||
const skipPatterns = ['contracts-exposed/**', 'contracts/mocks/**'];
|
||||
|
||||
Reference in New Issue
Block a user