{"id":19888885,"url":"https://github.com/paypal/paypal-muse-components","last_synced_at":"2025-07-29T18:15:16.724Z","repository":{"id":34136089,"uuid":"168628981","full_name":"paypal/paypal-muse-components","owner":"paypal","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-28T22:55:59.000Z","size":9436,"stargazers_count":9,"open_issues_count":4,"forks_count":41,"subscribers_count":19,"default_branch":"main","last_synced_at":"2024-04-14T12:10:20.632Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paypal.png","metadata":{"files":{"readme":"README.md","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-02-01T02:17:26.000Z","updated_at":"2024-06-19T13:20:14.038Z","dependencies_parsed_at":"2023-11-28T23:41:03.381Z","dependency_job_id":null,"html_url":"https://github.com/paypal/paypal-muse-components","commit_stats":{"total_commits":568,"total_committers":33,"mean_commits":17.21212121212121,"dds":0.7922535211267605,"last_synced_commit":"dea5d2464f50d8a9e9ed066b96d4dfbeacccaa99"},"previous_names":[],"tags_count":107,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2Fpaypal-muse-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2Fpaypal-muse-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2Fpaypal-muse-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2Fpaypal-muse-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paypal","download_url":"https://codeload.github.com/paypal/paypal-muse-components/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241317602,"owners_count":19943202,"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-12T18:08:33.718Z","updated_at":"2025-03-01T04:43:06.085Z","avatar_url":"https://github.com/paypal.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"MUSE Component\n----------------------------------\n\n[![build status][build-badge]][build]\n[![code coverage][coverage-badge]][coverage]\n\n[build-badge]: https://img.shields.io/github/actions/workflow/status/paypal/paypal-muse-components/main.yml?branch=main\u0026logo=github\u0026style=flat-square\n[build]: https://github.com/paypal/paypal-muse-components/actions?query=workflow%3Abuild\n[coverage-badge]: https://img.shields.io/codecov/c/github/paypal/paypal-muse-components.svg?style=flat-square\n[coverage]: https://codecov.io/github/paypal/paypal-muse-components/\n\n\nMUSE component included in unified PayPal/Braintree client SDK.\n\n### Quick start\n\nSee [src/index.js](./src/index.js)\n\n#### Tests\n\n```bash\nnpm test\n```\n\n#### Testing with different/multiple browsers\n\n```bash\nnpm run karma -- --browser=Chrome\nnpm run karma -- --browser=Safari\nnpm run karma -- --browser=Firefox\nnpm run karma -- --browser=Chrome,Safari,Firefox\n```\n\n#### Keeping the browser open after tests\n\n```bash\nnpm run karma -- --browser=Chrome --keep-open\n```\n\n#### Releasing and Publishing\n\n- Publish your code with a patch version: \n\n```bash\nnpm run release\n```\n\n- Or `npm run release:patch`, `npm run release:minor`, `npm run release:major`\n\n### Module structure\n\n- `/src` - any code which should be transpiled, published, and end up in production\n- `/test` - karma tests for everything in `/src`\n- `__sdk__.js` - metadata for compiling and bundling the final component\n\n#### `/src/component.js`\n\nThis module exports the public interface for the component.\n\n```javascript\nexport let LebowskiPay = {\n    render(options) {\n        ...\n    }\n};\n```\n\nThen the integrating site can run:\n\n```javascript\npaypal.LebowskiPay.render({ ... });\n```\n\n#### `/__sdk__.js`\n\n`__sdk__.js` defines any metadata which helps the sdk server compile and serve up the component.\n\n```javascript\nexport default {\n\n    /**\n     * Define the lebowski-pay component\n     * Now developers can include paypal.com/sdk/js?components=lebowski-pay\n     */\n\n    'lebowski-pay': {\n\n        /**\n         * Entry point. Everything exported from this module will be exported\n         * in the `window.paypal` namespace.\n         */\n\n        entry: './src/index',\n\n        /**\n         * Define a static namespace.\n         * Server config will be available under the `__lebowski_pay__.serverConfig` global\n         */\n\n        staticNamespace: '__lebowski_pay__',\n\n        /**\n         * Define configuration required by this module\n         * \n         * - This should be in the form of a graphql query.\n         * - The query will be merged with queries defined by other modules\n         * - The final config will be passed as `__lebowski_pay__.serverConfig` in `./src/index` \n         */\n\n        configQuery: `\n            fundingEligibility {\n                card {\n                    branded\n                }\n            }\n        `\n    }\n};\n```\n\n\n### FAQ\n\n- **Why is there no webpack config, dist folder, or npm build command?**\n  \n  This module (and modules like it) are not intended to be built as standalone components. It will be pulled in and compiled/bundled on the server-side, then combined with other modules.\n\n- **When should I publish?**\n  \n  When you publish, you're signing off on your changes being code-complete, fully tested, and ready for release. Publishing **will not immediately trigger a deploy**, but please only publish changes which are in a deployable state.\n\n- **Can I define multiple components in one repo?**\n\n  Absolutely. `__sdk__.js` allows defining multiple entry points. These should generally represent different logical ui components, with separate concerns, and loose coupling. For example:\n\n  ```javascript\n  modules: {\n    'lebowski-pay': {\n        entry: './src/components/lebowski-pay'\n    },\n    'walter-pay': {\n        entry: './src/components/walter-pay'\n    },\n    'donnie-pay': {\n        entry: './src/components/donnie-pay'\n    }\n  },\n  ```\n\n  Please bear in mind that this opens the door to any combination or permutation of these modules to be requested by the merchant -- hence the need for loose coupling. `donnie-pay` should never have a hard dependency on `lebowski-pay` being present.\n\n- **Where is all of the karma, webpack, eslint, etc. config coming from?**\n\n  This module uses `@krakenjs/grumbler-scripts` as a common source of configuration and defaults. Any of these can be overriden, either partially, or entirely, depending on the individual needs of the module. You'll notice `.eslintrc.js`, `karma.conf.js`, etc. are lightweight wrappers which only define module-specific overrides.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaypal%2Fpaypal-muse-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaypal%2Fpaypal-muse-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaypal%2Fpaypal-muse-components/lists"}