Skip to content

Commit

Permalink
(chore) Leverage turbo fully for running scripts (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen authored Jan 13, 2023
1 parent fff7947 commit 76a153f
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 61 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
server-token: ${{ secrets.TURBO_SERVER_TOKEN }}

- name: Run tests, lint and typechecking
run: yarn turbo run lint test typescript
run: yarn turbo lint test typescript

- name: Run build
run: yarn turbo run build --color --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team="${{ github.repository_owner }}"
run: yarn turbo build --color --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team="${{ github.repository_owner }}"

- name: Upload build artifacts
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
run: yarn

- name: Build
run: yarn turbo run build --color
run: yarn turbo build --color

- name: Patch
run: yarn lerna version patch --no-git-tag-version --no-push --yes
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
run: npx lerna bootstrap

- name: Build
run: yarn turbo run build --color
run: yarn turbo build --color

- name: Publish
run: yarn run ci:publish
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
minimum-change-threshold: 10000 # 10 KB
build-script: "turbo run build --color --no-cache"
build-script: "turbo build --color"
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
. "$(dirname -- "$0")/_/husky.sh"

yarn pretty-quick --staged
yarn run extract-translations
yarn turbo extract-translations
34 changes: 0 additions & 34 deletions jest.config.json

This file was deleted.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
"ci:prepublish": "lerna publish from-package --no-git-reset --yes --dist-tag next",
"ci:release": "lerna version --no-git-tag-version",
"ci:prerelease": "lerna version prerelease --no-git-tag-version --yes",
"coverage": "yarn test --coverage",
"prettier": "prettier --config prettier.config.js --write \"packages/**/*.{ts,tsx}\"",
"postinstall": "husky install",
"start": "openmrs develop --sources 'packages/esm-*-app/'",
"test": "cross-env TZ=UTC jest --config jest.config.json --verbose false --passWithNoTests",
"verify": "turbo run lint && yarn test && turbo run typescript"
"verify": "turbo lint typescript test"
},
"devDependencies": {
"@babel/core": "^7.20.5",
Expand Down
23 changes: 23 additions & 0 deletions packages/esm-home-app/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
transform: {
'^.+\\.tsx?$': '@swc/jest',
},
transformIgnorePatterns: ['/node_modules/(?!@openmrs)'],
moduleNameMapper: {
'\\.(s?css)$': 'identity-obj-proxy',
'@openmrs/esm-framework': '@openmrs/esm-framework/mock',
'lodash-es': 'lodash',
},
collectCoverageFrom: [
'**/src/**/*.tsx',
'!**/node_modules/**',
'!**/vendor/**',
'!**/src/**/*.test.*',
'!**/src/declarations.d.tsx',
],
setupFilesAfterEnv: ['<rootDir>/setupTests.ts'],
testEnvironment: 'jsdom',
testEnvironmentOptions: {
url: 'http://localhost/',
},
};
4 changes: 3 additions & 1 deletion packages/esm-home-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"analyze": "webpack --mode=production --env.analyze=true",
"lint": "eslint src --ext tsx",
"typescript": "tsc",
"extract-translations": "i18next 'src/**/*.{component.tsx,tsx}' --config ../../tools/i18next-parser.config.js"
"extract-translations": "i18next 'src/**/*.{component.tsx,tsx}' --config ../../tools/i18next-parser.config.js",
"test": "cross-env TZ=UTC jest --config jest.config.js --verbose false --passWithNoTests",
"coverage": "yarn test --coverage"
},
"browserslist": [
"extends browserslist-config-openmrs"
Expand Down
3 changes: 2 additions & 1 deletion packages/esm-home-app/setupTests.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import '@testing-library/jest-dom/extend-expect';
import '@testing-library/jest-dom';

declare global {
interface Window {
getOpenmrsSpaBase: () => string;
openmrsBase: string;
spaBase: string;
}
Expand Down
13 changes: 0 additions & 13 deletions tools/setupTests.ts

This file was deleted.

7 changes: 4 additions & 3 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"dependsOn": [],
"outputs": []
},
"coverage": {
"dependsOn": [],
"outputs": ["coverage/**"]
},
"lint": {
"dependsOn": ["^lint"],
"outputs": []
Expand All @@ -20,9 +24,6 @@
},
"extract-translations": {
"outputs": []
},
"dev": {
"cache": false
}
}
}

0 comments on commit 76a153f

Please sign in to comment.