All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.build.generate-release-list.js Maven / Gradle / Ivy

The newest version!
const octokit = require('@octokit/rest')();
const fs = require('fs');

const list = {};

octokit
    .paginate(octokit.repos.listReleases.endpoint({
        owner: 'mapbox',
        repo: 'mapbox-gl-js'
    }))
    .then(releases => {
        releases.filter(release => release.tag_name.match(/^v\d+\.\d+\.\d+(-\w+)?/)).forEach(release => {
            list[release.tag_name] = {
                released: release.published_at,
                prerelease: release.prerelease
            };
        });

        fs.writeFileSync('dist/versions.json', JSON.stringify(list, null, 4) + '\n');
        fs.writeFileSync('dist/versions.jsonp', 'const mapboxglVersions = ' + JSON.stringify(list, null, 4) + ';\n');
    });




© 2015 - 2024 Weber Informatics LLC | Privacy Policy