Skip to content
This repository has been archived by the owner on Jan 26, 2025. It is now read-only.

Commit

Permalink
Use lerna to manage monorepo packages (#518)
Browse files Browse the repository at this point in the history
* Use lerna to manage monorepo (no yarn "workspace")

- Use webpack to load okta-react in test harness (do not copy to node_modules)
- Install all packages on top-level yarn install
- Avoid installing local node module for test harness
- Use a web_module shim for okta-angular test harness
  • Loading branch information
aarongranick-okta authored Aug 13, 2019
1 parent 1f3261a commit fa4c0fa
Show file tree
Hide file tree
Showing 29 changed files with 36,690 additions and 17,774 deletions.
16 changes: 10 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
language: node_js
node_js:
- '8.10'
- '8.10.0'

addons:
chrome: stable
apt:
packages:
- oracle-java9-set-default

services:
- xvfb

jdk:
- default-jdk

script:
- yarn install
- sh ./scripts/runTests.sh
- bash ./scripts/snyk.sh

install:
- yarn install

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0
- export PATH="$HOME/.yarn/bin:$PATH"
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sudo apt-get update
- sudo apt-get install -y libappindicator1

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ yarn install

### Monorepo

The okta-oidc-js repo is managed as a **monorepo** using [Yarn Workspaces](https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/) for managing dependencies and [Lerna](https://lernajs.io/) for everything else. You can think of each package as a separate npm module - each must list out its own dependencies, have its own package name, and be versioned.
The okta-oidc-js repo is managed as a **monorepo** using [Lerna](https://lernajs.io/). Each package within the **monorepo** is a separate npm module, each with its own `package.json` and `node_modules` directory.

Packages are parsed from the `workspaces` property in [package.json](package.json), and adhere to this structure:
Packages are parsed from the `packages` property in [lerna.json](lerna.json), and adhere to this structure:

```bash
packages/
Expand Down
5 changes: 4 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"lerna": "2.1.0",
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true
"packages": [
"packages/*",
"packages/*/test/e2e/harness"
]
}
17 changes: 1 addition & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,6 @@
"publish": "lerna publish --skip-npm",
"test": "sh ./scripts/runTests.sh",
"clean": "lerna clean",
"postinstall": "lerna run prepare"
},
"workspaces": {
"packages": ["packages/*"],
"nohoist": [
"**/jest",
"**/jest/**",
"**/jest-junit",
"**/jest-junit/**",
"**/jest-expo",
"**/jest-expo/**",
"**/babel-jest",
"**/babel-jest/**",
"**/react-native",
"**/react-native/**"
]
"postinstall": "sh ./scripts/installPackages.sh"
}
}
2 changes: 2 additions & 0 deletions packages/configuration-validation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"homepage": "https://github.com/okta/okta-oidc-js#readme",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-eslint": "^8.1.1",
"babel-preset-env": "^1.7.0",
"eslint": "^4.7.1",
"jest": "^23.6.0"
},
Expand Down
Loading

0 comments on commit fa4c0fa

Please sign in to comment.