@softwear/latestcollectioncore 1.0.158 → 1.0.159

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/dist/index.d.ts CHANGED
@@ -15,7 +15,8 @@ export { default as pivotTable } from './pivotTable';
15
15
  export { default as round2 } from './round2';
16
16
  export { default as sizeToMap } from './sizeToMap';
17
17
  export { default as transaction } from './transaction';
18
- export * from './types';
18
+ export type { AggregateFnI, AggregatorFnI, AttributeI, BrandSettingI, ColorI, dbTransactionI, DocumentItemI, GroupI, HrTimeframeI, ImageI, MarkedSkuI, MatrixI, ProductI, RaGI, RowI, SkuI, StockTransferDataI, StockTransferMatrixI, StockTransferSelectionI, TransactionI, } from './types';
19
+ export { mappingStrategyE, subscriptionE, tagTypeE, TimeGranularityE, transactionTypeE, vatCategoryE, } from './types';
19
20
  export * from './consts';
20
21
  export { default as lcAxios, createAxiosInstance, axiosRetry, exponentialDelay, isAxiosError, } from './lcAxios';
21
22
  export type { AxiosRequestConfig, AxiosResponse, AxiosPromise, AxiosError, AxiosTransformer, AxiosRetryOptions, AxiosRequestConfigAny, } from './lcAxios';
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.isAxiosError = exports.exponentialDelay = exports.axiosRetry = exports.createAxiosInstance = exports.lcAxios = exports.transaction = exports.sizeToMap = exports.round2 = exports.pivotTable = exports.isean13 = exports.imageBinder = exports.hasOnlyDigits = exports.hashBrand = exports.getPreferedPropertyMappings = exports.getBrandName = exports.findSkuByBarcode = exports.ensureArray = exports.edifact = exports.ean13 = exports.deepCopy = exports.buildPropertyMappingFn = exports.articleStatus = void 0;
20
+ exports.isAxiosError = exports.exponentialDelay = exports.axiosRetry = exports.createAxiosInstance = exports.lcAxios = exports.vatCategoryE = exports.transactionTypeE = exports.TimeGranularityE = exports.tagTypeE = exports.subscriptionE = exports.mappingStrategyE = exports.transaction = exports.sizeToMap = exports.round2 = exports.pivotTable = exports.isean13 = exports.imageBinder = exports.hasOnlyDigits = exports.hashBrand = exports.getPreferedPropertyMappings = exports.getBrandName = exports.findSkuByBarcode = exports.ensureArray = exports.edifact = exports.ean13 = exports.deepCopy = exports.buildPropertyMappingFn = exports.articleStatus = void 0;
21
21
  var articleStatus_1 = require("./articleStatus");
22
22
  Object.defineProperty(exports, "articleStatus", { enumerable: true, get: function () { return __importDefault(articleStatus_1).default; } });
23
23
  var buildPropertyMappingFn_1 = require("./buildPropertyMappingFn");
@@ -52,7 +52,13 @@ var sizeToMap_1 = require("./sizeToMap");
52
52
  Object.defineProperty(exports, "sizeToMap", { enumerable: true, get: function () { return __importDefault(sizeToMap_1).default; } });
53
53
  var transaction_1 = require("./transaction");
54
54
  Object.defineProperty(exports, "transaction", { enumerable: true, get: function () { return __importDefault(transaction_1).default; } });
55
- __exportStar(require("./types"), exports);
55
+ var types_1 = require("./types");
56
+ Object.defineProperty(exports, "mappingStrategyE", { enumerable: true, get: function () { return types_1.mappingStrategyE; } });
57
+ Object.defineProperty(exports, "subscriptionE", { enumerable: true, get: function () { return types_1.subscriptionE; } });
58
+ Object.defineProperty(exports, "tagTypeE", { enumerable: true, get: function () { return types_1.tagTypeE; } });
59
+ Object.defineProperty(exports, "TimeGranularityE", { enumerable: true, get: function () { return types_1.TimeGranularityE; } });
60
+ Object.defineProperty(exports, "transactionTypeE", { enumerable: true, get: function () { return types_1.transactionTypeE; } });
61
+ Object.defineProperty(exports, "vatCategoryE", { enumerable: true, get: function () { return types_1.vatCategoryE; } });
56
62
  __exportStar(require("./consts"), exports);
57
63
  var lcAxios_1 = require("./lcAxios");
58
64
  Object.defineProperty(exports, "lcAxios", { enumerable: true, get: function () { return __importDefault(lcAxios_1).default; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softwear/latestcollectioncore",
3
- "version": "1.0.158",
3
+ "version": "1.0.159",
4
4
  "description": "Core functions for LatestCollections applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,9 +16,12 @@
16
16
  },
17
17
  "scripts": {
18
18
  "build": "tsc -p tsconfig.json",
19
+ "verify": "node scripts/verify-exports.mjs",
20
+ "postbuild": "npm run verify",
19
21
  "build:watch": "tsc -p tsconfig.json --watch",
20
22
  "test": "vitest run",
21
23
  "test:watch": "vitest",
24
+ "prepublishOnly": "npm run build && npm test",
22
25
  "dev": "concurrently \"npm:build:watch\" \"npm:test:watch\""
23
26
  },
24
27
  "repository": {
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Ensures dist/index.js exposes runtime enums for both CJS require() and ESM named imports
3
+ * (same interop Vite/esbuild rely on). Run after `npm run build`.
4
+ */
5
+ import { createRequire } from 'module'
6
+ import { dirname, join } from 'path'
7
+ import { fileURLToPath, pathToFileURL } from 'url'
8
+
9
+ const root = dirname(fileURLToPath(import.meta.url))
10
+ const indexPath = join(root, '..', 'dist', 'index.js')
11
+
12
+ const ENUMS = [
13
+ 'subscriptionE',
14
+ 'vatCategoryE',
15
+ 'tagTypeE',
16
+ 'mappingStrategyE',
17
+ 'transactionTypeE',
18
+ 'TimeGranularityE',
19
+ ]
20
+
21
+ const require = createRequire(import.meta.url)
22
+ const cjs = require(indexPath)
23
+ for (const name of ENUMS) {
24
+ if (cjs[name] == null) throw new Error(`CJS: missing export "${name}"`)
25
+ }
26
+
27
+ const ns = await import(pathToFileURL(indexPath).href)
28
+ for (const name of ENUMS) {
29
+ if (ns[name] == null) throw new Error(`ESM: missing export "${name}"`)
30
+ }
31
+
32
+ console.log('verify-exports: ok (%d enums)', ENUMS.length)
package/src/index.ts CHANGED
@@ -15,7 +15,38 @@ export { default as pivotTable } from './pivotTable'
15
15
  export { default as round2 } from './round2'
16
16
  export { default as sizeToMap } from './sizeToMap'
17
17
  export { default as transaction } from './transaction'
18
- export * from './types'
18
+ // Explicit type vs value re-exports: `export *` compiles to CJS `__exportStar`, which some ESM
19
+ // consumers (e.g. Vite) do not surface as named exports. Runtime enums need explicit re-exports.
20
+ export type {
21
+ AggregateFnI,
22
+ AggregatorFnI,
23
+ AttributeI,
24
+ BrandSettingI,
25
+ ColorI,
26
+ dbTransactionI,
27
+ DocumentItemI,
28
+ GroupI,
29
+ HrTimeframeI,
30
+ ImageI,
31
+ MarkedSkuI,
32
+ MatrixI,
33
+ ProductI,
34
+ RaGI,
35
+ RowI,
36
+ SkuI,
37
+ StockTransferDataI,
38
+ StockTransferMatrixI,
39
+ StockTransferSelectionI,
40
+ TransactionI,
41
+ } from './types'
42
+ export {
43
+ mappingStrategyE,
44
+ subscriptionE,
45
+ tagTypeE,
46
+ TimeGranularityE,
47
+ transactionTypeE,
48
+ vatCategoryE,
49
+ } from './types'
19
50
  export * from './consts'
20
51
  export {
21
52
  default as lcAxios,