Skip to content

Commit

Permalink
[SDK-2817] Updated dependencies and release configuration (#1213)
Browse files Browse the repository at this point in the history
* Clean up the ci script

* Add postbump script to .shiprc

* Run npm update, add ignore file for prettier

* Update lint-staged, es-check, prettier (with config)

* Remove vscode prettier config in favour of .prettierrc

* Update some testing dependencies

* Update eslint
  • Loading branch information
Steve Hobbs authored Oct 1, 2021
1 parent 6ef61ec commit c9e3e97
Show file tree
Hide file tree
Showing 9 changed files with 2,547 additions and 2,704 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"prefer-spread": 0,
"prefer-rest-params": 0,
"lines-around-directive": 0,
"valid-typeof": 0
"valid-typeof": 0,
"radix": "off"
},
"settings": {
"polyfills": ["Object.assign"]
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
5 changes: 4 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"singleQuote": true,
"printWidth": 80
"printWidth": 80,
"trailingComma": "none",
"arrowParens": "avoid",
"endOfLine": "auto"
}
10 changes: 5 additions & 5 deletions .shiprc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files": {
"src/version.js": [],
"README.md": []
},
"postbump": "node scripts/jsdocs.js"
"files": {
"src/version.js": [],
"README.md": []
},
"postbump": "npm run build && git add -f dist/ && node scripts/jsdocs.js"
}
2 changes: 0 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Place your settings in this file to overwrite default and user settings.
{
"editor.formatOnSave": true,
"prettier.printWidth": 100,
"prettier.singleQuote": true,
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
Expand Down
5,129 changes: 2,510 additions & 2,619 deletions package-lock.json

Large diffs are not rendered by default.

43 changes: 21 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,39 +63,39 @@
},
"devDependencies": {
"@auth0/component-cdn-uploader": "^2.2.2",
"@babel/core": "^7.15.0",
"@babel/eslint-parser": "^7.15.0",
"@babel/core": "^7.15.5",
"@babel/eslint-parser": "^7.15.7",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.15.0",
"@babel/preset-env": "^7.15.6",
"@babel/register": "^7.15.3",
"babel-plugin-istanbul": "^5.1.4",
"babel-plugin-istanbul": "^6.0.0",
"browserstack-local": "^1.4.8",
"chromedriver": "^92.0.1",
"chromedriver": "^92.0.2",
"codecov": "^3.8.3",
"concurrently": "^6.2.1",
"cross-env": "^5.2.0",
"es-check": "^5.2.4",
"eslint": "^6.0.1",
"concurrently": "^6.2.2",
"cross-env": "^7.0.3",
"es-check": "^6.0.0",
"eslint": "^7.32.0",
"eslint-config-auth0-base": "^13.1.0",
"eslint-config-prettier": "^6.15.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-compat": "^3.13.0",
"eslint-plugin-import": "^2.24.1",
"eslint-plugin-import": "^2.24.2",
"expect.js": "^0.3.1",
"husky": "^3.0.0",
"husky": "^7.0.2",
"istanbul": "^0.4.5",
"jsdoc": "^3.6.7",
"jsdoc-to-markdown": "5.0.0",
"jsdom": "^15.1.1",
"jsdom-global": "^3.0.2",
"jsonwebtoken": "^8.5.1",
"lint-staged": "^9.2.0",
"mocha": "^9.1.0",
"mocha-junit-reporter": "^1.23.1",
"lint-staged": "^11.1.2",
"mocha": "^9.1.2",
"mocha-junit-reporter": "^2.0.0",
"mocha-parallel-tests": "^2.2.1",
"nyc": "^14.1.1",
"oidc-provider": "^7.6.0",
"prettier": "^1.18.2",
"pretty-quick": "^1.11.1",
"nyc": "^15.1.0",
"oidc-provider": "^7.8.0",
"prettier": "^2.4.1",
"pretty-quick": "^3.1.1",
"proxyquire": "^2.1.1",
"rollup": "^1.17.0",
"rollup-plugin-commonjs": "^10.0.1",
Expand All @@ -108,10 +108,9 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.1.1",
"selenium-webdriver": "^3.6.0",
"semver": "^6.2.0",
"sinon": "^7.3.2",
"sinon": "^11.1.2",
"wait-on": "^6.0.0",
"yargs": "^14.0.0"
"yargs": "^17.2.1"
},
"ccu": {
"name": "auth0",
Expand Down
52 changes: 0 additions & 52 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ MATCHER=${3:-"*"}
NPM_NAME=$(node scripts/utils/attribute.js name)
VERSION=$(node scripts/utils/attribute.js version)

NPM_BIN=$(npm bin)
STABLE=$($NPM_BIN/semver $VERSION -r "*")

# Enable failing on exit status here because semver exits with 1 when the range
# doesn't match.
set -e
Expand Down Expand Up @@ -42,51 +39,6 @@ cdn_release()
success "$NPM_NAME ($1) uploaded to cdn"
}

bower_release()
{
# Check if tag exists
TAG_NAME="v$VERSION"
TAG_EXISTS=$(git tag -l "$TAG_NAME")

if [ ! -z "$TAG_EXISTS" ]; then
verbose "There is already a tag $TAG_EXISTS in git. Skipping git deploy."
else
verbose "Deploying $VERSION to git"

LAST_COMMIT=$(git log -1 --pretty=%B)
# removing dist and build folders from gitignore so it gets pushed to the tag
grep -v -e '^dist$' -e '^dist/$' .gitignore > /tmp/.gitignore
grep -v -e '^build$' -e '^build/$' .gitignore > /tmp/.gitignore
mv /tmp/.gitignore .gitignore
git add --force dist/*
git add --force build/*
git commit -am "$TAG_NAME"
git tag "$TAG_NAME" -m "$LAST_COMMIT"
git push origin $TAG_NAME
success "$NPM_NAME version ready for bower"
fi
}

npm_release()
{
verbose "Checking if version $1 of $NPM_NAME is already available in npm…"

NPM_EXISTS=$(npm info -s $NPM_NAME@$1 version)

if [ ! -z "$NPM_EXISTS" ] && [ "$NPM_EXISTS" == "$1" ]; then
verbose "There is already a version $NPM_EXISTS in npm. Skipping npm publish…"
else
if [ ! -z "$STABLE" ]; then
verbose "Deploying $1 to npm"
npm publish
else
verbose "Deploying $1 to npm with tag $NPM_TAG"
npm publish --tag "$NPM_TAG"
fi
success "$NPM_NAME uploaded to npm registry"
fi
}

# Lint
npm run lint

Expand All @@ -101,9 +53,5 @@ rm -rf build
npm run build

# Release
git checkout -b dist
bower_release
new_line
cdn_release "$VERSION"
git checkout master
git branch -D dist
6 changes: 4 additions & 2 deletions src/web-auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function WebAuth(options) {
: true;

this.baseOptions._timesToRetryFailedRequests = options._timesToRetryFailedRequests
? parseInt(options._timesToRetryFailedRequests, 0)
? parseInt(options._timesToRetryFailedRequests)
: 0;

this.baseOptions.tenant =
Expand Down Expand Up @@ -215,7 +215,9 @@ WebAuth.prototype.parseHash = function(options, cb) {
}

var hashStr =
options.hash === undefined ? windowHelper.getWindow().location.hash : options.hash;
options.hash === undefined
? windowHelper.getWindow().location.hash
: options.hash;
hashStr = hashStr.replace(/^#?\/?/, '');

parsedQs = qs.parse(hashStr);
Expand Down

0 comments on commit c9e3e97

Please sign in to comment.