@antelopejs/dms-database 0.0.1 → 0.0.3

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.
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import type { DropdownMenuItem } from "@nuxt/ui";
3
3
  import type { QueryScope, SavedQuery } from "../composables/useQueryStore";
4
- import { formatRelativeTime } from "../utils/relativeTime";
4
+ import { formatDatabaseRelativeTime } from "../utils/relativeTime";
5
5
 
6
6
  interface Props {
7
7
  items: SavedQuery[];
@@ -101,7 +101,7 @@ function menuItems(item: SavedQuery): DropdownMenuItem[][] {
101
101
  </div>
102
102
  </div>
103
103
  <span class="text-dimmed font-mono text-[10.5px] shrink-0">
104
- {{ formatRelativeTime(item.createdAt) }}
104
+ {{ formatDatabaseRelativeTime(item.createdAt) }}
105
105
  </span>
106
106
  <UDropdownMenu :items="menuItems(item)" :content="{ align: 'end' }">
107
107
  <UButton
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import type { HistoryEntry } from "../composables/useQueryStore";
3
- import { formatRelativeTime } from "../utils/relativeTime";
3
+ import { formatDatabaseRelativeTime } from "../utils/relativeTime";
4
4
 
5
5
  interface Props {
6
6
  items: HistoryEntry[];
@@ -41,7 +41,7 @@ function meta(item: HistoryEntry): string {
41
41
  { count: item.rowCount },
42
42
  item.rowCount,
43
43
  );
44
- return `${formatRelativeTime(item.executedAt)} · ${count}`;
44
+ return `${formatDatabaseRelativeTime(item.executedAt)} · ${count}`;
45
45
  }
46
46
 
47
47
  function prev() {
@@ -4,7 +4,10 @@ const relativeFormatter = new Intl.RelativeTimeFormat(undefined, {
4
4
 
5
5
  // Human "3 minutes ago" style label for an ISO timestamp, relative to now.
6
6
  // Shared by the query history and favorites panels.
7
- export function formatRelativeTime(iso: string): string {
7
+ // Deliberately not named `formatRelativeTime`: the DMS core layer exports a
8
+ // translation-aware helper under that name, and auto-imports across layers
9
+ // would shadow one with the other.
10
+ export function formatDatabaseRelativeTime(iso: string): string {
8
11
  const diffMs = new Date(iso).getTime() - Date.now();
9
12
  const minutes = Math.round(diffMs / 60_000);
10
13
  if (Math.abs(minutes) < 60) return relativeFormatter.format(minutes, "minute");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/dms-database",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,6 +25,22 @@
25
25
  "provenance": true,
26
26
  "registry": "https://registry.npmjs.org/"
27
27
  },
28
+ "scripts": {
29
+ "build": "rimraf dist && tsc -p tsconfig.build.json",
30
+ "dev:frontend": "pnpm frontend:dev",
31
+ "dev": "ajs project run -w -p playground",
32
+ "generate": "ajs module exports generate",
33
+ "lint:fix": "oxlint --fix --max-warnings=1000000 && oxfmt . && pnpm --dir frontend-vue lint:fix",
34
+ "lint": "oxlint && oxfmt --check . && pnpm --dir frontend-vue lint",
35
+ "typecheck": "tsc -p tsconfig.json",
36
+ "format": "oxfmt . && pnpm --dir frontend-vue format",
37
+ "frontend:dev": "cd playground && pnpm frontend:dev",
38
+ "test": "pnpm run build && ajs module test .",
39
+ "release": "pnpm --dir frontend-vue install --frozen-lockfile && release-it",
40
+ "prepack": "pnpm run build",
41
+ "knip": "knip --dependencies",
42
+ "knip:all": "knip"
43
+ },
28
44
  "dependencies": {
29
45
  "@antelopejs/interface-api": ">=0.0.13 <1.0.0",
30
46
  "@antelopejs/interface-api-util": ">=0.1.2 <1.0.0",
@@ -55,24 +71,10 @@
55
71
  "optionalDependencies": {
56
72
  "@antelopejs/interface-dms-automation": ">=0.0.1 <1.0.0"
57
73
  },
74
+ "packageManager": "pnpm@10.2.0",
58
75
  "antelopeJs": {
59
76
  "baseUrl": "dist",
60
77
  "implements": [],
61
78
  "test": "src/test/harness.ts"
62
- },
63
- "scripts": {
64
- "build": "rimraf dist && tsc -p tsconfig.build.json",
65
- "dev:frontend": "pnpm frontend:dev",
66
- "dev": "ajs project run -w -p playground",
67
- "generate": "ajs module exports generate",
68
- "lint:fix": "oxlint --fix --max-warnings=1000000 && oxfmt . && pnpm --dir frontend-vue lint:fix",
69
- "lint": "oxlint && oxfmt --check . && pnpm --dir frontend-vue lint",
70
- "typecheck": "tsc -p tsconfig.json",
71
- "format": "oxfmt . && pnpm --dir frontend-vue format",
72
- "frontend:dev": "cd playground && pnpm frontend:dev",
73
- "test": "pnpm run build && ajs module test .",
74
- "release": "pnpm --dir frontend-vue install --frozen-lockfile && release-it",
75
- "knip": "knip --dependencies",
76
- "knip:all": "knip"
77
79
  }
78
- }
80
+ }