Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
feat: introduce ES entry point for configuration-validation package
Browse files Browse the repository at this point in the history
OKTA-334917
<<<Jenkins Check-In of Tested SHA: bde3263 for [email protected]>>>
Artifact: okta-oidc-js
  • Loading branch information
oleksandrpravosudko-okta authored and eng-prod-CI-bot-okta committed Jan 11, 2021
1 parent 1029475 commit 8327d9f
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 18 deletions.
14 changes: 14 additions & 0 deletions packages/configuration-validation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 1.1.0

### Features

- [#954](https://github.com/okta/okta-oidc-js/pull/954)
- Adds ES entry point for configuration-validation
- Adds sourcemaps

# 1.0.0

### Features

- [#879](https://github.com/okta/okta-oidc-js/pull/879) Adds support for Typescript

# 0.4.3

### Bug Fixes
Expand Down
11 changes: 7 additions & 4 deletions packages/configuration-validation/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "@okta/configuration-validation",
"version": "1.0.0",
"version": "1.1.0",
"description": "Configuration validation support for Okta JavaScript SDKs",
"main": "./dist/lib.js",
"module": "./dist/lib.esm.js",
"types": "./dist/lib.d.ts",
"files": [
"dist",
"src"
],
"scripts": {
"clean": "rimraf dist",
"build": "tsc",
"build": "rollup -c",
"lint": "eslint . && tsc -p test",
"prepare": "yarn build",
"test": "yarn lint && yarn test:unit",
Expand Down Expand Up @@ -50,6 +51,9 @@
"eslint-plugin-jest": "^23.20.0",
"jest": "^26.4.2",
"rimraf": "^3.0.2",
"rollup": "^2.35.1",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.29.0",
"typescript": "^4.0.2"
},
"jest": {
Expand All @@ -66,7 +70,6 @@
]
},
"dependencies": {
"@okta/okta-auth-js": "^4.0.0",
"lodash": "^4.17.15"
"@okta/okta-auth-js": "^4.0.0"
}
}
29 changes: 29 additions & 0 deletions packages/configuration-validation/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import pkg from './package.json'
import typescript from 'rollup-plugin-typescript2'
import { terser } from 'rollup-plugin-terser'

export default {
input: 'src/lib.ts',
output: [
{
file: pkg.main,
format: 'cjs',
sourcemap: 'hidden'
},
{
file: pkg.module,
format: 'es',
sourcemap: 'hidden'
}
],
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
],
plugins: [
typescript({
typescript: require('typescript'),
}),
terser()
]
}
7 changes: 3 additions & 4 deletions packages/configuration-validation/src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ export interface OktaAuthOptions extends BaseOptions {
// used only by this library
testing?: TestingOptions;
}

import { merge } from 'lodash';

class ConfigurationValidationError extends Error {}

const findDomainURL = 'https://bit.ly/finding-okta-domain';
Expand Down Expand Up @@ -73,7 +72,7 @@ export const buildConfigObject = (config?: OktaAuthOptions): OktaAuthOptions =>
const storage = config.storage;
if (storage !== undefined || autoRenew !== undefined ) {
// Properties already defined within the "tokenManager" section will not be overwritten
tokenManager = merge({
tokenManager = Object.assign({
autoRenew: autoRenew,
storage: storage,
}, tokenManager || {});
Expand All @@ -85,7 +84,7 @@ export const buildConfigObject = (config?: OktaAuthOptions): OktaAuthOptions =>
responseType = responseType.split(/\s+/);
}

const normalizedConfig = merge({}, config, {
const normalizedConfig = Object.assign({}, config, {
clientId: config.clientId || config.client_id,
redirectUri: config.redirectUri || config.redirect_uri,
responseType: responseType,
Expand Down
3 changes: 2 additions & 1 deletion packages/configuration-validation/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"declaration": true,
"outDir": "./dist",
"allowJs": true,
"target": "es5"
"target": "es5",
"sourceMap": true
},
"include": ["./src/**/*"]
}
Loading

0 comments on commit 8327d9f

Please sign in to comment.