Skip to content

Commit

Permalink
Refactored to es6 modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist authored and kedashoe committed Oct 3, 2017
1 parent e76b9a7 commit f494250
Show file tree
Hide file tree
Showing 375 changed files with 2,928 additions and 2,650 deletions.
17 changes: 17 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"env": {
"cjs": {
"plugins": [
"annotate-pure-calls",
"./scripts/transpile/esm-to-cjs",
"./scripts/transpile/wrap-constructor-pattern"
]
},
"es": {
"plugins": [
"annotate-pure-calls",
"./scripts/transpile/wrap-constructor-pattern"
]
}
},
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
**/*.min.js
test/index.html
test/bundle.js
es/**
src/**
dist/**
lib/test/**
node_modules/**
Expand Down
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"parserOptions": {
"sourceType": "module"
},
"env": {
"node": true,
"mocha": true,
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/es
/src
/lib/bench/report/
/lib/docs/public/
/node_modules/
/npm-debug.log
/ramda.js.tmp
/lib/test/bundle.js
/tmp
/bower_components/
Expand Down
9 changes: 4 additions & 5 deletions BOOKMARKLET.md

Large diffs are not rendered by default.

17 changes: 5 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
UGLIFY = node_modules/.bin/uglifyjs
XYZ = node_modules/.bin/xyz --repo git@github.com:ramda/ramda.git --script scripts/prepublish

SRC = $(shell find src -name '*.js')

dist/ramda.js:
npm run build:umd

dist/ramda.js: scripts/build scripts/header scripts/template.js $(SRC)
git checkout -- '$@'
scripts/header >ramda.js.tmp
'$<' --complete >>ramda.js.tmp
mv ramda.js.tmp '$@'

dist/ramda.min.js: dist/ramda.js scripts/header
scripts/header >'$@'
$(UGLIFY) --compress --mangle <'$<' >>'$@'
dist/ramda.min.js:
npm run build:umd:min


.PHONY: clean
clean:
rm -f -- dist/ramda.js ramda.js.tmp
rm -f -- dist/ramda.js


.PHONY: lint
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,15 @@ Or you can inject ramda into virtually any unsuspecting website using [the bookm

### Build

* on Unix-based platforms, `npm run build` updates __dist/ramda.js__ and __dist/ramda.min.js__
* on Windows, write the output of `scripts/build --complete` to a temporary file, then rename the temporary file __dist/ramda.js__.
`npm run build` creates `es`, `src` directories and updates both __dist/ramda.js__ and __dist/ramda.min.js__

#### Partial Builds

It is possible to build Ramda with a subset of the functionality to reduce its file size. Ramda's build system supports this with command line flags. For example if you're using `R.compose`, `R.reduce`, and `R.filter` you can create a partial build with:

./scripts/build -- src/compose.js src/reduce.js src/filter.js > dist/ramda.custom.js
npm run --silent partial-build compose reduce filter > dist/ramda.custom.js

This requires having Node/io.js installed.
This requires having Node/io.js installed and ramda's dependencies installed (just use `npm install` before running partial build).



Expand Down
2 changes: 2 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"**/.*",
"node_modules",
"bower_components",
"source",
"es",
"test",
"tests",
"examples",
Expand Down
248 changes: 0 additions & 248 deletions index.js

This file was deleted.

Loading

0 comments on commit f494250

Please sign in to comment.