@haus-tech/package-size-plugin 3.0.2 → 3.0.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 ADDED
@@ -0,0 +1,24 @@
1
+ ## 3.0.3
2
+
3
+ ### 🚀 Features
4
+
5
+ - **package-size-plugin:** enhance package size configuration options ([c04bd80](https://github.com/WeAreHausTech/haus-tech-vendure-plugins/commit/c04bd80))
6
+ - **package-size-plugin:** add package size unit support to ProductVariant ([3e2cdf0](https://github.com/WeAreHausTech/haus-tech-vendure-plugins/commit/3e2cdf0))
7
+ - **product:** Product package size plugin ([#2](https://github.com/WeAreHausTech/haus-tech-vendure-plugins/pull/2))
8
+
9
+ ### 🩹 Fixes
10
+
11
+ - **package-size-plugin:** set default package size unit to 'st' ([e08589c](https://github.com/WeAreHausTech/haus-tech-vendure-plugins/commit/e08589c))
12
+
13
+ ## 3.0.1
14
+
15
+ ### 🚀 Features
16
+
17
+ - **package-size-plugin:** add package size unit support to ProductVariant ([3e2cdf0](https://github.com/WeAreHausTech/haus-tech-vendure-plugins/commit/3e2cdf0))
18
+
19
+ ## 3.0.0
20
+
21
+ ### 🚀 Features
22
+
23
+ - Product package size plugin (#2) ([b38c847](https://github.com/WeAreHausTech/haus-vendure-plugins-public/commit/b38c8477c4728556f5711d57b7ef8acdfad029e9))
24
+ - New plugin - product popularity (#6) ([3de3285](https://github.com/WeAreHausTech/haus-vendure-plugins-public/commit/3de3285c57c300ee46e2d02f5c960ceb323401e2))
package/README.md CHANGED
@@ -1,4 +1,11 @@
1
- # Package Size Plugin for Vendure
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.2
6
+ ---
7
+
8
+ # Package Size Plugin
2
9
 
3
10
  This plugin adds package size and optional unit functionality to product variants in Vendure.
4
11
 
@@ -193,6 +200,51 @@ const elasticSearchConfig: ElasticsearchOptions = {
193
200
  }
194
201
  ```
195
202
 
203
+ ## Use Cases
204
+
205
+ The Package Size Plugin is ideal for:
206
+
207
+ - E-commerce platforms that require detailed package size information for logistics and shipping calculations.
208
+ - Businesses that need to expose package size data to customers or third-party systems via the shop API.
209
+ - Scenarios where Elasticsearch is used to index and search for product variant data, including package sizes.
210
+
211
+ ## Example GraphQL Query
212
+
213
+ You can query the `packageSize` field using the shop API:
214
+
215
+ ```graphql
216
+ query {
217
+ product(id: "1") {
218
+ variants {
219
+ id
220
+ name
221
+ packageSize
222
+ packageSizeUnit # if using units
223
+ }
224
+ }
225
+ }
226
+ ```
227
+
228
+ ## Testing
229
+
230
+ 1. Run `yarn test` to execute the e2e tests.
231
+ 2. Implement additional tests to cover your specific use cases.
232
+
233
+ ## Publishing to NPM
234
+
235
+ 1. Make sure you are [logged in to NPM](https://docs.npmjs.com/cli/v9/commands/npm-login).
236
+ 2. Build the plugin:
237
+
238
+ ```bash
239
+ yarn build
240
+ ```
241
+
242
+ 3. Publish the plugin:
243
+
244
+ ```bash
245
+ yarn publish
246
+ ```
247
+
196
248
  ## Features
197
249
 
198
250
  - ✅ Configurable package size field type (integer or float)
@@ -202,3 +254,8 @@ const elasticSearchConfig: ElasticsearchOptions = {
202
254
  - ✅ Multi-language labels (English/Swedish)
203
255
  - ✅ TypeScript support
204
256
  - ✅ Backward compatibility with migration path
257
+
258
+ ## Resources
259
+
260
+ - [Vendure Plugin Documentation](https://www.vendure.io/docs/plugins/)
261
+ - [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.2",
3
+ "version": "3.0.4",
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": "dist/index.js",
15
- "types": "dist/index.d.ts",
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
- "build": "rimraf dist && tsc",
23
- "test": "jest --preset=\"ts-jest\"",
24
- "prepublishOnly": "yarn && yarn build"
25
- }
26
- }
17
+ "start": "yarn ts-node test/dev-server.ts"
18
+ },
19
+ "type": "commonjs"
20
+ }
@@ -15,3 +15,4 @@ const getShopApiExtensions = (packageSizeFieldType) => {
15
15
  `;
16
16
  };
17
17
  exports.getShopApiExtensions = getShopApiExtensions;
18
+ //# sourceMappingURL=api-extensions.js.map
@@ -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"}
@@ -45,3 +45,4 @@ exports.ProductVariantEntityResolver = ProductVariantEntityResolver = __decorate
45
45
  (0, graphql_1.Resolver)('ProductVariant'),
46
46
  __metadata("design:paramtypes", [])
47
47
  ], ProductVariantEntityResolver);
48
+ //# sourceMappingURL=package-size.resolver.js.map
@@ -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"}
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./package-size.plugin"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/package-size-plugin/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC"}
@@ -60,3 +60,4 @@ class PackageSizePlugin {
60
60
  }
61
61
  }
62
62
  exports.PackageSizePlugin = PackageSizePlugin;
63
+ //# sourceMappingURL=package-size.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-size.plugin.js","sourceRoot":"","sources":["../../../../packages/package-size-plugin/src/package-size.plugin.ts"],"names":[],"mappings":";;;;;;;;;AAAA,wCAMsB;AACtB,yDAA2D;AAC3D,uEAA0E;AAyB1E,MAAa,iBAAiB;IACrB,AAAP,MAAM,CAAC,IAAI,CAAC,MAA+B;QACzC,MAAM,SAAS,GAAG,MAAM,CAAC,oBAAoB,IAAI,KAAK,CAAA;QACtD,MAAM,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,IAAI,KAAK,CAAA;QA2C7D,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;SAAG,CAAA;QAA3B,wBAAwB;YAzC7B,IAAA,oBAAa,EAAC;gBACb,OAAO,EAAE,CAAC,yBAAkB,CAAC;gBAC7B,iBAAiB,EAAE;oBACjB,SAAS,EAAE,CAAC,oDAA4B,CAAC;oBACzC,MAAM,EAAE,IAAA,qCAAoB,EAAC,SAAS,CAAC;iBACxC;gBACD,aAAa,EAAE,CAAC,aAAa,EAAE,EAAE;oBAC/B,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,IAAI,CAAA;oBAC9C,MAAM,YAAY,GAAG,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;oBAEpD,aAAa,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC;wBAC7C,IAAI,EAAE,qBAAqB;wBAC3B,IAAI,EAAE,SAAS;wBACf,YAAY,EAAE,YAAY;wBAC1B,MAAM,EAAE,KAAK;wBACb,KAAK,EAAE;4BACL,EAAE,YAAY,EA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