Build Tasks

The PKG Aspect registers Build Tasks to the snap and tag pipelines, to perform packaging and publishing operations in the Component Capsule.

Pack Components

The 'Pack Components' task is executed as part of the snap pipeline and tag pipeline.

bit snap io/card
CopiedCopy
bit tag ui/card
CopiedCopy

This task creates a tarball from the component's Capsule directory (excluding files defined in the Capsule's .npmignore). The Capsule contains the component's package.json, as well as its dist (generated by compiler) and source files.

The generate tarball is persisted in the component object.

$ bit artifacts envs/my-react --task PackComponents

my-workspace/ui/card@0.0.1
  teambit.pkg/pkg
    PackComponents
      package-tar/company-scope.ui.card-0.0.1.tgz
CopiedCopy

Publish

The 'Publish' task executes as part of the tag pipeline.

bit tag ui/card
CopiedCopy

This only happens if a package is configured to be published to an external commonJS package registry (when using Vit Cloud for component hosting, packages, which are stored in the exported component version, are available to be installed as regular packages).

{
  "teambit.pkg/pkg": {
    "packageJson": {
      "name": "@my-reg-scope/{name}",
      "publishConfig": {
        "scope": "@john",
        "registry": "https://registry.some-registry.org/"
      }
    }
  }
}
CopiedCopy