{"id":27248935,"url":"https://github.com/nice-winter/template-ts","last_synced_at":"2025-04-10T23:48:34.581Z","repository":{"id":199861623,"uuid":"703943462","full_name":"nice-winter/template-ts","owner":"nice-winter","description":"A Template for Node.js using TypeScript and ES Module.","archived":false,"fork":false,"pushed_at":"2025-04-10T13:33:50.000Z","size":190,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T23:48:32.093Z","etag":null,"topics":["nodejs","nodejs-template","rollup-example","template","ts-template","typescript","typescript-example","typescript-template"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/nice-winter.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":"2023-10-12T08:18:45.000Z","updated_at":"2025-04-10T13:33:54.000Z","dependencies_parsed_at":"2023-10-13T02:01:29.700Z","dependency_job_id":"20fe6be0-3e97-4f05-90a3-571e0b495bc7","html_url":"https://github.com/nice-winter/template-ts","commit_stats":null,"previous_names":["hhui64/ts-esm-template","babyw1nter/template-ts","nice-winter/template-ts"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nice-winter%2Ftemplate-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nice-winter%2Ftemplate-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nice-winter%2Ftemplate-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nice-winter%2Ftemplate-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nice-winter","download_url":"https://codeload.github.com/nice-winter/template-ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317721,"owners_count":21083528,"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":["nodejs","nodejs-template","rollup-example","template","ts-template","typescript","typescript-example","typescript-template"],"created_at":"2025-04-10T23:48:34.159Z","updated_at":"2025-04-10T23:48:34.575Z","avatar_url":"https://github.com/nice-winter.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# template-ts [![CI](https://github.com/nice-winter/template-ts/actions/workflows/ci.yml/badge.svg)](https://github.com/nice-winter/template-ts/actions/workflows/ci.yml)\n\nA Node.js template with TypeScript and ES Module support. It is designed for quickly initializing an empty TypeScript project, with pre-configured support for [oxlint](https://oxc.rs/docs/guide/usage/linter.html) for code linting, [tsup](https://tsup.egoist.dev) for JavaScript bundling, and VSCode debugging.\n\nIt also comes with pre-configured CI/CD workflows based on GitHub Actions, making it suitable for rapid library development or quick prototyping, without the need to set everything up from scratch.\n\nProjects initialized with this template are recommended to be developed in [VS Code](https://code.visualstudio.com).\n\n## Features\n\n- ✅ ES Module support.\n- 🩹 Linting and formatting with Git hooks.\n- 📝 Automatically watches for file changes and restarts.\n- 🐞 VS Code debugging support.\n- 📦 Bundles JavaScript using [tsup](https://tsup.egoist.dev).\n- 🚀 CI/CD integration.\n\n## Environment Requirements\n\n- **Node.js**: Requires version **22.0.0** or higher.\n\n## Usage\n\n### Initialization\n\nClick the `Use this template` button at the top-right and set a name for the new repository,\n\nor directly clone this repository to your local machine:\n\n```bash\n# Use the `degit` command to clone the template repository to your local machine.\nnpx degit nice-winter/template-ts my-project\n\n# Enter the project directory and install dependencies.\ncd my-project\nnpm i\n\n# Start and watch for file changes.\nnpm run dev\n```\n\n### Develop and build\n\nStart and watch for file changes:\n\n```bash\nnpm run dev\n```\n\nLinting \u0026 Formatting:\n\n```bash\n# lint\nnpm run lint\n\n# format\nnpm run format\n```\n\nBundling to JavaScript:\n\n```bash\n# build for production\nnpm run build\n```\n\nThe JavaScript files will output to `dist` .\n\n### CI/CD\n\nThis template comes with the following pre-configured workflows:\n\n- **ci**: Triggered on any push or when a PR is opened to the `main` branch.\n  It runs a series of unit tests and builds the project.\n\n- **release**: Triggered when a tag is pushed with the format `v*`.\n  It automatically creates a release in the repository and applies the corresponding tag.\n\n- **publish**: Triggered when a tag is pushed with the format `v*`.\n  It runs unit tests and builds the project before publishing it to NPM.\n\n**However, you need to adjust the following configurations for publish to work properly.**\n\n1.You need to add your `NPM_TOKEN` to the secrets in the repository settings.\n\n2.To prevent accidental publishing, the template project's package.json has private set to true by default. To publish your package, you must change `private` from true to `false` in package.json:\n\n```diff\n{\n  \"name\": \"@nice-winter/template-ts\",\n  \"description\": \"...\",\n  \"version\": \"1.0.0\",\n-  \"private\": true,\n+  \"private\": false,\n  // ...Other keys...\n}\n```\n\n3.Update the `repository.url` field in package.json to **your repository URL**:\n\n⚠️ **Note:** The publish workflow enables [Generating provenance statements](https://docs.npmjs.com/generating-provenance-statements) by default when publishing to NPM. You need to update the `repository.url` field in package.json to your own repository URL, otherwise, it will cause an error.\n\n```diff\n{\n  \"author\": \"...\",\n  \"repository\": {\n-   \"url\": \"git+https://github.com/nice-winter/template-ts.git\"\n+   \"url\": \"git+https://github.com/yourname/your-repository.git\"\n  },\n  \"license\": \"MIT\",\n  \"dependencies\": {},\n  // ...Other keys...\n}\n```\n\nOnly then will the \"Publish package\" workflow be triggered. Otherwise, it will not be published to NPM.\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnice-winter%2Ftemplate-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnice-winter%2Ftemplate-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnice-winter%2Ftemplate-ts/lists"}