{"id":20832232,"url":"https://github.com/scbd/self-embedding-component","last_synced_at":"2025-09-10T07:40:31.623Z","repository":{"id":78590890,"uuid":"204298751","full_name":"scbd/self-embedding-component","owner":"scbd","description":"Client side service used to create self embeding components.","archived":false,"fork":false,"pushed_at":"2023-03-13T19:56:02.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-08-19T03:01:07.604Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scbd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-08-25T13:34:17.000Z","updated_at":"2022-02-11T16:03:48.000Z","dependencies_parsed_at":"2023-05-09T15:24:36.894Z","dependency_job_id":null,"html_url":"https://github.com/scbd/self-embedding-component","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"73c5d0968b4f0a080c60df1b26a3c7a2acaf4635"},"previous_names":["scbd/self-embed-vue-component"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scbd/self-embedding-component","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbd%2Fself-embedding-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbd%2Fself-embedding-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbd%2Fself-embedding-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbd%2Fself-embedding-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scbd","download_url":"https://codeload.github.com/scbd/self-embedding-component/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbd%2Fself-embedding-component/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274427532,"owners_count":25283221,"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","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-18T00:10:50.435Z","updated_at":"2025-09-10T07:40:31.594Z","avatar_url":"https://github.com/scbd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Self Embedding Component\n\nTo use this library in order to create a self embedding Vue3 component, 2 files must be in the root of your src directory.  The library when in use assumes the target component is already published to a cdn based on it's package name.  Or the SCBD dev cdn.\n\nThis library is dependant on \n[js import maps](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap) in conjunction with [es-module-shims](https://www.npmjs.com/package/es-module-shims).   [es-module-shims](https://www.npmjs.com/package/es-module-shims) polyfills for old browsers and add the additional functionality of multiple external [js import maps](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap) per page.\n\nYou must build the widget and widget-mount separately. [@scbd/dist-builder](https://github.com/scbd/dist-builder) will automagically build the component and widget required files.\n\n# widget.js\n\nIs the entry point for building the widget.  \n\n```\n\nimport WidgetBuilder from 'https://cdn.cbd.int/@scbd/self-embedding-component@3.1.0'// jsdeliver not working ?\nimport Package       from '../package.json'\n\n// load external css for dependant components\nconst css = []\n\n// ugly but required for context\nconst callingImportMetaUrl = import.meta.url\n\n/*** DEV RELEASE */\nconst cdnUrl = 'https://scbd-components.s3.amazonaws.com'; // only required for releasing to dev\n\nnew WidgetBuilder({ Package, css, callingImportMetaUrl }, { cdnUrl }) \n/*** DEV RELEASE */\n\n/*** PROD RELEASE */\n//new WidgetBuilder({ Package, css, callingImportMetaUrl }) \n/*** PROD RELEASE */\n\n\n```\n\n# widget-mount.js\n\nRequired for context and global vue app uses's.\n\n```\n\nimport            { createApp   } from 'vue-demi';\nimport            { createI18n  } from 'vue-i18n';\nimport            { createPinia } from 'pinia';\nimport component, { i18n: componentSourceI18nTranslations } from '@scbd/idb-views';\n\nconst { rootProps } = window?.chm?.scbdIdbViews || {};  // required to pass options from single line script tag, only one per page need to fix to use the mountId below as reference\nconst { search    } = new URL(import.meta.url);         // required to get current context, I hate this no other way\nconst   mountId     = search.replace(\"?\", \"#\");         // extract unique mount id from self context url.  It will default to the package name, however, if needed you can add a search param key onto widget entry url ?some-unique which will turn into #package-name or #package-name-some-unique\n\ncreateApp(component, rootProps)\n.use(createI18n(componentSourceI18nTranslations))         //area for app's global use of some libraries if needed.\n.use(createPinia())\n.mount(mountId)\n\n\n```\n\n# After Building Hack\nafter build need to replace json5 ref  in dist/index.min.js with  //https://cdn.jsdelivr.net/npm/json5@2.2.0/dist/index.min.mjs","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscbd%2Fself-embedding-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscbd%2Fself-embedding-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscbd%2Fself-embedding-component/lists"}