
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
carbon-gulp
Advanced tools
Shared build steps for projects using the carbon UI Library
npm install carbon-gulp -D
Install gulp
npm install gulp -D
Create your own gulpfile.js with the following structure
// gulpfile.js
const gulp = require('gulp');
const cbngulp = require('carbon-gulp')(gulp);
cbngulp.registerTasks({
// here goes the tasks configuration
});
// gulp tasks alliases
gulp.task('set-dev', () => {
cbngulp.config.devmode = true;
});
gulp.task('build', [
'scss',
'js'
]);
gulp.task('dev', ['set-dev', 'scss:watch', 'js:watch', 'serve']);
gulp.task('default', ['build']);
JS Builds and minimises and uglifies your js files
js: {
dependencies: ['eslint'], // optional
entry: 'src/main.js',
out: 'dist/main.min.js',
watch: 'src/**/*.js',
rollupConfig: {
moduleName: 'yourModuleName',
format: 'iife'
}
}
SCSS Builds css from sass files and minimises it
scss: {
dependencies: ['stylelint'], // optional
entry: 'src/main.scss',
out: 'dist/carbon.min.css',
watch: 'src/**/*.scss'
}
Optional tasks for linting code style
eslint: {
files: 'src/**/*.js'
},
stylelint: {
files: 'src/**/*.scss'
}
For running linter tasks you will also need to create a configuration files. You could add custom rules to configuration files.
.eslintrc.js for eslint task
module.exports = Object.assign(require('carbon-gulp/.eslintrc.js'), {
// custom rules here
});
stylelint.config.js for stylelint task
module.exports = Object.assign(require('carbon-gulp/.stylelintrc.js'), {
// custom rules here
});
Simply cleans dist folder
serve: {
dir: 'dist'
}
Runs a local server on localhost:3000 by default
clean: {
files: ['dist/**/*']
}
Runs karma tests
jstest: {
type: 'js',
entry: 'src/main.spec.js',
out: 'dist/main.min.spec.js',
watch: ['test-src/**/*.js', 'js-src/**/*.js'],
},
karma: {
dependencies: ['jstest'],
files: ['dist/index.spec.js']
}
Please note, running tests on saucelabs requires SAUCE_USERNAME and SAUCE_ACCESS_KEY env variables to be set correctly.
karma: {
dependencies: ['jstest'],
files: ['dist/index.spec.js'],
sauceLabs: {
startConnect: true
// all available options are here: https://github.com/karma-runner/karma-sauce-launcher
}
}
This is a working example, that shows all posible build tasks
const gulp = require('gulp');
const cbngulp = require('carbon-gulp')(gulp);
cbngulp.registerTasks({
js: {
entry: 'src/main.entry.js',
out: 'dist/main.min.js',
watch: 'src/**/*.js',
rollupConfig: {
format: 'iife',
moduleName: 'yourModuleName'
}
},
scss: {
entry: 'src/main.scss',
out: 'dist/main.min.css',
watch: 'src/**/*.scss'
},
clean: {
path: ['dist/**/*']
},
serve: {
dir: 'dist',
},
jstest: {
type: 'js',
entry: 'src/main.spec.js',
out: 'dist/main.min.spec.js',
watch: ['test-src/**/*.js', 'js-src/**/*.js'],
},
karma: {
dependencies: ['jstest'],
files: ['dist/main.min.spec.js'],
}
});
gulp.task('set-dev', () => {
scgulp.config.devmode = true;
});
gulp.task('build', ['js', 'scss']);
gulp.task('dev', ['set-dev', 'js:watch', 'jstest:watch', 'karma', 'scss:watch', 'serve']);
npm install gulp-grunt -D
...
FAQs
Shared build steps for projects using the carbon library
We found that carbon-gulp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.