Sip is a suite of Gulp tasks that make developing JavaScript less painful 🕊
Table of Contents
In three simple Gulp tasks Sip will drive your JavaScript development to new productive heights! 📈
Type: object
test
TaskFunction check dependencies, check types, generate a README and run Jestdevelop
TaskFunction all the above and also watch for changesbuild
TaskFunction all the above and also formats your files and compiles yourlib
intodist
with Babel
Sip.setup
will return an object of Tasks that you can use in your gulpfile.js
🥂
import * as Sip from "@talon/sip"
// for individual projects you can use the __dirname as the root
Object.assign(exports, Sip.setup(__dirname))
// lerna exec provides LERNA_PACKAGE_NAME as an environment variable
const pkg = process.env.LERNA_PACKAGE_NAME.split("/").slice(-1)
// which can be used to apply the package root for each package on the fly
Object.assign(exports, Sip.setup(`${__dirname}/packages/${pkg}`))
root
string the root path of the package to operate on
Returns Sip initalized Gulp tasks
- ✅ adds and removes dependencies from
package.json
as they are used inlib
using depcheck - ✅ lints
lib
for JSDoc comments, fixes what it can automatically - ✅ typechecks
lib
from the JSDoc comments using TypeScript - ✅ generates a README from the
lib
JSDoc comments with documentation.js - ✅ runs Jest
- with @talon/lit you can test your README
describe("readme driven development", () => {
it("is lit! 🔥", () => expect(true).toBeTruthy())
})
You can configure documentation.js to tweak the README generation and/or also configure Jest as you please
ESLint is used as part of the JSDoc typechecker, you can override the rules with your own eslintrc
file
root
string the root path of the package to operate onoptions
object task optionsoptions.fix
boolean whether or not to write changes for automatically fixable issues
Returns TaskFunction the initialized gulp task
Everything that test
does and also formats your code then compiles it with Babel to dist
Babel may be configured in many ways and/or if you have prettier preferences they can be configured as well
this is the one you run in CI 🔁
Returns TaskFunction the initialized gulp task
Everything that build
does but also watches lib
and runs again on file changes 👀
Note: automatic JSDoc fixing is turned off to avoid infinite looping of this task.
root
string the root path of the package to operate on
Returns TaskFunction the initialized gulp task