Skip to content

Commit

Permalink
Merge pull request #321 from TheLudd/es6
Browse files Browse the repository at this point in the history
add es module file and declaration
  • Loading branch information
davidchambers authored May 25, 2020
2 parents 1b1acd6 + da8e9b0 commit ef685db
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ When adding a type class to __README.md__, please update __names__ then run:
```console
$ npm run generate-js
$ npm run generate-ts
$ npm run generate-es
```
22 changes: 22 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export const equals = 'fantasy-land/equals';
export const lte = 'fantasy-land/lte';
export const compose = 'fantasy-land/compose';
export const id = 'fantasy-land/id';
export const concat = 'fantasy-land/concat';
export const empty = 'fantasy-land/empty';
export const invert = 'fantasy-land/invert';
export const filter = 'fantasy-land/filter';
export const map = 'fantasy-land/map';
export const contramap = 'fantasy-land/contramap';
export const ap = 'fantasy-land/ap';
export const of = 'fantasy-land/of';
export const alt = 'fantasy-land/alt';
export const zero = 'fantasy-land/zero';
export const reduce = 'fantasy-land/reduce';
export const traverse = 'fantasy-land/traverse';
export const chain = 'fantasy-land/chain';
export const chainRec = 'fantasy-land/chainRec';
export const extend = 'fantasy-land/extend';
export const extract = 'fantasy-land/extract';
export const bimap = 'fantasy-land/bimap';
export const promap = 'fantasy-land/promap';
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@
"/README.md",
"/index.d.ts",
"/index.js",
"/index.mjs",
"/package.json"
],
"main": "index.js",
"types": "index.d.ts",
"module": "index.mjs",
"scripts": {
"doctest": "sanctuary-doctest",
"generate-es": "scripts/generate-es",
"generate-js": "scripts/generate-js",
"generate-ts": "scripts/generate-ts",
"lint": "sanctuary-lint",
Expand Down
4 changes: 4 additions & 0 deletions scripts/generate-es
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -euf -o pipefail

awk '{ print "export const " $0 " = \047fantasy-land/" $0 "\047;" }' names >index.mjs
1 change: 1 addition & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules/.bin/sanctuary-lint "$@"

scripts/generate-js && git diff --exit-code index.js
scripts/generate-ts && git diff --exit-code index.d.ts
scripts/generate-es && git diff --exit-code index.mjs

0 comments on commit ef685db

Please sign in to comment.