4.0.8 • Published 2 months ago

@travetto/repo v4.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Repo

Monorepo utilities

Install: @travetto/repo

npm install @travetto/repo

# or

yarn add @travetto/repo

The repo module aims to provide concise monorepo based tools. The monorepo support within the Travetto framework, is based on Npm/Yarn workspaces. This module is not a requirement for monorepo support, but provides some quality of life improvements for:

  • Versioning releases
  • Publishing releases
  • Listing local modules
  • Running commands on all workspace modules

CLI - Version

The versioning operation will find all the changed modules (and the modules that depend on the changed), and will update the versions in accordance with the user preferences. The versioning logic is backed by Npm's and Yarn's versioning functionality and so it is identical to using the tool manually. The determination of what has or hasn't changed is relative to the last versioning commit.

Terminal: Version execution

$ trv repo:version -h

Usage: repo:version [options] <level:major|minor|patch|premajor|preminor|prepatch|prerelease> [prefix:string]

Options:
  --mode <all|changed|direct>  The mode for versioning
  -f, --force                  Force operation, even in a dirty workspace (default: false)
  --commit, --no-commit        Produce release commit message (default: true)
  -m, --modules <string>       The module when mode is single
  -t, --tag                    Should we create a tag for the version
  -h, --help                   display help for command

Level is a standard semver level of: major, minor, patch or prerelease. The prefix argument only applies to the prerelease and allows for determining the prerelease level. For example:

Terminal: Cutting a release candidate

npx trv repo:version prerelease rc

After a release is cut, a new commit will be created that marks the next stable point in the commit history.

Code: Versioning Commit

commit e9dc1a1de9625ab47398997fee6a95dd5a426900
Author: Travetto Framework <travetto.framework@gmail.com>
Date:   Thu Feb 23 17:51:37 2023 -0500
Date:   Thu Feb 23 17:51:37 2023 -0500

    Publish @travetto/asset,@travetto/asset-rest,@travetto/auth,@travetto/auth-model,@travetto/auth-rest,@travetto/auth-rest-jwt,@travetto/auth-rest-passport,@travetto/auth-rest-session,...

CLI - Publish

The publish functionality is relatively naive, but consistent. The code will look at all modules in the mono-repo and check the listed version against what is available in the npm registry. If the local version is newer, it is a candidate for publishing.

Terminal: Publish execution

$ trv repo:publish -h

Usage: repo:publish [options]

Options:
  --dry-run, --no-dry-run  Dry Run? (default: true)
  -h, --help               display help for command

By default the tool will execute a dry run only, and requires passing a flag to disable the dry run.

Terminal: Publishing changes

npx trv repo:publish --no-dry-run

If no modules are currently changed, then the command will indicate there is no work to do, and exit gracefully.

CLI - List

The listing functionality provides the ability to get the workspace modules in the following formats:

Terminal: List execution

$ trv repo:list -h

Usage: repo:list [options]

Options:
  -c, --changed                   Only show changed modules (default: false)
  -f, --format <graph|json|list>  Output format (default: "list")
  -fh, --from-hash <string>       Start revision to check against
  -th, --to-hash <string>         End revision to check against
  -h, --help                      display help for command
  • list - Standard text list, each module on its own line
  • graph - Modules as a digraph, mapping interdependencies
  • json - Graph of modules in JSON form, with additional data (useful for quickly building a dependency graph)

Terminal: List execution of Monorepo

$ trv repo:list

global-test/asset-rest
global-test/auth-rest
global-test/auth-rest-jwt
global-test/model_asset
global-test/model_auth-model
global-test/model_cache
global-test/model_rest-session
global-test/openapi
global-test/pack_app
global-test/rest-client
global-test/rest-session
global-test/transformer-test
module/asset
module/asset-rest
module/auth
module/auth-model
module/auth-rest
module/auth-rest-jwt
module/auth-rest-passport
module/auth-rest-session
module/base
module/cache
module/cli
module/command
module/compiler
module/config
module/context
module/di
module/doc
module/email
module/email-compiler
module/email-inky
module/email-nodemailer
module/eslint
module/image
module/jwt
module/log
module/manifest
module/model
module/model-dynamodb
module/model-elasticsearch
module/model-firestore
module/model-mongo
module/model-mysql
module/model-postgres
module/model-query
module/model-redis
module/model-s3
module/model-sql
module/model-sqlite
module/openapi
module/pack
module/registry
module/repo
module/rest
module/rest-aws-lambda
module/rest-client
module/rest-express
module/rest-express-lambda
module/rest-fastify
module/rest-fastify-lambda
module/rest-koa
module/rest-koa-lambda
module/rest-model
module/rest-model-query
module/rest-session
module/scaffold
module/schema
module/schema-faker
module/terminal
module/test
module/transformer
module/worker
module/yaml
related/todo-app

CLI - Exec

The exec command allows for running commands on all modules, or just changed modules.

Terminal: Exec execution

$ trv repo:exec -h

Usage: repo:exec [options] <cmd:string> [args...:string]

Options:
  -c, --changed                        Only changed modules (default: false)
  -w, --workers <number>               Number of concurrent workers (default: 4)
  --prefix-output, --no-prefix-output  Prefix output by folder (default: true)
  --show-stdout, --no-show-stdout      Show stdout (default: true)
  -h, --help                           display help for command

The standard format includes prefixed output to help identify which module produced which output.

Terminal: List execution of Monorepo

$ trv repo:exec pwd

global-test/asset-rest <workspace-root>/global-test/asset-rest
         global-test/auth-rest <workspace-root>/global-test/auth-rest
     global-test/auth-rest-jwt <workspace-root>/global-test/auth-rest-jwt
       global-test/model_asset <workspace-root>/global-test/model_asset
  global-test/model_auth-model <workspace-root>/global-test/model_auth-model
       global-test/model_cache <workspace-root>/global-test/model_cache
global-test/model_rest-session <workspace-root>/global-test/model_rest-session
           global-test/openapi <workspace-root>/global-test/openapi
          global-test/pack_app <workspace-root>/global-test/pack_app
       global-test/rest-client <workspace-root>/global-test/rest-client
      global-test/rest-session <workspace-root>/global-test/rest-session
  global-test/transformer-test <workspace-root>/global-test/transformer-test
                  module/asset <workspace-root>/module/asset
             module/asset-rest <workspace-root>/module/asset-rest
                   module/auth <workspace-root>/module/auth
             module/auth-model <workspace-root>/module/auth-model
              module/auth-rest <workspace-root>/module/auth-rest
          module/auth-rest-jwt <workspace-root>/module/auth-rest-jwt
     module/auth-rest-passport <workspace-root>/module/auth-rest-passport
      module/auth-rest-session <workspace-root>/module/auth-rest-session
                   module/base <workspace-root>/module/base
                  module/cache <workspace-root>/module/cache
                    module/cli <workspace-root>/module/cli
                module/command <workspace-root>/module/command
               module/compiler <workspace-root>/module/compiler
                 module/config <workspace-root>/module/config
                module/context <workspace-root>/module/context
                     module/di <workspace-root>/module/di
                    module/doc <workspace-root>/module/doc
                  module/email <workspace-root>/module/email
         module/email-compiler <workspace-root>/module/email-compiler
             module/email-inky <workspace-root>/module/email-inky
       module/email-nodemailer <workspace-root>/module/email-nodemailer
                 module/eslint <workspace-root>/module/eslint
                  module/image <workspace-root>/module/image
                    module/jwt <workspace-root>/module/jwt
                    module/log <workspace-root>/module/log
               module/manifest <workspace-root>/module/manifest
                  module/model <workspace-root>/module/model
         module/model-dynamodb <workspace-root>/module/model-dynamodb
    module/model-elasticsearch <workspace-root>/module/model-elasticsearch
        module/model-firestore <workspace-root>/module/model-firestore
            module/model-mongo <workspace-root>/module/model-mongo
            module/model-mysql <workspace-root>/module/model-mysql
         module/model-postgres <workspace-root>/module/model-postgres
            module/model-query <workspace-root>/module/model-query
            module/model-redis <workspace-root>/module/model-redis
               module/model-s3 <workspace-root>/module/model-s3
              module/model-sql <workspace-root>/module/model-sql
           module/model-sqlite <workspace-root>/module/model-sqlite
                module/openapi <workspace-root>/module/openapi
                   module/pack <workspace-root>/module/pack
               module/registry <workspace-root>/module/registry
                   module/repo .
                   module/rest <workspace-root>/module/rest
        module/rest-aws-lambda <workspace-root>/module/rest-aws-lambda
            module/rest-client <workspace-root>/module/rest-client
           module/rest-express <workspace-root>/module/rest-express
    module/rest-express-lambda <workspace-root>/module/rest-express-lambda
           module/rest-fastify <workspace-root>/module/rest-fastify
    module/rest-fastify-lambda <workspace-root>/module/rest-fastify-lambda
               module/rest-koa <workspace-root>/module/rest-koa
        module/rest-koa-lambda <workspace-root>/module/rest-koa-lambda
             module/rest-model <workspace-root>/module/rest-model
       module/rest-model-query <workspace-root>/module/rest-model-query
           module/rest-session <workspace-root>/module/rest-session
               module/scaffold <workspace-root>/module/scaffold
                 module/schema <workspace-root>/module/schema
           module/schema-faker <workspace-root>/module/schema-faker
               module/terminal <workspace-root>/module/terminal
                   module/test <workspace-root>/module/test
              related/todo-app <workspace-root>/related/todo-app
            module/transformer <workspace-root>/module/transformer
                 module/worker <workspace-root>/module/worker
                   module/yaml <workspace-root>/module/yaml
4.0.8

2 months ago

4.0.7

2 months ago

4.0.6

2 months ago

4.0.5

2 months ago

4.0.4

2 months ago

4.0.3

2 months ago

4.0.1

3 months ago

4.0.0

3 months ago

4.0.2

3 months ago

4.0.0-rc.8

3 months ago

4.0.0-rc.7

3 months ago

4.0.0-rc.6

3 months ago

4.0.0-rc.5

3 months ago

4.0.0-rc.4

3 months ago

4.0.0-rc.3

3 months ago

4.0.0-rc.1

3 months ago

4.0.0-rc.2

3 months ago

4.0.0-rc.0

4 months ago

3.4.10

5 months ago

3.4.8

6 months ago

3.4.7

6 months ago

3.4.6

6 months ago

3.4.9

5 months ago

3.4.0-rc.10

6 months ago

3.3.6

7 months ago

3.4.0

6 months ago

3.2.2

10 months ago

3.2.1

10 months ago

3.4.4

6 months ago

3.4.3

6 months ago

3.4.2

6 months ago

3.4.1

6 months ago

3.2.3

10 months ago

3.4.0-rc.9

6 months ago

3.4.0-rc.7

6 months ago

3.4.0-rc.8

6 months ago

3.4.0-rc.5

6 months ago

3.4.0-rc.6

6 months ago

3.4.0-rc.3

6 months ago

3.4.0-rc.4

6 months ago

3.4.0-rc.1

7 months ago

3.4.0-rc.2

6 months ago

3.4.5

6 months ago

3.4.0-rc.0

7 months ago

3.3.1

9 months ago

3.3.0

9 months ago

3.3.5

8 months ago

3.3.4

8 months ago

3.3.3

9 months ago

3.3.2

9 months ago

3.2.0

11 months ago

3.1.10

11 months ago

3.2.0-rc.0

11 months ago

3.1.9

11 months ago

3.1.8

11 months ago

3.1.3

12 months ago

3.1.7

11 months ago

3.1.6

12 months ago

3.1.5

12 months ago

3.1.4

12 months ago

3.1.2

1 year ago

3.0.3

1 year ago

3.1.1

1 year ago

3.1.0-rc.10

1 year ago

3.1.0

1 year ago

3.1.0-rc.2

1 year ago

3.1.0-rc.3

1 year ago

3.1.0-rc.0

1 year ago

3.1.0-rc.1

1 year ago

3.1.0-rc.6

1 year ago

3.1.0-rc.7

1 year ago

3.1.0-rc.4

1 year ago

3.1.0-rc.5

1 year ago

3.1.0-rc.8

1 year ago

3.1.0-rc.9

1 year ago

3.0.0-rc.24

1 year ago

3.0.0-rc.25

1 year ago

3.0.1-rc.1

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

3.0.2-rc.1

1 year ago

3.0.2-rc.0

1 year ago

3.0.0-rc.13

1 year ago

3.0.0-rc.23

1 year ago

3.0.0-rc.12

1 year ago

3.0.0-rc.15

1 year ago

3.0.0-rc.14

1 year ago

3.0.0-rc.17

1 year ago

3.0.0-rc.16

1 year ago

3.0.0-rc.19

1 year ago

3.0.0-rc.18

1 year ago

3.0.0-rc.20

1 year ago

3.0.0-rc.22

1 year ago

3.0.0-rc.21

1 year ago

3.0.0-rc.9

1 year ago

3.0.0-rc.11

1 year ago

3.0.0-rc.10

1 year ago

3.0.0-rc.8

1 year ago

3.0.0-rc.7

1 year ago

3.0.0-rc.6

1 year ago

3.0.0-rc.5

1 year ago

3.0.0-rc.4

1 year ago