trustci 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. package/README.md +25 -0
  2. package/dist/cli.js +3 -2
  3. package/package.json +19 -2
package/README.md CHANGED
@@ -78,9 +78,34 @@ published artifact is plain Node-compatible JS.
78
78
  ```bash
79
79
  bun install
80
80
  bun test
81
+ bun run typecheck
81
82
  bun run build # -> dist/cli.js (npx entry point), via `bun build --target node`
82
83
  ```
83
84
 
85
+ `bun install` also enables a husky `commit-msg` hook that runs
86
+ [commitlint](https://commitlint.js.org/) with `@commitlint/config-conventional`,
87
+ so every commit must be a [Conventional Commit](https://www.conventionalcommits.org/).
88
+
89
+ ## Releasing
90
+
91
+ Releases are automated: every merge to `main` runs the CircleCI config
92
+ `workflows/publish/npm-polyrepo-bun-semantic-release.yaml` from
93
+ [hideokamoto/circleci-configurations](https://github.com/hideokamoto/circleci-configurations).
94
+ [semantic-release](https://github.com/semantic-release/semantic-release) decides the
95
+ next version from the commits since the latest `v*` tag, pushes the tag, publishes
96
+ to npm via Trusted Publishing (OIDC), and creates the GitHub Release.
97
+
98
+ | Commit | Release |
99
+ | --- | --- |
100
+ | `fix:` / `perf:` | patch |
101
+ | `feat:` | minor |
102
+ | `feat!:` / `fix!:` or a `BREAKING CHANGE:` footer | major |
103
+ | `chore:` / `docs:` / `ci:` / `test:` / `refactor:` … | none |
104
+
105
+ Do not bump `version` in `package.json`, create tags, or run `npm publish` manually.
106
+ Release notes are published on
107
+ [GitHub Releases](https://github.com/hideokamoto/trustci/releases).
108
+
84
109
  ## License
85
110
 
86
111
  MIT
package/dist/cli.js CHANGED
@@ -190,8 +190,9 @@ async function resolvePipelineDefinitionId(token, projectId, file) {
190
190
  }
191
191
  return match.id;
192
192
  }
193
- if (data.items.length === 1) {
194
- return data.items[0].id;
193
+ const [only] = data.items;
194
+ if (data.items.length === 1 && only) {
195
+ return only.id;
195
196
  }
196
197
  const available = data.items.map((d) => d.config_file_path ?? d.name ?? d.id).join(", ");
197
198
  throw new Error(`Multiple pipeline definitions found for project "${projectId}". Specify --file to select one: ${available}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trustci",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Bulk-register npm Trusted Publishers (npm trust) across all public packages in a monorepo. Supports GitHub, GitLab and CircleCI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,9 @@
16
16
  "scripts": {
17
17
  "build": "bun build src/cli.ts --target node --outfile dist/cli.js",
18
18
  "test": "bun test",
19
- "prepublishOnly": "bun run build"
19
+ "typecheck": "tsc --noEmit",
20
+ "prepublishOnly": "bun run build",
21
+ "prepare": "husky"
20
22
  },
21
23
  "keywords": [
22
24
  "npm",
@@ -30,9 +32,24 @@
30
32
  "gitlab",
31
33
  "circleci"
32
34
  ],
35
+ "author": {
36
+ "name": "Hidetaka Okamoto",
37
+ "url": "https://github.com/hideokamoto"
38
+ },
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/hideokamoto/trustci.git"
42
+ },
43
+ "homepage": "https://github.com/hideokamoto/trustci#readme",
44
+ "bugs": {
45
+ "url": "https://github.com/hideokamoto/trustci/issues"
46
+ },
33
47
  "license": "MIT",
34
48
  "devDependencies": {
49
+ "@commitlint/cli": "^21.2.3",
50
+ "@commitlint/config-conventional": "^21.2.3",
35
51
  "@types/bun": "latest",
52
+ "husky": "^9.1.7",
36
53
  "typescript": "^5"
37
54
  }
38
55
  }