From 508041b7b94f92a8d6eeb35c8db47cd2ab5990f5 Mon Sep 17 00:00:00 2001 From: Kirill Konshin Date: Sat, 21 Mar 2015 00:33:51 -0700 Subject: [PATCH 1/6] Docs & scripts - Created CONTRIBUTING.md - Updated README.md - Added package.json scripts --- CONTRIBUTING.md | 28 ++++++++++++++++++++++++ README.md | 57 +++++++++++++++++++++++++++++++++++++------------ package.json | 4 ++++ 3 files changed, 75 insertions(+), 14 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..09bf774 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,28 @@ +# Contribution + +# Git Flow + +The crypto-js project uses [git flow](https://github.com/nvie/gitflow) to manage branches. +Do your changes on the `develop` or even better on a `feature/*` branch. Don't do any changes on the `master` branch. + +# Pull request + +Target your pull request on `develop` branch. Other pull request won't be accepted. + +# How to build + +1. Clone + +2. Run + + ```sh + npm install + ``` + +3. Run + + ```sh + npm run build + ``` + +4. Check `build` folder \ No newline at end of file diff --git a/README.md b/README.md index b232804..5ead0a0 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,9 @@ Modularized port of googlecode project crypto-js. ## Node.js (Install) Requirements: -* Node.js -* npm (Node.js package manager) + +- Node.js +- npm (Node.js package manager) ```bash npm install crypto-js @@ -15,6 +16,7 @@ npm install crypto-js ### Usage Modular include: + ```javascript var AES = require("crypto-js/aes"); var SHA256 = require("crypto-js/sha256"); @@ -23,6 +25,7 @@ console.log(SHA256("Message")); ``` Including all libraries, for access to extra methods: + ```javascript var CryptoJS = require("crypto-js"); console.log(CryptoJS.HmacSHA1("Message", "Key")); @@ -30,22 +33,59 @@ console.log(CryptoJS.HmacSHA1("Message", "Key")); ## Client (browser) +Requirements: + +- Node.js +- Bower (package manager for frontend) + +```bash +bower install crypto-js +``` + ### Usage Modular include: + ```javascript +require.config({ + packages: [ + { + name: 'crypto-js', + location: 'path-to/bower_components/crypto-js', + main: 'index' + } + ] +}); + require(["crypto-js/aes", "crypto-js/sha256"], function (AES, SHA256) { console.log(SHA256("Message")); }); ``` Including all libraries, for access to extra methods: + ```javascript -require("crypto-js", function (CryptoJS) { +// Above-mentioned will work or use this simple form +require.config({ + paths: { + 'require-js': 'path-to/bower_components/crypto-js/crypto-js' + } +}); + +require(["crypto-js"], function (CryptoJS) { console.log(CryptoJS.HmacSHA1("Message", "Key")); }); ``` +### Usage without RequireJS + +```html + + + ## API See: https://code.google.com/p/crypto-js @@ -122,17 +162,6 @@ See: https://code.google.com/p/crypto-js - ```crypto-js/pad-zeropadding``` - ```crypto-js/pad-nopadding``` -## Contribution - -### Git Flow - -The crypto-js project uses [git flow](https://github.com/nvie/gitflow) to manage branches. -Do your changes on the `develop` or even better on a `feature/*` branch. Don't do any changes on the `master` branch. - -### Pull request - -Target your pull request on `develop` branch. Other pull request won't be accepted. - ## License [The MIT License (MIT)](http://opensource.org/licenses/MIT) diff --git a/package.json b/package.json index ad4dfb3..cd423ae 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,10 @@ "url": "http://opensource.org/licenses/MIT" } ], + "scripts": { + "build": "grunt build", + "check": "grunt default" + }, "main": "index.js", "dependencies": {}, "devDependencies": { From 30c53221581817ac8d6c3ab9fd9aa7ebd8fa3f6f Mon Sep 17 00:00:00 2001 From: evanvosberg Date: Tue, 31 Mar 2015 18:48:50 +0200 Subject: [PATCH 2/6] Update umd build config for global exports. --- grunt/config/modularize.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grunt/config/modularize.js b/grunt/config/modularize.js index d17d313..133053f 100644 --- a/grunt/config/modularize.js +++ b/grunt/config/modularize.js @@ -123,7 +123,8 @@ module.exports = { // core "core": { "exports": "CryptoJS", - "components": ["core"] + "components": ["core"], + "global": "CryptoJS" }, "x64-core": { "exports": "CryptoJS", From 7bf510021890a5cb8c4ec89c1ed0b857ef69998e Mon Sep 17 00:00:00 2001 From: evanvosberg Date: Tue, 31 Mar 2015 19:12:33 +0200 Subject: [PATCH 3/6] Use latest fmd without the concat series/parallel bug. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cd423ae..d5c019c 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "main": "index.js", "dependencies": {}, "devDependencies": { - "fmd": "~0.0.1", + "fmd": "~0.0.3", "grunt": "^0.4.5", "grunt-contrib-clean": "^0.6.0", "grunt-contrib-copy": "^0.6.0", From 3c63cb47145b50b12ac7b29d0e354846bc3e0dd0 Mon Sep 17 00:00:00 2001 From: evanvosberg Date: Wed, 1 Apr 2015 02:58:33 +0200 Subject: [PATCH 4/6] Add contributing doc to the build. --- grunt/config/copy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/grunt/config/copy.js b/grunt/config/copy.js index aaeb79c..4e6a603 100644 --- a/grunt/config/copy.js +++ b/grunt/config/copy.js @@ -9,6 +9,7 @@ module.exports = { cwd: '<%= meta.cwd %>', src: [ 'README.md', + 'CONTRIBUTING.md', 'license.md', 'docs/**/*' ], From 4eb74b984f84384ad5488f1b08875fe9b1014510 Mon Sep 17 00:00:00 2001 From: evanvosberg Date: Wed, 1 Apr 2015 02:59:12 +0200 Subject: [PATCH 5/6] Remove legacy dev dependency. --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index d5c019c..2aec27c 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,7 @@ "grunt-jsonlint": "^1.0.4", "grunt-update-json": "^0.2.0", "load-grunt-config": "^0.16.0", - "lodash": "^3.5.0", - "tar.gz": "~0.1.1" + "lodash": "^3.5.0" }, "keywords": [ "security", From 514d5967dbbce85867fe189e98a67001a541255d Mon Sep 17 00:00:00 2001 From: evanvosberg Date: Wed, 1 Apr 2015 15:05:46 +0200 Subject: [PATCH 6/6] Bump version. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2aec27c..9f9be52 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "crypto-js", "title": "crypto-js", "description": "Modularized port of googlecode project crypto-js.", - "version": "3.1.3", + "version": "3.1.4", "homepage": "http://github.com/evanvosberg/crypto-js", "author": { "name": "Evan Vosberg",