@openpkg-ts/cli 0.8.3 → 0.9.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/index.js +10 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -55,6 +55,9 @@ function reportDiagnostics(diagnostics) {
55
55
  console.error(`${d.severity}: ${d.message}`);
56
56
  }
57
57
  }
58
+ if (diagnostics.some((d) => d.severity === "error")) {
59
+ process.exit(1);
60
+ }
58
61
  }
59
62
  async function specCommand(args) {
60
63
  const { values, positionals } = parseArgs({
@@ -104,7 +107,13 @@ async function listCommand(args) {
104
107
  const entryFile = positionals[0];
105
108
  if (!entryFile)
106
109
  fail("list requires an entry file (openpkg list src/index.ts)");
107
- const { exports } = await listExports({ entryFile });
110
+ const { exports, errors } = await listExports({ entryFile });
111
+ for (const err of errors) {
112
+ console.error(`error: ${err}`);
113
+ }
114
+ if (errors.length > 0 && exports.length === 0) {
115
+ process.exit(1);
116
+ }
108
117
  if (values.json) {
109
118
  console.log(JSON.stringify(exports, null, 2));
110
119
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpkg-ts/cli",
3
- "version": "0.8.3",
3
+ "version": "0.9.0",
4
4
  "description": "CLI for OpenPkg - extract TypeScript API specs and generate docs",
5
5
  "keywords": [
6
6
  "openpkg",
@@ -35,7 +35,7 @@
35
35
  "test": "bun test"
36
36
  },
37
37
  "dependencies": {
38
- "@openpkg-ts/sdk": "^0.41.0"
38
+ "@openpkg-ts/sdk": "^0.43.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/bun": "latest",