ghost-portal/scripts/findPackages.js
Jaco Greeff d677d64817
UI support for simple payouts (#2509)
* UI support for simple payouts

* payout modal

* Adjust with era filtering

* Slow as molasses, but seems working

* Adjust th vertical alignment

* Bump API

* Update

* Cleanup reward retrievals

* linting

* Bumps

* Some rendering optimizations

* Re-add counter

* Fix new header linting

* Actual API bump

* Bumps

* Adjustments

* Adjust payouts as stand-alone tab

* Adjust nominations

* rm unused style

* change offsets

* Adjust
2020-04-08 16:39:32 +02:00

29 lines
842 B
JavaScript

// Copyright 2017-2020 @polkadot/apps authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
const fs = require('fs');
const path = require('path');
module.exports = function findPackages () {
const pkgRoot = path.join(__dirname, '..', 'packages');
return fs
.readdirSync(pkgRoot)
.filter((entry) => {
const pkgPath = path.join(pkgRoot, entry);
return !['.', '..'].includes(entry) &&
fs.lstatSync(pkgPath).isDirectory() &&
fs.existsSync(path.join(pkgPath, 'package.json'));
})
.map((dir) => {
const jsonPath = path.join(pkgRoot, dir, 'package.json');
const { name } = JSON.parse(
fs.readFileSync(jsonPath).toString('utf-8')
);
return { dir, name };
});
};