Skip to content

Auto Tools

Alex Feinstein edited this page Apr 3, 2020 · 2 revisions

Auto Tools

Auto tools is a monorepo management toolset, which helps with the following tasks:

  • decide what release type should be applied to which package
  • find and bump cross-package dependencies
  • run user tasks for releasing packages
  • publish releasing packages to the registry
  • post results to slack, telegram, github

Git Commits

Auto parses Git commit messages to decide which packages should be released. Therefore commit messages have to be in certain shape...

<prefix> <pkg1[, pkg2]>: <commit message>

prefix is any string token defined in Auto config.
pkg1 is a package name.

For example:

🌱 my-package: add new feature

To make it easier to compose a proper commit message Auto provides the following command:

yarn start commit

You will be presented a quiz, by answering which, a proper message would be committed. Don't forget to git add files, you would like to commit.

Publishing packages

Being on master, run the following command:

yarn start publish

Auto will compute which package gets what release type, and will show you a report. You have to review it and decide to go ahead, by choosing yes answer.
This would run a procedure of:

  • optionally running user-defined tasks (builds)
  • writing packages versions
  • making version commits and tags
  • publishing packages to configured registry
  • posting reports to selected messengers

Publishing to local registry

In order so publish packages to local registry, for example for testing them locally, run the following command:

yarn start testPublish

The procedures are similar to the above including the report, the only differences are:

  • no Git commits and tags would be made
  • packages would be published to local registry, running in Docker
  • no messages would be posted

After packages have been published, don't break the terminal, cause registry is bound to it.

To install published packages create scopedRegistries record in Project manifest.json, describing your packages and registry Url:

"scopedRegistries": [
  {
    "name": "Local",
    "url": "http://localhost:4873",
    "scopes": [
      "com.my-company.my-package"
    ]
  }
]

Unity Package Manager will now install newly published packages from local registry.

Run local Npm registry

It is possible to run local npm registry, without any other procedures

yarn start runNpm

This command spins up local registry in Docker at 4873 port. You can then publish by directing npm or yarn to http://localhost:4873 registry, during manual publish. To install packages from local registry - create scoped registry as described above.

Clone this wiki locally