@dashkite/genie-presets v0.7.0
Genie Presets
Defines presets for the Genie task runner. Probably most useful for DashKite internal development.
The available presets are:
| Name | Description | 
|---|---|
| presets | Presets for managing your presets. | 
| verify | Make sure a module is ready for release. | 
| update | Like verify, but tries to fix everything. | 
| release | Builds, versions, and publishes a module. | 
| esm | Set up package.json to use ESM modules. | 
| license | Install a given license. | 
| server | Run a local server. | 
| browser | Run a local server and connect a puppeteer instance to it for automed tests. | 
| coffeescript | Builds CoffeeScript source and test code for node and import targets. | 
| pug | Compile pug into HTML or JavaScript functions. | 
| stylus | Compile Stylus into CSS or a JavaScript module. | 
| yaml | Compile YAML into JSON or a JavaScript module. | 
| media | Compile media assets for use in Web apps or Web Components. | 
| writeme | Builds YAML spec files into Markdown reference docs using WriteMe. | 
| retype | Configures and runs Retype, publishing to GitHub pages. | 
To use a preset, just load it from your task file, passing in your Genie module.
import "coffeescript/register"
import * as t from "@dashkite/genie"
import preset from "@dashkite/genie-presets"
preset t, "coffeescript"
preset t, "writeme"
preset t, "retype"
preset t, "release"You can also specify them in genie.yaml, along with any applicable options.
presets:
	coffeescript:
		targets:
			- import
	verify: ~
  update: ~
	release: ~You can also use the built-in presets mixin to add or remove them:
genie presets:add:esmcoffeescript
| Name | Description | 
|---|---|
| build | Builds source and test files from srcandtestdirectories into thebuilddirectory. Builds to two targets:nodeandimport, to corresponding subdirectories. | 
| test | Builds and run tests from the build/directory. | 
| dev:test | Runs tests from test/directly without building the source. (This is sometimes helpful for complex builds, where the build is relatively slow.) | 
| watch | Watch the src/andtest/directory for changes and runsbuildin response. | 
| clean | Remove the builddirectory. | 
| targets:add | Adds a target using the default configuration. | 
| targets:remove | Removes a target. | 
Options
| Name | Type | Description | 
|---|---|---|
| targets | dictionary | Target configurations. | 
Each target configuration consists of an array of build descriptions. Each build description specifies a glob, a preset name, corresponding to the presets of Masonry’s CoffeeScript extension, and an options object to pass to the Masonry preset.
Example
Default build for the import target:
targets:
  import:
    # build from src to the browser
	  - preset: import
  		glob: src/**/*.coffee
  	# build test client
  	- preset: import
  		glob: test/client/**/*.coffee
  		options:
  			mode: debug
  	# build test driver
  	- preset: node
  		glob:
  		- test/**/*.coffee
  		- '!test/client/**/*.coffee'release
Usually what you want to run is something like:
genie release:patchwhich will run all the subtasks necessary to do a full release. But sometimes, for whatever reason, you want to do the steps manually, in which case, this preset also provides subtask definitions for convenience.
Important ▹ The release preset assumes that you have a test task defined (the coffeescript preset defines one, for example) and runs that before proceeding. That task should also perform a build, if necessary, and run tests against the build to ensure that the published code has been tested.
| Name | Description | 
|---|---|
| release: | Does a patch release (test, version, publish, and push). Takes version as arguments. Ex: release:patch:alpha. The prerelease argument is optional. | 
| release:version: | Versions the module: npm version <level>. Version may bemajor,minor,patch,alpha, orbeta. To start a new prerelease, usemajor,minor, orpatchwithalphaorbeta. Ex:minor-betaorpatch-alpha. | 
| release:publish | Publishes to the NPM registry: npm publish --access public. | 
| release:push | Pushes to git remote: git push --follow-tags. | 
Options
- version- Arguments to pass to- npm version.
writeme
| Name | Description | 
|---|---|
| docs:build | Builds your Markdown files (into docs/reference) from your specs (specs). | 
| docs:watch | Watches the specsdirectory for changes and runsdocs:buildin response. | 
| docs:clean | Removes the docs/referencedirectory. Important:  Do not add files to this directory, since they’ll be removed on the next build. | 
Options
Currently takes no options.
retype
| Name | Description | 
|---|---|
| retype:configure | Sets up your Retype configuration for use locally and with GitHub pages. Requires the RETYPE_LICENSE_KEYenvironment variable be set. You will also need to add the license key to your GitHub secrets. | 
| site:build | Builds the site with Retype into the .retypedirectory. (This directory should be added to your.gitignore.) | 
| site:watch | Runs doc:watchif defined and runs Retype using your local configuration. | 
Options
Currently takes no options.
esm
| Name | Description | 
|---|---|
| esm:dual | Set up nodeandimporttargets in yourpackage.json. | 
| esm:dual:glob | Set up nodeandimportglob targets in yourpackage.json. | 
| esm:node | Set up nodetarget in yourpackage.json. | 
| esm:import | Set up importtarget in yourpackage.json. | 
| esm:node:glob | Set up nodeglob targets in yourpackage.json. | 
| esm:import:glob | Set up importglob targets in yourpackage.json. | 
| esm:main | Set up maintarget in yourpackage.json. | 
Options
Currently takes no options.
license
| Name | Description | 
|---|---|
| license:ethical | Installs an ethical source license. | 
Options
Currently takes no options.
verify
| Name | Description | 
|---|---|
| verify | Runs verify:audit,verify:dependencies, andverify:license. | 
| verify:audit | Runs npm audit. | 
| verify:dependencies | Runs ncu. You can installncuby runningnpm i -g npm-check-updates. Runsverify:dependencies:no-localandno-legacyfirst. | 
| verify:license | Checks to make sure a license file exists and there’s a license entry in package.json. | 
| verify:dependencies:no-local | Checks for local dependencies (those starting with file:). | 
| verify:dependencies:no-legacy | Checks for legacy dependencies. | 
Options
Currently takes no options.
pug
Coming soon.
stylus
Coming soon.
media
Coming soon.
yaml
Coming soon.
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago