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
testTaskFunction check dependencies, check types, generate a README and run JestdevelopTaskFunction all the above and also watch for changesbuildTaskFunction all the above and also formats your files and compiles yourlibintodistwith 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}`))
rootstring the root path of the package to operate on
Returns Sip initalized Gulp tasks
- ✅ adds and removes dependencies from
package.jsonas they are used inlibusing depcheck - ✅ lints
libfor JSDoc comments, fixes what it can automatically - ✅ typechecks
libfrom the JSDoc comments using TypeScript - ✅ generates a README from the
libJSDoc 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
rootstring the root path of the package to operate onoptionsobject task optionsoptions.fixboolean 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.
rootstring the root path of the package to operate on
Returns TaskFunction the initialized gulp task