Coder Social home page Coder Social logo

monorepo-template's Introduction

monorepo project

使用这个模板

  1. 点击Use this template

  2. 修改package.json的repository信息

  3. 如果需要使用github actions,需要在仓库的设置Settings/Actions/General/Workflow permissions中选择Read and write permissionsAllow GitHub Actions to create and approve pull requests

  4. 非特殊情况不要在main分支开发,而是通过feature分支pull request合并到main分支

  5. 在github apps仓库中安装changeset-bot,并使它对当前仓库生效

  6. 使用github actions自动部署gh-pages,需要检查.github/workflows/deploy.yml.github/workflows/publish.yml中的环境变量,是否是指定的项目

  7. 第一次部署,请检查GitHub Pages是设置了对应的Source分支和目录,分支是gh-pages分支,目录一般是根目录

  8. 如果需要npm功能,请在仓库的设置settings/Secrets/Actions中添加NPM_TOKEN,点击New repository secret按钮添加即可

工作流

  1. 使用feature分支开发
  2. 提交pull request到main分支
  3. 合并pull request到main分支
  4. 此时changesets-bot会创建一个Release From Changeset的pull request
  5. 如果需要继续开发,请继续其他的开发,重复1-3步骤
  6. 开发完成,需要发布npm,就将Release From Changeset的pull request合并到main分支
  7. 此时会自动发布到npm以及gh-pages
  8. 如果在其它时间想要发布gh-pages,可以在Actions中手动点击deploy的run workflow按钮

package.json命令详解

preinstall

必须使用pnpm进行安装,否则会报错

prepare

初始化husky

test

单元测试

lint

eslint代码校验

lint:style

stylelint代码校验

prettier

prettier代码格式化

lint-staged

提供给husky配置的pre-commit hook

commitlint

提供给husky配置的commit-msg hook

pack-version

在github action ci中使用changesets构建版本号

release

使用pnpm发布npm包,并且使用changesets构建tag和release版本号

publish-success

发布npm包成功之后的hook

monorepo-template's People

Contributors

hcg1023 avatar github-actions[bot] avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.