Skip to content

eunakria/waso

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Waso

NPM Version

This software is a work in progress.
It's not yet ready for production use, but feel free to give it a try and contribute with issues and pull requests!


Logo

Waso (/ˈwaso/, from the toki pona word for "bird") is a refined task runner inspired by Gulp, Grunt, and Taskr.

It is designed to revive the fluid nature of Makefiles in modern Node.js projects, and provide a more versatile asset pipeline than the convoluted systems that tools like Webpack and Parcel offer.

Usage

Waso starts with a waso.config.js file in your project's root directory. It is a JavaScript file that exports an instance of the Waso class.

const { Waso, Task } = require('waso')

const sass = require('waso-sass')
const postcss = require('waso-postcss')
const rollup = require('waso-rollup')

const autoprefixer = require('autoprefixer')
const cssnano = require('cssnano')

module.exports = new Waso({
	_js: new Task([
		Waso.source('src/js/index.js'),
		Waso.incremental({
			target: 'dist/js/',
		}),
		rollup(),
		Waso.target('dist/js/'),
	]),

	_css: new Task([
		Waso.source('src/css/index.scss'),
		Waso.incremental({
			target: 'dist/js/',
			renamer: () => 'index.css',
		}),
		sass(),
		postcss([
			autoprefixer(),
			cssnano(),
		]),
		Waso.target('dist/css/'),
	]),

	default: Task.series([ '_js', '_css' ]),
})

From there, all it takes is to run npx waso to build your project.

Transformers

Waso is driven by small scripts called transformers, generators which take an input list of files and yield modified versions of them. Transformers can be written manually, but a few are provided out of the box as packages in the Waso monorepo.

Package Description
waso-babel NPM Version Transform JavaScript files with Babel.
waso-postcss NPM Version Apply PostCSS transformations to CSS files.
waso-rollup NPM Version Bundle JavaScript files with Rollup.
waso-sass NPM Version Transform Sass and SCSS files into CSS files.
waso-svgo NPM Version Compress SVG files with SVGO.
waso-terser NPM Version Minify JavaScript files with Terser.
waso-typescript NPM Version Transform TypeScript files into JavaScript files.

Interested?

Get started by installing Waso with npm i -D waso. From there, check out the examples or documentation. (TODO)

About

Waso is a refined task runner for Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published