Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yet Another Switch to CommonJS #456

Merged
merged 64 commits into from
Jan 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
074672a
Start 0.7.0.
davidlehn Jan 6, 2017
1395e79
Move code to lib/.
davidlehn Aug 1, 2016
a9b22e3
Convert code to CommonJS.
davidlehn Aug 2, 2016
942f030
Update tests to use CommonJS code.
davidlehn Aug 2, 2016
951ba2f
Use IIFEs for modules that return early.
davidlehn Aug 5, 2016
454e03b
Set `module.exports` on early return.
davidlehn Aug 5, 2016
32a11d1
Remove multiple forge instances feature.
davidlehn Dec 15, 2016
d067b82
Add forge.util.isNodejs.
davidlehn Dec 15, 2016
8b38606
Fix source paths.
davidlehn Dec 15, 2016
ec7d258
Update linting tools.
davidlehn Dec 15, 2016
74a1fae
Add webpack build support.
davidlehn Dec 15, 2016
5f6bb82
Update testing to use Karma.
davidlehn Dec 16, 2016
a00726c
Style fixes.
davidlehn Dec 16, 2016
0c35030
Refactor tests and examples.
davidlehn Dec 21, 2016
9f8ec2e
Update README.
davidlehn Dec 21, 2016
7345e14
Improve OID mapping code.
davidlehn Dec 21, 2016
3878e02
Cleanup.
davidlehn Dec 21, 2016
bd54039
Coverage testing note and cleanups.
davidlehn Dec 21, 2016
8a452cd
Use compact contributors style and add myself.
davidlehn Dec 21, 2016
920ec9b
Use Node.js for http, https, and policy servers.
davidlehn Dec 21, 2016
4b83b04
Improve policy server logging.
davidlehn Dec 21, 2016
781da71
Add sessionIdContext to HTTPS test server.
davidlehn Dec 21, 2016
aa0d125
Add HTTPS test server session resume support.
davidlehn Dec 21, 2016
b187dbc
Remove Python support.
davidlehn Dec 23, 2016
6256832
Refactor Flash support.
davidlehn Dec 23, 2016
25f1c09
Rebuild SocketPool.swf.
davidlehn Dec 23, 2016
6f5ac9b
Remove trailing whitespace.
davidlehn Dec 23, 2016
b5663f1
Update to HTML 5 style doctype.
davidlehn Dec 23, 2016
a2208ce
Build, use, and test jsbn for webworkers.
davidlehn Dec 23, 2016
3986c9e
Cleanups.
davidlehn Dec 23, 2016
cea3132
Fix WebSocket and WebID tests.
davidlehn Dec 23, 2016
5b04307
Add browserify testing support.
davidlehn Dec 23, 2016
a034c54
Fix Node.js 4 testing compatibility.
davidlehn Dec 23, 2016
90631f7
Add karma tap reporter.
davidlehn Dec 23, 2016
4c7b053
Enable all tests in PhantomJS.
davidlehn Dec 23, 2016
31a3262
Increase Mocha timeout.
davidlehn Dec 23, 2016
ba37674
Add Karma Safari support.
davidlehn Dec 23, 2016
b55a294
Add more UTC vs generalized time tests.
davidlehn Jan 2, 2017
8cc47c8
Update dependencies.
davidlehn Jan 2, 2017
83fc064
Clean up websocket and webid tests.
davidlehn Jan 4, 2017
c8b1a3b
Fix test looping bugs.
davidlehn Jan 5, 2017
7699994
Improve PhantomJS support.
davidlehn Jan 5, 2017
ddd17a2
Add CHANGELOG.
davidlehn Jan 5, 2017
f053b51
Add Security Considerations section.
davidlehn Jan 5, 2017
7a191d5
Move Bower/bundle support to forge-dist.
davidlehn Jan 5, 2017
96d5ddc
Improve requirements text.
davidlehn Jan 5, 2017
889deb2
Add pbkdf2 usePureJavaScript test.
davidlehn Jan 5, 2017
8dd1c0b
Check for callback errors.
davidlehn Jan 5, 2017
4c9a82f
Add async rsa.generateKeyPair tests.
davidlehn Jan 5, 2017
4c58c70
Modify non-web worker primeinc to make it deterministic.
dlongley Jan 5, 2017
551e480
WebWorker improvements.
davidlehn Jan 6, 2017
93e41d4
Default to cheap-module-source-map.
davidlehn Jan 6, 2017
6f77914
Update release process.
davidlehn Jan 6, 2017
f7fcf32
Add rsa.generateKeyPair usePureJavaScript tests.
davidlehn Jan 6, 2017
52b327a
Only run Travis-CI karma tests once.
davidlehn Jan 6, 2017
74ef74d
Always use webpack for karma worker bundle.
davidlehn Jan 6, 2017
bf1b75d
Add .editorconfig support.
davidlehn Jan 6, 2017
ff959ee
Add .npmignore.
davidlehn Jan 6, 2017
bb55966
Add migration from 0.6.x to 0.7.x notes.
davidlehn Jan 6, 2017
99b04b6
Fix typos.
davidlehn Jan 6, 2017
46f4f16
Reword some text.
davidlehn Jan 6, 2017
543781c
Fix for IE <= 8.
davidlehn Jan 6, 2017
30c9fc9
Security considerations updates.
davidlehn Jan 10, 2017
3bbbe91
Update CHANGELOG.
davidlehn Jan 10, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,json,yaml,yml}]
indent_style = space
indent_size = 2

[*.py]
indent_style = space
indent_size = 4
12 changes: 1 addition & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@
.cproject
.project
.settings
Makefile
TAGS
aclocal.m4
autom4te.cache
build
config.log
config.status
configure
coverage
dist
js/forge.bundle.js
js/forge.min.js
node_modules
nodejs/coverage
tests/forge
2 changes: 1 addition & 1 deletion nodejs/.istanbul.yml → .istanbul.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
instrumentation:
root: ..
root: .
29 changes: 24 additions & 5 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"excludeFiles": [
"./js/forge.bundle.js",
"./js/forge.min.js",
"./js/jsbn.js",
"./nodejs/ui/require.js",
"./nodejs/ui/test.min.js"
"./lib/jsbn.js"
],
"disallowKeywords": ["with"],
"disallowKeywordsOnNewLine": ["else", "catch"],
Expand All @@ -16,44 +12,67 @@
// use w/angular directive templates?
//"disallowMultipleLineStrings": true,
"disallowNewlineBeforeBlockStatements": true,
//"disallowSpaceAfterKeywords": [
// "if",
// "for",
// "while",
// "do",
// "switch",
// "catch"
//],
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpaceBeforeBinaryOperators": [","],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true
},
//"disallowSpacesInCallExpression": true,
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
//"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowTrailingComma": true,
"disallowTrailingWhitespace": true,
//"maximumLineLength": {
// "value": 80,
// "allExcept": ["comments", "regex"]
//},
"requireCommaBeforeLineBreak": true,
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
"requireLineFeedAtFileEnd": true,
"requireSemicolons": true,
"requireSpaceAfterBinaryOperators": ["?", ":", "+", "-", "/", "*", "%", "==", "===", "!=", "!==", ">", ">=", "<", "<=", "&&", "||"],
"requireSpaceBeforeBinaryOperators": ["?", ":", "+", "-", "/", "*", "%", "==", "===", "!=", "!==", ">", ">=", "<", "<=", "&&", "||"],
//"requireSpaceBeforeObjectValues": true,
"requireSpaceAfterKeywords": [
"else",
"do",
"return",
"try"
],
//"requireSpaceBeforeKeywords": [
// "else",
// "while",
// "catch"
//],
"requireSpaceBeforeBlockStatements": true,
"requireSpacesInConditionalExpression": {
"afterTest": true,
"beforeConsequent": true,
"afterConsequent": true,
"beforeAlternate": true
},
//"requireSpacesInForStatement": true,
"requireSpacesInFunction": {
"beforeOpeningCurlyBrace": true
},
"safeContextKeyword": "self",
//"validateIndentation": 2,
"validateLineBreaks": "LF",
// FIXME: enable doc checks (update to use newer jscs jsdoc module)
//"validateJSDoc": {
Expand Down
6 changes: 0 additions & 6 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
js/forge.bundle.js
minify.js
nodejs/build.js
nodejs/minify.js
nodejs/ui/require.js
nodejs/ui/test.min.js
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"sub": true
"sub": true,
"esversion": 6
}
43 changes: 43 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# cruft
*.py[co]
*.sw[nop]
*~
.bower.json
.cdtproject
.classpath
.cproject
.project
.settings
TAGS

# development
.editorconfig
.istanbul.yml
.jscsrc
.jshintignore
.jshintrc
.npmignore
.travis.yml
CONTRIBUTING.md
examples
karma*.js
tests
webpack*.js

# installed
node_modules

# built
dist
coverage

# browser WebWorker files
lib/prime.worker.js

# index.all.js
lib/index.all.js
lib/form.js
lib/http.js
lib/socket.js
lib/tlssocket.js
lib/xhr.js
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ node_js:
- "6"
- "node"
sudo: false
install: (cd nodejs && npm install)
install: npm install
script:
- (cd nodejs && npm test)
- if [ "x$BUNDLER" = "x" ]; then npm test; fi
- if [ "x$BUNDLER" != "x" ]; then npm run test-karma; fi
# only run karma tests for one node version
matrix:
include:
- node_js: "6"
env: BUNDLER=webpack
- node_js: "6"
env: BUNDLER=browserify
notifications:
email:
on_success: change
Expand Down
83 changes: 83 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Forge ChangeLog
===============

## 0.7.0 - 2017-??-??

### Fixed

- Fix test looping bugs so all tests are run.

### Changed

- Major refactor to use CommonJS plus a browser build system.
- Updated tests, examples, docs.
- Updated dependencies.
- Updated flash build system.
- Improve OID mapping code.
- Change test servers from Python to JavaScript.
- Improve PhantomJS support.
- Move Bower/bundle support to
[forge-dist](https://github.com/digitalbazaar/forge-dist).

### Added

- webpack bundler support via `npm run build`:
- Builds .js, .min.js, and basic sourcemaps.
- Basic build: forge.js.
- Build with extra utils and networking support: forge.all.js.
- Build WebWorker support: prime.worker.js.
- Browserify support in package.json.
- Karma browser testing.
- `forge.options` field.
- `forge.options.usePureJavaScript` flag.
- `forge.util.isNodejs` flag (used to select "native" APIs).
- Run PhantomJS tests in Travis-CI.
- Add "Donations" section to README.
- Add IRC to "Contact" section of README.
- Add "Security Considerations" section to README.
- Add pbkdf2 usePureJavaScript test.
- Add rsa.generateKeyPair async and usePureJavaScript tests.
- Add .editorconfig support.

### Removed

- **BREAKING**: Can no longer call `forge({...})` to create new instances.
- Remove a large amount of old cruft.

### Migration from 0.6.x to 0.7.x

- (all) If you used the feature to create a new forge instance with new
configuration options you will need to rework your code. That ability has
been removed due to implementation complexity. The main rare use was to set
the option to use pure JavaScript. That is now available as a library global
flag `forge.options.usePureJavaScript`.
- (npm,bower) If you used the default main file there is little to nothing to
change.
- (npm) If you accessed a sub-resource like `forge/js/pki` you should either
switch to just using the main `forge` and access `forge.pki` or update to
`forge/lib/pki`.
- (bower) If you used a sub-resource like `forge/js/pki` you should switch to
just using `forge` and access `forge.pki`. The bower release bundles
everything in one minified file.
- (bower) A configured workerScript like
`/bower_components/forge/js/prime.worker.js` will need to change to
`/bower_components/forge/dist/prime.worker.min.js`.
- (all) If you used the networking support or flash socket support, you will
need to use a custom build and/or adjust where files are loaded from. This
functionality is not included in the bower distribution by default and is
also now in a different directory.
- (all) The library should now directly support building custom bundles with
webpack, browserify, or similar.

### Notes

- This major update requires updating the version to 0.7.x. The existing
work-in-progress "0.7.x" branch will be painfully rebased on top of this new
0.7.x and moved forward to 0.8.x or later as needed.
- 0.7.x is a start of simplifying forge based on common issues and what has
appeared to be the most common usage. Please file issues with feedback if the
changes are problematic for your use cases.

## 0.6.x - 2016 and earlier

- See Git commit log or https://github.com/digitalbazaar/forge.
28 changes: 25 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ Versioning
Release Process
---------------

* commit changes
## Update the main repository:

* Commit changes.
* `$EDITOR package.json`: update to release version and remove `-dev` suffix.
* `git commit package.json -m "Release {version}."`
* `git tag {version}`
Expand All @@ -29,12 +31,32 @@ Release Process
* `git push`
* `git push --tags`

## Publish to NPM:

To ensure a clean upload, use a clean updated checkout, and run the following:

* `git checkout {version}`
* `npm publish`

## Update bundled distribution

This is kept in a different repository due to accumulated per-release bundle
sizes.

* Checkout [forge-dist][].
* Build a clean Forge version you want to distribute:
* `git checkout {version}`
* `npm run build`
* Copy files to `forge-dist`:
* `cp dist/forge.min.js{,.map} dist/prime.worker.min.js{,.map} FORGEDIST/dist/`
* Release `forge-dist`:
* `git commit -a -m "Release {version}."`
* `git tag {version}`
* `git push`
* `git push --tags`

[Node.js Style Guide]: http://nodeguide.com/style.html
[jshint]: http://www.jshint.com/install/
[Semantic Versioning]: http://semver.org/
[README]: ./README.md
[Semantic Versioning]: http://semver.org/
[forge-dist]: https://github.com/digitalbazaar/forge-dist
[jshint]: http://www.jshint.com/install/
6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
You may use the Forge project under the terms of either the BSD License or the
You may use the Forge project under the terms of either the BSD License or the
GNU General Public License (GPL) Version 2.

The BSD License is recommended for most projects. It is simple and easy to
The BSD License is recommended for most projects. It is simple and easy to
understand and it places almost no restrictions on what you can do with the
Forge project.

If the GPL suits your project better you are also free to use Forge under
If the GPL suits your project better you are also free to use Forge under
that license.

You don't have to do anything special to choose one license or the other and
Expand Down
Loading