@haus-tech/package-size-plugin 3.0.2 → 3.0.5
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 +28 -0
- package/README.md +59 -1
- package/package.json +7 -13
- package/{dist → src}/api/api-extensions.js +1 -0
- package/src/api/api-extensions.js.map +1 -0
- package/{dist → src}/api/package-size.resolver.js +1 -0
- package/src/api/package-size.resolver.js.map +1 -0
- package/{dist → src}/constants.js +1 -0
- package/src/constants.js.map +1 -0
- package/{dist → src}/index.js +1 -0
- package/src/index.js.map +1 -0
- package/{dist → src}/package-size.plugin.js +1 -0
- package/src/package-size.plugin.js.map +1 -0
- /package/{dist → src}/api/api-extensions.d.ts +0 -0
- /package/{dist → src}/api/package-size.resolver.d.ts +0 -0
- /package/{dist → src}/constants.d.ts +0 -0
- /package/{dist → src}/index.d.ts +0 -0
- /package/{dist → src}/package-size.plugin.d.ts +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
## 3.0.4
|
|
2
|
+
|
|
3
|
+
This was a version bump only for package-size-plugin to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 3.0.3
|
|
6
|
+
|
|
7
|
+
### 🚀 Features
|
|
8
|
+
|
|
9
|
+
- **package-size-plugin:** enhance package size configuration options ([c04bd80](https://github.com/WeAreHausTech/haus-tech-vendure-plugins/commit/c04bd80))
|
|
10
|
+
- **package-size-plugin:** add package size unit support to ProductVariant ([3e2cdf0](https://github.com/WeAreHausTech/haus-tech-vendure-plugins/commit/3e2cdf0))
|
|
11
|
+
- **product:** Product package size plugin ([#2](https://github.com/WeAreHausTech/haus-tech-vendure-plugins/pull/2))
|
|
12
|
+
|
|
13
|
+
### 🩹 Fixes
|
|
14
|
+
|
|
15
|
+
- **package-size-plugin:** set default package size unit to 'st' ([e08589c](https://github.com/WeAreHausTech/haus-tech-vendure-plugins/commit/e08589c))
|
|
16
|
+
|
|
17
|
+
## 3.0.1
|
|
18
|
+
|
|
19
|
+
### 🚀 Features
|
|
20
|
+
|
|
21
|
+
- **package-size-plugin:** add package size unit support to ProductVariant ([3e2cdf0](https://github.com/WeAreHausTech/haus-tech-vendure-plugins/commit/3e2cdf0))
|
|
22
|
+
|
|
23
|
+
## 3.0.0
|
|
24
|
+
|
|
25
|
+
### 🚀 Features
|
|
26
|
+
|
|
27
|
+
- Product package size plugin (#2) ([b38c847](https://github.com/WeAreHausTech/haus-vendure-plugins-public/commit/b38c8477c4728556f5711d57b7ef8acdfad029e9))
|
|
28
|
+
- New plugin - product popularity (#6) ([3de3285](https://github.com/WeAreHausTech/haus-vendure-plugins-public/commit/3de3285c57c300ee46e2d02f5c960ceb323401e2))
|
package/README.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
name: package-size-plugin
|
|
3
|
+
title: Package Size Plugin
|
|
4
|
+
description: Vendure plugin that allows you to manage and expose custom package size information for product variants.
|
|
5
|
+
version: 3.0.4
|
|
6
|
+
tags: [vendure, plugin, product]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Package Size Plugin
|
|
2
10
|
|
|
3
11
|
This plugin adds package size and optional unit functionality to product variants in Vendure.
|
|
4
12
|
|
|
@@ -193,6 +201,51 @@ const elasticSearchConfig: ElasticsearchOptions = {
|
|
|
193
201
|
}
|
|
194
202
|
```
|
|
195
203
|
|
|
204
|
+
## Use Cases
|
|
205
|
+
|
|
206
|
+
The Package Size Plugin is ideal for:
|
|
207
|
+
|
|
208
|
+
- E-commerce platforms that require detailed package size information for logistics and shipping calculations.
|
|
209
|
+
- Businesses that need to expose package size data to customers or third-party systems via the shop API.
|
|
210
|
+
- Scenarios where Elasticsearch is used to index and search for product variant data, including package sizes.
|
|
211
|
+
|
|
212
|
+
## Example GraphQL Query
|
|
213
|
+
|
|
214
|
+
You can query the `packageSize` field using the shop API:
|
|
215
|
+
|
|
216
|
+
```graphql
|
|
217
|
+
query {
|
|
218
|
+
product(id: "1") {
|
|
219
|
+
variants {
|
|
220
|
+
id
|
|
221
|
+
name
|
|
222
|
+
packageSize
|
|
223
|
+
packageSizeUnit # if using units
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Testing
|
|
230
|
+
|
|
231
|
+
1. Run `yarn test` to execute the e2e tests.
|
|
232
|
+
2. Implement additional tests to cover your specific use cases.
|
|
233
|
+
|
|
234
|
+
## Publishing to NPM
|
|
235
|
+
|
|
236
|
+
1. Make sure you are [logged in to NPM](https://docs.npmjs.com/cli/v9/commands/npm-login).
|
|
237
|
+
2. Build the plugin:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
yarn build
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
3. Publish the plugin:
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
yarn publish
|
|
247
|
+
```
|
|
248
|
+
|
|
196
249
|
## Features
|
|
197
250
|
|
|
198
251
|
- ✅ Configurable package size field type (integer or float)
|
|
@@ -202,3 +255,8 @@ const elasticSearchConfig: ElasticsearchOptions = {
|
|
|
202
255
|
- ✅ Multi-language labels (English/Swedish)
|
|
203
256
|
- ✅ TypeScript support
|
|
204
257
|
- ✅ Backward compatibility with migration path
|
|
258
|
+
|
|
259
|
+
## Resources
|
|
260
|
+
|
|
261
|
+
- [Vendure Plugin Documentation](https://www.vendure.io/docs/plugins/)
|
|
262
|
+
- [GraphQL Code Generator](https://the-guild.dev/graphql/codegen) for generating TypeScript types for custom GraphQL types.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haus-tech/package-size-plugin",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "Package size plugin for Vendure",
|
|
5
5
|
"author": "Haus Tech",
|
|
6
6
|
"repository": {
|
|
@@ -11,16 +11,10 @@
|
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=20.0.0"
|
|
13
13
|
},
|
|
14
|
-
"main": "
|
|
15
|
-
"types": "
|
|
16
|
-
"files": [
|
|
17
|
-
"dist",
|
|
18
|
-
"README.md"
|
|
19
|
-
],
|
|
14
|
+
"main": "src/index.js",
|
|
15
|
+
"types": "src/index.d.ts",
|
|
20
16
|
"scripts": {
|
|
21
|
-
"start": "yarn ts-node test/dev-server.ts"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
}
|
|
17
|
+
"start": "yarn ts-node test/dev-server.ts"
|
|
18
|
+
},
|
|
19
|
+
"type": "commonjs"
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-extensions.js","sourceRoot":"","sources":["../../../../../packages/package-size-plugin/src/api/api-extensions.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEtB,MAAM,oBAAoB,GAAG,CAAC,oBAAqC,EAAE,EAAE;IAC5E,MAAM,eAAe,GAAG,oBAAoB,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAA;IAE1E,OAAO,IAAA,qBAAG,EAAA;;qBAES,eAAe;;;GAGjC,CAAA;AACH,CAAC,CAAA;AATY,QAAA,oBAAoB,wBAShC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-size.resolver.js","sourceRoot":"","sources":["../../../../../packages/package-size-plugin/src/api/package-size.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAgE;AAChE,wCAAmE;AAG5D,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACvC,gBAAe,CAAC;IAGhB,WAAW,CAAQ,GAAmB,EAAY,OAAuB;QACvE,OAAO,OAAO,CAAC,YAAY,CAAC,mBAAmB,IAAI,CAAC,CAAA;IACtD,CAAC;IAGD,eAAe,CAAQ,GAAmB,EAAY,OAAuB;QAC3E,OAAO,OAAO,CAAC,YAAY,CAAC,uBAAuB,IAAI,IAAI,CAAA;IAC7D,CAAC;CACF,CAAA;AAZY,oEAA4B;AAIvC;IADC,IAAA,sBAAY,GAAE;IACF,WAAA,IAAA,UAAG,GAAE,CAAA;IAAuB,WAAA,IAAA,gBAAM,GAAE,CAAA;;qCAAzB,qBAAc,EAAqB,qBAAc;;+DAExE;AAGD;IADC,IAAA,sBAAY,GAAE;IACE,WAAA,IAAA,UAAG,GAAE,CAAA;IAAuB,WAAA,IAAA,gBAAM,GAAE,CAAA;;qCAAzB,qBAAc,EAAqB,qBAAc;;mEAE5E;uCAXU,4BAA4B;IADxC,IAAA,kBAAQ,EAAC,gBAAgB,CAAC;;GACd,4BAA4B,CAYxC"}
|
|
@@ -3,3 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PLUGIN_INIT_OPTIONS = exports.loggerCtx = void 0;
|
|
4
4
|
exports.loggerCtx = 'PackageSizePlugin';
|
|
5
5
|
exports.PLUGIN_INIT_OPTIONS = Symbol('PACKAGE_SIZE_PLUGIN_INIT_OPTIONS');
|
|
6
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../packages/package-size-plugin/src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,mBAAmB,CAAA;AAC/B,QAAA,mBAAmB,GAAG,MAAM,CAAC,kCAAkC,CAAC,CAAA"}
|
package/{dist → src}/index.js
RENAMED
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/package-size-plugin/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-size.plugin.js","sourceRoot":"","sources":["../../../../packages/package-size-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I,EAAE,QAAQ;4BACd,YAAY,EAAE,WAAW;4BACzB,EAAE,EAAE;gCACF,SAAS,EAAE,iBAAiB;6BAC7B;4BACD,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE;gCACL,EAAE,YAAY,EAAE,mBAAY,CAAC,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE;gCAC7D,EAAE,YAAY,EAAE,mBAAY,CAAC,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE;6BAC9D;yBACF,CAAC,CAAA;oBACJ,CAAC;oBAED,OAAO,aAAa,CAAA;gBACtB,CAAC;gBACD,aAAa,EAAE,QAAQ;aACxB,CAAC;WACI,wBAAwB,CAAG;QAEjC,OAAO,wBAAwB,CAAA;IACjC,CAAC;CACF;AAlDD,8CAkDC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{dist → src}/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|