0.7.0 • Published 9 months ago

@dashkite/genie-presets v0.7.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
9 months ago

Genie Presets

Defines presets for the Genie task runner. Probably most useful for DashKite internal development.

The available presets are:

NameDescription
presetsPresets for managing your presets.
verifyMake sure a module is ready for release.
updateLike verify, but tries to fix everything.
releaseBuilds, versions, and publishes a module.
esmSet up package.json to use ESM modules.
licenseInstall a given license.
serverRun a local server.
browserRun a local server and connect a puppeteer instance to it for automed tests.
coffeescriptBuilds CoffeeScript source and test code for node and import targets.
pugCompile pug into HTML or JavaScript functions.
stylusCompile Stylus into CSS or a JavaScript module.
yamlCompile YAML into JSON or a JavaScript module.
mediaCompile media assets for use in Web apps or Web Components.
writemeBuilds YAML spec files into Markdown reference docs using WriteMe.
retypeConfigures 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:esm

coffeescript

NameDescription
buildBuilds source and test files from src and test directories into the build directory. Builds to two targets: node and import, to corresponding subdirectories.
testBuilds and run tests from the build/ directory.
dev:testRuns tests from test/ directly without building the source. (This is sometimes helpful for complex builds, where the build is relatively slow.)
watchWatch the src/ and test/ directory for changes and runs build in response.
cleanRemove the build directory.
targets:addAdds a target using the default configuration.
targets:removeRemoves a target.

Options

NameTypeDescription
targetsdictionaryTarget 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:patch

which 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.

NameDescription
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 be major, minor, patch, alpha, or beta. To start a new prerelease, use major, minor, or patch with alpha or beta. Ex: minor-beta or patch-alpha.
release:publishPublishes to the NPM registry: npm publish --access public.
release:pushPushes to git remote: git push --follow-tags.

Options

  • version - Arguments to pass to npm version.

writeme

NameDescription
docs:buildBuilds your Markdown files (into docs/reference) from your specs (specs).
docs:watchWatches the specs directory for changes and runs docs:build in response.
docs:cleanRemoves the docs/reference directory. Important: Do not add files to this directory, since they’ll be removed on the next build.

Options

Currently takes no options.

retype

NameDescription
retype:configureSets up your Retype configuration for use locally and with GitHub pages. Requires the RETYPE_LICENSE_KEY environment variable be set. You will also need to add the license key to your GitHub secrets.
site:buildBuilds the site with Retype into the .retype directory. (This directory should be added to your .gitignore.)
site:watchRuns doc:watch if defined and runs Retype using your local configuration.

Options

Currently takes no options.

esm

NameDescription
esm:dualSet up node and import targets in your package.json.
esm:dual:globSet up node and import glob targets in your package.json.
esm:nodeSet up node target in your package.json.
esm:importSet up import target in your package.json.
esm:node:globSet up node glob targets in your package.json.
esm:import:globSet up import glob targets in your package.json.
esm:mainSet up main target in your package.json.

Options

Currently takes no options.

license

NameDescription
license:ethicalInstalls an ethical source license.

Options

Currently takes no options.

verify

NameDescription
verifyRuns verify:audit, verify:dependencies, and verify:license.
verify:auditRuns npm audit.
verify:dependenciesRuns ncu. You can install ncu by running npm i -g npm-check-updates. Runs verify:dependencies:no-local and no-legacy first.
verify:licenseChecks to make sure a license file exists and there’s a license entry in package.json.
verify:dependencies:no-localChecks for local dependencies (those starting with file:).
verify:dependencies:no-legacyChecks for legacy dependencies.

Options

Currently takes no options.

pug

Coming soon.

stylus

Coming soon.

media

Coming soon.

yaml

Coming soon.

0.7.0

9 months ago

0.6.3

1 year ago

0.6.2

1 year ago

0.6.4

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.7

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.2

3 years ago

0.5.0

3 years ago

0.5.1

3 years ago

0.4.14

3 years ago

0.4.13

3 years ago

0.4.11

3 years ago

0.4.12

3 years ago

0.4.10

3 years ago

0.4.9

3 years ago

0.4.8

3 years ago

0.4.5

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.1.10

3 years ago

0.1.11

3 years ago

0.1.12

3 years ago

0.1.13

3 years ago

0.1.14

3 years ago

0.1.15

3 years ago

0.2.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.8

3 years ago

0.4.4

3 years ago

0.1.9

3 years ago

0.4.1

3 years ago

0.2.3

3 years ago

0.4.0

3 years ago

0.2.2

3 years ago

0.3.1

3 years ago

0.4.3

3 years ago

0.2.5

3 years ago

0.4.2

3 years ago

0.2.4

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago