Registry / devops / bitcore-build

bitcore-build

JSON →
library10.10.5jsnpmunverified

The `bitcore-build` package serves as a specialized build helper within the larger Bitcore ecosystem by BitPay, providing pre-configured Gulp tasks for common development workflows. This utility streamlines processes such as linting, testing, and creating browser-compatible bundles for Bitcore modules, making it an essential component for developers contributing to or utilizing the Bitcore full stack for Bitcoin and blockchain-based applications. The current stable version, 10.10.5, aligns with the Bitcore monorepo's even-odd versioning convention, where even major versions denote stable releases. While Gulp is a foundational dependency, `bitcore-build` differentiates itself by offering a tailored, integrated build solution specifically designed for the Bitcore module architecture, rather than a general-purpose build tool. Its release cadence is tied to the overall Bitcore project, which sees continuous development and updates to its core libraries and services.

npm install bitcore-build
INSTALL
IMPORT
SIG · BITCORE-BUILD
B
bitcore-build
devopsjavascriptv10.10.5
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

bitcoreTasks
✓ const bitcoreTasks = require('bitcore-build');
✗ import bitcoreTasks from 'bitcore-build';
This package is primarily designed for CommonJS environments, typically used within Gulpfiles. Direct ESM `import` syntax is not officially supported without a transpiler.
Gulp Integration
✓ const gulp = require('gulp'); const bitcoreTasks = require('bitcore-build'); bitcoreTasks('my-module');
✗ require('bitcore-build')();
The package exports a function that should be called with a module name string, not directly invoked without arguments.
Browser Task Skipping
✓ const bitcoreTasks = require('bitcore-build'); bitcoreTasks('my-node-module', {skipBrowsers: true});
✗ bitcoreTasks('my-node-module', { browser: false });
To omit browser-specific tasks for Node.js-only modules, use the `skipBrowsers: true` option in the configuration object.

This quickstart demonstrates how to integrate `bitcore-build` into a Gulpfile, initialize it for a submodule, and define a default Gulp task to execute the common build, test, and coverage tasks provided by the package.

const gulp = require('gulp'); const bitcoreTasks = require('bitcore-build'); // Initialize bitcore-build for a module named 'my-custom-bitcore-module' // This will add default tasks like 'lint', 'test', 'browser', 'coverage' to Gulp. bitcoreTasks('my-custom-bitcore-module'); // Define a default Gulp task to run common build steps. // The tasks 'lint', 'test', 'browser', 'coverage' are added by bitcore-build. // For Node.js-only modules, consider passing `{ skipBrowsers: true }` to `bitcoreTasks`. gulp.task('default', gulp.series('lint', 'test', 'browser', 'coverage', function(done) { console.log('Bitcore module build complete!'); done(); })); // Example of running a specific task added by bitcore-build: gulp.task('custom-test-run', gulp.series('test', function(done) { console.log('Only tests were run!'); done(); }));
bitcore-build --version
Debug
Known issues
gotchaBitcore's versioning scheme uses even major versions for stable releases (e.g., v8.x.x, v10.x.x) and odd major versions for beta releases (e.g., v9.x.x, v11.x.x). Beta versions may contain breaking changes or major feature additions that are still in testing. Always check the main Bitcore repository's release notes for specific version details.
fix
Refer to the `bitpay/bitcore` monorepo's `CHANGELOG.md` or release notes before upgrading, especially across major versions. Pin exact versions in `package.json` for production deployments.
affects: >=1.0.0
deprecated`bitcore-build` is heavily reliant on Gulp, which is an older build tool. Modern JavaScript projects often utilize more contemporary bundlers and task runners (e.g., Webpack, Rollup, Vite, or direct npm scripts). While still functional within the Bitcore ecosystem, external projects might find Gulp an outdated choice.
fix
For new projects outside the direct Bitcore ecosystem, consider modern build tools. For existing Bitcore projects, continue using Gulp as prescribed.
affects: >=1.0.0
gotchaWhen developing Node.js-only modules within the Bitcore ecosystem, ensure you explicitly skip browser-related build tasks to avoid unnecessary dependencies or build failures in non-browser environments.
fix
Pass `{ skipBrowsers: true }` as the second argument when calling `bitcoreTasks('your-module-name', { skipBrowsers: true });`
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'gulp'
`gulp` is a peer dependency or expected global install, and it's not found in the project's `node_modules` or globally.
fix
Ensure `gulp` is installed locally in your project: `npm install --save-dev gulp` or `yarn add --dev gulp`.
TypeError: bitcoreTasks is not a function
The `require('bitcore-build')` statement might be returning an unexpected value, or the module might not be correctly exporting its primary function.
fix
Verify your `require` statement. The module is expected to export a function directly: `const bitcoreTasks = require('bitcore-build');`. Avoid `const { bitcoreTasks } = require('bitcore-build');` as it's a default export.
Task 'browser' is not in your gulpfile
This error occurs when `bitcore-build`'s browser tasks are not being loaded or are being explicitly skipped, but a Gulp task tries to run them.
fix
Check if `bitcoreTasks('your-module', { skipBrowsers: true });` is used. If so, remove 'browser' from your `gulp.task` definition, or remove the `skipBrowsers` option if browser builds are intended.
Upgrade
Version history
10.10.5latest on npm
Audit
Dependencies
gulprequiredBitcore-build is a Gulp-based task runner helper, requiring Gulp for its operations.
Agent activity
11 hits · last 30 days
node
10
Anthropic
1
Resources
bitcore-build — npm install bitcore-build · libregistry