@ethima/semantic-release-configuration 8.0.0 → 9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethima/semantic-release-configuration",
3
- "version": "8.0.0",
3
+ "version": "9.0.0",
4
4
  "description": "A shareable semantic release configuration supporting a range of languages and platforms supported by the Ethima organization.",
5
5
  "main": "./src/index.js",
6
6
  "repository": {
@@ -24,18 +24,18 @@
24
24
  "dependencies": {
25
25
  "@semantic-release/changelog": "6.0.3",
26
26
  "@semantic-release/git": "10.0.1",
27
- "@semantic-release/github": "9.2.6",
28
- "@semantic-release/gitlab": "13.0.2",
29
- "conventional-changelog-conventionalcommits": "7.0.2",
27
+ "@semantic-release/github": "11.0.0",
28
+ "@semantic-release/gitlab": "13.2.1",
29
+ "conventional-changelog-conventionalcommits": "8.0.0",
30
30
  "cosmiconfig": "9.0.0",
31
- "execa": "8.0.1",
31
+ "nano-spawn": "0.2.0",
32
32
  "semantic-release-replace-plugin": "1.2.7"
33
33
  },
34
34
  "devDependencies": {
35
- "ava": "6.1.1"
35
+ "ava": "6.2.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "semantic-release": ">= 22.0.7"
38
+ "semantic-release": ">= 24.1.0"
39
39
  },
40
40
  "engines": {
41
41
  "node": ">= 20.8.1"
@@ -1,12 +1,31 @@
1
+ import { accessSync } from "node:fs";
1
2
  import { cosmiconfigSync } from "cosmiconfig";
2
3
  import { env } from "node:process";
3
4
 
5
+ /**
6
+ * Helper function to synchronously check whether a file exists on disk, e.g.
7
+ * used to check for default files that should be removed from lists if they
8
+ * are not present.
9
+ */
10
+ function fileExists(filename) {
11
+ try {
12
+ accessSync(filename);
13
+ return true;
14
+ } catch {
15
+ return false;
16
+ }
17
+ }
18
+
4
19
  const CONFIGURATION_DEFAULTS = {
5
20
  // The character(s) to use to separate the prefix for maintenance and
6
21
  // prerelease branches from the version pattern
7
22
  branch_prefix_separator: env.BRANCH_PREFIX_SEPARATOR || "-",
8
23
  changelog_filename: "CHANGELOG.md",
9
- files_with_versioned_templates: ["README.md"],
24
+ // Files that may contain versioned templates which will be updated upon
25
+ // release. These are conditionally included to ensure downstream operations
26
+ // to not have to guard against files in this list not being present, e.g.
27
+ // when staging for commits
28
+ files_with_versioned_templates: ["README.md"].filter(fileExists),
10
29
  // The branch prefix for patterned maintenance branches
11
30
  maintenance_branch_prefix: env.MAINTENANCE_BRANCH_PREFIX || "release",
12
31
  // The branch prefix for patterned prerelease branches
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
+ import spawn from "nano-spawn";
1
2
  import { accessSync } from "node:fs";
2
3
  import { env } from "node:process";
3
- import { execa } from "execa";
4
4
 
5
5
  import { BranchesConfiguration } from "./branches.js";
6
6
  import { CONFIGURATION } from "./configuration.js";
@@ -20,7 +20,7 @@ const GIT_ASSETS = [
20
20
  * @return bool Whether the file is being tracked by Git.
21
21
  */
22
22
  async function isFileTrackedByGit(path) {
23
- const { stdout } = await execa("git", ["ls-files", path]);
23
+ const { stdout } = await spawn("git", ["ls-files", path]);
24
24
  return stdout.includes(path);
25
25
  }
26
26