{"id":14978251,"url":"https://github.com/biyuehu/standard-dev-demo","last_synced_at":"2026-01-30T21:01:47.202Z","repository":{"id":189272474,"uuid":"679953874","full_name":"BIYUEHU/standard-dev-demo","owner":"BIYUEHU","description":"standard development's demo repository","archived":false,"fork":false,"pushed_at":"2024-02-19T06:39:00.000Z","size":185,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-29T08:45:03.394Z","etag":null,"topics":["commitlint","demo","eslint","eslint-plugin","eslint-plugin-import","git","husky","javascript","js","lint-staged","node","nodejs","npm","pnpm","prettier","prettier-eslint","standard-version","ts","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BIYUEHU.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-08-18T02:18:30.000Z","updated_at":"2024-01-30T06:49:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc9408b5-1837-4a1f-ad9d-26fffe013afc","html_url":"https://github.com/BIYUEHU/standard-dev-demo","commit_stats":{"total_commits":30,"total_committers":1,"mean_commits":30.0,"dds":0.0,"last_synced_commit":"364d220169f29cb1be8e00c364a86922fe35b539"},"previous_names":["biyuehu/standard-dev-demo"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/BIYUEHU/standard-dev-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BIYUEHU%2Fstandard-dev-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BIYUEHU%2Fstandard-dev-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BIYUEHU%2Fstandard-dev-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BIYUEHU%2Fstandard-dev-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BIYUEHU","download_url":"https://codeload.github.com/BIYUEHU/standard-dev-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BIYUEHU%2Fstandard-dev-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28919362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T20:25:28.696Z","status":"ssl_error","status_checked_at":"2026-01-30T20:25:13.426Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["commitlint","demo","eslint","eslint-plugin","eslint-plugin-import","git","husky","javascript","js","lint-staged","node","nodejs","npm","pnpm","prettier","prettier-eslint","standard-version","ts","typescript"],"created_at":"2024-09-24T13:57:08.534Z","updated_at":"2026-01-30T21:01:47.183Z","avatar_url":"https://github.com/BIYUEHU.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# standard-dev-demo\n\n**Last update: 2024-1-30**\n\n\u003e Main Stack: pnpm, eslint, prettier, husky, commitlint\n\n\u003e Secondary Stack: Typescript, git, lint-staged, standard-version\n\n## 1.Initialize project and use pnpm\n\n_Initialize project_:\n\n```bash\nmkdir standard-dev-demo\ncd ./standard-dev-demo\nnpm init -y\n```\n\n\u003e For Vue, React ,NestJs and other projecst: use their own cli tools\n\u003e Such as `Vue-cli(Vue-cli-ui)`, `Vite`...\n\n_Open it(Vscode):_\n\n```bash\ncode .\n```\n\nUse pnpm:\n\n```bash\nnpm install pnpm -g\n```\n\n### why is pnpm?\n\n- Fast speed - It's fast than `npm` and `yarn`\n- Small footprint - Using `hard linking` to link nodes\\_ modules resource\n- Compatible with NPM - PNPM is fully compatible with the ecosystem of NPM and can be easily migrated.\n\n_Install Typescript:_\n\n```bash\nnpm install typescript -g\ntsc --init\n```\n\n\u003e Example tsconfig.json\n\n```json\n{\n  \"extends\": \"./tsconfig.node.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"dist\"\n  },\n  \"include\": [\"src/**/*.ts\"]\n}\n```\n\n```json\n{\n  \"compilerOptions\": {\n    \"module\": \"NodeNext\",\n    \"moduleResolution\": \"NodeNext\",\n    \"target\": \"ESNext\",\n    \"strict\": true,\n    \"declaration\": true,\n    \"experimentalDecorators\": true,\n    \"composite\": true,\n    \"incremental\": true\n  }\n}\n```\n\n_Initialize Git:_\n\n\u003e Create a Github repository: [https://github.com/new](https://github.com/new)\n\n```bash\ngit init\ngit remote add origin git@github.com:BIYUEHU/standard-dev-demo.git\ngit push -u origin master\n```\n\n\u003e Create `.gitignore`\n\n```ini\nnode_modules\ndist\nlib\n.husky/_\n\n.vscode/*\n.vs/*\n!.vscode/extensions.json\n\n*.tgz\ntsconfig.tsbuildinfo\n*.log\n```\n\n# 2.Standardize code format and style\n\n\u003e ESLint: Check syntax and find problems By `npm packages`\n\u003e Prettier: A code-format tool and unified code style By `Editor Plugins`\n\n```bash\npnpm install eslint-config-prettier eslint-config-airbnb-base eslint-config-typescript eslint prettier -D\n```\n\n_Install their editor plugins(Vscode):_\n\n\u003e Search in the expand store: `ESLint` `Prettier - Code formatter`\n\u003e Optional plugins: `ESLint Chinese Rules`(For Chinese) `Prettier ESLint`\n\n\u003e Change save setting: Settings(`ctrl + .`) -\u003e Search: save -\u003e √ Editor: Format On Save\n\n\u003e Right click in the editing area -\u003e Using Format Document -\u003e Configure default formatted documents\n\n_Auto fix problems that is can by ESLint on save:_\n\n```json\n/*\n * VSCode Settings JSON File\n */\n{\n  \"editor.codeActionsOnSave\": {\n    \"source.fixAll.eslint\": true\n  }\n}\n```\n\n\u003e .eslintrc\n\n```json\n{\n  \"root\": true,\n  \"env\": {\n    \"es2024\": true\n  },\n  \"extends\": [\"airbnb-base\", \"prettier\", \"typescript\"],\n  \"parser\": \"@typescript-eslint/parser\",\n  \"plugins\": [\"@typescript-eslint\"],\n  \"rules\": {\n    \"import/no-extraneous-dependencies\": 0,\n    \"import/no-unresolved\": 0,\n    \"import/extensions\": 0,\n    \"no-use-before-define\": 0,\n    \"no-unused-vars\": 0,\n    \"no-shadow\": 0,\n    \"no-redeclare\": 0\n  },\n  \"ignorePatterns\": [\"*.js\", \"*.d.ts\"]\n}\n```\n\n\u003e .prettier\n\n```json\n{\n  \"singleQuote\": true,\n  \"printWidth\": 120,\n  \"trailingComma\": \"none\"\n}\n```\n\n\u003e package.json\n\n```json\n{\n  // ...\n  \"scripts\": {\n    // ...\n    \"lint\": \"eslint \\\"src/*.{ts,tsx}\\\" --fix\",\n    \"format\": \"prettier --config .prettierrc \\\"src/*.ts\\\" --write\"\n  }\n}\n```\n\n## 3.Standard Git Commit Specification\n\n\u003e Husky: A tool for adding hooks to Git clients, which automatically triggers functions before some Git operations\n\u003e\n\u003e [https://typicode.github.io/husky/#/](https://typicode.github.io/husky/#/)\n\n\u003e Commitlint: A tool for verifying comments submitted by git commit\n\n\u003e Lint-staged: filter out Git code temporary storage areas (by `git add`), passing a list of all temporary files to the task\n\nInstall Husky:\n\n```bash\npnpm install husky -D\n```\n\n\u003e package.json\n\n```json\n{\n  // ...\n  \"scripts\": {\n    // ...\n    \"prepare\": \"husky install\"\n  }\n}\n```\n\n```bash\npnpm prepare\npnpx husky install\n```\n\nInstall Commitlint:\n\n```bash\npnpm install @commitlint/config-conventional @commitlint/cli -D\npnpx husky add .husky/commit-msg 'npx --no-install commitlint --edit \"$1\"'\n```\n\n\u003e .commitlintrc\n\n```json\n{\n  \"extends\": [\"@commitlint/config-conventional\"],\n  \"rules\": {\n    \"type-enum\": [\n      2,\n      \"always\",\n      [\"feat\", \"fix\", \"docs\", \"style\", \"refactor\", \"perf\", \"test\", \"build\", \"ci\", \"chore\", \"revert\"]\n    ],\n    \"subject-case\": [0]\n  }\n}\n```\n\n| Type     | Description                                                                                                 |\n| -------- | ----------------------------------------------------------------------------------------------------------- |\n| feat     | A new feature                                                                                               |\n| fix      | A bug fix                                                                                                   |\n| docs     | Documentation only changes                                                                                  |\n| style    | Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)      |\n| refactor | A code change that neither fixes a bug nor adds a feature                                                   |\n| perf     | A code change that improves performance                                                                     |\n| test     | Adding missing tests or correcting existing tests                                                           |\n| build    | Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)         |\n| ci       | Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) |\n| chore    | Other changes that don't modify src or test files                                                           |\n| revert   | Reverts a previous commit                                                                                   |\n\nUse lint-staged:\n\n```bash\npnpm install lint-staged -D\n```\n\n\u003e package.json\n\n```json\n{\n  // ...\n  \"lint-staged\": {\n    \"*.{js,jsx,vue,ts}\": [\"pnpm lint\", \"pnpm format\", \"git add .\"]\n  }\n}\n```\n\n```bash\npnpx husky add .husky/pre-commit \"npx lint-staged\"\n```\n\n## 4.Auto release\n\nInstall standard-version\n\n```bash\npnpm install standard-version -D\n```\n\n\u003e package.json\n\n```json\n{\n  // ...\n  \"scripts\": {\n    // ...\n    \"release\": \"pnpm release:changelog \u0026\u0026 standard-version\",\n    \"release:changelog\": \"conventional-changelog -p angular -i CHANGELOG.md -s\"\n  }\n}\n```\n\nTry a few!\n\n```bash\npnpm release\n```\n\n## 5.Publish to Npm Package\n\nMange npm's sources:\n\n```bash\nnpm install nrm -g\nnrm ls\nnrm use npm\nnpm login\n```\n\n\u003e package.json\n\nAdded some information for your `package.json`\n\n```json\n{\n  // ...\n  \"bugs\": {\n    \"url\": \"https://github.com/biyuehu/standard-dev-demo/issues\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/biyuehu/standard-dev-demo.git\"\n  },\n  \"homepage\": \"https://github.com/biyuehu/standard-dev-demo\"\n}\n```\n\nWhen Everything is ready:\n\n```bash\ngit add .\ngit commit -m 'chore: update'\npnpm release\ngit push\npnpm publish\n```\n\nView your package: [https://www.npmjs.com/package/standard-dev-demo](https://www.npmjs.com/package/standard-dev-demo)\n\n\u003e Good!You can develop to a standard project,Now!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiyuehu%2Fstandard-dev-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiyuehu%2Fstandard-dev-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiyuehu%2Fstandard-dev-demo/lists"}