@halospv3/hce.shared-config 1.2.6 → 2.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/CHANGELOG.md CHANGED
@@ -1,3 +1,36 @@
1
+ ## [2.0.0](https://github.com/halospv3/hce.shared/compare/v1.2.7...v2.0.0) (2024-03-17)
2
+
3
+
4
+ ### ⚠ BREAKING CHANGES
5
+
6
+ * **node:** increase minimum version of NodeJS to 20.8.1 as required by semantic-release
7
+
8
+ ### Bug Fixes
9
+
10
+ * add minimum npm version; error if required node, npm versions unavailable ([3969ad5](https://github.com/halospv3/hce.shared/commit/3969ad5a012f8e8330a14267a44d2c65f25b0690))
11
+ * **deps:** bump undici from 5.28.2 to 5.28.3 ([7a6f822](https://github.com/halospv3/hce.shared/commit/7a6f8222c5fb83c7764765e956f7587971341da6))
12
+ * **deps:** update commitlint monorepo to v19 ([9237ddb](https://github.com/halospv3/hce.shared/commit/9237ddbecd0b7d9dfbf50b96b9cc926da71ea165))
13
+ * **deps:** update dependency semantic-release to v23 ([7e1a020](https://github.com/halospv3/hce.shared/commit/7e1a020ebf5bc87861c705789055540485713b4c))
14
+ * **deps:** update semantic-release monorepo ([ecd2ad3](https://github.com/halospv3/hce.shared/commit/ecd2ad33907e663cdf351481725a5f8a8ee439fb))
15
+
16
+
17
+ ### Reverts
18
+
19
+ * use './' instead of 'file:' ([21fc83f](https://github.com/halospv3/hce.shared/commit/21fc83fef5d4bd1815ff4c2a4324559e40ae5519))
20
+
21
+
22
+ ### Build System
23
+
24
+ * **node:** :arrow_up: raise minimum NodeJS version to 20.8.1 ([cb92a3d](https://github.com/halospv3/hce.shared/commit/cb92a3d8917189464f36887b1e43bb099ecc175f))
25
+
26
+ ## [1.2.7](https://github.com/halospv3/hce.shared/compare/v1.2.6...v1.2.7) (2024-01-06)
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * **deps:** bump @commitlint/cli from 18.4.3 to 18.4.4 ([c732a4b](https://github.com/halospv3/hce.shared/commit/c732a4b9a7154954000b97ba0a2f79765dc6c1a8))
32
+ * **deps:** bump @commitlint/config-conventional from 18.4.3 to 18.4.4 ([cd95f08](https://github.com/halospv3/hce.shared/commit/cd95f082805d3766384a13f5353cc61d7882a0d5))
33
+
1
34
  ## [1.2.6](https://github.com/halospv3/hce.shared/compare/v1.2.5...v1.2.6) (2024-01-05)
2
35
 
3
36
 
@@ -0,0 +1,6 @@
1
+ // Bundled with Packemon: https://packemon.dev
2
+ // This is an MJS wrapper for a sibling CJS file
3
+
4
+ import data from './index.cjs';
5
+
6
+ export default data;
package/cjs/index.cjs ADDED
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ const node_fs = require('node:fs');
4
+ const path = require('node:path');
5
+ const node_url = require('node:url');
6
+ const jsYaml = require('js-yaml');
7
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
8
+ const _interopDefault = e => e && e.__esModule ? e : {
9
+ default: e
10
+ };
11
+ const path__default = /*#__PURE__*/_interopDefault(path);
12
+ const jsYaml__default = /*#__PURE__*/_interopDefault(jsYaml);
13
+
14
+ /// ../static/.releaserc.yml
15
+
16
+ function findStaticConfig() {
17
+ const glob = "static/.releaserc.yml";
18
+ let dirPath = node_url.fileURLToPath(path__default.default.dirname(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href));
19
+ let combinedPath = path__default.default.join(dirPath, glob);
20
+ while (!node_fs.existsSync(combinedPath)) {
21
+ /* file:// + dirname behavior on Windows. 'root' is empty when 'file://' is present.
22
+ * file:///C:/Repos
23
+ * file:///C:
24
+ * file://
25
+ * .
26
+ */
27
+ // DEBUG.log(dirPath);
28
+ // DEBUG.log(combinedPath.href);
29
+ /** Throw if we reached root. */
30
+ if (path__default.default.dirname(dirPath) === "") throw new Error(`Failed to get full path for HCE.Shared's shared configuration. HCE.Shared recursively searched parent directories for '${glob}' starting from '${path__default.default.dirname(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)}'`);
31
+ dirPath = path__default.default.dirname(dirPath);
32
+ combinedPath = path__default.default.join(dirPath, glob);
33
+ }
34
+ return combinedPath;
35
+ }
36
+ const options = jsYaml__default.default.load(node_fs.readFileSync(findStaticConfig(), {
37
+ encoding: "utf8"
38
+ }));
39
+ module.exports = options;
40
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":null,"names":["fileURLToPath","path","existsSync","jsYaml","readFileSync"],"mappings":";;;;;;;;;;;;;AAIA;AACA;AACA,SAAS,gBAAgB,GAAG;AAC5B,EAAE,MAAM,IAAI,GAAG,uBAAuB,CAAC;AACvC,EAAE,IAAI,OAAO,GAAGA,sBAAa,CAACC,qBAAI,CAAC,OAAO,CAAC,8LAAe,CAAC,CAAC,CAAC;AAC7D,EAAE,IAAI,YAAY,GAAGA,qBAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC9C,EAAE,OAAO,CAACC,kBAAU,CAAC,YAAY,CAAC,EAAE;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAID,qBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,uHAAuH,EAAE,IAAI,CAAC,iBAAiB,EAAEA,qBAAI,CAAC,OAAO,CAAC,8LAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1O,IAAI,OAAO,GAAGA,qBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACpC,IAAI,YAAY,GAAGA,qBAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC5C,GAAG;AACH,EAAE,OAAO,YAAY,CAAC;AACtB,CAAC;AACI,MAAC,OAAO,GAAGE,uBAAM,CAAC,IAAI,CAACC,oBAAY,CAAC,gBAAgB,EAAE,EAAE;AAC7D,EAAE,QAAQ,EAAE,MAAM;AAClB,CAAC,CAAC;;;;"}
package/cjs/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import type { Options } from "semantic-release";
2
+ declare const options: Options;
3
+ /**
4
+ * Runs HCE.Shared and returns a semantic-release "shareable configuration" object.
5
+ * @type {Options}.
6
+ */
7
+ export default options;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AA+BhD,QAAA,MAAM,OAAO,SAAiF,CAAC;AAE/F;;;GAGG;AACH,eAAe,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@halospv3/hce.shared-config",
3
- "version": "1.2.6",
3
+ "version": "2.0.0",
4
4
  "description": "Automate commit message quality, changelogs, and CI/CD releases. Exports a semantic-release shareable configuration deserialized from this package's '.releaserc.yml'. Shared resources for .NET projects are also distributed with this package.",
5
5
  "keywords": [
6
6
  "halo",
@@ -32,7 +32,7 @@
32
32
  "format": "prettier --write \"./src/**/*\" \"./tests/**/*\"",
33
33
  "lint": "eslint --cache --fix \"./src/**/*\" \"./tests/**/*\"",
34
34
  "pack": "packemon pack --addEngines --addFiles --declaration",
35
- "prepare": "husky install",
35
+ "prepare": "husky",
36
36
  "presemantic-release": "npm run pack && npm run check",
37
37
  "semantic-release": "npx semantic-release",
38
38
  "test": "tsx --test ./tests/index.test.mts",
@@ -41,49 +41,51 @@
41
41
  "watch": "packemon watch"
42
42
  },
43
43
  "dependencies": {
44
- "@commitlint/cli": "^18.4.3",
45
- "@commitlint/config-conventional": "^18.4.3",
44
+ "@commitlint/cli": "^19.2.0",
45
+ "@commitlint/config-conventional": "^19.1.0",
46
46
  "@semantic-release/changelog": "^6.0.3",
47
47
  "@semantic-release/commit-analyzer": "^11.1.0",
48
48
  "@semantic-release/git": "^10.0.1",
49
- "@semantic-release/github": "^9.2.6",
50
- "@semantic-release/npm": "^11.0.0",
49
+ "@semantic-release/github": "^10.0.2",
50
+ "@semantic-release/npm": "^12.0.0",
51
51
  "@semantic-release/release-notes-generator": "^12.1.0",
52
52
  "conventional-changelog-conventionalcommits": "^7.0.2",
53
- "husky": "^8.0.3",
53
+ "husky": "^9.0.11",
54
54
  "js-yaml": "^4.1.0",
55
55
  "node-fetch": "^3.3.2",
56
- "semantic-release": "^22.0.0",
56
+ "semantic-release": "^23.0.4",
57
57
  "semantic-release-export-data": "^1.0.1"
58
58
  },
59
59
  "devDependencies": {
60
+ "@babel/cli": "^7.23.9",
60
61
  "@halospv3/hce.shared-config": "./",
61
- "@tsconfig/node-lts": "^20.0.0",
62
- "@types/debug": "^4.1.8",
63
- "@types/js-yaml": "^4.0.8",
64
- "@types/node": "^20.5.1",
65
- "@types/semantic-release": "^20.0.1",
66
- "@typescript-eslint/eslint-plugin": "^6.7.5",
67
- "@typescript-eslint/parser": "^6.7.5",
62
+ "@tsconfig/node-lts": "^20.1.1",
63
+ "@types/debug": "^4.1.12",
64
+ "@types/js-yaml": "^4.0.9",
65
+ "@types/node": "^20.11.28",
66
+ "@types/semantic-release": "^20.0.6",
67
+ "@typescript-eslint/eslint-plugin": "^7.2.0",
68
+ "@typescript-eslint/parser": "^7.2.0",
68
69
  "ajv": "^8.12.0",
69
70
  "ajv-draft-04": "^1.0.0",
70
- "babel-cli": "^6.26.0",
71
- "babel-plugin-cjs-esm-interop": "^3.0.2",
72
- "eslint": "^8.51.0",
73
- "eslint-config-moon": "^2.0.10",
71
+ "babel-plugin-cjs-esm-interop": "^4.0.0",
72
+ "eslint": "^8.57.0",
73
+ "eslint-config-moon": "^2.1.2",
74
74
  "eslint-plugin-disable": "^2.0.3",
75
75
  "node-fetch": "^3.3.2",
76
- "packemon": "^3.2.1",
77
- "prettier": "^3.0.3",
76
+ "packemon": "^4.0.1",
77
+ "prettier": "^3.2.5",
78
78
  "prettier-config-moon": "^1.1.2",
79
79
  "tsconfig-moon": "^1.3.0",
80
80
  "tslib": "^2.6.2",
81
- "tsx": "^4.0.0",
82
- "typescript": "^5.2.2"
81
+ "tsx": "^4.7.1",
82
+ "typescript": "^5.4.2"
83
83
  },
84
84
  "engines": {
85
- "node": ">=16.12.0"
85
+ "node": ">=18.12.0",
86
+ "npm": ">=10.5.0"
86
87
  },
88
+ "engineStrict": true,
87
89
  "publishConfig": {
88
90
  "tag": "latest"
89
91
  },
@@ -101,7 +103,14 @@
101
103
  "commitlint": {
102
104
  "extends": [
103
105
  "@commitlint/config-conventional"
104
- ]
106
+ ],
107
+ "rules": {
108
+ "body-max-line-length": [
109
+ 1,
110
+ "always",
111
+ 100
112
+ ]
113
+ }
105
114
  },
106
115
  "packemon": {
107
116
  "format": "cjs",
package/src/index.ts ADDED
@@ -0,0 +1,42 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import jsYaml from "js-yaml";
5
+ import type { Options } from "semantic-release";
6
+
7
+ /// ../static/.releaserc.yml
8
+
9
+ function findStaticConfig(): string {
10
+ const glob = "static/.releaserc.yml";
11
+ let dirPath = fileURLToPath(path.dirname(import.meta.url));
12
+ let combinedPath = path.join(dirPath, glob);
13
+
14
+ while (!existsSync(combinedPath)) {
15
+ /* file:// + dirname behavior on Windows. 'root' is empty when 'file://' is present.
16
+ * file:///C:/Repos
17
+ * file:///C:
18
+ * file://
19
+ * .
20
+ */
21
+ // DEBUG.log(dirPath);
22
+ // DEBUG.log(combinedPath.href);
23
+ /** Throw if we reached root. */
24
+ if (path.dirname(dirPath) === "")
25
+ throw new Error(
26
+ `Failed to get full path for HCE.Shared's shared configuration. HCE.Shared recursively searched parent directories for '${glob}' starting from '${path.dirname(
27
+ import.meta.url,
28
+ )}'`,
29
+ );
30
+ dirPath = path.dirname(dirPath);
31
+ combinedPath = path.join(dirPath, glob);
32
+ }
33
+ return combinedPath;
34
+ }
35
+
36
+ const options = jsYaml.load(readFileSync(findStaticConfig(), { encoding: "utf8" })) as Options;
37
+
38
+ /**
39
+ * Runs HCE.Shared and returns a semantic-release "shareable configuration" object.
40
+ * @type {Options}.
41
+ */
42
+ export default options;
@@ -0,0 +1,32 @@
1
+ # footer contains links e.g. 3rd-party plugins, little-known features
2
+
3
+ ### global vars
4
+ # https://semantic-release.gitbook.io/semantic-release/v/beta/usage/plugins#plugin-options-configuration
5
+ preset: conventionalcommits
6
+
7
+ ### main options
8
+
9
+ branches: # https://semantic-release.gitbook.io/semantic-release/v/beta/usage/configuration#branches
10
+ - main
11
+ - name: develop
12
+ channel: develop
13
+ prerelease: true
14
+ plugins: # https://semantic-release.gitbook.io/semantic-release/v/beta/usage/configuration#plugins
15
+ - "@semantic-release/commit-analyzer"
16
+ - "semantic-release-export-data"
17
+ - "@semantic-release/release-notes-generator"
18
+ - "@semantic-release/changelog"
19
+ - - "@semantic-release/git"
20
+ - assets:
21
+ - README.md
22
+ - CHANGELOG.md
23
+ - - "@semantic-release/github"
24
+ - assets:
25
+ - path: ./publish/*
26
+ ## (OPTIONAL) update Version strings
27
+ # https://github.com/jpoehnelt/semantic-release-replace-plugin
28
+ # https://github.com/droidsolutions/semantic-release-update-file
29
+
30
+ ## Arbitrary shell commands
31
+ # (useful for `dotnet publish publish/`, but should be run after version tag is pushed so InformationalVersionInfo isn't a subversion)
32
+ # https://github.com/semantic-release/exec