@antelopejs/dms 0.13.0 → 0.13.1

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,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.13.1
4
+
5
+ [compare changes](https://github.com/AntelopeJS/dms/compare/v0.13.0...v0.13.1)
6
+
7
+ ### 🩹 Fixes
8
+
9
+ - **frontend:** Run the API error CLIs when pnpm links the package ([#634](https://github.com/AntelopeJS/dms/pull/634))
10
+
11
+ ### ❤️ Contributors
12
+
13
+ - Antony Rizzitelli ([@Upd4ting](http://github.com/Upd4ting))
14
+
3
15
  ## v0.13.0
4
16
 
5
17
  [compare changes](https://github.com/AntelopeJS/dms/compare/v0.12.1...v0.13.0)
@@ -1,4 +1,10 @@
1
- import { readdirSync, readFileSync, existsSync, statSync } from "node:fs";
1
+ import {
2
+ readdirSync,
3
+ readFileSync,
4
+ realpathSync,
5
+ existsSync,
6
+ statSync,
7
+ } from "node:fs";
2
8
  import { createRequire } from "node:module";
3
9
  import { dirname, join, resolve } from "node:path";
4
10
  import { fileURLToPath } from "node:url";
@@ -233,7 +239,7 @@ export function assertApiErrorPresentation(roots) {
233
239
 
234
240
  if (
235
241
  process.argv[1] &&
236
- resolve(process.argv[1]) === fileURLToPath(import.meta.url)
242
+ realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url))
237
243
  ) {
238
244
  const roots = process.argv.slice(2);
239
245
  if (!roots.length)
@@ -1,4 +1,4 @@
1
- import { readFileSync, writeFileSync } from "node:fs";
1
+ import { readFileSync, realpathSync, writeFileSync } from "node:fs";
2
2
  import { createRequire } from "node:module";
3
3
  import { resolve } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
@@ -175,7 +175,7 @@ export function migrateApiErrorFile(file, write = false) {
175
175
 
176
176
  if (
177
177
  process.argv[1] &&
178
- resolve(process.argv[1]) === fileURLToPath(import.meta.url)
178
+ realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url))
179
179
  ) {
180
180
  const roots = process.argv
181
181
  .slice(2)
@@ -1,4 +1,15 @@
1
1
  import assert from "node:assert/strict";
2
+ import { spawnSync } from "node:child_process";
3
+ import {
4
+ mkdirSync,
5
+ mkdtempSync,
6
+ rmSync,
7
+ symlinkSync,
8
+ writeFileSync,
9
+ } from "node:fs";
10
+ import { tmpdir } from "node:os";
11
+ import { join } from "node:path";
12
+ import { fileURLToPath } from "node:url";
2
13
  import ts from "typescript";
3
14
  import {
4
15
  analyzeApiErrorScript,
@@ -90,4 +101,34 @@ for (const source of [
90
101
  ]);
91
102
  assert.equal(result.manual[0].reason, "manual-error-presentation");
92
103
  }
104
+ const linkRoot = mkdtempSync(join(tmpdir(), "dms-api-error-cli-"));
105
+ const appRoot = mkdtempSync(
106
+ fileURLToPath(new URL("../.api-error-cli-", import.meta.url)),
107
+ );
108
+ try {
109
+ const scripts = join(linkRoot, "scripts");
110
+ symlinkSync(fileURLToPath(new URL(".", import.meta.url)), scripts, "dir");
111
+ writeFileSync(join(appRoot, "package.json"), "{}");
112
+ mkdirSync(join(appRoot, "app"));
113
+ writeFileSync(
114
+ join(appRoot, "app", "manual.ts"),
115
+ `export function useSave() { try {} catch (error) { toast.add({ title: t(dynamic), color: 'error' }); } }`,
116
+ );
117
+ const checker = spawnSync(
118
+ process.execPath,
119
+ [join(scripts, "check-api-error-presentation.mjs"), join(appRoot, "app")],
120
+ { encoding: "utf8" },
121
+ );
122
+ assert.notEqual(checker.status, 0, "checker fails through a symlinked path");
123
+ const codemod = spawnSync(
124
+ process.execPath,
125
+ [join(scripts, "codemods", "api-error-presenter.mjs"), join(appRoot, "app")],
126
+ { encoding: "utf8", cwd: appRoot },
127
+ );
128
+ assert.equal(codemod.status, 0, codemod.stderr);
129
+ assert.match(codemod.stdout, /"reason":"manual-error-presentation"/);
130
+ } finally {
131
+ rmSync(linkRoot, { recursive: true, force: true });
132
+ rmSync(appRoot, { recursive: true, force: true });
133
+ }
93
134
  console.log("PASS API error invariant and codemod fixtures");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/dms",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "AntelopeJS DMS. Plug in your PostgreSQL, MongoDB or RethinkDB database and your coding agent builds a back office and analytics dashboard as typed TypeScript. Real-time updates on the data the DMS manages.",
5
5
  "keywords": [
6
6
  "antelopejs",