Skip to content
This repository was archived by the owner on Oct 10, 2019. It is now read-only.

Fixes some minor repo inconsistencies #3

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[
"@babel/preset-env",
{
useBuiltIns: "usage", // or "entry"
corejs: 3,
"useBuiltIns": "usage", // or "entry"
"corejs": 3,
"targets": {
"browsers": [
"last 2 versions"
Expand Down
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
test/
zenroom/
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "airbnb-base"
"extends": "standard",
"rules": {
"camelcase": "off"
}
}
19 changes: 8 additions & 11 deletions dist/lib/zenroom.js

Large diffs are not rendered by default.

Binary file removed dist/lib/zenroom.js.mem
Binary file not shown.
Binary file modified dist/lib/zenroom.wasm
Binary file not shown.
32 changes: 26 additions & 6 deletions dist/wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ require("regenerator-runtime/runtime");
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var MAX_BUFFER_SIZE = 1048576;

var C = require('../dist/lib/zenroom');
/* istanbul ignore next */

Expand Down Expand Up @@ -77,6 +75,8 @@ var zenroom = function () {
* @example <caption>Example usage of `script()`</caption>
* // returns zenroom
* import zenroom from 'zenroom'
* // or without ES6 syntax
* // const zenroom = require('zenroom').default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please update also the README.md?

Copy link
Contributor Author

@dappiu dappiu Jul 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .wasm and .js files are the output from Zenroom @ 34cc00c, the commit referred from the submodule, and emscripten

Actually, compiling from the master branch of Zenroom, the wasm produced won't pass the tests in which the script contains a reference to the global ECDH and spits out these messages:

[string "..."]:2: attempt to index a nil value (global 'ECDH')
[string "ZEN:begin(1)..."]:1: attempt to index a nil value (global 'ZEN')[!]

I'd ask @jaromil to give me a hint on how to address this problem

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it fixed now?

*
* const script = 'print("hello")'
* zenroom.script(script).zenroom_exec().reset()
Expand All @@ -98,6 +98,8 @@ var zenroom = function () {
* @example <caption>Example usage of `keys()`</caption>
* // returns zenroom
* import zenroom from 'zenroom'
* // or without ES6 syntax
* // const zenroom = require('zenroom').default
*
* const script = `
* keys = JSON.decode(KEYS)
Expand All @@ -124,6 +126,8 @@ var zenroom = function () {
* @example <caption>Example usage of `conf()`</caption>
* // returns zenroom
* import zenroom from 'zenroom'
* // or without ES6 syntax
* // const zenroom = require('zenroom').default
*
* const script = 'print("hello")'
* const conf = 'umm'
Expand All @@ -146,6 +150,8 @@ var zenroom = function () {
* @example <caption>Example usage of `data()`</caption>
* // returns zenroom
* import zenroom from 'zenroom'
* // or without ES6 syntax
* // const zenroom = require('zenroom').default
*
* const script = `
* data = JSON.decode(DATA)
Expand All @@ -172,6 +178,8 @@ var zenroom = function () {
* @example <caption>Example usage of `print()`</caption>
* // returns zenroom
* import zenroom from 'zenroom'
* // or without ES6 syntax
* // const zenroom = require('zenroom').default
*
* const savedLines = []
* const printFunction = (text) => { savedLines.push(text) }
Expand All @@ -198,6 +206,8 @@ var zenroom = function () {
* @example <caption>Example usage of `success()`</caption>
* // returns zenroom
* import zenroom from 'zenroom'
* // or without ES6 syntax
* // const zenroom = require('zenroom').default
*
* const script = 'print("hello")'
* zenroom.script(script).success(()=>{
Expand All @@ -222,6 +232,8 @@ var zenroom = function () {
* @example <caption>Example usage of `error()`</caption>
* // returns zenroom
* import zenroom from 'zenroom'
* // or without ES6 syntax
* // const zenroom = require('zenroom').default
*
* const script = 'print("hello")';
* zenroom.script(script).error(()=>{
Expand Down Expand Up @@ -250,14 +262,14 @@ var zenroom = function () {
* <li>2 = DEBUG</li>
* </ul>
*
* @example <caption>Example usage of `success`</caption>
* @example <caption>Example usage of `verbosity()`</caption>
* // returns zenroom
* import zenroom from 'zenroom'
* // or without ES6 syntax
* // const zenroom = require('zenroom').default
*
* const script = 'print("hello")'
* zenroom.script(script).success(()=>{
* pleaseRunSomeOtherMethodAfter();
* }).zenroom_exec()
* zenroom.script(script).verbosity(2).zenroom_exec()
*
* @param {number} verbosity
* @returns {object} the zenroom module
Expand All @@ -278,6 +290,8 @@ var zenroom = function () {
* @example <caption>Example usage of `zenroom_exec()`</caption>
* // returns zenroom
* import zenroom from 'zenroom'
* // or without ES6 syntax
* // const zenroom = require('zenroom').default
*
* const script = 'print("hello")';
* zenroom.script(script).zenroom_exec()
Expand All @@ -300,6 +314,8 @@ var zenroom = function () {
* @example <caption>Example usage of `zencode_exec()`</caption>
* // returns zenroom
* import zenroom from 'zenroom'
* // or without ES6 syntax
* // const zenroom = require('zenroom').default
*
* const zencode = 'print("hello")';
* zenroom.script(script).zencode_exec()
Expand Down Expand Up @@ -333,6 +349,8 @@ var zenroom = function () {
* @example <caption>Example usage of `init()`</caption>
* // returns zenroom
* import zenroom from 'zenroom'
* // or without ES6 syntax
* // const zenroom = require('zenroom').default
*
* const encrypt_secret_to_many = {
* script: `keyring = ECDH.new()
Expand Down Expand Up @@ -407,6 +425,8 @@ var zenroom = function () {
* @example <caption>Example usage of `reset()`</caption>
* // returns zenroom
* import zenroom from 'zenroom'
* // or without ES6 syntax
* // const zenroom = require('zenroom').default
*
* const script = 'print("hello")';
* zenroom.script(script)
Expand Down
17 changes: 0 additions & 17 deletions index.js

This file was deleted.

47 changes: 21 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "zenroom",
"version": "0.9.5",
"description": "wrapper of Zenroom, a secure and small virtual machine for crypto language processing",
"main": "index.js",
"main": "src/wrapper.js",
"repository": "https://github.com/puria/zenroomjs.git",
"author": "Puria Nafisi Azizi <[email protected]>",
"license": "AGPL-3.0",
"scripts": {
"lint": "npx standard",
"lint": "eslint --ext .js .",
"build": "cd zenroom && make javascript-npm",
"clean": "rimraf dist/lib && cd zenroom && make clean",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
Expand All @@ -24,37 +24,32 @@
"dist"
],
"devDependencies": {
"@babel/cli": "^7.2.0",
"@babel/core": "^7.2.0",
"@babel/preset-env": "^7.2.0",
"@babel/cli": "^7.5.5",
"@babel/core": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.0.0",
"babel-plugin-istanbul": "^5.1.0",
"@babel/register": "^7.5.5",
"babel-plugin-istanbul": "^5.2.0",
"babelify": "^10.0.0",
"chai": "^4.2.0",
"codecov": "^3.1.0",
"documentation": "^8.1.2",
"eslint": "^5.9.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.14.0",
"codecov": "^3.5.0",
"documentation": "^12.0.3",
"eslint": "^6.1.0",
"eslint-config-standard": "^13.0.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^9.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"mkdirp": "^0.5.1",
"mocha": "^5.2.0",
"nyc": "^13.1.0",
"release-it": "^8.3.0",
"rimraf": "^2.6.2",
"sinon": "^7.1.1",
"standard": "^12.0.1"
"mocha": "^6.2.0",
"nyc": "^14.1.1",
"release-it": "^12.3.4",
"rimraf": "^2.6.3",
"sinon": "^7.3.2"
},
"dependencies": {
"core-js": "^3.1.4",
"regenerator-runtime": "^0.13.2"
},
"standard": {
"ignore": [
"dist",
"zenroom",
"test"
]
"regenerator-runtime": "^0.13.3"
},
"nyc": {
"extends": "@istanbuljs/nyc-config-babel",
Expand Down
Loading