Skip to content

Commit

Permalink
Update golos-lib-js to 0.9.71, support check-integrity
Browse files Browse the repository at this point in the history
  • Loading branch information
1aerostorm committed May 8, 2024
1 parent 0135dae commit 664126f
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ config/process.json
config/process-dev.json
config/process-prod.json
config/client_config.js
app/JsLibHash.json

db/config/config.json

Expand Down
2 changes: 2 additions & 0 deletions app/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { init as initAnchorHelper } from 'app/utils/anchorHelper';
import { authRegisterUrl, } from 'app/utils/AuthApiClient';
import { APP_ICON, VEST_TICKER, } from 'app/client_config';
import session from 'app/utils/session'
import libInfo from 'app/JsLibHash.json'

const APP_REMINDER_INTERVAL = 60*24*60*60*1000

Expand Down Expand Up @@ -96,6 +97,7 @@ class App extends React.Component {
componentDidMount() {
if (process.env.BROWSER) {
console.log('ui-wallet version:', $STM_Config.ui_version);
console.log('golos-lib-js version:', libInfo.version, 'hash:', libInfo.hash)
}

const { nightmodeEnabled } = this.props;
Expand Down
59 changes: 59 additions & 0 deletions check_integrity.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const fs = require('fs')
const { hashElement } = require('folder-hash')

async function main(argv) {
try {
const hashOut = './lib/my_hash.js'

const path = 'node_modules/golos-lib-js'

const res = await hashElement(path, {
files: {
exclude: [
path + '/lib/my_hash.js',
path + '/dist/golos.min.js.gz',
path + '/dist/golos-tests.min.js.gz',
path + '/dist/stats.html',
// These not including when NPM publishes
'.npmrc',
'.babelrc',
'.gitignore',
'.npmignore',
'yarn.lock',
],
matchBasename: true,
matchPath: true,
},
folders: {
exclude: [
'node_modules',
path + '/src',
path + '/examples'
],
matchPath: true,
ignoreRootName: true
}
})

console.log(res.children)
//console.log(res.children.filter(o => o.name === 'lib')[0].children.filter(o => o.name === 'auth')[0].children)

console.log('LIBRARY HASH IS', res.hash)

if (argv[2] === '--save') {
let json = 'node_modules/golos-lib-js/package.json'
json = fs.readFileSync(json, 'utf8')
json = JSON.parse(json)

const appPath = 'app/JsLibHash.json'
let data = {}
data.version = json.version
data.hash = res.hash
fs.writeFileSync(appPath, JSON.stringify(data))
}
} catch (err) {
console.error('LIBRARY HASH FAILED:', err)
}
}

main(process.argv)
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@
"main": "dist/electron/electron.js",
"scripts": {
"build-version": "./server/build-version.sh",
"build": "NODE_ENV=production ./node_modules/.bin/webpack --config ./webpack/prod.config.js",
"build-hash": "node check_integrity --save",
"build": "npm run build-hash && NODE_ENV=production ./node_modules/.bin/webpack --config ./webpack/prod.config.js",
"mocha": "NODE_ENV=test mocha ./mocha.setup.js",
"test": "npm run mocha -- app/**/*.test.js",
"test:watch:all": "npm test -- --watch --watch-extensions jsx",
"test:watch": "npm run mocha -- --watch --watch-extensions jsx",
"prod": "NODE_ENV=production ./node_modules/@babel/node/bin/babel-node.js server/index.js",
"dev": "./node_modules/.bin/webpack serve --config ./webpack/dev.config.js",
"dev": "npm run build-hash && ./node_modules/.bin/webpack serve --config ./webpack/dev.config.js",
"dev:local": "./.env.start.local.sh",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"dev:app": "./node_modules/.bin/webpack serve --config ./webpack/dev-app.config.js",
"build:app": "cross-env NODE_ENV=production NODE_CONFIG_ENV=production,desktop ./node_modules/.bin/webpack --config ./webpack/prod-app.config.js",
"build:app": "npm run build-hash && cross-env NODE_ENV=production NODE_CONFIG_ENV=production,desktop ./node_modules/.bin/webpack --config ./webpack/prod-app.config.js",
"build:app-entry": "cross-env NODE_ENV=production NODE_CONFIG_ENV=production,desktop ./node_modules/@babel/node/bin/babel-node.js build_app_entry.js"
},
"author": "Golos <[email protected]>",
Expand Down Expand Up @@ -52,7 +53,7 @@
"fs-extra": "^10.0.1",
"git-rev-sync": "^3.0.2",
"golos-dex-lib-js": "^1.0.2",
"golos-lib-js": "^0.9.68",
"golos-lib-js": "^0.9.71",
"history": "^2.0.0-rc2",
"immutable": "^3.8.2",
"intl": "^1.2.5",
Expand Down
29 changes: 28 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4264,7 +4264,7 @@ golos-dex-lib-js@^1.0.2:
dependencies:
golos-lib-js "^0.9.64"

golos-lib-js@^0.9.64, golos-lib-js@^0.9.68:
golos-lib-js@^0.9.64:
version "0.9.68"
resolved "https://registry.yarnpkg.com/golos-lib-js/-/golos-lib-js-0.9.68.tgz#62f3c4a7755eacfbe6dc2f6ebc3111f2ff74e6dd"
integrity sha512-KoQMFHtINYdM0hhe9dKPpWXZLo3MkFXyRxY/zQq0kbBjAwJBU4P1WEMwmPS+MPujjizfvU6nerUOLI4Lj7ChFw==
Expand All @@ -4291,6 +4291,33 @@ golos-lib-js@^0.9.64, golos-lib-js@^0.9.68:
stream-browserify "^3.0.0"
ws "^8.2.3"

golos-lib-js@^0.9.71:
version "0.9.71"
resolved "https://registry.yarnpkg.com/golos-lib-js/-/golos-lib-js-0.9.71.tgz#794bc6582a96f0e1a3bc4301e0c5dfac976a15bf"
integrity sha512-FkR7nuyMUXj+IT8ErTFhu6BsaEvPaLZAr72r5H+GUhqbD8q98tFfBURCKw0MGfiO9CEv0zdDG3daPTq2TThvxA==
dependencies:
abort-controller "^3.0.0"
assert "^2.0.0"
bigi "^1.4.2"
browserify-aes "^1.0.6"
bs58 "^4.0.0"
buffer "^6.0.3"
bytebuffer "^5.0.1"
core-js "^3.17.3"
create-hash "^1.1.2"
create-hmac "^1.1.4"
cross-env "^5.0.0"
cross-fetch "^3.0.0"
debug "^2.6.8"
detect-node "^2.0.3"
ecurve "^1.0.5"
lodash "^4.17.21"
process "^0.11.10"
regenerator-runtime "^0.13.9"
secure-random "^1.1.1"
stream-browserify "^3.0.0"
ws "^8.2.3"

goober@^2.1.10:
version "2.1.12"
resolved "https://registry.yarnpkg.com/goober/-/goober-2.1.12.tgz#6c1645314ac9a68fe76408e1f502c63df8a39042"
Expand Down

0 comments on commit 664126f

Please sign in to comment.