Skip to content

Commit

Permalink
updated build (tested with NodeJS v7+ NPM v4+, and Yarn)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielweck committed May 25, 2017
1 parent d8a7032 commit cc02b59
Show file tree
Hide file tree
Showing 5 changed files with 685 additions and 24 deletions.
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -24,7 +24,8 @@ See [license.txt](./license.txt).
## Prerequisites

* A decent terminal. On Windows, GitShell works great ( http://git-scm.com ), GitBash works too ( https://msysgit.github.io ), and Cygwin adds useful commands ( https://www.cygwin.com ).
* NodeJS ( https://nodejs.org ) **v4+** (Note that NodeJS v6+ and NPM v3+ are now supported)
* NodeJS ( https://nodejs.org ) **v4+** (Note that NodeJS v6+ and NPM v3+ are now supported, including NodeJS v7+ and NPM v4+)
* Optionally: Yarn ( https://yarnpkg.com ) **v0.23+**


## Development
Expand All @@ -33,9 +34,10 @@ See [license.txt](./license.txt).

* `git submodule update --init --recursive` to ensure that the readium-shared-js chain of dependencies is initialised (readium-cfi-js)
* `git checkout BRANCH_NAME && git submodule foreach --recursive 'git checkout BRANCH_NAME'` to switch to the desired BRANCH_NAME
* `npm run prepare` (to perform required preliminary tasks, like patching code before building)
* `npm run prepare:all` (to perform required preliminary tasks, like patching code before building)
* OR: `yarn run prepare:yarn:all` (to use Yarn instead of NPM for node_module management)

Note that in some cases, administrator rights may be needed in order to install dependencies, because of NPM-related file access permissions (the console log would clearly show the error). Should this be the case, running `sudo npm run prepare` usually solves this.
Note that in some cases, administrator rights may be needed in order to install dependencies, because of NPM-related file access permissions (the console log would clearly show the error). Should this be the case, running `sudo npm run prepare:all` usually solves this.

Note that the above command executes the following:

Expand Down
56 changes: 51 additions & 5 deletions package.cson
Expand Up @@ -36,8 +36,9 @@ name: "readium-shared-js"
version: "0.27.0-alpha"

engines:
node: ">=0.12"
npm: ">2.10"
node: ">=4"
npm: ">=2"
yarn: ">=0.23"

description: "Readium - shared javascript module"

Expand Down Expand Up @@ -154,7 +155,7 @@ scripts:


#=====================
'prepare': '
'prepare:all': '
npm run
prepare:submodule
Expand All @@ -170,11 +171,42 @@ scripts:
'prepare:local': '
npm outdated
&&
;
npm install
&&
npm update
&&
npm run prepare:local:common
'

#=====================
'prepare:yarn:all': '
yarn run
prepare:yarn:submodule
&&
yarn run
prepare:yarn:local
&&
yarn run
prepare:patch
'

#=====================
'prepare:yarn:local': '
yarn outdated
;
yarn install
&&
yarn upgrade
&&
yarn run prepare:local:common
'

#=====================
'prepare:local:common': '
node
readium-cfi-js/readium-build-tools/gitHubForksUpdater.js
'
Expand All @@ -184,7 +216,19 @@ scripts:
cd readium-cfi-js
&&
npm run prepare
npm run prepare:all
&&
cd ..
&&
ls
'

#=====================
'prepare:yarn:submodule': '
cd readium-cfi-js
&&
npm run prepare:yarn:all
&&
cd ..
&&
Expand All @@ -205,6 +249,8 @@ scripts:
#=====================
clean: '
yarn --version
;
node --version
&&
npm --version
Expand Down
35 changes: 20 additions & 15 deletions package.json
Expand Up @@ -7,8 +7,9 @@
"name": "readium-shared-js",
"version": "0.27.0-alpha",
"engines": {
"node": ">=0.12",
"npm": ">2.10"
"node": ">=4",
"npm": ">=2",
"yarn": ">=0.23"
},
"description": "Readium - shared javascript module",
"keywords": [
Expand Down Expand Up @@ -45,27 +46,31 @@
],
"dependencies": {
"concurrently": "latest",
"http-server": "danielweck/http-server",
"npm-run-all": "latest",
"opener": "latest",
"http-server": "danielweck/http-server"
"opener": "latest"
},
"devDependencies": {
"jquery-sizes": "bramstein/jsizes",
"domReady": "requirejs/domReady",
"backbone": "latest",
"urijs": "danielweck/URI.js",
"eventemitter3": "latest",
"es6-collections": "latest",
"css-element-queries": "danielweck/css-element-queries",
"cssom": "danielweck/CSSOM",
"css-element-queries": "danielweck/css-element-queries"
"domReady": "requirejs/domReady",
"es6-collections": "latest",
"eventemitter3": "latest",
"jquery-sizes": "bramstein/jsizes",
"urijs": "danielweck/URI.js"
},
"scripts": {
"cson2json": "node ./readium-cfi-js/node_modules/cson/bin/cson2json package.cson > package.json && node readium-cfi-js/readium-build-tools/optimizePackageJsonScripts.js",
"prepare": "npm run prepare:submodule && npm run prepare:local && npm run prepare:patch",
"prepare:local": "npm outdated && npm install && npm update && node readium-cfi-js/readium-build-tools/gitHubForksUpdater.js",
"prepare:submodule": "cd readium-cfi-js && npm run prepare && cd .. && ls",
"prepare:all": "npm run prepare:submodule && npm run prepare:local && npm run prepare:patch",
"prepare:local": "npm outdated ; npm install && npm update && npm run prepare:local:common",
"prepare:yarn:all": "yarn run prepare:yarn:submodule && yarn run prepare:yarn:local && yarn run prepare:patch",
"prepare:yarn:local": "yarn outdated ; yarn install && yarn upgrade && yarn run prepare:local:common",
"prepare:local:common": "node readium-cfi-js/readium-build-tools/gitHubForksUpdater.js",
"prepare:submodule": "cd readium-cfi-js && npm run prepare:all && cd .. && ls",
"prepare:yarn:submodule": "cd readium-cfi-js && npm run prepare:yarn:all && cd .. && ls",
"prepare:patch": "node ./readium-cfi-js/node_modules/rimraf/bin.js node_modules/eventemitter3/_rjs/** && node readium-cfi-js/node_modules/requirejs/bin/r.js -convert node_modules/eventemitter3/ node_modules/eventemitter3/_rjs/",
"clean": "node --version && npm --version && node ./readium-cfi-js/node_modules/rimraf/bin.js build-output/* && node ./readium-cfi-js/node_modules/rimraf/bin.js api-docs/*",
"clean": "yarn --version ; node --version && npm --version && node ./readium-cfi-js/node_modules/rimraf/bin.js build-output/* && node ./readium-cfi-js/node_modules/rimraf/bin.js api-docs/*",
"apidocs": "node ./readium-cfi-js/node_modules/yuidocjs/lib/cli.js -N -C -c yuidocs.json",
"prebuild": "npm run clean",
"build": "npm run build:styles && npm run build:scripts",
Expand All @@ -83,4 +88,4 @@
"dowatch": "node ./readium-cfi-js/node_modules/watch/cli.js \"npm run build && node readium-cfi-js/readium-build-tools/webbrowser.js && node ./readium-cfi-js/node_modules/rimraf/bin.js open_webbrowser.js\" dev/ js/ plugins/ readium-cfi-js/js/",
"httpServe": "node readium-cfi-js/readium-build-tools/http-server.js -LOGFILE http.log -OPEN /dev/ -a 127.0.0.1 -p 9090 --cors ."
}
}
}
2 changes: 1 addition & 1 deletion readium-cfi-js
Submodule readium-cfi-js updated 5 files
+2 −2 .travis.yml
+5 −3 README.md
+32 −4 package.cson
+22 −18 package.json
+2,960 −0 yarn.lock

0 comments on commit cc02b59

Please sign in to comment.