Skip to content

Commit

Permalink
Set up monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianRappl committed May 5, 2021
1 parent e0cee19 commit 04bf410
Show file tree
Hide file tree
Showing 66 changed files with 16,624 additions and 19,660 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf

[*.md]
trim_trailing_whitespace = false
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
src/**/*.test.tsx
**/*.d.tsx
src/**/*.spec.tsx
**/*.d.tsx
**/node_modules/**/*
11 changes: 6 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": [
"ts-react-important-stuff",
"plugin:prettier/recommended"
]
}
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": ["ts-react-important-stuff", "plugin:prettier/recommended"]
}
47 changes: 24 additions & 23 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ on:
types:
- created

env:
ESM_NAME: "@openmrs/esm-home-app"
JS_NAME: "openmrs-esm-home-app.js"

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -23,21 +19,26 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: "14.x"
- run: npm install
- run: npm run lint
- run: npm run coverage
- run: npm run typescript
- run: npm run build --if-present
- run: npx lerna bootstrap
- run: npx lerna run lint
- run: npx lerna run typescript
- run: npx lerna run test
- run: npx lerna run build
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: dist
name: packages
path: |
dist
packages/**/dist
deploy:
deploy_home_app:
runs-on: ubuntu-latest

env:
DIR_NAME: "esm-home-app"
ESM_NAME: "@openmrs/esm-home-app"
JS_NAME: "openmrs-esm-home-app.js"

needs: build

if: ${{ github.event_name == 'push' }}
Expand All @@ -51,7 +52,7 @@ jobs:
shell: bash
run: |
mkdir -p dist/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}
mv dist/*.* dist/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}/
mv packages/${{ env.DIR_NAME }}/dist/*.* dist/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}/
- name: Publish to Digital Ocean
uses: jakejarvis/s3-sync-action@master
with:
Expand Down Expand Up @@ -81,16 +82,17 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "14.x"
registry-url: "https://registry.npmjs.org"
- run: npm install
- run: sed -i -e "s/\(\"version\":\\s\+\"\([0-9]\+\.\?\)\+\)/\1-pre.${{ github.run_number }}/" 'package.json'
- run: npm publish --access public --tag next
- run: npx lerna bootstrap
- run: npx lerna run build
- run: npx lerna version "$(node -e "console.log(require('./lerna.json').version)")-pre.${{ github.run_number }}" --no-git-tag-version --yes
- run: git config user.email "[email protected]" && git config user.name "OpenMRS CI"
- run: git add . && git commit -m "Prerelease version" --no-verify
- run: npm run ci:prepublish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

Expand All @@ -103,14 +105,13 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "14.x"
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm publish --access public
registry-url: "https://registry.npmjs.org"
- run: npx lerna bootstrap
- run: npx lerna run build
- run: npm run ci:publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
Loading

0 comments on commit 04bf410

Please sign in to comment.