Skip to content

Commit

Permalink
add package.json and readme for js template
Browse files Browse the repository at this point in the history
  • Loading branch information
cherriechang committed Aug 14, 2024
1 parent 0d964f2 commit c9851f8
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 1 deletion.
50 changes: 50 additions & 0 deletions templates/template-js/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# {name}

## Overview

{description}

## Loading

### In browser

```html
<script src="https://unpkg.com/@jspsych-timelines/{name}">
```
### Via NPM
```
npm install @jspsych-timelines/{name}
```
```js
import { createTimeline, timelineUnits, utils } from "@jspsych-timelines/{name}"
```
## Compatibility
`@jspsych-timelines/{name}` requires jsPsych v7.0.0 or later.
## Documentation
### createTimeline
#### {globalName}.createTimeline(jsPsych, { *options* }) ⇒ <code>timeline</code>
Description of the timeline that this plugin generates
The following parameters can be specified in the **options** parameter.
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| parameter | type | default | description |
### timelineUnits
### utils
## Author / Citation
{author}
33 changes: 33 additions & 0 deletions templates/template-js/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "@jspsych-timelines/{name}",
"version": "0.0.1",
"description": "{description}",
"unpkg": "dist/index.browser.min.js",
"files": [
"index.js",
"dist"
],
"scripts": {
"build": "babel index.js --presets @babel/preset-env,minify --source-maps --out-file dist/index.browser.min.js",
"build:watch": "npm run build -- --watch"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jspsych/jspsych-timelines.git",
"directory": "packages/{name}"
},
"author": {
"name": "{author}",
"url": "{authorUrl}"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/jspsych/jspsych-timelines/issues"
},
"homepage": "https://github.com/jspsych/jspsych-timelines/tree/main/packages/{name}",
"devDependencies": {
"@jspsych/config": "^2.0.0",
"jspsych": "^7.0.0"
}
}

2 changes: 1 addition & 1 deletion templates/template-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"main": "dist/index.mjs",
"types": "dist/index.d.ts",
"unpkg": "dist/index.global.js",
"unpkg": "dist/index.browser.min.js",
"scripts": {
"build": "tsup src/index.ts --format esm,iife --sourcemap --dts --treeshake --clean --global-name {globalName}"
},
Expand Down

0 comments on commit c9851f8

Please sign in to comment.