2.2.14 • Published 4 months ago

@werk/command-publish v2.2.14

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

Werk Run Command

Publish workspaces.

Note: Only unpublished versions of public workspaces are published!

npm werk

Install

npm i -D @werk/command-publish

Publish Workspaces

Before publishing, the state of the monorepo is validated, and the root workspace build script is run (if present).

werk publish

The packages to be published can be limited using Werk global selection options. Selected workspaces will still be checked for publishability, and may be skipped if they are not publishable.

werk -w my-workspace publish

To pack packages instead of publishing them immediately, set the --to-archive option.

werk publish --to-archive

The resulting archives can be published later by setting the --from-archive option. This will skip most validation, only checking for the existence of archives with a name and version matching the adjacent package.json file.

werk publish --from-archive

Multi-Factor Authentication

Use the --otp option to set a one-time password for publishing.

werk publish --otp=123456

Remove Package Fields

Use the --remove-package-fields option to remove fields from the package.json file before publishing. This is useful for removing fields that are only used for local development, such as devDependencies and scripts.

werk publish --remove-package-fields devDependencies scripts

The fields can be dot notated to remove nested fields.

werk publish --remove-package-fields scripts.test

Publish Tag

Use the --tag option to set the tag for the published package. The default tag is latest.

werk publish --tag=next

Dry run

Use the --dry-run option to validate without making any permanent changes on disk (temporary only) or pushing to the registry. The --dry-run option will be passed through to the npm publish or npm pack command.

werk publish --dry-run

Validation

Validation is always performed before publishing. This provides reasonable certainty that published packages will have resolvable dependencies based on the expected source code.

  1. Ensure the Git working tree is clean.

    • If there are uncommitted changes, then there may not be any permanent record of the published code. Publishing also makes temporary changes to package.json files, which need to be removed be resetting the uncommitted changes.
  2. Ensure local dependencies are either successfully published, or were already published from up-to-date code.

    • If there are local modifications that are not already published or going to be published (no version change or filtered out), then local building and testing may not reflect the published behavior of a package.
  3. Ensure package.json entry points exist and will be included in the published package.

    • If the entry points do not exist or are not included in the published package, then the package may not be usable.

Temporary package.json changes

The following changes are made before publishing, and will be rolled back after publishing finishes (successfully or not). Change are only made in publishable workspaces.

  • Record the current commit hash under the gitHead key.
    • NPM should already do this for publishing. However, it is not done when packing. The field is also poorly documented even though it was added in v7, so it's possible that it might not be added in the future.
  • Update all local workspace dependency versions.
    • Replace any file: or * "versions" with real versions.
    • Update any version ranges so that the minimum version is the current version.
2.2.14

4 months ago

2.2.13

5 months ago

2.2.12

5 months ago

2.2.11

5 months ago

2.2.10

5 months ago

2.2.9

5 months ago

1.4.6

9 months ago

1.4.5

10 months ago

1.4.4

10 months ago

1.4.3

10 months ago

1.4.2

10 months ago

1.4.1

10 months ago

2.2.1

7 months ago

2.0.3

8 months ago

2.2.0

7 months ago

2.0.2

8 months ago

2.2.3

7 months ago

2.0.5

8 months ago

2.2.2

7 months ago

2.0.4

8 months ago

2.2.5

6 months ago

2.0.7

8 months ago

2.2.4

7 months ago

2.0.6

8 months ago

2.2.6

6 months ago

2.0.8

8 months ago

2.0.1

8 months ago

2.0.0

8 months ago

2.1.9

8 months ago

1.5.0

8 months ago

2.1.2

8 months ago

2.1.1

8 months ago

2.1.4

8 months ago

2.1.3

8 months ago

2.1.6

8 months ago

2.1.5

8 months ago

2.1.8

8 months ago

2.1.7

8 months ago

2.1.0

8 months ago

2.2.8

6 months ago

1.4.7

9 months ago

1.4.0

10 months ago

1.2.16

10 months ago

1.2.14

10 months ago

1.2.15

10 months ago

1.2.13

11 months ago

1.2.12

11 months ago

1.2.11

11 months ago

1.2.10

11 months ago

1.2.9

11 months ago

1.2.8

11 months ago

1.2.7

11 months ago

1.2.6

11 months ago

1.2.5

11 months ago

1.2.4

11 months ago

1.2.3

11 months ago

1.2.2

11 months ago

1.2.1

11 months ago

1.2.0

11 months ago

1.1.3

11 months ago

1.1.2

11 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.0.10

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago