medusa-plugin-tax-lookup 0.1.0 → 0.2.0

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.
@@ -0,0 +1,3 @@
1
+ declare const _default: import("@medusajs/types").ModuleProviderExports;
2
+ export default _default;
3
+ export * from './provider';
@@ -1,8 +1,23 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  const utils_1 = require("@medusajs/framework/utils");
4
18
  const provider_1 = require("./provider");
5
19
  exports.default = (0, utils_1.ModuleProvider)(utils_1.Modules.TAX, {
6
20
  services: [provider_1.TaxLookupProvider]
7
21
  });
8
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvcHJvdmlkZXJzL3RheC1sb29rdXAvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxxREFBbUU7QUFDbkUseUNBQThDO0FBRTlDLGtCQUFlLElBQUEsc0JBQWMsRUFBQyxlQUFPLENBQUMsR0FBRyxFQUFFO0lBQzFDLFFBQVEsRUFBRSxDQUFDLDRCQUFpQixDQUFDO0NBQzdCLENBQUMsQ0FBQSJ9
22
+ __exportStar(require("./provider"), exports);
23
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvcHJvdmlkZXJzL3RheC1sb29rdXAvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHFEQUFtRTtBQUNuRSx5Q0FBOEM7QUFFOUMsa0JBQWUsSUFBQSxzQkFBYyxFQUFDLGVBQU8sQ0FBQyxHQUFHLEVBQUU7SUFDMUMsUUFBUSxFQUFFLENBQUMsNEJBQWlCLENBQUM7Q0FDN0IsQ0FBQyxDQUFBO0FBRUYsNkNBQTBCIn0=
@@ -0,0 +1,15 @@
1
+ import { TaxTypes } from '@medusajs/framework/types';
2
+ import { Logger } from '@medusajs/framework/types';
3
+ export interface TaxLookupOptions {
4
+ dataDirectory: string;
5
+ }
6
+ export declare class TaxLookupProvider implements TaxTypes.ITaxProvider {
7
+ static identifier: string;
8
+ protected logger_: Logger;
9
+ protected taxRates_: Record<string, number>;
10
+ constructor({ logger }: {
11
+ logger: Logger;
12
+ }, options: TaxLookupOptions);
13
+ getIdentifier(): string;
14
+ getTaxLines(itemLines: TaxTypes.ItemTaxCalculationLine[], shippingLines: TaxTypes.ShippingTaxCalculationLine[], context: TaxTypes.TaxCalculationContext): Promise<(TaxTypes.ItemTaxLineDTO | TaxTypes.ShippingTaxLineDTO)[]>;
15
+ }
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Tax provider for Medusa that looks up tax rates by ZIP code from CSV files.
4
4
 
5
+ [Documentation](https://pevey.com/medusa-plugin-tax-lookup)
6
+
5
7
  If you are not familiar with Medusa, you can learn more on [the project web site](https://www.medusajs.com/).
6
8
 
7
9
  ## Features
@@ -73,3 +75,13 @@ If multiple CSV files contain the same ZIP code, the last file loaded wins.
73
75
  The column names the tax provider is configured to use are based on the format of csv files downloaded from Avalara: https://www.avalara.com/taxrates/en/download-tax-tables.html.
74
76
 
75
77
  However, you can use any spreadsheet you want. Just change the name of the rate column in your data source to `EstimatedCombinedRate` and the postal code column to `ZipCode`.
78
+
79
+ ## Building for Production
80
+
81
+ Make sure you copy your configured tax data directory to your .medusa/server build output. You can automate this by updating your build script in your project's package.json.
82
+
83
+ Example:
84
+
85
+ ```
86
+ "build": "medusa build && cp -R tax-data .medusa/server",
87
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "medusa-plugin-tax-lookup",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Tax rate lookup provider for Medusa v2",
5
5
  "author": "Lacey Pevey",
6
6
  "license": "MIT",
@@ -14,11 +14,26 @@
14
14
  ],
15
15
  "exports": {
16
16
  "./package.json": "./package.json",
17
- "./.medusa/server/src/modules/*": "./.medusa/server/src/modules/*/index.js",
18
- "./modules/*": "./.medusa/server/src/modules/*/index.js",
19
- "./providers/*": "./.medusa/server/src/providers/*/index.js",
20
- "./*": "./.medusa/server/src/*.js",
21
- ".": "./.medusa/server/src/providers/tax-lookup/index.js"
17
+ "./.medusa/server/src/modules/*": {
18
+ "types": "./.medusa/server/src/modules/*/index.d.ts",
19
+ "default": "./.medusa/server/src/modules/*/index.js"
20
+ },
21
+ "./modules/*": {
22
+ "types": "./.medusa/server/src/modules/*/index.d.ts",
23
+ "default": "./.medusa/server/src/modules/*/index.js"
24
+ },
25
+ "./providers/*": {
26
+ "types": "./.medusa/server/src/providers/*/index.d.ts",
27
+ "default": "./.medusa/server/src/providers/*/index.js"
28
+ },
29
+ "./*": {
30
+ "types": "./.medusa/server/src/*.d.ts",
31
+ "default": "./.medusa/server/src/*.js"
32
+ },
33
+ ".": {
34
+ "types": "./.medusa/server/src/providers/tax-lookup/index.d.ts",
35
+ "default": "./.medusa/server/src/providers/tax-lookup/index.js"
36
+ }
22
37
  },
23
38
  "keywords": [
24
39
  "medusa-plugin-tax",
@@ -35,38 +50,33 @@
35
50
  "test:unit": "TEST_TYPE=unit NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --detectOpenHandles --forceExit --passWithNoTests"
36
51
  },
37
52
  "devDependencies": {
38
- "@medusajs/admin-sdk": "2.13.6",
39
- "@medusajs/cli": "2.13.6",
40
- "@medusajs/framework": "2.13.6",
41
- "@medusajs/icons": "2.13.6",
42
- "@medusajs/medusa": "2.13.6",
43
- "@medusajs/test-utils": "2.13.6",
44
- "@medusajs/ui": "4.0.25",
45
- "@swc/core": "^1.7.28",
46
- "@swc/jest": "^0.2.39",
47
- "@types/jest": "^30.0.0",
48
- "@types/node": "^20.0.0",
49
- "@types/react": "^18.3.2",
50
- "@types/react-dom": "^18.2.25",
51
- "jest": "^29.7.0",
52
- "prop-types": "^15.8.1",
53
- "react": "^18.2.0",
54
- "react-dom": "^18.2.0",
55
- "ts-node": "^10.9.2",
56
- "typescript": "^5.6.2",
57
- "vite": "^5.2.11",
58
- "yalc": "^1.0.0-pre.53"
53
+ "@medusajs/admin-sdk": "2.14.2",
54
+ "@medusajs/cli": "2.14.2",
55
+ "@medusajs/framework": "2.14.2",
56
+ "@medusajs/icons": "2.14.2",
57
+ "@medusajs/ui": "4.1.9",
58
+ "@swc/core": "1.7.28",
59
+ "@swc/jest": "0.2.39",
60
+ "@types/jest": "30.0.0",
61
+ "@types/node": "20.0.0",
62
+ "@types/react": "18.3.2",
63
+ "@types/react-dom": "18.2.25",
64
+ "jest": "29.7.0",
65
+ "prop-types": "15.8.1",
66
+ "react": "18.3.1",
67
+ "react-dom": "18.3.1",
68
+ "ts-node": "10.9.2",
69
+ "typescript": "5.6.2",
70
+ "vite": "5.4.14",
71
+ "yalc": "1.0.0-pre.53"
59
72
  },
60
73
  "peerDependencies": {
61
- "@medusajs/admin-sdk": "2.13.6",
62
- "@medusajs/cli": "2.13.6",
63
- "@medusajs/framework": "2.13.6",
64
- "@medusajs/icons": "2.13.6",
65
- "@medusajs/medusa": "2.13.6",
66
- "@medusajs/test-utils": "2.13.6",
67
- "@medusajs/ui": "4.0.25"
74
+ "@medusajs/framework": "2.14.2",
75
+ "@medusajs/js-sdk": "2.14.2",
76
+ "@medusajs/medusa": "2.14.2"
68
77
  },
69
78
  "engines": {
70
79
  "node": ">=20"
71
- }
72
- }
80
+ },
81
+ "gitHead": "35f16164d0d17e6281b2801a9f1eb355b5035571"
82
+ }