@virmator/publish 13.1.0 → 13.2.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.
Files changed (2) hide show
  1. package/dist/publish.js +15 -0
  2. package/package.json +2 -2
package/dist/publish.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { awaitedBlockingMap, extractErrorMessage, isEnumValue, isTruthy, safeMatch, } from '@augment-vir/common';
2
2
  import { askQuestionUntilConditionMet, readPackageJson, runShellCommand as runHiddenShellCommand, runShellCommand, } from '@augment-vir/node-js';
3
3
  import { defineVirmatorPlugin, parseTsConfig, VirmatorNoTraceError, } from '@virmator/core';
4
+ import { existsSync } from 'node:fs';
4
5
  import { readFile, writeFile } from 'node:fs/promises';
5
6
  import { join, relative, resolve } from 'node:path';
6
7
  import { assertDefined } from 'run-time-assertions';
@@ -87,6 +88,7 @@ export const virmatorPublishPlugin = defineVirmatorPlugin(import.meta.dirname, {
87
88
  questionToAsk: 'Failed to automatically determine next publish version. Please enter one:',
88
89
  });
89
90
  }
91
+ log.info(`Publishing version ${nextVersion}...`);
90
92
  await updateVersions(nextVersion, monoRepoRootPath, monoRepoPackages, log);
91
93
  await runHiddenShellCommand('npm i');
92
94
  }
@@ -123,6 +125,19 @@ export const virmatorPublishPlugin = defineVirmatorPlugin(import.meta.dirname, {
123
125
  alteredPackageJsonFiles.push(alteredJsonFile);
124
126
  await writeFile(alteredJsonFile.path, packageJsonContents);
125
127
  }
128
+ const updatedPackageJson = await readPackageJson(packagePath);
129
+ if (updatedPackageJson.main &&
130
+ !existsSync(join(packagePath, updatedPackageJson.main))) {
131
+ throw new Error(`Missing 'main' file '${updatedPackageJson.main}' from '${relative(monoRepoRootPath, packageJsonPath)}'.`);
132
+ }
133
+ if (updatedPackageJson.module &&
134
+ !existsSync(join(packagePath, updatedPackageJson.module))) {
135
+ throw new Error(`Missing 'module' file '${updatedPackageJson.module}' from '${relative(monoRepoRootPath, packageJsonPath)}'.`);
136
+ }
137
+ if (updatedPackageJson.types &&
138
+ !existsSync(join(packagePath, updatedPackageJson.types))) {
139
+ throw new Error(`Missing 'types' file '${updatedPackageJson.types}' from '${relative(monoRepoRootPath, packageJsonPath)}'.`);
140
+ }
126
141
  }
127
142
  try {
128
143
  if (monoRepoPackages.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@virmator/publish",
3
- "version": "13.1.0",
3
+ "version": "13.2.0",
4
4
  "description": "Default publish plugin for virmator.",
5
5
  "keywords": [
6
6
  "virmator",
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@augment-vir/common": "^29.3.0",
37
37
  "@augment-vir/node-js": "^29.3.0",
38
- "@virmator/core": "^13.1.0",
38
+ "@virmator/core": "^13.2.0",
39
39
  "chalk": "^5.3.0",
40
40
  "mri": "^1.2.0",
41
41
  "run-time-assertions": "^1.5.2",