@thisismanta/semantic-version 11.2.1 → 11.3.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
@@ -1,4 +1,3 @@
1
- export declare function debug(text: string | number): void;
2
1
  export declare function run(command: string): Promise<string>;
3
2
  export declare const npm: string;
4
3
  export declare const allowedTypes: readonly ["feat", "fix", "build", "chore"];
package/lib/index.js CHANGED
@@ -2,7 +2,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_src = require("./src.js");
3
3
  exports.allowedTypes = require_src.allowedTypes;
4
4
  exports.checkConventionalMessage = require_src.checkConventionalMessage;
5
- exports.debug = require_src.debug;
6
5
  exports.getCurrentPackageVersion = require_src.getCurrentPackageVersion;
7
6
  exports.getGitHistory = require_src.getGitHistory;
8
7
  exports.getReleaseNote = require_src.getReleaseNote;
@@ -2135,9 +2135,26 @@ var require_timers = /* @__PURE__ */ require_src.__commonJSMin(((exports, module
2135
2135
  * used as a drop-in replacement for the native functions.
2136
2136
  */
2137
2137
  module.exports = {
2138
+ /**
2139
+ * The setTimeout() method sets a timer which executes a function once the
2140
+ * timer expires.
2141
+ * @param {Function} callback A function to be executed after the timer
2142
+ * expires.
2143
+ * @param {number} delay The time, in milliseconds that the timer should
2144
+ * wait before the specified function or code is executed.
2145
+ * @param {*} [arg] An optional argument to be passed to the callback function
2146
+ * when the timer expires.
2147
+ * @returns {NodeJS.Timeout|FastTimer}
2148
+ */
2138
2149
  setTimeout(callback, delay, arg) {
2139
2150
  return delay <= RESOLUTION_MS ? setTimeout(callback, delay, arg) : new FastTimer(callback, delay, arg);
2140
2151
  },
2152
+ /**
2153
+ * The clearTimeout method cancels an instantiated Timer previously created
2154
+ * by calling setTimeout.
2155
+ *
2156
+ * @param {NodeJS.Timeout|FastTimer} timeout
2157
+ */
2141
2158
  clearTimeout(timeout) {
2142
2159
  if (timeout[kFastTimer])
2143
2160
  /**
@@ -2146,26 +2163,66 @@ var require_timers = /* @__PURE__ */ require_src.__commonJSMin(((exports, module
2146
2163
  timeout.clear();
2147
2164
  else clearTimeout(timeout);
2148
2165
  },
2166
+ /**
2167
+ * The setFastTimeout() method sets a fastTimer which executes a function once
2168
+ * the timer expires.
2169
+ * @param {Function} callback A function to be executed after the timer
2170
+ * expires.
2171
+ * @param {number} delay The time, in milliseconds that the timer should
2172
+ * wait before the specified function or code is executed.
2173
+ * @param {*} [arg] An optional argument to be passed to the callback function
2174
+ * when the timer expires.
2175
+ * @returns {FastTimer}
2176
+ */
2149
2177
  setFastTimeout(callback, delay, arg) {
2150
2178
  return new FastTimer(callback, delay, arg);
2151
2179
  },
2180
+ /**
2181
+ * The clearTimeout method cancels an instantiated FastTimer previously
2182
+ * created by calling setFastTimeout.
2183
+ *
2184
+ * @param {FastTimer} timeout
2185
+ */
2152
2186
  clearFastTimeout(timeout) {
2153
2187
  timeout.clear();
2154
2188
  },
2189
+ /**
2190
+ * The now method returns the value of the internal fast timer clock.
2191
+ *
2192
+ * @returns {number}
2193
+ */
2155
2194
  now() {
2156
2195
  return fastNow;
2157
2196
  },
2197
+ /**
2198
+ * Trigger the onTick function to process the fastTimers array.
2199
+ * Exported for testing purposes only.
2200
+ * Marking as deprecated to discourage any use outside of testing.
2201
+ * @deprecated
2202
+ * @param {number} [delay=0] The delay in milliseconds to add to the now value.
2203
+ */
2158
2204
  tick(delay = 0) {
2159
2205
  fastNow += delay - RESOLUTION_MS + 1;
2160
2206
  onTick();
2161
2207
  onTick();
2162
2208
  },
2209
+ /**
2210
+ * Reset FastTimers.
2211
+ * Exported for testing purposes only.
2212
+ * Marking as deprecated to discourage any use outside of testing.
2213
+ * @deprecated
2214
+ */
2163
2215
  reset() {
2164
2216
  fastNow = 0;
2165
2217
  fastTimers.length = 0;
2166
2218
  clearTimeout(fastNowTimeout);
2167
2219
  fastNowTimeout = null;
2168
2220
  },
2221
+ /**
2222
+ * Exporting for testing purposes only.
2223
+ * Marking as deprecated to discourage any use outside of testing.
2224
+ * @deprecated
2225
+ */
2169
2226
  kFastTimer
2170
2227
  };
2171
2228
  }));
@@ -3080,6 +3137,7 @@ var require_data_url = /* @__PURE__ */ require_src.__commonJSMin(((exports, modu
3080
3137
  const mimeType = {
3081
3138
  type: typeLowercase,
3082
3139
  subtype: subtypeLowercase,
3140
+ /** @type {Map<string, string>} */
3083
3141
  parameters: /* @__PURE__ */ new Map(),
3084
3142
  essence: `${typeLowercase}/${subtypeLowercase}`
3085
3143
  };
@@ -4430,11 +4488,14 @@ var require_file = /* @__PURE__ */ require_src.__commonJSMin(((exports, module)
4430
4488
  const { webidl } = require_webidl();
4431
4489
  var FileLike = class FileLike {
4432
4490
  constructor(blobLike, fileName, options = {}) {
4491
+ const n = fileName;
4492
+ const t = options.type;
4493
+ const d = options.lastModified ?? Date.now();
4433
4494
  this[kState] = {
4434
4495
  blobLike,
4435
- name: fileName,
4436
- type: options.type,
4437
- lastModified: options.lastModified ?? Date.now()
4496
+ name: n,
4497
+ type: t,
4498
+ lastModified: d
4438
4499
  };
4439
4500
  }
4440
4501
  stream(...args) {
@@ -16209,6 +16270,16 @@ function getProxyFetch(destinationUrl) {
16209
16270
  function getApiBaseUrl() {
16210
16271
  return process.env["GITHUB_API_URL"] || "https://api.github.com";
16211
16272
  }
16273
+ function getUserAgentWithOrchestrationId(baseUserAgent) {
16274
+ var _a;
16275
+ const orchId = (_a = process.env["ACTIONS_ORCHESTRATION_ID"]) === null || _a === void 0 ? void 0 : _a.trim();
16276
+ if (orchId) {
16277
+ const tag = `actions_orchestration_id/${orchId.replace(/[^a-z0-9_.-]/gi, "_")}`;
16278
+ if (baseUserAgent === null || baseUserAgent === void 0 ? void 0 : baseUserAgent.includes(tag)) return baseUserAgent;
16279
+ return `${baseUserAgent ? `${baseUserAgent} ` : ""}${tag}`;
16280
+ }
16281
+ return baseUserAgent;
16282
+ }
16212
16283
  //#endregion
16213
16284
  //#region node_modules/universal-user-agent/index.js
16214
16285
  function getUserAgent() {
@@ -18520,6 +18591,8 @@ function getOctokitOptions(token, options) {
18520
18591
  const opts = Object.assign({}, options || {});
18521
18592
  const auth = getAuthString(token, opts);
18522
18593
  if (auth) opts.auth = auth;
18594
+ const userAgent = getUserAgentWithOrchestrationId(opts.userAgent);
18595
+ if (userAgent) opts.userAgent = userAgent;
18523
18596
  return opts;
18524
18597
  }
18525
18598
  //#endregion
package/lib/src.js CHANGED
@@ -5,7 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
8
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
9
  var __copyProps = (to, from, except, desc) => {
10
10
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
11
  key = keys[i];
@@ -453,18 +453,17 @@ function yn(value, { lenient: lenient$1 = false, default: default_ } = {}) {
453
453
  }
454
454
  //#endregion
455
455
  //#region src/index.ts
456
- const debuggingEnabled = yn(process.env.DEBUG) || yn(process.env.ACTIONS_RUNNER_DEBUG) || yn(process.env.ACTIONS_STEP_DEBUG);
457
- function debug(text) {
458
- if (debuggingEnabled) console.log("::debug::" + text);
459
- }
456
+ const debug = yn(process.env.DEBUG) || yn(process.env.RUNNER_DEBUG) ? (text) => {
457
+ console.log("::debug::" + text);
458
+ } : () => {};
460
459
  function run(command) {
461
460
  return new Promise((resolve, reject) => {
462
461
  node_child_process.exec(command, (error, stdout, stderr) => {
463
- debug("> " + command);
462
+ debug("Run » " + command);
464
463
  stdout = stdout.trim();
465
- if (stdout.length > 0) debug(stdout);
464
+ if (stdout.length > 0) debug("Output » " + stdout);
466
465
  stderr = stderr.trim();
467
- if (stderr.length > 0) debug(stderr);
466
+ if (stderr.length > 0) debug("Error » " + stderr);
468
467
  if (error) reject(error);
469
468
  else resolve(stdout);
470
469
  });
@@ -571,12 +570,6 @@ Object.defineProperty(exports, "checkConventionalMessage", {
571
570
  return checkConventionalMessage;
572
571
  }
573
572
  });
574
- Object.defineProperty(exports, "debug", {
575
- enumerable: true,
576
- get: function() {
577
- return debug;
578
- }
579
- });
580
573
  Object.defineProperty(exports, "getCurrentPackageVersion", {
581
574
  enumerable: true,
582
575
  get: function() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thisismanta/semantic-version",
3
- "version": "11.2.1",
3
+ "version": "11.3.0",
4
4
  "license": "ISC",
5
5
  "author": "Anantachai Saothong <thisismanta@gmail.com>",
6
6
  "repository": {
@@ -24,26 +24,26 @@
24
24
  "postversion": "npm publish --provenance --access public"
25
25
  },
26
26
  "devDependencies": {
27
- "@actions/github": "^9.0.0",
27
+ "@actions/github": "^9.1.1",
28
28
  "@types/node": "~24.12.2",
29
29
  "@types/semver": "^7.7.1",
30
- "lefthook": "^2.1.5",
31
- "oxfmt": "^0.44.0",
30
+ "lefthook": "^2.1.6",
31
+ "oxfmt": "^0.47.0",
32
32
  "semver": "^7.7.4",
33
- "typescript": "^6.0.2",
34
- "vite": "^8.0.7",
35
- "vitest": "^4.1.3",
33
+ "typescript": "^6.0.3",
34
+ "vite": "^8.0.10",
35
+ "vitest": "^4.1.5",
36
36
  "yn": "^5.1.0"
37
37
  },
38
38
  "devEngines": {
39
39
  "packageManager": {
40
40
  "name": "npm",
41
- "version": "^11.9.0",
41
+ "version": "^11.12.1",
42
42
  "onFail": "error"
43
43
  },
44
44
  "runtime": {
45
45
  "name": "node",
46
- "version": "^24.14.0",
46
+ "version": "^24.15.0",
47
47
  "onFail": "warn"
48
48
  }
49
49
  },