This file (2kB) exceeds the allowed full mode (48 kb) size. The editor full height is disabled, only scrolling is allowed.
If you wish to edit a file, it is recommended to use the scroll mode as some users do not like the full height mode.
const utils = require('corifeus-utils');
module.exports = (grunt) => {
const _ = require('lodash');
const builder = require(`corifeus-builder`);
const loader = new builder.loader(grunt);
loader.js();
grunt.registerTask('cory-load-modules', async function() {
const done = this.async();
try {
let replace = '';
/*
let finds = await utils.fs.find({
find: 'package.json',
});
const path = require('path')
const findsP3x = await utils.fs.find({
root: path.resolve(process.cwd(), '../p3x'),
find: 'package.json',
});
finds = finds.concat(findsP3x)
*/
const packages = (await utils.http.request('https://network.corifeus.com/public/api/repo?renew=1')).body.repo
let sortedObject = {}
sortedObject = Object.keys(packages).sort((a, b) => {
return (packages[b].corifeus.stargazers_count || 0) - (packages[a].corifeus.stargazers_count || 0)
}).reduce((prev, curr, i) => {
prev[i] = packages[curr]
return prev
}, {})
//console.log(JSON.stringify(sortedObject, null, 4))
Object.keys(sortedObject).forEach((key) => {
const pkg = sortedObject[key]
const desc = pkg.description ;
const stargazers = pkg.corifeus.stargazers_count;
const hiddenStars = stargazers !== undefined ? `<!--@star|${pkg.name}-->` : '';
const githubLink = stargazers !== undefined ? ` | [Github](https://github.com/patrikx3/${pkg.corifeus.reponame})` : '';
replace += `
### ${hiddenStars} ${desc}
[README](https://corifeus.com/${pkg.corifeus.reponame === 'corifeus' ? 'matrix' : pkg.corifeus.reponame})${githubLink}
---
`
})
const config = grunt.config.get('cory-replace');
config['projects'] = {
prefix: '[//]: #@corifeus-projects',
postfix: '[//]: #@corifeus-projects:end',
replace: replace,
files: [
'README.md',
]
}
grunt.config.set('cory-replace', config)
done();
} catch(e) {
done(e)
}
});
grunt.registerTask('default', ['cory-load-modules'].concat(builder.config.task.build.js));
}
| / | Focus search |
| ? | Show this help |
| Esc | Unfocus input |