Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
Adding ESM build
Browse files Browse the repository at this point in the history
  • Loading branch information
alippai committed Dec 28, 2017
1 parent ae57292 commit 66b0621
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 43 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
asmcrypto*.js
asmcrypto*.mjs
asmcrypto*.map
test/aes.asm.js
test/aes.asm.js.map
Expand Down
21 changes: 19 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = function (grunt) {
options: {
format: 'umd',
sourceMap: true,
banner: "/*! asmCrypto<%= pkg.version && ' v'+pkg.version %>, (c) 2013 <%= pkg.author.name %>, opensource.org/licenses/<%= pkg.license %> */",
banner: "/*! asmCrypto<%= pkg.version && ' v'+pkg.version %>, (c) 2018 <%= pkg.author.name %>, opensource.org/licenses/<%= pkg.license %> */",
},
default: {
options: {
Expand All @@ -27,6 +27,14 @@ module.exports = function (grunt) {
'asmcrypto.js': './src/entry-default.js'
}
},
default_esm: {
options: {
format: 'es',
},
files: {
'asmcrypto.mjs': './src/entry-default.js'
}
},
all: {
options: {
moduleName: 'asmCrypto',
Expand All @@ -35,6 +43,14 @@ module.exports = function (grunt) {
'asmcrypto.js': './src/entry-export_all.js'
}
},
all_esm: {
options: {
format: 'es',
},
files: {
'asmcrypto.mjs': './src/entry-export_all.js'
}
},
test_AES_ASM: {
options: {
moduleName: 'AES_asm',
Expand All @@ -53,7 +69,7 @@ module.exports = function (grunt) {
sourceMapIn: 'asmcrypto.js.map',
sourceMapIncludeSources: true,
screwIE8: true,
banner: "/*! asmCrypto<%= pkg.version && ' v'+pkg.version %>, (c) 2013 <%= pkg.author.name %>, opensource.org/licenses/<%= pkg.license %> */"
banner: "/*! asmCrypto<%= pkg.version && ' v'+pkg.version %>, (c) 2018 <%= pkg.author.name %>, opensource.org/licenses/<%= pkg.license %> */"
},
all: {
files: {
Expand Down Expand Up @@ -108,6 +124,7 @@ module.exports = function (grunt) {
});

grunt.registerTask('default', ['rollup:default', 'rollup:test_AES_ASM', 'uglify']);
grunt.registerTask('esm', ['rollup:default_esm']);
grunt.registerTask('devel', ['rollup:all', 'rollup:test_AES_ASM', 'connect', 'watch']);
grunt.registerTask('test', ['connect', 'qunit']);
};
84 changes: 43 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,47 @@
{
"name": "asmcrypto.js",
"description": "Asm.js implementation of WebCrypto API",
"homepage": "https://github.com/vibornoff/asmcrypto.js",
"main": "asmcrypto.js",
"license": "MIT",
"author": {
"name": "Artem S Vybornov",
"email": "[email protected]",
"web": "https://github.com/vibornoff"
"name": "asmcrypto.js",
"version": "0.13.0",
"description": "Asm.js implementation of WebCrypto API",
"homepage": "https://github.com/vibornoff/asmcrypto.js",
"main": "asmcrypto.js",
"module": "asmcrypto.mjs",
"license": "MIT",
"author": {
"name": "Artem S Vybornov",
"email": "[email protected]",
"web": "https://github.com/vibornoff"
},
"contributors": [
{
"name": "Ádám Lippai",
"email": "[email protected]",
"web": "https://github.com/alippai"
},
"contributors": [
{
"name": "Ádám Lippai",
"email": "[email protected]",
"web": "https://github.com/alippai"
},
{
"name": "Ximin Luo",
"email": "[email protected]",
"web": "https://github.com/infinity0"
}
],
"repository": {
"type": "git",
"url": "https://github.com/vibornoff/asmcrypto.js.git"
},
"devDependencies": {
"uglify-js": "vibornoff/UglifyJS2",
"grunt": "~1.0",
"grunt-cli": "~1.2",
"grunt-contrib-uglify": "~3.3",
"grunt-contrib-concat": "~1.0",
"grunt-contrib-qunit": "~2.0",
"grunt-contrib-connect": "~1.0",
"grunt-contrib-watch": "~1.0",
"grunt-contrib-clean": "~1.1",
"grunt-jsdoc": "~2.2",
"grunt-rollup": "^8.2.0"
},
"scripts": {
"prepublish": "grunt",
"test": "grunt test"
{
"name": "Ximin Luo",
"email": "[email protected]",
"web": "https://github.com/infinity0"
}
],
"repository": {
"type": "git",
"url": "https://github.com/vibornoff/asmcrypto.js.git"
},
"devDependencies": {
"uglify-js": "vibornoff/UglifyJS2",
"grunt": "~1.0",
"grunt-cli": "~1.2",
"grunt-contrib-uglify": "~3.3",
"grunt-contrib-concat": "~1.0",
"grunt-contrib-qunit": "~2.0",
"grunt-contrib-connect": "~1.0",
"grunt-contrib-watch": "~1.0",
"grunt-contrib-clean": "~1.1",
"grunt-jsdoc": "~2.2",
"grunt-rollup": "^8.2.0"
},
"scripts": {
"prepublish": "grunt && grunt esm",
"test": "grunt test"
}
}

0 comments on commit 66b0621

Please sign in to comment.