ChucK has no package manager but I want one.
npm is basically magic and could be used with a couple of changes.
Steve is nice implementation of those changes.
All of this is double secret alpha and I decided to write out the README on how it's going to eventually work before doing the implementation. Call it a spec or wishful thinking or unbridled optimism or notes on a bar napkin. You should assume everything in this README is a lie unless it has a :shipit: next to it
steve init :shipit:
A thin wrapper for
There are a couple of differences
index.ckwill be the default for
scriptswill be prepopulated using
- There won't be any mention of test commands (one day I may write a runner/assertion library)
steve package :shipit:
- Creates the
packagefolder or clears it if it exists
- Looks at
initialze.ckand takes a note of the files to be loaded
- Copies each of the files found in the above step into the
packagefolder prepending the order in
steve start [args]
- Starts a ChucK vm
- Adds all dependencies from
package.jsonto the vm by crawling
node_modules/**/package/*.ck(plus their dependencies)
initialize.ckto the vm
- Adds the main file (default:
index.ck) to the vm passing
argswhen it does
A small note on dependencies
Since ChucK has no concept of namespaces or scope if the same dependency is required by the package or packages it depends on and they differ by a major version
steve will refuse to start the app. If they have the same major version
steve will only load the highest version. You should follow
semver and backwards compatibility religiously.
A thin wrapper for
steve package && npm publish;
steve test :shipit:
Everything else works just like
Parts of a steve package
This contains the list of ChucK files in the package in the order they need to be added to the VM. They should be in any of the following format
Machine.add(me.dir()+"subfolder/**/File.ck"); Machine.add(me.dir() + "subfolder/**/File.ck"); Machine.add("./subfolder/**/File.ck");
Any referenced packages will be added to the VM before the files in the
This pattern was established in the book Programming for Musicians and Digital Artists: Creating music with ChucK.
This is by default the
main file for ChucK packages. There is no need to include it in the
initialze.ck file. It will always be the last file added to the ChucK vm and when
steve watch is called and it will be the reloaded when any changes are registered. If you want to use another file for this purpose then you should define it in your
package.json file. Any arguments passed to
steve start will be forwarded to this file when it's added to the vm.