diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index d4fe45c..fe92156 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -24,32 +24,25 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: "16.x" - - - name: Cache dependencies - id: cache - uses: actions/cache@v3 + uses: actions/setup-node@v3 with: - path: '**/node_modules' - key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - - - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' - run: yarn + node-version: "18.x" + - run: yarn install --immutable - name: Setup local cache server for Turborepo uses: felixmosh/turborepo-gh-artifacts@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} server-token: ${{ secrets.TURBO_SERVER_TOKEN }} - - - name: Run tests, lint and typechecking - run: yarn verify - - - name: Run build - run: yarn turbo build --color + + - run: yarn verify + - run: yarn turbo build --color + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: dist + path: | + dist pre_release: runs-on: ubuntu-latest @@ -63,25 +56,13 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: "16.x" - registry-url: "https://registry.npmjs.org" - - - name: Cache dependencies - id: cache - uses: actions/cache@v3 - with: - path: '**/node_modules' - key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + node-version: "18.x" - - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' - run: yarn install --immutable + - run: yarn install --immutable - - name: Version - run: yarn version "$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-pre.${{ github.run_number }}" + - run: yarn version "$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-pre.${{ github.run_number }}" - - name: Build - run: yarn turbo run build --color --concurrency=5 + - run: yarn turbo run build --color - run: git config user.email "info@openmrs.org" && git config user.name "OpenMRS CI" - run: git add . && git commit -m "Prerelease version" --no-verify @@ -90,6 +71,13 @@ jobs: run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public --tag next env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: dist + path: | + dist + release: runs-on: ubuntu-latest @@ -101,16 +89,22 @@ jobs: steps: - uses: actions/checkout@v3 - name: Download Artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 - name: Use Node.js uses: actions/setup-node@v3 with: - node-version: "16.x" - registry-url: 'https://registry.npmjs.org' - - run: yarn - - run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public --tag latest + node-version: "18.x" + - run: yarn install --immutable + - run: yarn turbo build --color + - run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: dist + path: | + dist deploy_form_builder: diff --git a/package.json b/package.json index 5c2d2ba..aa8764d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openmrs/esm-form-builder-app", - "version": "2.0.0", + "version": "2.0.1", "license": "MPL-2.0", "description": "OpenMRS ESM Form Builder App", "browser": "dist/openmrs-esm-form-builder-app.js", diff --git a/webpack.config.js b/webpack.config.js index b17d102..22caf01 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,17 +1,9 @@ -const path = require("path"); const config = (module.exports = require("openmrs/default-webpack-config")); -config.scriptRuleConfig.exclude = - path.sep == "/" - ? /(node_modules[^\/@openmrs\/esm\-patient\-common\-lib])/ - : /(node_modules[^\\@openmrs\/esm\-patient\-common\-lib])/; +config.scriptRuleConfig.exclude = /(node_modules(?![/\\]@(?:openmrs|ohri)))/; config.overrides.resolve = { - extensions: [".tsx", ".ts", ".jsx", ".js", ".scss"], + extensions: [".tsx", ".ts", ".jsx", ".js", ".scss", ".json"], alias: { "@openmrs/esm-framework": "@openmrs/esm-framework/src/internal", - "openmrs-esm-ohri-commons-lib": path.resolve( - __dirname, - "../esm-commons-lib/src/index" - ), "@openmrs/openmrs-form-engine-lib": "@openmrs/openmrs-form-engine-lib/src/index", }, diff --git a/yarn.lock b/yarn.lock index 073613d..23a4c6f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5802,9 +5802,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001400, caniuse-lite@npm:^1.0.30001426": - version: 1.0.30001431 - resolution: "caniuse-lite@npm:1.0.30001431" - checksum: bc8ab55cd194e240152946b54bfaff7456180cc018674fc7ed134f4f502192405f6643f422feaa0a5e7cc02b5bac564cfac7771ac6d29f5d129482fcfe335ba1 + version: 1.0.30001517 + resolution: "caniuse-lite@npm:1.0.30001517" + checksum: e4e87436ae1c4408cf4438aac22902b31eb03f3f5bad7f33bc518d12ffb35f3fd9395ccf7efc608ee046f90ce324ec6f7f26f8a8172b8c43c26a06ecee612a29 languageName: node linkType: hard