-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: use OKTA_AUTH injection token to inject oktaAuth instance (#79) * fixes prod build issue by introducing OKTA_AUTH injection token * add test apps * add changelog & migrating guide * add test apps readme OKTA-435165 <<<Jenkins Check-In of Tested SHA: 7b7fe1c for [email protected]>>> Artifact: okta-angular Files changed count: 286 PR Link: "#80"
- Loading branch information
1 parent
3698e63
commit e4c55a4
Showing
261 changed files
with
74,331 additions
and
5,634 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ testenv | |
yalc.lock | ||
yarn-error.log | ||
.idea | ||
build2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn test:apps:clear; git add test/apps/**/package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"packages": [ | ||
"test/apps/*" | ||
], | ||
"version": "0.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npx lerna exec -- npx yalc remove --all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#!/bin/bash -x | ||
|
||
source ${OKTA_HOME}/${REPO}/scripts/setup.sh | ||
source ${OKTA_HOME}/${REPO}/scripts/setup-e2e.sh | ||
|
||
setup_service google-chrome-stable 83.0.4103.61-1 | ||
setup_service java 1.8.222 | ||
setup_service google-chrome-stable 89.0.4389.72-1 | ||
|
||
export TEST_SUITE_TYPE="junit" | ||
export TEST_RESULT_FILE_DIR="${REPO}/test-reports/e2e" | ||
|
@@ -14,6 +15,9 @@ export [email protected] | |
get_secret prod/okta-sdk-vars/client_secret CLIENT_SECRET | ||
get_secret prod/okta-sdk-vars/password PASSWORD | ||
|
||
export CI=true | ||
export DBUS_SESSION_BUS_ADDRESS=/dev/null | ||
|
||
if ! yarn test:e2e; then | ||
echo "unit failed! Exiting..." | ||
exit ${TEST_FAILURE} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pushd ./dist | ||
npx yalc publish | ||
popd | ||
|
||
npx lerna exec -- npx yalc add @okta/okta-angular | ||
npx lerna exec -- yarn build --prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash -xe | ||
|
||
# Install yarn | ||
setup_service yarn 1.21.1 | ||
|
||
yarn global add yalc | ||
|
||
# Add yarn to the $PATH so npm cli commands do not fail | ||
export PATH="${PATH}:$(yarn global bin)" | ||
|
||
# Install required node version | ||
export NVM_DIR="/root/.nvm" | ||
setup_service node v12.20.0 | ||
|
||
cd ${OKTA_HOME}/${REPO} | ||
|
||
# undo permissions change on scripts/publish.sh | ||
git checkout -- scripts | ||
|
||
# ensure we're in a branch on the correct sha | ||
git checkout $BRANCH | ||
git reset --hard $SHA | ||
|
||
git config --global user.email "[email protected]" | ||
git config --global user.name "oktauploader-okta" | ||
|
||
#!/bin/bash | ||
YARN_REGISTRY=https://registry.yarnpkg.com | ||
OKTA_REGISTRY=${ARTIFACTORY_URL}/api/npm/npm-okta-master | ||
|
||
# Yarn does not utilize the npmrc/yarnrc registry configuration | ||
# if a lockfile is present. This results in `yarn install` problems | ||
# for private registries. Until [email protected] is released, this is our current | ||
# workaround. | ||
# | ||
# Related issues: | ||
# - https://github.com/yarnpkg/yarn/issues/5892 | ||
# - https://github.com/yarnpkg/yarn/issues/3330 | ||
|
||
# Replace yarn registry with Okta's | ||
echo "Replacing $YARN_REGISTRY with $OKTA_REGISTRY within yarn.lock files..." | ||
find . -type d -name node_modules -prune -o -name 'yarn.lock' -print -exec sed -i "s#${YARN_REGISTRY}#${OKTA_REGISTRY}#" {} + | ||
|
||
if ! yarn install --frozen-lockfile; then | ||
echo "yarn install failed! Exiting..." | ||
exit ${FAILED_SETUP} | ||
fi | ||
for app in test/apps/* | ||
do | ||
pushd $app | ||
yarn install | ||
popd | ||
done | ||
|
||
# Revert the original change(s) | ||
echo "Replacing $OKTA_REGISTRY with $YARN_REGISTRY within yarn.lock files..." | ||
find . -type d -name node_modules -prune -o -name 'yarn.lock' -print -exec sed -i "s#${OKTA_REGISTRY}#${YARN_REGISTRY}#" {} + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Test Apps | ||
|
||
This folder includes Angular test apps cross all supported Angular versions (7 - 13). All apps are generated via @angular/cli, then small adjustment has been added to support the E2E testing requirements. | ||
|
||
## How to setup a new test app | ||
|
||
1. Generate a new Angular app with @angular/cli under `test/apps` directory. | ||
|
||
**Note:** repalce `{version}` in the script with the Angular version for the new app. | ||
|
||
```bash | ||
nxp @angular/cli@{version} new angular-v{version} | ||
``` | ||
2. Copy `prebuild.js` from the exising test apps. The `prebuild` script loads okta test configs from `testenv`, then add it to Angular's environment module (`src/environments`). | ||
3. Update `scripts` and `workspaces` field in package.json by following `package.json` in the exising apps. | ||
4. Add `lite-server` in `devDependencies`, so the e2e tests can run against the prod build artifacts. `bs-config.js` should also be copied over as the static server's config file. | ||
5. Once above steps are finished, try the newly generated app locally first. If everything looks good, then update `runner.js` under `e2e` folder to bind e2e tests with the new app. | ||
6. Push a commit and test on bacon. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. | ||
# For additional information regarding the format and rule options, please see: | ||
# https://github.com/browserslist/browserslist#queries | ||
|
||
# For the full list of supported browsers by the Angular framework, please see: | ||
# https://angular.io/guide/browser-support | ||
|
||
# You can see what browsers were selected by your queries by running: | ||
# npx browserslist | ||
|
||
last 1 Chrome version | ||
last 1 Firefox version | ||
last 2 Edge major versions | ||
last 2 Safari major versions | ||
last 2 iOS major versions | ||
Firefox ESR | ||
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line. | ||
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Editor configuration, see https://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.ts] | ||
quote_type = single | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
Oops, something went wrong.