How to use the @beemo/core.Script function in @beemo/core

To help you get started, we’ve selected a few @beemo/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github milesj / build-tool-config / packages / config / lib / scripts / ConvertChangelog.js View on Github external
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_extra_1 = __importDefault(require("fs-extra"));
const fast_glob_1 = __importDefault(require("fast-glob"));
const semver_1 = __importDefault(require("semver"));
const core_1 = require("@beemo/core");
class ConvertChangelogScript extends core_1.Script {
    blueprint() {
        return {};
    }
    async execute(context) {
        const files = await fast_glob_1.default('**/CHANGELOG.md', {
            absolute: true,
            cwd: context.cwd.path(),
            ignore: ['node_modules'],
        });
        return Promise.all(files.map(filePath => this.convertChangelog(filePath)));
    }
    async convertChangelog(filePath) {
        const data = [];
        let lastVersion = '0.0.0';
        (await fs_extra_1.default.readFile(filePath, 'utf8'))
            .split('\n')
github milesj / build-tool-config / packages / config / lib / scripts / Build.js View on Github external
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const execa_1 = __importDefault(require("execa"));
const core_1 = require("@beemo/core");
class BuildScript extends core_1.Script {
    constructor() {
        super(...arguments);
        Object.defineProperty(this, "workspaceArgs", {
            enumerable: true,
            configurable: true,
            writable: true,
            value: []
        });
    }
    args() {
        return {
            string: ['workspaces'],
            default: {
                workspaces: '',
            },
        };
github milesj / build-tool-config / packages / config / lib / scripts / AddFunding.js View on Github external
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_extra_1 = __importDefault(require("fs-extra"));
const fast_glob_1 = __importDefault(require("fast-glob"));
const core_1 = require("@beemo/core");
class AddFundingScript extends core_1.Script {
    args() {
        return {};
    }
    blueprint() {
        return {};
    }
    bootstrap() {
        this.task('Add funding to all package.json', this.addFundingToPackages);
    }
    addFundingToPackages(context) {
        return fast_glob_1.default('**/package.json', {
            absolute: true,
            cwd: context.cwd.path(),
            ignore: ['**/node_modules'],
        }).then(pkgPaths => pkgPaths.map(pkgPath => {
            const pkg = fs_extra_1.default.readJsonSync(pkgPath);
github milesj / build-tool-config / packages / config / lib / scripts / Init.js View on Github external
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_extra_1 = __importDefault(require("fs-extra"));
const core_1 = require("@beemo/core");
const constants_1 = require("../constants");
class InitScript extends core_1.Script {
    args() {
        return {
            boolean: ['local', 'node', 'react', 'workspaces'],
            default: {
                local: false,
                node: false,
                react: false,
                workspaces: false,
            },
        };
    }
    blueprint() {
        return {};
    }
    execute(context, args) {
        var _a;

@beemo/core

Manage all dev tool configurations in a single centralized repository.

MIT
Latest version published 2 years ago

Package Health Score

50 / 100
Full package analysis