Skip to content
This repository was archived by the owner on Jan 2, 2024. It is now read-only.

Commit 8fce32d

Browse files
committed
Convert the web-sdk to a monorepo.
Change from using Jest as a playwright runner to using the playwright test runner This is still partially a WIP. I'd love to be able to write a plugin for nx and playwright and i'm talking to the Playwright devs specifically about exposing their test runner for this use case. Playwright speeds up our tests dramatically, improves stability and overall is a really positive change. Distribute CI tasks We distribute CI tasks leveraging the Distributed Task Executor from Nx. This will run in parallel the packages. When running the `test` task the DTE will parallelize all "test" tasks that it can run. Updated dependencies Part of this work included some updates to our dependencies like Jest, and typescript. Nothing out of the usual. Made fixes where needed. Renaming occured as part of feedback received over the course of the PR. autoscript-* refers to what was previously the e2e tests. autoscript-suites are the test suites where autoscript-apps refers to the actual app. Reverted to running CI on only mac. This is because there is a more near term goal of running e2e's against a preview env which alleviates the need for standing this up in CI which is a pain. updated the readme to remove certs from sample instructions and remove them from the reactjs instructions where possible. They are still needed for the server though (todos-api) remove certs from introspect call
1 parent 91897a4 commit 8fce32d

File tree

375 files changed

+48383
-20390
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

375 files changed

+48383
-20390
lines changed

.eslintrc.js

-23
This file was deleted.

.eslintrc.json

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"root": true,
3+
"plugins": ["@nrwl/nx", "@typescript-eslint"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {
8+
"@nrwl/nx/enforce-module-boundaries": [
9+
"error",
10+
{
11+
"enforceBuildableLibDependency": true,
12+
"allow": [],
13+
"depConstraints": [
14+
{
15+
"sourceTag": "*",
16+
"onlyDependOnLibsWithTags": ["*"]
17+
}
18+
]
19+
}
20+
]
21+
}
22+
},
23+
{
24+
"files": ["*.ts", "*.tsx"],
25+
"extends": ["plugin:@nrwl/nx/typescript"],
26+
"rules": {}
27+
},
28+
{
29+
"files": ["*.js", "*.jsx"],
30+
"extends": ["plugin:@nrwl/nx/javascript"],
31+
"rules": {}
32+
}
33+
],
34+
"parser": "@typescript-eslint/parser", // Specifies the ESLint parser
35+
"extends": [
36+
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
37+
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
38+
],
39+
"parserOptions": {
40+
"ecmaVersion": 2018, // Allows for the parsing of modern ECMAScript features
41+
"sourceType": "module"
42+
},
43+
"ignorePatterns": ["packages/**/dist/*"],
44+
"rules": {
45+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
46+
// e.g. "@typescript-eslint/explicit-function-return-type": "off"
47+
"@typescript-eslint/indent": ["error", 2],
48+
"@typescript-eslint/no-use-before-define": "warn",
49+
"max-len": ["error", { "code": 100 }],
50+
"quotes": ["error", "single", { "allowTemplateLiterals": true }]
51+
}
52+
}

.github/pull_request_template.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@ Check all that apply
2323

2424
- [ ] Acceptance criteria is met.
2525
- [ ] All tasks listed in the user story have been completed.
26-
- [ ] Coded to standards. - [ ] Code peer-reviewed. - [ ] Ensure backward compatibility (special attention).
26+
- [ ] Coded to standards.
27+
- [ ] Code peer-reviewed.
28+
- [ ] Ensure backward compatibility (special attention).
2729
- [ ] API reference docs is updated.
2830
- [ ] Unit tests are written.
2931
- [ ] Integration tests are written.
3032
- [ ] e2e tests are written.
3133
- [ ] CI build passing on the feature branch.
32-
- [ ] Functional spec is written/updated - [ ] contains example code snippets.
34+
- [ ] Functional spec is written/updated
35+
- [ ] contains example code snippets.
3336
- [ ] Change log updated.
3437
- [ ] Documentation story is created and tracked.
3538
- [ ] UI is completed or ticket is created.

.github/workflows/develop.yml

-117
This file was deleted.

.github/workflows/macos.yml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: ForgeRock Mac CI
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
- master
7+
pull_request:
8+
9+
env:
10+
NX_CLOUD_DISTRIBUTED_EXECUTION: true
11+
12+
jobs:
13+
pr:
14+
runs-on: macos-latest
15+
if: ${{ github.event_name == 'pull_request' }}
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
ref: ${{ github.event.pull_request.head.ref }}
20+
repository: ${{github.event.pull_request.head.repo.full_name}}
21+
fetch-depth: 0
22+
23+
- uses: actions/setup-node@v2
24+
with:
25+
node-version: '16.13.1'
26+
cache: 'npm'
27+
cache-dependency-path: '**/package-lock.json'
28+
29+
- name: Setup custom host for sdkapp.example.com
30+
run: sudo echo "127.0.0.1 sdkapp.example.com auth.example.com api.example.com user.example.com" | sudo tee -a /etc/hosts
31+
- run: cat /etc/hosts
32+
33+
- name: npm install
34+
run: npm ci
35+
env:
36+
DEBUG: pw:install
37+
# PLAYWRIGHT_BROWSERS_PATH: 0
38+
PLAYWRIGHT_SKIP_BROWSERS_DOWNLOAD: 1
39+
40+
- run: npx playwright install chromium firefox webkit
41+
42+
- name: Derive appropriate SHAs for base and head for `nx affected` commands
43+
uses: nrwl/nx-set-shas@v2
44+
with:
45+
main-branch-name: 'develop'
46+
47+
- run: npx nx-cloud start-ci-run
48+
- run: npx nx affected --target=build --parallel --max-parallel=3
49+
- run: npx nx affected --target=lint --parallel --max-parallel=3
50+
- run: npx nx affected --target=test --parallel --max-parallel=2
51+
- run: npx nx affected --target=test --configuration=integration --parallel --max-parallel=2
52+
- run: npx nx affected --target=e2e --parallel --max-parallel=2
53+
- run: npx nx-cloud stop-all-agents
54+
55+
- name: Upload Artifacts
56+
uses: actions/upload-artifact@v2
57+
if: always()
58+
with:
59+
name: 'E2E Artifacts'
60+
path: ${{ env.GITHUB_WORKSPACE }}/test-results
61+
retention-days: 5
62+
agents:
63+
runs-on: macos-latest
64+
name: Agent Mac
65+
strategy:
66+
matrix:
67+
agent: [1, 2, 3]
68+
steps:
69+
- uses: actions/checkout@v2
70+
with:
71+
ref: ${{ github.event.pull_request.head.ref }}
72+
repository: ${{github.event.pull_request.head.repo.full_name}}
73+
fetch-depth: 0
74+
- uses: actions/setup-node@v2
75+
with:
76+
node-version: '16.13.1'
77+
cache: 'npm'
78+
cache-dependency-path: '**/package-lock.json'
79+
- run: npm ci
80+
env:
81+
# PLAYWRIGHT_BROWSERS_PATH: 0
82+
PLAYWRIGHT_SKIP_BROWSERS_DOWNLOAD: 1
83+
84+
- name: Setup custom host for sdkapp.example.com
85+
run: sudo echo "127.0.0.1 sdkapp.example.com auth.example.com api.example.com user.example.com" | sudo tee -a /etc/hosts
86+
87+
- run: npx playwright install chromium firefox webkit
88+
- name: Start Nx Agent ${{ matrix.agent }}
89+
run: npx nx-cloud start-agent

.gitignore

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
# OS files
22
.DS_Store
3+
*/DS_Store
34

45
# Generated code
6+
tmp/
7+
*/dist/*
8+
dist
9+
packages/*/dist/
10+
packages/javascript-sdk/lib-esm
11+
packages/javascript-sdk/lib
12+
packages/javascript-sdk/bundle/
513
bundles/
614
docs/
715
coverage/
8-
lib/
9-
lib-esm/
1016
node_modules/
1117
samples/_static/js/*.js*
1218
tests/**/app/index.js*
1319
tests/**/ie11/ie-bundle.js*
1420
reports/*
1521
*.copy.*
22+
!env.config.copy.mjs
23+
packages/javascript-sdk/lib/
1624

1725
# Certificates
1826
*.pem
@@ -24,12 +32,21 @@ reports/*
2432
tests/**/app/index.js*
2533
tests/**/ie11/autoscript.js*
2634
reports/*
35+
test-results
2736

2837
# Sample code
2938
samples/_static/js/*.js*
39+
samples/_static/js/*
3040
samples/*/public/app.*
3141
samples/*/todos
3242
samples/*/users
43+
todos/
44+
users/
3345

3446
# Environment files
3547
.env
48+
.env.local
49+
.angular
50+
samples/**/.env.local
51+
samples/**/.env
52+
samples/angularjs-todo/.env.local

.prettierrc.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = {
2-
"arrowParens": "always",
3-
"printWidth": 100,
4-
"semi": true,
5-
"singleQuote": true,
6-
"tabWidth": 2,
7-
"trailingComma": "all",
2+
arrowParens: 'always',
3+
printWidth: 100,
4+
semi: true,
5+
singleQuote: true,
6+
tabWidth: 2,
7+
trailingComma: 'all',
88
};

0 commit comments

Comments
 (0)