{"_id":"@anish1091/esm-core","_rev":"1-7992758ebce876ba82ffcc13ae8cc60d","name":"@anish1091/esm-core","dist-tags":{"latest":"5.8.2"},"versions":{"5.8.1":{"name":"@anish1091/esm-core","version":"5.8.1","_id":"@anish1091/esm-core@5.8.1","maintainers":[{"name":"anish1091","email":"email.anishy@gmail.com"}],"dist":{"shasum":"dba617ecb3e2776d572bfcfea19b09b2d6ad4dea","tarball":"https://registry.npmjs.org/@anish1091/esm-core/-/esm-core-5.8.1.tgz","fileCount":1053,"integrity":"sha512-XLCgCmBswveJNAhj0d2veg3hdgmmyPe/7Bjq3Qt1V8QxXsP/Ja6RKmto4EGxcDbHjTot0uMEHSAHf9dVXmqMGg==","signatures":[{"sig":"MEQCIDnHtA5wRBhEIXfqR7scNsTT7RTD6SaWRAGS8/xi5DBCAiBcZP6mc1z3GRRo0RaIszy8r1im1yIbArr75T+PY9Q1zA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5098174},"gitHead":"2e1a472fbaf87572fae69966956ec215464feff3","private":false,"scripts":{"test":"cross-env TZ=UTC jest --config jest.config.json --verbose false --passWithNoTests --color","build":"turbo run build","setup":"yarn install && turbo run build","start":"openmrs develop","verify":"turbo run lint test typescript","release":"yarn workspaces foreach --all --topological version","coverage":"yarn test --coverage","run:omrs":"openmrs","test-e2e":"playwright test","run:shell":"yarn workspace @openmrs/esm-app-shell watch","build:apps":"turbo run build --filter='@openmrs/*-app'","ci:publish":"yarn workspaces foreach --all --topological --exclude @openmrs/esm-core npm publish --access public --tag latest","test-watch":"cross-env TZ=UTC jest --watch --config jest.config.json --color","postinstall":"husky install","ci:publish-next":"yarn workspaces foreach --all --topological --exclude @openmrs/esm-core npm publish --access public --tag next"},"_npmUser":{"name":"anish1091","email":"email.anishy@gmail.com"},"workspaces":["packages/apps/*","packages/framework/*","packages/shell/*","packages/tooling/*"],"_npmVersion":"9.6.7","description":":wave: New to our project? Be sure to review the [OpenMRS 3 Frontend Developer Documentation](https://o3-docs.openmrs.org/). You may find the [Introduction](https://o3-docs.openmrs.org/docs/introduction) especially helpful.","directories":{},"lint-staged":{"*.{ts,tsx}":"eslint --cache --fix --max-warnings 0","*.{css,scss,ts,tsx}":"prettier --write --list-different"},"resolutions":{"minipass":"3.3.5","@carbon/icons-react":"11.37.0"},"_nodeVersion":"18.16.0","_hasShrinkwrap":false,"packageManager":"yarn@4.4.0","devDependencies":{"jest":"^29.7.0","husky":"^8.0.3","turbo":"^2.0.6","dotenv":"^16.0.3","eslint":"^8.55.0","openmrs":"workspace:*","postcss":"^8.4.41","typedoc":"^0.22.18","webpack":"^5.88.0","jest-cli":"^29.7.0","prettier":"^3.1.0","@swc/core":"^1.3.58","@swc/jest":"^0.2.36","cross-env":"7.0.3","classnames":"^2.3.2","swc-loader":"^0.2.6","typescript":"~4.6.4","@types/jest":"^29.5.12","lint-staged":"^15.2.9","autoprefixer":"^10.4.20","timezone-mock":"^1.2.2","fake-indexeddb":"^4.0.2","i18next-parser":"^6.6.0","@types/systemjs":"^6.1.0","@playwright/test":"1.45.3","@types/react-dom":"^18.0.6","@types/webpack-env":"^1.16.4","identity-obj-proxy":"^3.0.0","@testing-library/dom":"^9.3.4","@testing-library/react":"^14.1.2","jest-environment-jsdom":"^29.7.0","typedoc-plugin-markdown":"3.11.14","systemjs-webpack-interop":"^2.3.7","typedoc-plugin-file-tags":"^1.0.1","@testing-library/jest-dom":"^6.1.5","@typescript-eslint/parser":"^6.13.2","eslint-plugin-react-hooks":"^4.6.2","typedoc-plugin-no-inherit":"^1.3.1","@testing-library/user-event":"^14.5.2","fork-ts-checker-webpack-plugin":"^7.2.13","@typescript-eslint/eslint-plugin":"^6.13.2"},"_npmOperationalInternal":{"tmp":"tmp/esm-core_5.8.1_1727969819899_0.9931011434165111","host":"s3://npm-registry-packages"}},"5.8.2":{"name":"@anish1091/esm-core","version":"5.8.2","private":false,"workspaces":["packages/apps/*","packages/framework/*","packages/shell/*","packages/tooling/*"],"scripts":{"run:omrs":"openmrs","run:shell":"yarn workspace @openmrs/esm-app-shell watch","ci:publish-next":"yarn workspaces foreach --all --topological --exclude @openmrs/esm-core npm publish --access public --tag next","ci:publish":"yarn workspaces foreach --all --topological --exclude @openmrs/esm-core npm publish --access public --tag latest","release":"yarn workspaces foreach --all --topological version","build":"turbo run build","build:apps":"turbo run build --filter='@openmrs/*-app'","setup":"yarn install && turbo run build","start":"openmrs develop","verify":"turbo run lint test typescript","postinstall":"husky install","test":"cross-env TZ=UTC jest --config jest.config.json --verbose false --passWithNoTests --color","test-watch":"cross-env TZ=UTC jest --watch --config jest.config.json --color","test-e2e":"playwright test","coverage":"yarn test --coverage"},"devDependencies":{"@playwright/test":"1.45.3","@swc/core":"^1.3.58","@swc/jest":"^0.2.36","@testing-library/dom":"^9.3.4","@testing-library/jest-dom":"^6.1.5","@testing-library/react":"^14.1.2","@testing-library/user-event":"^14.5.2","@types/jest":"^29.5.12","@types/react-dom":"^18.0.6","@types/systemjs":"^6.1.0","@types/webpack-env":"^1.16.4","@typescript-eslint/eslint-plugin":"^6.13.2","@typescript-eslint/parser":"^6.13.2","autoprefixer":"^10.4.20","classnames":"^2.3.2","cross-env":"7.0.3","dotenv":"^16.0.3","eslint":"^8.55.0","eslint-plugin-react-hooks":"^4.6.2","fake-indexeddb":"^4.0.2","fork-ts-checker-webpack-plugin":"^7.2.13","husky":"^8.0.3","i18next-parser":"^6.6.0","identity-obj-proxy":"^3.0.0","jest":"^29.7.0","jest-cli":"^29.7.0","jest-environment-jsdom":"^29.7.0","lint-staged":"^15.2.9","openmrs":"workspace:*","postcss":"^8.4.41","prettier":"^3.1.0","swc-loader":"^0.2.6","systemjs-webpack-interop":"^2.3.7","timezone-mock":"^1.2.2","turbo":"^2.0.6","typedoc":"^0.22.18","typedoc-plugin-file-tags":"^1.0.1","typedoc-plugin-markdown":"3.11.14","typedoc-plugin-no-inherit":"^1.3.1","typescript":"~4.6.4","webpack":"^5.88.0"},"lint-staged":{"*.{ts,tsx}":"eslint --cache --fix --max-warnings 0","*.{css,scss,ts,tsx}":"prettier --write --list-different"},"resolutions":{"@carbon/icons-react":"11.37.0","minipass":"3.3.5"},"packageManager":"yarn@4.4.0","gitHead":"2e1a472fbaf87572fae69966956ec215464feff3","description":":wave: New to our project? Be sure to review the [OpenMRS 3 Frontend Developer Documentation](https://o3-docs.openmrs.org/). You may find the [Introduction](https://o3-docs.openmrs.org/docs/introduction) especially helpful.","_id":"@anish1091/esm-core@5.8.2","_nodeVersion":"18.16.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-fzDyzQLNvIaT6yzMxx+Z2WU++KqyS3vERMYO3ZQbsnZKnhqiJL3AoIucry119X5c6CueQvSjnvpAH7l6D5Aw0A==","shasum":"17151e0aadfd18fe72231866ff63822f62c0c6af","tarball":"https://registry.npmjs.org/@anish1091/esm-core/-/esm-core-5.8.2.tgz","fileCount":1053,"unpackedSize":5098201,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDRfRkeb2jLXrBf/iH+Nf0wKWCphTPzj/D8z9cIRcezrAiAD2qUFN87xTyPMeZ+L+39sHpqetQpsTrP8yXb1pXpUxg=="}]},"_npmUser":{"name":"anish1091","email":"email.anishy@gmail.com"},"directories":{},"maintainers":[{"name":"anish1091","email":"email.anishy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esm-core_5.8.2_1727970600645_0.43271755226279973"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-03T15:36:59.816Z","modified":"2024-10-03T15:50:01.145Z","5.8.1":"2024-10-03T15:37:00.201Z","5.8.2":"2024-10-03T15:50:00.934Z"},"description":":wave: New to our project? Be sure to review the [OpenMRS 3 Frontend Developer Documentation](https://o3-docs.openmrs.org/). You may find the [Introduction](https://o3-docs.openmrs.org/docs/introduction) especially helpful.","maintainers":[{"name":"anish1091","email":"email.anishy@gmail.com"}],"readme":":wave: New to our project? Be sure to review the [OpenMRS 3 Frontend Developer Documentation](https://o3-docs.openmrs.org/). You may find the [Introduction](https://o3-docs.openmrs.org/docs/introduction) especially helpful.\n\nAlso see the [API documentation](./packages/framework/esm-framework/docs/API.md)\nfor `@openmrs/esm-framework`, which is contained in this repository.\n\n![OpenMRS CI](https://github.com/openmrs/openmrs-esm-core/workflows/OpenMRS%20CI/badge.svg)\n![Check documentation](https://github.com/openmrs/openmrs-esm-core/actions/workflows/docs.yml/badge.svg)\n\nBelow is the documentation for this repository.\n\n# OpenMRS Frontend Core\n\nThis is a [monorepo](https://yarnpkg.com/advanced/lexicon#monorepo) containing the core packages for the OpenMRS Frontend. These packages handle cross-cutting concerns such as the configuration and extension systems, the core framework, global state management, the stlyeguide, and more.\n\n## Available Packages\n\n### Application\n\nThis contains tooling and the app shell.\n\n- [openmrs](packages/tooling/openmrs)\n- [@openmrs/esm-app-shell](packages/shell/esm-app-shell)\n\n### Framework\n\nThe following common libraries have been developed. They may also be used independently of the app shell.\n\n- [@openmrs/esm-api](packages/framework/esm-api): helps make calls to the backend\n- [@openmrs/esm-config](packages/framework/esm-config): validation and storage of frontend configuration\n- [@openmrs/esm-error-handling](packages/framework/esm-error-handling): handling of errors\n- [@openmrs/esm-extensions](packages/framework/esm-extensions): implementation of a frontend component extension system\n- [@openmrs/esm-feature-flags](packages/framework/esm-feature-flags): hide features that are in progress\n- [@openmrs/esm-globals](packages/framework/esm-globals): useful global variables and types\n- [@openmrs/esm-navigation](packages/framework/esm-navigation): navigation utilities, breadcrumbs, and history\n- [@openmrs/esm-offline](packages/framework/esm-offline): provides offline functionality\n- [@openmrs/esm-react-utils](packages/framework/esm-react-utils): utilities for React components\n- [@openmrs/esm-state](packages/framework/esm-state): brings in state management\n- [@openmrs/esm-styleguide](packages/framework/esm-styleguide): styling and UI capabilities\n- [@openmrs/esm-translations](packages/framework/esm-translations): common translations and utilities\n- [@openmrs/esm-utils](packages/framework/esm-utils): general utility and helper functions\n\nAll libraries are aggregated in the `@openmrs/esm-framework` package:\n\n- [@openmrs/esm-framework](packages/framework/esm-framework)\n\n### Frontend modules\n\nA set of frontend modules provide the core technical functionality of the application.\n\n- [@openmrs/esm-devtools-app](packages/apps/esm-devtools-app)\n- [@openmrs/esm-implementer-tools-app](packages/apps/esm-implementer-tools-app)\n- [@openmrs/esm-login-app](packages/apps/esm-login-app)\n- [@openmrs/esm-primary-navigation-app](packages/apps/esm-primary-navigation-app)\n- [@openmrs/esm-offline-tools-app](packages/apps/esm-offline-tools-app)\n\n## Development\n\n### Getting Started\n\nTo set up the repository for development, run the following commands:\n\n```sh\nyarn\nyarn setup\n```\n\n### Building\n\nTo build all packages in the repository, run the following command:\n\n```sh\nyarn build\n```\n\nVerification of the existing packages can also be done in one step using `yarn`:\n\n```sh\nyarn verify\n```\n\n### Running the app shell and the framework\n\n```sh\nyarn run:shell\n```\n\n`run:shell` will run the latest version of the shell and the framework only.\n\n### Running the frontend modules in `apps`\n\n```sh\nyarn run:omrs develop --sources packages/apps/<app folder>\n```\n\nThis will allow you to develop the app similar to the experience of developing other apps.\n\n### Running the tooling\n\n```sh\ncd packages/tooling/openmrs\nyarn build\n./dist/cli.js\n```\n\n### Running tests\n\n#### Unit tests\n\nTo run tests for all packages, run:\n\n```bash\nyarn turbo run test\n```\n\nTo run tests in `watch` mode, run:\n\n```bash\nyarn turbo run test:watch\n```\n\nTo run tests for a specific package, pass the package name to the `--filter` flag. For example, to run tests for `esm-patient-conditions-app`, run:\n\n```bash\nyarn turbo run test --filter=\"esm-patient-conditions-app\"\n```\n\nTo run a specific test file, run:\n\n```bash\nyarn turbo run test -- login\n```\n\nThe above command will only run tests in the file or files that match the provided string.\n\nYou can also run the matching tests from above in watch mode by running:\n\n```bash\nyarn turbo run test:watch -- login.test\n```\n\nTo generate a `coverage` report, run:\n\n```bash\nyarn turbo run coverage\n```\n\nBy default, `turbo` will cache test runs. This means that re-running tests wihout changing any of the related files will return the cached logs from the last run. To bypass the cache, run tests with the `force` flag, as follows:\n\n```bash\nyarn turbo run test --force\n```\n\n#### E2E tests\n\nTo run E2E tests locally, follow these steps:\n\n##### Start the Development Server\n\nBegin by spinning up a development server for the frontend module that you want to test. Ensure the server is running before proceeding.\n\n##### Set Up Environment Variables\n\nCopy the example environment variables into a new .env file by running the following command:\n\n```bash\ncp example.env .env\n```\n\n##### Execute Tests\n\nRun the tests with the following command:\n\n```bash\nyarn test-e2e --ui --headed\n```\n\nRead the [e2e testing guide](https://openmrs.atlassian.net/wiki/spaces/docs/pages/150962731/Testing+Frontend+Modules+O3#End-to-end-testing-with-Playwright) to learn more about End-to-End tests.\n\n### Linking the framework\n\nYou probably want to try out your changes to a framework library in a frontend module. Unfortunately, getting\na working development environment for this is very finicky. No one technique works for all frontend modules\nall the time.\n\nNote that even though frontend modules import from `@openmrs/esm-framework`, the package you need to link is the sub-library; for example, if you are trying to test changes in `packages/framework/esm-api`, you will need to link that sub-library.\n\nIf you're unsure whether your version of a core package is running, add a `console.log` at the top level of a file you're working on.\n\nHere are the tools at your disposal for trying to get this to work:\n\n#### Yarn link\n\nThis should be the first thing you try. To link the styleguide, for example, you would use\n\n```sh\nyarn link ../path/to/openmrs-esm-core/packages/framework/esm-styleguide\n```\n\nThis will add a line to the \"resolutions\" section of the `package.json` file which uses the `portal:` protocol.\nThe other protocol is `link:`. If you need to make changes to the `esm-framework` package, you will need to link\nit in as well. However, this does not work as a portal created with the `yarn link` command. Rather you will\nwant to manually add the line to the `resolutions` field in the `package.json` file:\n\n```json\n\"resolutions\": {\n  \"@openmrs/esm-framework\": \"link:../path/to/openmrs-esm-core/packages/framework/esm-framework\"\n}\n```\n\n#### Yalc\n\nSometimes, the build tooling will simply not work with `yarn link`. In this case, you will need to use `yalc`.\nInstall `yalc` on your computer with:\n\n```sh\nnpm install -g yalc\n```\n\nThen, link the repository you are working on. For `esm-api`, for example, run\n\n```sh\n# In this repository\ncd packages/framework/esm-api\nyalc publish\ncd ../../../openmrs-esm-patient-chart  # for example\nyalc link @openmrs/esm-api\n```\n\nIn order for patient-chart to receive further updates you make to esm-api, you will need to run `yalc push` in the esm-api directory and `yalc update` in the patient-chart directory.\n\n### Running with a local version of the core packages\n\nThis satisfies the build tooling, but we must do one more step to get the frontend to load these dependencies at runtime.\n\nHere, there are two options:\n\n#### Method 1: Using the frontend dev server\n\nIn order to get your local version of the core packages to be served in your local\ndev server, you will need to link the tooling as well.\n\n`yarn link /path/to/esm-core/packages/tooling/openmrs`.\n\nYou can try using `yalc` for this as well, if `yarn link` doesn't work. Or manually creating a `link:` resolution in `package.json`.\nIn packages/shell/esm-app-shell, run `yarn build:development --watch` to ensure that the built app shell is updated with your changes and available to the patient chart.\nThen run your patient chart dev server as usual, with `yarn start`.\n\n#### Method 2: Using import map overrides\n\nIn `esm-core`, start the app shell with `yarn run:shell`. Then, in the patient chart repository, `cd` into whatever packages you are working on and run `yarn serve` from there. Then use the import map override tool in the browser to tell the frontend to load your local patient chart packages.\n\n#### Once it's working\n\nPlease note that any of these techniques will modify the `package.json` file. These changes must be undone before creating\nyour PR. If you used `yarn link`, you can undo these changes by running `yarn unlink --all` in the patient chart repo.\n\n### Version and release\n\nWe use Yarn [workspaces](https://yarnpkg.com/features/workspaces) to handle versioning in this monorepo.\n\nTo increment the version, run the following command:\n\n```sh\nyarn release [version]\n```\n\nWhere version corresponds to:\n\n- `patch` for bug fixes e.g. `3.2.0` → `3.2.1`\n- `minor` for new features that are backwards-compatible e.g `3.2.0` → `3.3.0`\n- `major` for breaking changes e.g. `3.2.0` → `4.0.0`\n\nNote that this command will not create a new tag, nor publish the packages. After running it, make a PR or merge to `main` with the resulting changeset. Note that the release commit message must resemble `(chore) Release vx.x.x` where `x.x.x` is the new version number prefixed with `v`.\n\nThis is because we don't want to trigger a pre-release build when effecting a version bump.\n\nOnce the version bump commit is merged, go to GitHub and [draft a new release](https://github.com/openmrs/openmrs-esm-core/releases/new).\n\nThe tag should be prefixed with `v` (e.g., `v3.2.1`), while the release title should just be the version number (e.g., `3.2.1`). The creation of the GitHub release will cause GitHub Actions to publish the packages, completing the release process.\n\n> Don't run `npm publish`, `yarn publish`, or `lerna publish`. Use the above process.\n\n## Design Patterns\n\nFor documentation about our design patterns, please visit our design system documentation website.\n\n## Bumping Playwright\n\nBe sure to update the Playwright version in the [Bamboo Playwright Docker image](e2e/support/bamboo/playwright.Dockerfile) whenever making version changes.\nAlso, ensure you specify fixed (pinned) versions of Playwright in the package.json file to maintain consistency between the Playwright version used in the Docker image for Bamboo test execution and the version used in the codebase.\n","readmeFilename":"README.md"}