@virmator/publish 13.3.12 → 13.3.13

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 (2) hide show
  1. package/dist/publish.js +11 -9
  2. package/package.json +6 -6
package/dist/publish.js CHANGED
@@ -1,11 +1,11 @@
1
- import { awaitedBlockingMap, extractErrorMessage, isEnumValue, isTruthy, safeMatch, } from '@augment-vir/common';
2
- import { askQuestionUntilConditionMet, readPackageJson, runShellCommand as runHiddenShellCommand, runShellCommand, } from '@augment-vir/node-js';
1
+ import { assert, check } from '@augment-vir/assert';
2
+ import { awaitedBlockingMap, extractErrorMessage, safeMatch } from '@augment-vir/common';
3
+ import { askQuestionUntilConditionMet, readPackageJson, runShellCommand as runHiddenShellCommand, runShellCommand, } from '@augment-vir/node';
3
4
  import { defineVirmatorPlugin, parseTsConfig, VirmatorNoTraceError, } from '@virmator/core';
4
5
  import mri from 'mri';
5
6
  import { existsSync } from 'node:fs';
6
7
  import { readFile, writeFile } from 'node:fs/promises';
7
8
  import { join, relative, resolve } from 'node:path';
8
- import { assertDefined } from 'run-time-assertions';
9
9
  import semver from 'semver';
10
10
  import simpleGit from 'simple-git';
11
11
  const inVirmatorEnvKey = 'IN_VIRMATOR';
@@ -82,7 +82,7 @@ export const virmatorPublishPlugin = defineVirmatorPlugin(import.meta.dirname, {
82
82
  ];
83
83
  if (!nextVersion || (await isVersionPublished(nextVersion, allPackageJsonFiles))) {
84
84
  nextVersion = await askQuestionUntilConditionMet({
85
- async conditionCallback(response) {
85
+ async verifyResponseCallback(response) {
86
86
  const version = semver.coerce(response)?.raw;
87
87
  if (!version) {
88
88
  return false;
@@ -104,7 +104,7 @@ export const virmatorPublishPlugin = defineVirmatorPlugin(import.meta.dirname, {
104
104
  'publish',
105
105
  ...publishArgs,
106
106
  ]
107
- .filter(isTruthy)
107
+ .filter(check.isTruthy)
108
108
  .join(' ');
109
109
  const alteredPackageJsonFiles = [];
110
110
  async function alterPackageEntryPoints(packagePath) {
@@ -181,7 +181,7 @@ export const virmatorPublishPlugin = defineVirmatorPlugin(import.meta.dirname, {
181
181
  });
182
182
  async function updateGit(packageDirPath) {
183
183
  const newVersion = (await readPackageJson(packageDirPath)).version;
184
- assertDefined(newVersion);
184
+ assert.isDefined(newVersion);
185
185
  if (await doChangesExist(packageDirPath)) {
186
186
  await runShellCommand(`git commit -a --amend --no-edit`, {
187
187
  cwd: packageDirPath,
@@ -229,17 +229,19 @@ async function getGitCommitVersion(decrement, git) {
229
229
  const tags = maybeTag
230
230
  ? Array.from(maybeTag.matchAll(/tag: ([^),]+)[),]/g))
231
231
  .map((entry) => entry[1])
232
- .filter(isTruthy)
232
+ .filter(check.isTruthy)
233
233
  : [];
234
234
  const versionTags = tags
235
235
  .map((tag) => {
236
236
  return semver.coerce(tag);
237
237
  })
238
- .filter(isTruthy);
238
+ .filter(check.isTruthy);
239
239
  const sortedVersionTags = semver.sort(versionTags);
240
240
  const latestVersionTag = sortedVersionTags.slice(-1)[0];
241
241
  const [, rawChangeMarker,] = message ? safeMatch(message.trim(), /^\[([^\]]+)]/) : [];
242
- const changeMarker = rawChangeMarker && isEnumValue(rawChangeMarker, ChangeMarker) ? rawChangeMarker : undefined;
242
+ const changeMarker = rawChangeMarker && check.isEnumValue(rawChangeMarker, ChangeMarker)
243
+ ? rawChangeMarker
244
+ : undefined;
243
245
  return {
244
246
  version: latestVersionTag,
245
247
  changeMarker,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@virmator/publish",
3
- "version": "13.3.12",
3
+ "version": "13.3.13",
4
4
  "description": "Default publish plugin for virmator.",
5
5
  "keywords": [
6
6
  "virmator",
@@ -33,18 +33,18 @@
33
33
  "test:update": "npm test"
34
34
  },
35
35
  "dependencies": {
36
- "@augment-vir/common": "^29.3.0",
37
- "@augment-vir/node-js": "^29.3.0",
38
- "@virmator/core": "^13.3.12",
36
+ "@augment-vir/assert": "^30.0.4",
37
+ "@augment-vir/common": "^30.0.4",
38
+ "@augment-vir/node": "^30.0.4",
39
+ "@virmator/core": "^13.3.13",
39
40
  "chalk": "^5.3.0",
40
41
  "mri": "^1.2.0",
41
- "run-time-assertions": "^1.5.2",
42
42
  "semver": "^7.6.3",
43
43
  "simple-git": "^3.26.0",
44
44
  "url-vir": "^1.5.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@types/node": "^22.5.4",
47
+ "@types/node": "^22.5.5",
48
48
  "@types/semver": "^7.5.8",
49
49
  "markdown-code-example-inserter": "^2.0.3",
50
50
  "type-fest": "^4.26.1",