{"id":13850430,"url":"https://github.com/1602/elm-app-webcomponent","last_synced_at":"2025-08-21T10:10:19.658Z","repository":{"id":138875970,"uuid":"163016318","full_name":"1602/elm-app-webcomponent","owner":"1602","description":null,"archived":false,"fork":false,"pushed_at":"2018-12-27T20:33:33.000Z","size":4,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-02T15:50:02.669Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1602.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2018-12-24T18:44:36.000Z","updated_at":"2021-10-06T01:40:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"198ea068-f53b-497f-b3ed-cd7e65fe0f6d","html_url":"https://github.com/1602/elm-app-webcomponent","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/1602/elm-app-webcomponent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Felm-app-webcomponent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Felm-app-webcomponent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Felm-app-webcomponent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Felm-app-webcomponent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1602","download_url":"https://codeload.github.com/1602/elm-app-webcomponent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Felm-app-webcomponent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271462064,"owners_count":24763857,"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-08-21T02:00:08.990Z","response_time":74,"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-08-04T20:01:11.988Z","updated_at":"2025-08-21T10:10:19.596Z","avatar_url":"https://github.com/1602.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"## Build web-component using create-elm-app\n\n### Installation\n\n1. add this plugin as a development dependency of a project you created with `create-elm-app`\n\n```\nyarn add -D elm-app-webcomponent\n```\n\n2. use plugin in `elmapp.config.js`\n\n```javascript\nexports.configureWebpack = require('elm-app-webcomponent');\n```\n\n### Usage\n\n1. You need to create an entry point for your web component in `src/custom-element.js`,\nthis is a boilerplate you might want to start with:\n\n\n```javascript\nconst Elm = require('./Main');\nconst css = require('./main.css').toString();\n\ncustomElements.define('my-webcomponent',\n    class extends HTMLElement {\n\n        constructor() {\n            super();\n\n            const appRoot = document.createElement('div');\n            const appStyles = document.createElement('style');\n            appStyles.textContent = css;\n\n            const shadowRoot = this.attachShadow({mode: 'open'});\n            shadowRoot.appendChild(appStyles);\n            shadowRoot.appendChild(appRoot);\n            this.appRoot = appRoot;\n        }\n\n        connectedCallback() {\n            const app = Elm.Elm.Main.init({ node: this.appRoot });\n            this.app = app;\n        }\n});\n```\n\n2. Run `elm-app build` as usual to build your web component.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1602%2Felm-app-webcomponent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1602%2Felm-app-webcomponent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1602%2Felm-app-webcomponent/lists"}