{"id":20037752,"url":"https://github.com/openedx/frontend-enterprise","last_synced_at":"2025-08-19T22:32:08.521Z","repository":{"id":36980973,"uuid":"209144006","full_name":"openedx/frontend-enterprise","owner":"openedx","description":"Frontend utilities for enterprise features.","archived":false,"fork":false,"pushed_at":"2024-12-06T00:49:59.000Z","size":7302,"stargazers_count":6,"open_issues_count":24,"forks_count":11,"subscribers_count":63,"default_branch":"master","last_synced_at":"2024-12-09T20:04:48.237Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openedx.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-17T19:51:18.000Z","updated_at":"2024-11-25T10:31:29.000Z","dependencies_parsed_at":"2023-10-15T14:54:37.192Z","dependency_job_id":"6ae07b3f-ed5c-4515-82d7-b2991313243b","html_url":"https://github.com/openedx/frontend-enterprise","commit_stats":{"total_commits":342,"total_committers":48,"mean_commits":7.125,"dds":0.7953216374269005,"last_synced_commit":"8c0df398ab55c35d0d8626237fb2c1f96f12bf1b"},"previous_names":["edx/frontend-enterprise"],"tags_count":231,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Ffrontend-enterprise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Ffrontend-enterprise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Ffrontend-enterprise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Ffrontend-enterprise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openedx","download_url":"https://codeload.github.com/openedx/frontend-enterprise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230374118,"owners_count":18216041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T10:21:49.800Z","updated_at":"2024-12-19T04:06:45.130Z","avatar_url":"https://github.com/openedx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"frontend-enterprise\n###################\n\n|Build Status| |Codecov|\n\n``frontend-enterprise`` is a monorepo powered by Lerna containing several JavaScript packages that are independently published to NPM. These packages, listed below, contain shared enterprise-related UI components and utility functions.\n\n- `@edx/frontend-enterprise-catalog-search \u003c/packages/catalog-search\u003e`_\n- `@edx/frontend-enterprise-logistration \u003c/packages/logistration\u003e`_\n- `@edx/frontend-enterprise-utils \u003c/packages/utils\u003e`_\n- `@edx/frontend-enterprise-hotjar \u003c/packages/hotjar\u003e`_\n\nEach of these packages is published to NPM and have their own README files. The packages can be found in the ``packages/*`` folder.\n\nGetting started with development\n********************************\n\nTo get started with ``frontend-enterprise`` local development, clone the repo and run the following commands:\n\n::\n\n  npm run setup\n\nThe above command will install package dependencies using NPM workspaces, hoisting all packages to `node_modules` at the root of the repository for performance reasons (e.g., there will only be one copy of React). By using NPM workspaces, `npm install` knows that when importing a package that is part of this monorepo (e.g., `@edx/frontend-enterprise-utils`), it should look at the local package folder and creates symlinks accordingly.\n\nOther useful commands for linting and testing may include:\n\n::\n\n  npm run lint\n  npm run test\n\nThe above NPM scripts are run via NPM workspaces behind-the-scenes. By default, it will run the associated NPM command in each package in the monorepo. However, NPM workspaces does provide a mechanism to only run tests for a specific package, for example:\n\n::\n\n  npm run test -w @edx/frontend-enterprise-catalog-search\n\nTo clean your local monorepo of any installed ``node_modules`` and symlinked packages to start fresh, you may run:\n\n::\n\n  npm run clean\n\nInstalling new NPM modules in the workspace packages\n----------------------------------------------------\n\nTo install a new NPM module in all workspace packages, use the `--workspaces` argument, e.g.:\n\n::\n\n  npm install @openedx/paragon@latest --workspaces\n\nTo install a new NPM module in one or more specific workspace package(s), use the `--workspace` argument, e.g.:\n\n::\n\n  npm install -D @openedx/paragon@latest --workspace=@edx/frontend-enterprise-catalog-search\n\n\nInstalling local monorepo package(s) into an Open edX micro-frontend\n--------------------------------------------------------------------\n\nFor any micro-frontend using `@openedx/frontend-build \u003chttps://github.com/openedx/frontend-build\u003e` that consumes any packages from this monorepo may want to use a local copy of one or more packages during development rather than relying solely on the published NPM packages. To do this, you may modify your module.config.js file (create module.config.js if it does not already exist) to create Webpack aliases to your local checkout of the monorepo packages:\n\n::\n\n  module.exports = {\n    localModules: [\n      {\n        moduleName: '@edx/frontend-enterprise-catalog-search',\n        dir: '../frontend-enterprise/packages/catalog-search',\n        dist: 'src',\n      },\n    ],\n  };\n\nBy configuring the module.config.js as such, when running ``npm start``, the consuming micro-frontend will instead import from the ``../frontend-enterprise/packages/catalog-search/src`` rather than the published ``@edx/frontend-enterprise-catalog-search`` NPM package. This allows contributors to test any local changes to packages in this monorepo inside of consuming applications.\n\nNote that the ``dist`` configuration option in the above example is set to ``src`` vs. ``dist``. By using ``src`` here, any changes made to package source files will be picked up and hot reloaded by the consuming micro-frontend.\n\nConversely, if this option is ``dist``, it expects a ``dist`` directory to exist in the package. To ensure these ``dist`` directories exist, you may run ``npm run dev`` in another terminal window/tab to watch for changes in any package source files and re-transpile them into ``dist`` such that the consuming micro-frontend will always be using the build with the latest source file changes.\n\nConsiderations for updating existing packages or adding a new package\n*********************************************************************\n\nWhen making updates in this monorepo, be sure to consider whether your changes should belong in an existing NPM package or a brand new NPM package. The purpose of the monorepo is to keep clear separation of concerns between packages so that each package owns a smaller domain of functionality or components to avoid package bloat.\n\nHowever, we do run the risk of packages becoming a \"catch-all\" package (e.g., ``@edx/frontend-enterprise-utils``) for anything that doesn't fit in existing packages. Contributors to the monorepo should consider whether any new functionality is related to the domains established in existing packages.\n\nManaging package dependencies\n*****************************\n\nEach package in the monorepo contains its own package.json file and unique set of dependencies depending on their needs. However, issues may arise when importing conflicting versions of external packages (e.g., React) in multiple monorepo packages. This is because some dependencies only properly work when there is a single copy of the dependency to ensure the same version is used throughout an application. For example, ``react`` and ``react-dom`` are common offenders here as there can only be one copy of React used at any given time. If a library/app attempts to use more than one copy or differening versions of React, there will be unintended behavior and warnings.\n\nTo get around this issue of common/shared dependencies, we can rely on how NPM finds installed packages. If a package does not exist in ``node_modules`` for an individual package, NPM will look in ``node_modules`` further up the directory tree until it finds the package, or gets to the root of the repository.\n\nNPM workspaces helps with this by hoisting installed packages to the root `node_modules` folder where they will be accessible to any package in the monorepo to ensure there is only one copy used throughout. These dependencies are still noted in each individual package.json file as both a peer dependency and a dev dependency.\n\nWriting a commit\n----------------\n\nThere is a precommit plugin (commitlint) which requires commit messages formatted using conventional commits. See https://github.com/conventional-changelog/commitlint#what-is-commitlint for more details. In general you need something like the following:\n\n``type: subject``\n\nwhere type must be one of ``[build, ci, docs, feat, fix, perf, refactor, revert, style, test]``\n\nNote: only `fix`, `feat`, and `perf` will trigger a new NPM release, as this is the default behavior for semantic-release.\n\nVersioning and releases\n***********************\n\nThis library has its version automatically updated by Lerna using semantic versioning under-the-hood when publishing to NPM. Lerna is configured to use independent versioning with conventional commits, as opposed to keeping all package versions in sync.\n\nWhen your contribution's PR is approved/merged, you'll need to instruct Lerna to create a new release commit (i.e., ``chore(release): publish new versions``), as outlined in the steps below. In this release commit, Lerna increments the versions in the appropriate package.json files for any changed packages, creates Git tags, and updates the CHANGELOG file(s).\n\nTo create the Lerna release commit once your contribution's PR is approved/merged, please perform the following steps:\n\n#. Pull latest changes on your local checkout of ``master``, ensuring your merged commit is included. It's also recommended to ensure you have the latest Git tags (i.e., ``git fetch --tags``).\n#. Checkout a new branch and execute ``npm run lerna:version``. Verify the recognized changed packages and their associated versions are correct. Once confirmed, Lerna will create a release commit and Git tags.\n#. Open a new PR with the release commit; **do not push the Git tags yet**. Once approved, merge the release commit PR to ``master``.\n#. After the release commit is merged, ensure your local checkout of ``master`` includes the release commit. Because the release commit was squashed before merging, the Git tags generated by Lerna are associated with an orphaned commit SHA. The Git tags will need to be re-created for the correct commit SHA on ``master``. The Git tags may be re-created for the latest commit by executing ``git tag -fa \u003ctag-name\u003e`` for each of the generated tags (e.g., ``git tag -fa @edx/frontend-enterprise-catalog-search@10.1.0``). Once you've re-created the Git tags for the correct commit SHA, you may verify them by executing ``git log --oneline --decorate`` to ensure the Git tags are associated with the latest commit on the ``master`` branch.\n#. Once the Git tags are verified to be associated with the latest release commit on ``master``, push the Git tags to the remote repository by executing ``git push --tags``. Confirm the Git tags have been created by verifying the tags in GitHub.\n#. To publish packages that had their versions incremented per the above steps, you must manually trigger the ``Publish from package.json`` Github Action workflow `found here \u003chttps://github.com/openedx/frontend-enterprise/actions/workflows/publish-from-package.yml\u003e`_. It will publish any versions denoted in the package.json files that are not currently published on the NPM registry, publishing the incremented versions from the aforementioned release commit.\n#. Finally, we also recommend creating a GitHub release for the recently pushed Git tags to document the releases.\n\nPreview changed packages in CI with Github Actions\n--------------------------------------------------\n\nAs a convenience, a dry run of the ``lerna version`` command is run for each push to determine which packages in the monorepo will be published should a PR get merged.\n\n.. |Build Status| image:: https://github.com/openedx/frontend-enterprise/actions/workflows/release.yml/badge.svg\n   :target: https://github.com/openedx/frontend-enterprise/actions\n.. |Codecov| image:: https://codecov.io/gh/edx/frontend-enterprise/branch/master/graph/badge.svg?token=lBHoe5P4Q3\n   :target: https://codecov.io/gh/edx/frontend-enterprise\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenedx%2Ffrontend-enterprise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenedx%2Ffrontend-enterprise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenedx%2Ffrontend-enterprise/lists"}