@softwear/latestcollectioncore 1.0.159 → 1.0.160

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.
@@ -1,2 +1,3 @@
1
- import { SkuI, BrandSettingI, mappingStrategyE } from './index';
1
+ import { SkuI, BrandSettingI } from './index';
2
+ import { mappingStrategyE } from './types';
2
3
  export default function (brands: Array<BrandSettingI>, strategy: mappingStrategyE): (sku: SkuI) => SkuI;
package/dist/index.d.ts CHANGED
@@ -16,7 +16,13 @@ export { default as round2 } from './round2';
16
16
  export { default as sizeToMap } from './sizeToMap';
17
17
  export { default as transaction } from './transaction';
18
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
+ import * as types from './types';
20
+ export declare const mappingStrategyE: typeof types.mappingStrategyE;
21
+ export declare const subscriptionE: typeof types.subscriptionE;
22
+ export declare const tagTypeE: typeof types.tagTypeE;
23
+ export declare const TimeGranularityE: typeof types.TimeGranularityE;
24
+ export declare const transactionTypeE: typeof types.transactionTypeE;
25
+ export declare const vatCategoryE: typeof types.vatCategoryE;
20
26
  export * from './consts';
21
27
  export { default as lcAxios, createAxiosInstance, axiosRetry, exponentialDelay, isAxiosError, } from './lcAxios';
22
28
  export type { AxiosRequestConfig, AxiosResponse, AxiosPromise, AxiosError, AxiosTransformer, AxiosRetryOptions, AxiosRequestConfigAny, } from './lcAxios';
package/dist/index.js CHANGED
@@ -10,6 +10,18 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
10
10
  if (k2 === undefined) k2 = k;
11
11
  o[k2] = m[k];
12
12
  }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
13
25
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
26
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
27
  };
@@ -52,13 +64,16 @@ var sizeToMap_1 = require("./sizeToMap");
52
64
  Object.defineProperty(exports, "sizeToMap", { enumerable: true, get: function () { return __importDefault(sizeToMap_1).default; } });
53
65
  var transaction_1 = require("./transaction");
54
66
  Object.defineProperty(exports, "transaction", { enumerable: true, get: function () { return __importDefault(transaction_1).default; } });
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; } });
67
+ // Runtime enums: use `export const x = types.x`, not `export { x } from './types'`.
68
+ // TS emits `Object.defineProperty(exports, "x", { get: ... })` for re-exports; Vite/esbuild
69
+ // does not treat those getters as static named exports for ESM interop.
70
+ const types = __importStar(require("./types"));
71
+ exports.mappingStrategyE = types.mappingStrategyE;
72
+ exports.subscriptionE = types.subscriptionE;
73
+ exports.tagTypeE = types.tagTypeE;
74
+ exports.TimeGranularityE = types.TimeGranularityE;
75
+ exports.transactionTypeE = types.transactionTypeE;
76
+ exports.vatCategoryE = types.vatCategoryE;
62
77
  __exportStar(require("./consts"), exports);
63
78
  var lcAxios_1 = require("./lcAxios");
64
79
  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.159",
3
+ "version": "1.0.160",
4
4
  "description": "Core functions for LatestCollections applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,21 @@
1
+ import * as esbuild from 'esbuild'
2
+ import { readFileSync } from 'fs'
3
+ import { dirname, join } from 'path'
4
+ import { fileURLToPath } from 'url'
5
+
6
+ const dir = dirname(fileURLToPath(import.meta.url))
7
+ const result = await esbuild.build({
8
+ stdin: {
9
+ contents: `import { TimeGranularityE } from ${JSON.stringify(join(dir, '..', 'dist', 'index.js'))}\nconsole.log(TimeGranularityE.DAY)\n`,
10
+ resolveDir: dir,
11
+ sourcefile: 'entry.mjs',
12
+ loader: 'js',
13
+ },
14
+ bundle: true,
15
+ format: 'esm',
16
+ platform: 'browser',
17
+ write: false,
18
+ })
19
+ const text = result.outputFiles[0].text
20
+ if (!text.includes('day') && !text.includes('TimeGranularityE')) throw new Error('esbuild bundle did not retain enum')
21
+ console.log('esbuild interop check: ok')
@@ -1,4 +1,5 @@
1
- import { hashBrand, SkuI, BrandSettingI, mappingStrategyE } from './index'
1
+ import { hashBrand, SkuI, BrandSettingI } from './index'
2
+ import { mappingStrategyE } from './types'
2
3
 
3
4
  // The order of the following mappingPairs is significant.
4
5
  // - If no mapping is available, we prefer colorFamily to be copied from colorSupplier, not colorCodeSupplier.
package/src/index.ts CHANGED
@@ -15,8 +15,7 @@ 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
- // 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.
18
+ // Types-only re-exports (no runtime).
20
19
  export type {
21
20
  AggregateFnI,
22
21
  AggregatorFnI,
@@ -39,14 +38,16 @@ export type {
39
38
  StockTransferSelectionI,
40
39
  TransactionI,
41
40
  } from './types'
42
- export {
43
- mappingStrategyE,
44
- subscriptionE,
45
- tagTypeE,
46
- TimeGranularityE,
47
- transactionTypeE,
48
- vatCategoryE,
49
- } from './types'
41
+ // Runtime enums: use `export const x = types.x`, not `export { x } from './types'`.
42
+ // TS emits `Object.defineProperty(exports, "x", { get: ... })` for re-exports; Vite/esbuild
43
+ // does not treat those getters as static named exports for ESM interop.
44
+ import * as types from './types'
45
+ export const mappingStrategyE = types.mappingStrategyE
46
+ export const subscriptionE = types.subscriptionE
47
+ export const tagTypeE = types.tagTypeE
48
+ export const TimeGranularityE = types.TimeGranularityE
49
+ export const transactionTypeE = types.transactionTypeE
50
+ export const vatCategoryE = types.vatCategoryE
50
51
  export * from './consts'
51
52
  export {
52
53
  default as lcAxios,