@shopware/composables 1.7.0 → 1.8.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/README.md CHANGED
@@ -157,7 +157,7 @@ All composable functions are fully typed with TypeScript and they are registed g
157
157
 
158
158
  - [📘 Documentation](https://frontends.shopware.com)
159
159
 
160
- - [👥 Community Slack](https://shopwarecommunity.slack.com) (`#composable-frontends` & `#shopware-pwa` channel)
160
+ - [👥 Community Slack](https://shopwarecommunity.slack.com) (`#composable-frontends`)
161
161
 
162
162
  <!-- AUTO GENERATED CHANGELOG -->
163
163
 
@@ -165,13 +165,9 @@ All composable functions are fully typed with TypeScript and they are registed g
165
165
 
166
166
  Full changelog for stable version is available [here](https://github.com/shopware/frontends/blob/main/packages/composables/CHANGELOG.md)
167
167
 
168
- ### Latest changes: 1.7.0
169
-
170
- ### Minor Changes
171
-
172
- - [#1596](https://github.com/shopware/frontends/pull/1596) [`3a79106`](https://github.com/shopware/frontends/commit/3a791065d04152255095965e3fb12ea538a22639) Thanks [@patzick](https://github.com/patzick)! - Changed `@shopware-pwa/composables` package to `@shopware/composables`. Just rename it in package.json file and run install.
168
+ ### Latest changes: 1.8.1
173
169
 
174
170
  ### Patch Changes
175
171
 
176
- - Updated dependencies [[`6736509`](https://github.com/shopware/frontends/commit/67365096168e28b9683cfd3b5d4c8bb3b4ae07e3)]:
177
- - @shopware-pwa/helpers-next@1.3.0
172
+ - Updated dependencies [[`7324620`](https://github.com/shopware/frontends/commit/7324620a3f39c1b62f7cc294192a3e8b8b336d09)]:
173
+ - @shopware/api-client@1.2.1
package/dist/index.d.mts CHANGED
@@ -2,7 +2,7 @@ import * as vue from 'vue';
2
2
  import { CSSProperties, ComputedRef, AnchorHTMLAttributes, ImgHTMLAttributes, App, EffectScope, Ref } from 'vue';
3
3
  import { createAPIClient, ApiError } from '@shopware/api-client';
4
4
  import { operations as operations$1, components } from '@shopware/api-client/store-api-types';
5
- import { getListingFilters, TierPrice } from '@shopware-pwa/helpers-next';
5
+ import { getListingFilters, TierPrice } from '@shopware/helpers';
6
6
 
7
7
  type operations = operations$1;
8
8
  type Schemas = components["schemas"];
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as vue from 'vue';
2
2
  import { CSSProperties, ComputedRef, AnchorHTMLAttributes, ImgHTMLAttributes, App, EffectScope, Ref } from 'vue';
3
3
  import { createAPIClient, ApiError } from '@shopware/api-client';
4
4
  import { operations as operations$1, components } from '@shopware/api-client/store-api-types';
5
- import { getListingFilters, TierPrice } from '@shopware-pwa/helpers-next';
5
+ import { getListingFilters, TierPrice } from '@shopware/helpers';
6
6
 
7
7
  type operations = operations$1;
8
8
  type Schemas = components["schemas"];
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { pascalCase } from 'scule';
2
2
  import { computed, effectScope, reactive, markRaw, inject, ref, provide, unref, onMounted, watch, resolveComponent } from 'vue';
3
- import { urlIsAbsolute, relativeUrlSlash, getSrcSetForMedia, getMainImageUrl, getTranslatedProperty, getListingFilters, getProductTierPrices, buildUrlPrefix } from '@shopware-pwa/helpers-next';
3
+ import { urlIsAbsolute, relativeUrlSlash, getSrcSetForMedia, getMainImageUrl, getTranslatedProperty, getListingFilters, getProductTierPrices, buildUrlPrefix } from '@shopware/helpers';
4
4
  import { ApiClientError } from '@shopware/api-client';
5
5
  import { createSharedComposable, injectLocal, provideLocal, createInjectionState, syncRefs } from '@vueuse/core';
6
6
  import { defu } from 'defu';
@@ -230,7 +230,7 @@ function useBreadcrumbs(newBreadcrumbs) {
230
230
  _breadcrumbs.value = [breadcrumb];
231
231
  };
232
232
  const buildDynamicBreadcrumbs = async (breadcrumbs) => {
233
- _breadcrumbs.value = breadcrumbs.breadcrumbs.map((breadcrumb) => {
233
+ _breadcrumbs.value = breadcrumbs.map((breadcrumb) => {
234
234
  return {
235
235
  ...breadcrumb,
236
236
  path: `/${breadcrumb.path}`
@@ -2678,7 +2678,7 @@ function resolveCmsComponent(content) {
2678
2678
  }
2679
2679
  function getDefaultApiParams() {
2680
2680
  console.error(
2681
- "[@shopware-pwa/composables] `getDefaultApiParams` is deprecated and will be removed in the next major release."
2681
+ "[@shopware/composables] `getDefaultApiParams` is deprecated and will be removed in the next major release."
2682
2682
  );
2683
2683
  return {};
2684
2684
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware/composables",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "description": "Shopware Frontends composables for Vue",
5
5
  "author": "Shopware",
6
6
  "repository": {
@@ -51,21 +51,21 @@
51
51
  "types"
52
52
  ],
53
53
  "dependencies": {
54
- "@vueuse/core": "11.2.0",
54
+ "@vueuse/core": "12.5.0",
55
55
  "defu": "6.1.4",
56
56
  "scule": "1.3.0",
57
- "@shopware/api-client": "1.2.0",
58
- "@shopware-pwa/helpers-next": "1.3.0"
57
+ "@shopware/helpers": "1.4.0",
58
+ "@shopware/api-client": "1.2.1"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@biomejs/biome": "1.8.3",
62
- "@nuxt/kit": "3.14.1592",
63
- "@vitest/coverage-v8": "2.1.8",
62
+ "@nuxt/kit": "3.15.4",
63
+ "@vitest/coverage-v8": "3.0.5",
64
64
  "@vue/test-utils": "2.4.6",
65
- "happy-dom": "16.6.0",
65
+ "happy-dom": "17.1.0",
66
66
  "typescript": "5.6.3",
67
67
  "unbuild": "2.0.0",
68
- "vitest": "2.1.8",
68
+ "vitest": "3.0.5",
69
69
  "vue": "3.5.13",
70
70
  "tsconfig": "0.0.0"
71
71
  },
@@ -2,7 +2,7 @@ import {
2
2
  getSrcSetForMedia,
3
3
  relativeUrlSlash,
4
4
  urlIsAbsolute,
5
- } from "@shopware-pwa/helpers-next";
5
+ } from "@shopware/helpers";
6
6
  import { computed } from "vue";
7
7
  import type {
8
8
  AnchorHTMLAttributes,
package/src/index.test.ts CHANGED
@@ -21,7 +21,7 @@ describe("resolveCmsComponent", () => {
21
21
  const result = getDefaultApiParams();
22
22
  expect(result).toEqual({});
23
23
  expect(console.error).toHaveBeenCalledWith(
24
- "[@shopware-pwa/composables] `getDefaultApiParams` is deprecated and will be removed in the next major release.",
24
+ "[@shopware/composables] `getDefaultApiParams` is deprecated and will be removed in the next major release.",
25
25
  );
26
26
  });
27
27
 
package/src/index.ts CHANGED
@@ -105,7 +105,7 @@ export function getDefaultApiParams(): {
105
105
  [composableName: string]: unknown;
106
106
  } {
107
107
  console.error(
108
- "[@shopware-pwa/composables] `getDefaultApiParams` is deprecated and will be removed in the next major release.",
108
+ "[@shopware/composables] `getDefaultApiParams` is deprecated and will be removed in the next major release.",
109
109
  );
110
110
  return {};
111
111
  }
@@ -1,10 +1,3 @@
1
- // import type {
2
- // ProductResponse as LegacyProductResponse,
3
- // LandingPage,
4
- // Category,
5
- // CmsPage,
6
- // } from "@shopware-pwa/types";
7
-
8
1
  export * from "./cmsBlockTypes";
9
2
  export * from "./cmsElementTypes";
10
3
  export * from "./cmsSectionTypes";
@@ -1,5 +1,5 @@
1
1
  import { beforeEach, describe, expect, it, vi } from "vitest";
2
- import type { operations } from "#shopware";
2
+ import type { Schemas } from "#shopware";
3
3
  import { useSetup } from "../_test";
4
4
  import { useBreadcrumbs } from "./useBreadcrumbs";
5
5
 
@@ -48,9 +48,9 @@ describe("useBreadcrumbs", () => {
48
48
  ],
49
49
  },
50
50
  });
51
- await vm.buildDynamicBreadcrumbs({
52
- breadcrumbs: [{ path: "test" }],
53
- } as unknown as operations["readBreadcrumb get /breadcrumb/{id}"]["response"]);
51
+ await vm.buildDynamicBreadcrumbs([
52
+ { path: "test" } as Schemas["Breadcrumb"],
53
+ ]);
54
54
 
55
55
  expect(vm.breadcrumbs[0].path).toBe("/test");
56
56
  });
@@ -71,7 +71,7 @@ export function useBreadcrumbs(
71
71
  const buildDynamicBreadcrumbs = async (
72
72
  breadcrumbs: operations["readBreadcrumb get /breadcrumb/{id}"]["response"],
73
73
  ) => {
74
- _breadcrumbs.value = breadcrumbs.breadcrumbs.map((breadcrumb) => {
74
+ _breadcrumbs.value = breadcrumbs.map((breadcrumb) => {
75
75
  // Adjust path to be compatible with the router
76
76
  return {
77
77
  ...breadcrumb,
@@ -1,4 +1,4 @@
1
- import { getMainImageUrl } from "@shopware-pwa/helpers-next";
1
+ import { getMainImageUrl } from "@shopware/helpers";
2
2
  import { computed } from "vue";
3
3
  import type { ComputedRef, Ref } from "vue";
4
4
  import { useCart } from "#imports";
@@ -1,4 +1,4 @@
1
- import { getTranslatedProperty } from "@shopware-pwa/helpers-next";
1
+ import { getTranslatedProperty } from "@shopware/helpers";
2
2
  import { computed } from "vue";
3
3
  import type { ComputedRef } from "vue";
4
4
  import type { Schemas } from "#shopware";
@@ -1,4 +1,4 @@
1
- import { urlIsAbsolute } from "@shopware-pwa/helpers-next";
1
+ import { urlIsAbsolute } from "@shopware/helpers";
2
2
  import type { Ref } from "vue";
3
3
  import { useContext, useShopwareContext } from "#imports";
4
4
  import type { Schemas, operations } from "#shopware";
@@ -1,4 +1,4 @@
1
- import { getListingFilters } from "@shopware-pwa/helpers-next";
1
+ import { getListingFilters } from "@shopware/helpers";
2
2
  import { createInjectionState, createSharedComposable } from "@vueuse/core";
3
3
  import { computed, inject, provide, ref } from "vue";
4
4
  import type { ComputedRef, Ref } from "vue";
@@ -1,4 +1,4 @@
1
- import { getTranslatedProperty } from "@shopware-pwa/helpers-next";
1
+ import { getTranslatedProperty } from "@shopware/helpers";
2
2
  import { computed, ref } from "vue";
3
3
  import type { ComputedRef, Ref } from "vue";
4
4
  import { useProduct, useShopwareContext } from "#imports";
@@ -1,5 +1,5 @@
1
- import { getProductTierPrices } from "@shopware-pwa/helpers-next";
2
- import type { TierPrice } from "@shopware-pwa/helpers-next";
1
+ import { getProductTierPrices } from "@shopware/helpers";
2
+ import type { TierPrice } from "@shopware/helpers";
3
3
  import { computed } from "vue";
4
4
  import type { ComputedRef, Ref } from "vue";
5
5
  import type { Schemas } from "#shopware";
@@ -1,9 +1,9 @@
1
- import { buildUrlPrefix } from "@shopware-pwa/helpers-next";
1
+ import { buildUrlPrefix } from "@shopware/helpers";
2
2
  import { describe, expect, it, vi } from "vitest";
3
3
  import { useSetup } from "../_test";
4
4
  import { useUrlResolver } from "./useUrlResolver";
5
5
 
6
- vi.mock("@shopware-pwa/helpers-next", async () => {
6
+ vi.mock("@shopware/helpers", async () => {
7
7
  return {
8
8
  buildUrlPrefix: vi.fn(),
9
9
  };
@@ -1,4 +1,4 @@
1
- import { buildUrlPrefix } from "@shopware-pwa/helpers-next";
1
+ import { buildUrlPrefix } from "@shopware/helpers";
2
2
  import { inject } from "vue";
3
3
 
4
4
  export function useUrlResolver() {