{"id":21186826,"url":"https://github.com/patrickroberts/svelte-ts-component-template","last_synced_at":"2025-07-10T01:31:32.120Z","repository":{"id":54517548,"uuid":"280721950","full_name":"patrickroberts/svelte-ts-component-template","owner":"patrickroberts","description":"A Svelte component library template with TypeScript support","archived":false,"fork":false,"pushed_at":"2021-02-13T18:16:32.000Z","size":8,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-15T04:54:15.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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrickroberts.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}},"created_at":"2020-07-18T19:10:09.000Z","updated_at":"2024-10-17T23:41:46.000Z","dependencies_parsed_at":"2022-08-13T18:30:27.853Z","dependency_job_id":null,"html_url":"https://github.com/patrickroberts/svelte-ts-component-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickroberts%2Fsvelte-ts-component-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickroberts%2Fsvelte-ts-component-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickroberts%2Fsvelte-ts-component-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickroberts%2Fsvelte-ts-component-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickroberts","download_url":"https://codeload.github.com/patrickroberts/svelte-ts-component-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225208553,"owners_count":17438209,"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-20T18:26:25.676Z","updated_at":"2024-11-20T18:26:26.478Z","avatar_url":"https://github.com/patrickroberts.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svelte-ts-component-template\n\nA base for building shareable Svelte components. Clone it with [degit](https://github.com/Rich-Harris/degit):\n\n```bash\nnpx degit patrickroberts/svelte-ts-component-template my-new-component\ncd my-new-component\nnpm install # or yarn\n```\n\nYour component's source code lives in `src/Component.svelte`.\n\nYou can create a package that exports multiple components by adding them to the `src` directory and editing `src/index.ts` to reexport them as named exports.\n\nTODO\n\n* [ ] some firm opinions about the best way to test components\n* [ ] update `degit` so that it automates some of the setup work\n\n## Setting up\n\n* Run `npm init` (or `yarn init`)\n* Replace this README with your own\n\n## Consuming components\n\nYour package.json has a `\"svelte\"` field pointing to `src/index.ts`, which allows Svelte apps to import the source code directly, if they are using a bundler plugin like [rollup-plugin-svelte](https://github.com/sveltejs/rollup-plugin-svelte) or [svelte-loader](https://github.com/sveltejs/svelte-loader) (where [`resolve.mainFields`](https://webpack.js.org/configuration/resolve/#resolve-mainfields) in your webpack config includes `\"svelte\"`). **This is recommended.**\n\nFor everyone else, `npm run build` will bundle your component's source code into a plain JavaScript module (`dist/index.mjs`) and a UMD script (`dist/index.js`). This will happen automatically when you publish your component to npm, courtesy of the `prepublishOnly` hook in package.json.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickroberts%2Fsvelte-ts-component-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickroberts%2Fsvelte-ts-component-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickroberts%2Fsvelte-ts-component-template/lists"}