@dotcom-tool-kit/circleci-npm 2.0.10 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -8,11 +8,9 @@ declare class PublishHook extends CircleCiConfigHook {
8
8
  branches: {
9
9
  ignore: string;
10
10
  };
11
- tags: {
12
- only: string;
13
- };
14
11
  };
15
12
  };
13
+ runOnVersionTags: boolean;
16
14
  }
17
15
  export declare const hooks: {
18
16
  'publish:tag': typeof PublishHook;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,+CAA+C,CAAA;AAG9E,cAAM,WAAY,SAAQ,kBAAkB;IAC1C,GAAG,SAAqB;IACxB,UAAU;;;;;;;;;;;MAOT;CACF;AAED,eAAO,MAAM,KAAK;;CAEjB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,+CAA+C,CAAA;AAE9E,cAAM,WAAY,SAAQ,kBAAkB;IAC1C,GAAG,SAAqB;IACxB,UAAU;;;;;;;;MAMT;IACD,gBAAgB,UAAO;CACxB;AAED,eAAO,MAAM,KAAK;;CAEjB,CAAA"}
package/lib/index.js CHANGED
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hooks = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const circleci_config_1 = (0, tslib_1.__importDefault)(require("@dotcom-tool-kit/circleci/lib/circleci-config"));
6
- const npm_1 = require("@dotcom-tool-kit/types/lib/npm");
7
6
  class PublishHook extends circleci_config_1.default {
8
7
  constructor() {
9
8
  super(...arguments);
@@ -12,10 +11,10 @@ class PublishHook extends circleci_config_1.default {
12
11
  context: 'npm-publish-token',
13
12
  requires: ['tool-kit/test'],
14
13
  filters: {
15
- branches: { ignore: '/.*/' },
16
- tags: { only: `${npm_1.semVerRegex}` }
14
+ branches: { ignore: '/.*/' }
17
15
  }
18
16
  };
17
+ this.runOnVersionTags = true;
19
18
  }
20
19
  }
21
20
  exports.hooks = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcom-tool-kit/circleci-npm",
3
- "version": "2.0.10",
3
+ "version": "3.0.0",
4
4
  "description": "",
5
5
  "main": "lib",
6
6
  "scripts": {
@@ -10,9 +10,9 @@
10
10
  "author": "FT.com Platforms Team <platforms-team.customer-products@ft.com>",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dotcom-tool-kit/types": "^2.6.2",
14
- "@dotcom-tool-kit/circleci": "^2.1.7",
15
- "@dotcom-tool-kit/npm": "^2.0.10",
13
+ "@dotcom-tool-kit/types": "^2.7.0",
14
+ "@dotcom-tool-kit/circleci": "^3.0.0",
15
+ "@dotcom-tool-kit/npm": "^2.0.11",
16
16
  "tslib": "^2.3.1"
17
17
  },
18
18
  "repository": {
package/readme.md CHANGED
@@ -1,7 +1,9 @@
1
- # `circleci-npm` Tool Kit plugin
1
+ # @dotcom-tool-kit/circleci-npm
2
2
 
3
3
  This plugin is for managing the `publish:tag` hook that is run from circleci to publish the built package to the npm registry.
4
4
 
5
+ The tool-kit/publish job is triggered in your circleci pipeline once you do a release with a tag matching the semver format. If your tag is a beta version, i.e. `v1.6.0-beta.1`, then the publish job will tag your build as a prerelease version. If your tag is a release version, i.e. `v1.6.0`, then the publish job will tag your build as the latest version.
6
+
5
7
  ## Installation
6
8
 
7
9
  Install `@dotcom-tool-kit/circleci-npm` as a `devDependency` in your app:
@@ -17,13 +19,21 @@ plugins:
17
19
  - '@dotcom-tool-kit/circleci-npm'
18
20
  ```
19
21
 
20
- And install this plugin's hooks:
22
+ Install this plugin's hooks:
21
23
 
22
24
  ```sh
23
25
  npx dotcom-tool-kit --install
24
26
  ```
25
27
 
26
- If you have the automated comment `# CONFIG GENERATED BY DOTCOM-TOOL-KIT, DO NOT EDIT BY HAND\n` in your `config.yml`, this will add the tool-kit/publish job to your `config.yml`. Furthermore, this will add the tags filter to the rest of the tool-kit jobs in your workflow in `config.yml`, as CircleCI will only run the jobs if the rest of the jobs have the tags filter.
28
+ ### For Tool Kit generated CircleCI `config.yml`
29
+
30
+ If you are migrating your project to Tool Kit for the first time then this plugin can generate a new `.circleci/config.yml` file for your project including Tool Kit configured workflows. To use this feature please delete or rename your existing CircleCI `config.yml` file before running the install command.
31
+
32
+ ### Adding to an existing Tool Kit generated CircleCI `config.yml`
33
+
34
+ If you have the automated comment `# CONFIG GENERATED BY DOTCOM-TOOL-KIT, DO NOT EDIT BY HAND\n` in your `config.yml`, running the install command will add the tool-kit/publish job to your `config.yml`. Furthermore, this will add the tags filter to the rest of the tool-kit jobs in your workflow in `config.yml`, as CircleCI will only run the jobs if the rest of the jobs have the tags filter.
35
+
36
+ ### Adding to a custom CircleCI `config.yml`
27
37
 
28
38
  If you don't have the automated comment in your `config.yml` and therefore choose to add the tool-kit/publish job manually, (1) copy and paste the below code snippet and (2) add the tags filter to the rest of the tool-kit jobs (you may refer to dotcom-tool-kit/core/sandbox/.circleci/config.yml as an example for this)
29
39
 
@@ -39,11 +49,8 @@ If you don't have the automated comment in your `config.yml` and therefore choos
39
49
  only: /^v\d+\.\d+\.\d+(-.+)?/
40
50
  ```
41
51
 
42
- The tool-kit/publish job is triggered in your circleci pipeline once you do a release with a tag matching the semver format, e.g. `v1.6.0-beta.1`, `v1.6.0`. If your tag is a beta version, i.e. `v1.6.0-beta.1`, then the publish job will tag your build as a prerelease version. But if your tag is a release version, i.e. `v1.6.0`, then the publish job will tag your build as the latest version.
43
-
44
52
  ## Hooks
45
53
 
46
- | Event | Description | Installed to...|
47
- |-|-|-|
48
- | `publish:tag` | Publishes the built package to the npm registry | `publish` job in `.circle/config.yml` |
49
-
54
+ | Event | Description | Installed to...| Default tasks |
55
+ |-|-|-|-|
56
+ | `publish:tag` | Publishes the built package to the npm registry | `publish` job in `.circle/config.yml` | NpmPublish |