@uplab/vendure-plugin-exchange-rates 0.1.2 → 0.1.4

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,19 @@
1
1
  # @uplab/vendure-plugin-exchange-rates
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#43](https://github.com/Uplab/uplab-vendure-plugins/pull/43) [`c1a7435`](https://github.com/Uplab/uplab-vendure-plugins/commit/c1a7435d95b0835a24ee51ff2ff529c5153afc9c) Thanks [@brmk](https://github.com/brmk)! - Keep the grey badges grey on the Vendure 3.8 dashboard. Its Badge no longer has a `secondary` variant and shows such a badge as plain text. That hit the «System change» badge in the change history, and the «Disabled» and «Fetched rate» badges on the exchange-rate pages. They look the same as before on 3.7.
8
+
9
+ - [#43](https://github.com/Uplab/uplab-vendure-plugins/pull/43) [`c7d7775`](https://github.com/Uplab/uplab-vendure-plugins/commit/c7d777541307cf7be3a80b07f9e3438e9c03c2f1) Thanks [@brmk](https://github.com/brmk)! - Install alongside Vendure 3.8: the `@nestjs/common` and `@nestjs/core` peers now accept `^11 || ^12`, and `@nestjs/graphql` accepts `^13 || ^14`. Vendure 3.8 moved to NestJS 12, so `npm install` failed with `ERESOLVE` against the old `^11` / `^13` ranges. Nothing changes on Vendure 3.7.
10
+
11
+ ## 0.1.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [#41](https://github.com/Uplab/uplab-vendure-plugins/pull/41) [`31d5deb`](https://github.com/Uplab/uplab-vendure-plugins/commit/31d5deba10edce2aef108da53358fafbb5ff7fae) Thanks [@brmk](https://github.com/brmk)! - Ship the LICENSE file in the package.
16
+
3
17
  ## 0.1.2
4
18
 
5
19
  ### Patch Changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Uplab Software
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,6 +1,5 @@
1
1
  import { Trans, useLingui } from '@lingui/react/macro';
2
2
  import {
3
- Badge,
4
3
  Button,
5
4
  DashboardRouteDefinition,
6
5
  DetailFormGrid,
@@ -22,6 +21,7 @@ import {
22
21
  import { useMemo } from 'react';
23
22
  import { formatRate } from '../format-rate';
24
23
  import { getCurrencyExchangeRateDetailDocument, updateCurrencyExchangeRateDocument } from '../graphql';
24
+ import { StateBadge } from '../state-badge';
25
25
 
26
26
  const pageId = 'currency-exchange-rate-detail';
27
27
 
@@ -122,9 +122,7 @@ function CurrencyExchangeRateDetailPage({ route }: { route: Route }) {
122
122
  <Trans>Status</Trans>
123
123
  </dt>
124
124
  <dd>
125
- <Badge variant={entity?.enabled ? 'success' : 'secondary'}>
126
- {entity?.enabled ? t`Enabled` : t`Disabled`}
127
- </Badge>
125
+ <StateBadge on={!!entity?.enabled}>{entity?.enabled ? t`Enabled` : t`Disabled`}</StateBadge>
128
126
  </dd>
129
127
  </div>
130
128
  <div className="flex flex-col">
@@ -1,8 +1,9 @@
1
1
  import { Trans, useLingui } from '@lingui/react/macro';
2
- import { Badge, DashboardRouteDefinition, DetailPageButton, ListPage, useLocalFormat } from '@vendure/dashboard';
2
+ import { DashboardRouteDefinition, DetailPageButton, ListPage, useLocalFormat } from '@vendure/dashboard';
3
3
  import { useMemo } from 'react';
4
4
  import { formatRate } from '../format-rate';
5
5
  import { getCurrencyExchangeRateListDocument } from '../graphql';
6
+ import { StateBadge } from '../state-badge';
6
7
 
7
8
  const pageId = 'currency-exchange-rate-list';
8
9
 
@@ -83,17 +84,15 @@ function CurrencyExchangeRateListPage({ route }: { route: Parameters<DashboardRo
83
84
  },
84
85
  enabled: {
85
86
  cell: ({ row }) => (
86
- <Badge variant={row.original.enabled ? 'success' : 'secondary'}>
87
- {row.original.enabled ? t`Enabled` : t`Disabled`}
88
- </Badge>
87
+ <StateBadge on={row.original.enabled}>{row.original.enabled ? t`Enabled` : t`Disabled`}</StateBadge>
89
88
  ),
90
89
  },
91
90
  useCustomRate: {
92
91
  header: () => <Trans>Custom rate</Trans>,
93
92
  cell: ({ row }) => (
94
- <Badge variant={row.original.useCustomRate ? 'success' : 'secondary'}>
93
+ <StateBadge on={row.original.useCustomRate}>
95
94
  {row.original.useCustomRate ? t`Using custom rate` : t`Fetched rate`}
96
- </Badge>
95
+ </StateBadge>
97
96
  ),
98
97
  },
99
98
  updatedAt: {
@@ -0,0 +1,19 @@
1
+ import { Badge } from '@vendure/dashboard';
2
+ import type { ReactNode } from 'react';
3
+
4
+ /**
5
+ * The look of the dashboard's `secondary` badge, on `outline`: Vendure 3.8's Badge no longer has `secondary`
6
+ * (it renders an unknown variant unstyled), while `outline` and these colours exist on 3.7 and 3.8 alike.
7
+ */
8
+ const OFF_BADGE = 'border-transparent bg-secondary text-secondary-foreground';
9
+
10
+ /** A yes/no state: green while on, grey while off. */
11
+ export function StateBadge({ on, children }: { on: boolean; children: ReactNode }) {
12
+ return on ? (
13
+ <Badge variant="success">{children}</Badge>
14
+ ) : (
15
+ <Badge variant="outline" className={OFF_BADGE}>
16
+ {children}
17
+ </Badge>
18
+ );
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uplab/vendure-plugin-exchange-rates",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Exchange rates for Vendure in any base currency, from the ECB, Frankfurter, Monobank, the NBU or your own source, overridable per currency in the dashboard",
5
5
  "license": "MIT",
6
6
  "author": "Uplab",
@@ -40,7 +40,8 @@
40
40
  "files": [
41
41
  "dist",
42
42
  "README.md",
43
- "CHANGELOG.md"
43
+ "CHANGELOG.md",
44
+ "LICENSE"
44
45
  ],
45
46
  "scripts": {
46
47
  "build": "rimraf dist && tsc -p tsconfig.build.json && node ../../scripts/copy-dashboard.mjs",
@@ -53,9 +54,9 @@
53
54
  },
54
55
  "peerDependencies": {
55
56
  "@lingui/react": "^5.0.0",
56
- "@nestjs/common": "^11.0.0",
57
- "@nestjs/core": "^11.0.0",
58
- "@nestjs/graphql": "^13.0.0",
57
+ "@nestjs/common": "^11.0.0 || ^12.0.0",
58
+ "@nestjs/core": "^11.0.0 || ^12.0.0",
59
+ "@nestjs/graphql": "^13.0.0 || ^14.0.0",
59
60
  "@vendure/core": "^3.7.0",
60
61
  "@vendure/dashboard": "^3.7.0",
61
62
  "react": "^19.0.0",
@@ -74,20 +75,26 @@
74
75
  },
75
76
  "devDependencies": {
76
77
  "@lingui/react": "^5.9.5",
77
- "@nestjs/common": "^11.0.12",
78
- "@nestjs/core": "^11.2.1",
79
- "@nestjs/graphql": "^13.0.0",
80
- "@types/react": "^19.0.0",
81
- "@vendure/core": "3.7.2",
82
- "@vendure/dashboard": "3.7.2",
83
- "@vendure/testing": "3.7.2",
78
+ "@nestjs/common": "^12.1.3",
79
+ "@nestjs/core": "^12.1.3",
80
+ "@nestjs/graphql": "^14.0.3",
81
+ "@testing-library/dom": "^10.4.2",
82
+ "@testing-library/react": "^16.3.3",
83
+ "@types/react": "19.3.0",
84
+ "@types/react-dom": "19.2.4",
85
+ "@vendure/core": "3.8.0",
86
+ "@vendure/dashboard": "3.8.0",
87
+ "@vendure/testing": "3.8.0",
84
88
  "graphql": "^16.11.0",
85
- "react": "^19.0.0",
89
+ "jsdom": "^26.1.0",
90
+ "react": "^19.3.0",
91
+ "react-dom": "^19.3.0",
92
+ "react-hook-form": "^7.86.0",
86
93
  "rimraf": "^6.0.1",
87
94
  "rxjs": "^7.8.1",
88
95
  "typeorm": "^0.3.21",
89
96
  "typescript": "^5.8.3",
90
- "unplugin-swc": "^1.5.7",
97
+ "unplugin-swc": "^1.6.0",
91
98
  "vitest": "^4.0.0"
92
99
  },
93
100
  "engines": {