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

Fix Jose import issue (#93) #97

Merged
merged 1 commit into from
Jul 23, 2019
Merged
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
6 changes: 4 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"env": {
"browser": true,
"es6": true,
"node": true
"node": true,
"jest/globals": true
},
"extends": [
"standard"
Expand All @@ -17,5 +18,6 @@
},
"rules": {
"semi": ["error", "always"]
}
},
"plugins": ["jest"]
}
11 changes: 9 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ module.exports = function(grunt) {
var config = {
pkg: grunt.file.readJSON('package.json'),

run: {
jest: {
cmd: 'jest',
}
},

eslint: {
options: {
fix: true
Expand Down Expand Up @@ -89,13 +95,14 @@ module.exports = function(grunt) {

grunt.initConfig(config);

grunt.loadNpmTasks('grunt-run');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-karma-coveralls');
grunt.loadNpmTasks('grunt-webpack');

grunt.registerTask('default', ['eslint', 'webpack', 'karma:without_coverage']);
grunt.registerTask('with_coverage', ['eslint', 'webpack', 'karma:with_coverage']);
grunt.registerTask('default', ['eslint', 'run:jest', 'webpack', 'karma:without_coverage']);
grunt.registerTask('with_coverage', ['eslint', 'run:jest', 'webpack', 'karma:with_coverage']);
};
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// babel.config.js
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
],
};
13 changes: 11 additions & 2 deletions dist/jose.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/jose.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/jose.min.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions lib/jose-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,24 @@ export { WebCryptographer } from './jose-jwe-webcryptographer';
/**
* Initializes a JoseJWE object.
*/
export var JoseJWE = {
const JoseJWE = {
Encrypter,
Decrypter
};

/**
* Initializes a JoseJWS object.
*/
export var JoseJWS = {
const JoseJWS = {
Signer,
Verifier
};

const Jose = { JoseJWS, JoseJWE };

export default { Jose };
export { Jose, JoseJWE, JoseJWS };

/**
* Set crypto provider to use (window.crypto, node-webcrypto-ossl, node-webcrypto-pkcs11 etc.).
*/
Expand Down
6 changes: 6 additions & 0 deletions lib/jose-core.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import DefaultJose, { Jose } from './jose-core.js';

it('ensure imports work', () => {
expect(Jose).not.toBeUndefined();
expect(DefaultJose).not.toBeUndefined();
});
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,35 @@
},
"scripts": {
"build": "grunt",
"lint": "eslint lib --fix"
"lint": "eslint lib --fix",
"test": "jest"
},
"devDependencies": {
"@babel/core": "^7.1.2",
"@babel/preset-env": "^7.1.0",
"@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.5",
"@webpack-cli/init": "^0.1.1",
"babel": "^6.23.0",
"babel-core": "^6.26.3",
"babel-jest": "^24.8.0",
"babel-loader": "^8.0.4",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"coveralls": "^2.13.1",
"eslint": "^6.0.1",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-jest": "^22.13.5",
"eslint-plugin-node": "^9.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"grunt": "~1.0.1",
"grunt": "^1.0.4",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-uglify": "^3.1.0",
"grunt-eslint": "^22.0.0",
"grunt-karma": "^2.0.0",
"grunt-karma-coveralls": "^2.5.4",
"grunt-run": "^0.8.1",
"grunt-webpack": "^3.1.3",
"jest": "^24.8.0",
"karma": "^1.7.1",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.1",
Expand Down