Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/curran/dummyvis
An example Chiasm plugin.
https://github.com/curran/dummyvis
Last synced: about 2 months ago
JSON representation
An example Chiasm plugin.
- Host: GitHub
- URL: https://github.com/curran/dummyvis
- Owner: curran
- License: mit
- Created: 2015-05-15T18:21:26.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-15T19:47:44.000Z (over 9 years ago)
- Last Synced: 2024-10-15T11:07:48.561Z (3 months ago)
- Language: JavaScript
- Size: 110 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dummyVis
An example [Chiasm](https://github.com/curran/chiasm) plugin demonstrating use of D3. See an older verion in action in this [example](http://bl.ocks.org/curran/raw/3f0b1128d74308fc8fe1/).This plugin project structure uses [JSPM](http://jspm.io/), an amazing package management and module loading system.
The following commands were used to set up this project (see also the [JSPM Getting Started Guide](https://github.com/jspm/jspm-cli/wiki/Getting-Started)):
```
jspm init # Accepting all defaults.
jspm install model=github:curran/model
jspm install d3
```Next, the code for the plugin itself was added into `lib/dummyVis.js`.
Next, `package.json` was edited. Here's the original `package.json` generated by JSPM:
```
{
"jspm": {
"directories": {},
"dependencies": {
"d3": "github:mbostock/d3@^3.5.5",
"model": "github:curran/model@^0.2.2"
},
"devDependencies": {
"traceur": "github:jmcriffey/[email protected]",
"traceur-runtime": "github:jmcriffey/[email protected]"
}
}
}
```This needs to be edited to tell JSPM where the source files are (by setting "directories.lib"), which is the main file (by setting "main"), and to declare that the format is AMD. Also, we do not really need to use Traceur at all, so the devDependencies can be removed. See also [Configuring Packages for jspm](https://github.com/jspm/registry/wiki/Configuring-Packages-for-jspm). Here is the new `package.json`:
```
{
"jspm": {
"directories": {
"lib": "lib"
},
"main": "dummyVis",
"format": "amd",
"dependencies": {
"d3": "github:mbostock/d3@^3.5.5",
"model": "github:curran/model@^0.2.2"
}
}
}
```Note that NPM and JSPM add the subdirectories `jspm_packages` and `node_modules` that should not be checked in to the Git repository. To exclude these from the repo, we need to create a `.gitignore` file with the following content:
```
jspm_packages
node_modules
```Finally, to publish this Chiasm plugin to the world for consuption using JSPM, the files were committed to the Git repo, and a Git semver tag was added with the command:
```
git tag -a v0.0.1 -m "First release"
git push --tags
```Now the plugin is published, and someone can install it in their enrivonment using the following command:
```
jspm install dummyVis=github:curran/dummyVis
```