{"id":23324487,"url":"https://github.com/hacxy/library-complete-template","last_synced_at":"2025-08-22T18:32:37.110Z","repository":{"id":232926536,"uuid":"785546364","full_name":"hacxy/library-complete-template","owner":"hacxy","description":"This is a JavaScript library project development template with complete infrastructure and developed using TypeScript to help you quickly build a JavaScript utility library that automatically generates documentation.","archived":false,"fork":false,"pushed_at":"2024-07-06T10:40:44.000Z","size":210,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-06T11:47:19.922Z","etag":null,"topics":["template","typescirpt-library","typescript-template"],"latest_commit_sha":null,"homepage":"","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/hacxy.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}},"created_at":"2024-04-12T05:23:56.000Z","updated_at":"2024-07-06T10:40:47.000Z","dependencies_parsed_at":"2024-07-06T11:56:01.764Z","dependency_job_id":null,"html_url":"https://github.com/hacxy/library-complete-template","commit_stats":null,"previous_names":["hacxy/library-complete-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacxy%2Flibrary-complete-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacxy%2Flibrary-complete-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacxy%2Flibrary-complete-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacxy%2Flibrary-complete-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hacxy","download_url":"https://codeload.github.com/hacxy/library-complete-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230626766,"owners_count":18255690,"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":["template","typescirpt-library","typescript-template"],"created_at":"2024-12-20T18:16:49.577Z","updated_at":"2024-12-20T18:16:50.393Z","avatar_url":"https://github.com/hacxy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Library Complete Template\n\nThis is a JavaScript library project development template with complete infrastructure and developed using TypeScript to help you quickly build a JavaScript utility library that automatically generates documentation.\n\nEnglish | [简体中文](https://github.com/hacxy/library-complete-template/blob/main/README_zh.md)\n\n## Features\n\n- Out-of-the-box, with complete infrastructure, no complex configuration required\n- Developed using TypeScript because we all love types\n- Extremely fast, built using [vite](https://vitejs.dev/), enjoy the lightning-fast experience brought by Vite\n- Comments as documentation, automatically output markdown documents using [typedoc](https://typedoc.org/) and [typedoc-plugin-markdown](https://typedoc-plugin-markdown.org/), driven by [vitepress](https://vitepress.dev/)\n- Unit testing with [vitest](https://vitest.dev/) for a more user-friendly testing experience, supporting UI mode\n\n## Examples\n\nHere are projects currently using this template:\n\n- [tianjie](https://github.com/hacxy/tianjie) Documentation: \u003chttps://tianjie.hacxy.cn\u003e\n\n## Using the Template\n\n### Create the Template Locally\n\nYou can quickly create the project locally using [create-ts-frame](https://github.com/hacxy/create-ts-frame)\n\nWhen executing the creation command, you can specify the project name and template name through options.\n\n```sh\n# npm 7+, requires additional double dashes:\nnpm create ts-frame@latest my-utils -- --template library-complete\n\n# yarn:\nyarn create ts-frame my-utils --template library-complete\n\n# pnpm:\npnpm create ts-frame my-utils --template library-complete\n\n# Bun:\nbun create ts-frame my-utils --template library-complete\n```\n\n### Install Dependencies\n\n```sh\ncd my-utils\nnpm install\n```\n\n### Development\n\n- Development mode:\n\nThis will start watching for TS files to bundle into the `dist` directory.\n\n```sh\nnpm run dev\n```\n\n- Build production code\n\n```sh\nnpm run build\n```\n\n- Run unit tests\n\n```sh\nnpm run test\n```\n\n- Run unit tests with visual interface\n\n```sh\nnpm run test:ui\n```\n\n- Run web demo in browser environment\n\n```sh\nnpm run demo:web\n```\n\n- Run node demo in node environment\n\n```sh\nnpm run demo:node\n```\n\n- Develop documentation\n\n```sh\nnpm run docs:dev\n```\n\n- Package documentation\n\n```sh\nnpm run docs:build\n```\n\n### Release\n\nWhen executing release command, it will be published using [release-it](https://github.com/release-it/release-it) tool\n\n```sh\nnpm run release\n```\n\n## How to generate documents\n\nWhen executing `npm run docs:dev`, typedoc will start in watch mode, and generate markdown documents for all exported methods to the `docs/src` directory. At the same time, vitepress development mode will be launched, and you can preview your document.\n\nAdditional documentation content can also be supplemented in method comments, but it is important to note that the comment content should be written according to the [typedoc](https://typedoc.org/guides/overview/) specifications. Here is an example:\n\n````ts\n/**\n * @name This is a method that says hello.\n * @group Utility functions.\n * @param name Name.\n * @returns\n * @example\n * ```ts\n * console.log(sayHello('hacxy')); // Hello, hacxy!\n * ```\n */\nexport const sayHello = (name: string): string =\u003e {\n  return `Hello, ${name}!`;\n};\n````\n\nIn this example, we enrich the method in the document's title, grouping, parameter description, and code examples. If you have written JSDoc comments before, this should not be unfamiliar to you. However, if you are new to it, please refer to [TypeDoc](https://typedoc.org/guides/overview/) for learning how to write.\n\nAdditionally, in comments we can also use Markdown syntax. When using Markdown syntax, the content will be rendered directly into the document.\n\nThe tags used in the above example:\n\n- @name: Method name\n\n- @group: Group that the method belongs to; this property will additionally affect the side navigation bar of the document\n\n- @param: Parameter description\n\n- @returns: Return value description\n\n- @example: Code example\n\nYou should not modify any files under `docs/src` directory because these files are generated by TypeDoc. They will eventually be driven by VitePress.\n\n## Development Specification\n\nAll modules should be uniformly exported in `src/index.ts`, so that Vite can find this entry point to build correct JS code for you and TypeDoc also generates documentation for modules through this entry point.\n\nIf you are still unclear about this, you can check out a project currently using this template at \u003chttps://github.com/hacxy/tianjie/blob/main/src/index.ts\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhacxy%2Flibrary-complete-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhacxy%2Flibrary-complete-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhacxy%2Flibrary-complete-template/lists"}