Skip to content

Commit

Permalink
Fixing issues with Vite not liking cassproject npm.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lomilar committed Oct 24, 2023
1 parent 7d8e6e1 commit cc3cf00
Show file tree
Hide file tree
Showing 9 changed files with 292 additions and 255 deletions.
517 changes: 276 additions & 241 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"dependencies": {
"axios": "1.1.3",
"base64-arraybuffer": "^1.0.2",
"buffer": "^6.0.3",
"forge": "^2.3.0",
"form-data": "^4.0.0",
"http2-wrapper": "^2.2.0",
Expand All @@ -114,6 +115,7 @@
"papaparse": "^5.4.1",
"pem-jwk": "^2.0.0",
"promise-worker": "^2.0.1",
"stream": "npm:stream-browserify@^3.0.0",
"rdf-canonize": "^3.4.0",
"web-worker": "^1.2.0"
},
Expand All @@ -139,24 +141,24 @@
},
"homepage": "https://github.com/cassproject/cass-npm#readme",
"devDependencies": {
"@babel/core": "^7.23.0",
"@babel/preset-env": "^7.22.20",
"@babel/core": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@cypress/browserify-preprocessor": "^3.0.2",
"@cypress/vite-dev-server": "^5.0.6",
"@cypress/webpack-preprocessor": "^6.0.0",
"babel-eslint": "^10.1.0",
"babel-plugin-transform-remove-strict-mode": "^0.0.2",
"chai": "^4.3.10",
"concurrently": "^8.2.1",
"concurrently": "^8.2.2",
"convert-hrtime": "^5.0.0",
"cypress": "^13.3.0",
"eslint": "^8.50.0",
"cypress": "^13.3.2",
"eslint": "^8.51.0",
"mocha": "^10.2.0",
"node-polyfill-webpack-plugin": "^2.0.1",
"nodemon": "^3.0.1",
"nyc": "^15.1.0",
"wait-on": "^7.0.1",
"webpack": "^5.88.2",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4"
}
}
4 changes: 2 additions & 2 deletions src/com/eduworks/ec/crypto/EcAesCtrAsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let realCrypto = require('crypto');
*/
module.exports = class EcAesCtrAsync {
static fipsOn(){
if (process && process.env && process.env.FIPS)
if (typeof process !== 'undefined' && process && process.env && process.env.FIPS)
if (realCrypto.getFips() == 0)
try {
realCrypto.setFips(true);
Expand All @@ -39,7 +39,7 @@ module.exports = class EcAesCtrAsync {
}

static fipsOff(){
if (process && process.env && process.env.FIPS)
if (typeof process !== 'undefined' && process && process.env && process.env.FIPS)
if (realCrypto.getFips() == 1)
try {
realCrypto.setFips(false);
Expand Down
2 changes: 1 addition & 1 deletion src/com/eduworks/ec/crypto/EcRsaOaepAsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ module.exports = class EcRsaOaepAsync {
crypto === undefined ||
crypto.subtle == null ||
crypto.subtle === undefined ||
(process && process.env && process.env.FIPS)
(typeof process !== 'undefined' && process && process.env && process.env.FIPS)
) {
return EcRsaOaepAsyncWorker.sign(ppk, text, success, failure);
}
Expand Down
2 changes: 1 addition & 1 deletion src/com/eduworks/ec/remote/EcRemote.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ if (global.axios == null)

const { cassPromisify } = require("../promises/helpers");

getAxiosOptions = function(url) {
let getAxiosOptions = function(url) {
let newOptions = Object.assign({}, axiosOptions);
if (corsOrigins.findIndex((x) => url.startsWith(x)) > -1)
newOptions.withCredentials = true;
Expand Down
2 changes: 1 addition & 1 deletion src/org/cassproject/ebac/identity/EcIdentityManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ module.exports = class EcIdentityManager {
* @static
*/
createSignature(duration, server, ppk, algorithm) {
if (process && process.env && process.env.FIPS == null && realCrypto.getFips && realCrypto.getFips() == 1)
if (typeof process !== 'undefined' && process && process.env && process.env.FIPS == null && realCrypto.getFips && realCrypto.getFips() == 1)
{
algorithm = "SHA-256";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ require("../../../general/AuditLogger.js")
*/
module.exports = class EcRemoteIdentityManager extends RemoteIdentityManagerInterface {
server = null;
global = null;
// global = null;
usernameWithSalt = null;
passwordWithSalt = null;
secretWithSalt = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = class OAuth2FileBasedRemoteIdentityManager extends
configuration = null;
oauthLoginResponse = null;
network = null;
global = null;
// global = null;
/**
* Returns true if the identity manager is global. Returns false if the identity manager is local to the server.
*
Expand Down
2 changes: 1 addition & 1 deletion src/org/cassproject/ebac/repository/EcRepository.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const envHttp2 = process.env.HTTP2 != null ? process.env.HTTP2.trim() == 'true' : true;
const envHttp2 = typeof process !== 'undefined' && process != null && process.env != null && process.env.HTTP2 != null ? process.env.HTTP2.trim() == 'true' : true;
if (!envHttp2)
{
global.axios = require("axios"); //Pre-empt http2 use.
Expand Down

0 comments on commit cc3cf00

Please sign in to comment.