@unchainedshop/core-countries 1.1.4 → 1.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.
package/jest.config.js ADDED
@@ -0,0 +1,5 @@
1
+ /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
2
+ export default {
3
+ preset: 'ts-jest',
4
+ testEnvironment: 'node',
5
+ };
@@ -1,3 +1,2 @@
1
1
  import { ResolveDefaultCurrencyCodeService } from '@unchainedshop/types/countries';
2
- import 'abort-controller/polyfill';
3
2
  export declare const resolveDefaultCurrencyCodeService: ResolveDefaultCurrencyCodeService;
@@ -1,4 +1,3 @@
1
- import 'abort-controller/polyfill';
2
1
  import LRU from 'lru-cache';
3
2
  // REMARK: --> combines defaultCurrency and resolveDefaultCurrencyCode helpers
4
3
  const { NODE_ENV } = process.env;
@@ -1 +1 @@
1
- {"version":3,"file":"resolveDefaultCurrencyCodeService.js","sourceRoot":"","sources":["../../src/service/resolveDefaultCurrencyCodeService.ts"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC;AACnC,OAAO,GAAG,MAAM,WAAW,CAAC;AAE5B,8EAA8E;AAE9E,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AAEjC,MAAM,GAAG,GAAG,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAmB;AAE1E,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,GAAG,EAAE,GAAG;IACR,GAAG;CACJ,CAAC,CAAC;AAEH,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AAE3C,MAAM,kBAAkB,GAAG,KAAK,EAAE,OAAgB,EAAE,OAAiB,EAAE,EAAE;IACvE,IAAI,OAAO,EAAE,iBAAiB,EAAE;QAC9B,OAAO,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC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,EAAE,OAAiB,EAAE,EAAE;IACvE,IAAI,OAAO,EAAE,iBAAiB,EAAE;QAC9B,OAAO,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC;YACrC,UAAU,EAAE,OAAO,CAAC,iBAAiB;SACtC,CAAC,CAAC;KACJ;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAAsC,KAAK,EACvF,EAAE,OAAO,EAAE,EACX,EAAE,OAAO,EAAE,EACX,EAAE;IACF,MAAM,YAAY,GAAG,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpD,IAAI,YAAY;QAAE,OAAO,YAAY,CAAC;IAEtC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IACjE,MAAM,QAAQ,GAAG,MAAM,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAE5D,MAAM,gBAAgB,GAAG,QAAQ,EAAE,OAAO,IAAI,kBAAkB,IAAI,KAAK,CAAC;IAC1E,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IAEjD,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,15 +1,19 @@
1
1
  {
2
2
  "name": "@unchainedshop/core-countries",
3
- "version": "1.1.4",
3
+ "version": "1.2.0",
4
4
  "main": "lib/countries-index.js",
5
+ "exports": {
6
+ ".": "./lib/countries-index.js",
7
+ "./*": "./lib/*"
8
+ },
5
9
  "types": "lib/countries-index.d.ts",
6
10
  "type": "module",
7
11
  "scripts": {
12
+ "prepublishOnly": "npm install && npm run build || :",
8
13
  "clean": "rm -rf lib",
9
- "build": "npm run clean && tsc -p tsconfig.build.json",
10
- "watch": "tsc --watch",
11
- "link:core": "npm link @unchainedshop/types",
12
- "test": "cross-env METEOR_PACKAGE_DIRS=../ TEST_CLIENT=0 TEST_WATCH=1 meteor test-packages ./ --driver-package meteortesting:mocha --port 4200"
14
+ "build": "npm run clean && tsc",
15
+ "watch": "tsc -w",
16
+ "test": "jest --watch"
13
17
  },
14
18
  "repository": {
15
19
  "type": "git",
@@ -27,22 +31,19 @@
27
31
  },
28
32
  "homepage": "https://github.com/unchainedshop/unchained#readme",
29
33
  "dependencies": {
30
- "@unchainedshop/utils": "1.1.3",
34
+ "@unchainedshop/events": "^1.1.9",
35
+ "@unchainedshop/utils": "^1.1.9",
31
36
  "emoji-flags": "^1.3.0",
32
37
  "i18n-iso-countries": "^7.5.0",
33
38
  "lru-cache": "^7.10.2",
34
39
  "simpl-schema": "^1.12.2"
35
40
  },
36
- "peerDependencies": {
37
- "@unchainedshop/events": "1.1.3"
38
- },
39
41
  "devDependencies": {
40
- "@types/chai": "^4.3.1",
41
- "@types/mocha": "^9.1.1",
42
- "@unchainedshop/events": "1.1.3",
43
- "@unchainedshop/types": "^1.1.2",
44
- "chai": "^4.3.6",
42
+ "@types/node": "^16.11.44",
43
+ "@unchainedshop/types": "^1.1.9",
45
44
  "cross-env": "^7.0.3",
45
+ "jest": "^28.1.2",
46
+ "ts-jest": "^28.0.5",
46
47
  "typescript": "^4.7.4"
47
48
  }
48
49
  }
@@ -1,6 +1,5 @@
1
1
  import { Country, ResolveDefaultCurrencyCodeService } from '@unchainedshop/types/countries';
2
2
  import { Modules } from '@unchainedshop/types/modules';
3
- import 'abort-controller/polyfill';
4
3
  import LRU from 'lru-cache';
5
4
 
6
5
  // REMARK: --> combines defaultCurrency and resolveDefaultCurrencyCode helpers
@@ -1,5 +1,5 @@
1
1
  import { assert } from 'chai';
2
- import { initDb } from 'meteor/unchained:mongodb';
2
+ import { initDb } from '@unchainedshop/mongodb';
3
3
  import { configureCountriesModule } from '@unchainedshop/core-countries';
4
4
 
5
5
  describe('Test exports', () => {
package/tsconfig.json CHANGED
@@ -1,8 +1,29 @@
1
1
  {
2
- "extends": "./tsconfig.build.json",
3
2
  "compilerOptions": {
4
- "noEmit": true,
5
- "types": ["node", "mocha"]
3
+ "allowJs": true,
4
+ "allowSyntheticDefaultImports": true,
5
+ "declaration": true,
6
+ "esModuleInterop": true,
7
+ "experimentalDecorators": true,
8
+ "forceConsistentCasingInFileNames": true,
9
+ "lib": [
10
+ "esnext"
11
+ ],
12
+ "module": "esnext",
13
+ "moduleResolution": "node",
14
+ "noImplicitReturns": true,
15
+ "noUnusedLocals": false,
16
+ "outDir": "lib",
17
+ "preserveWatchOutput": true,
18
+ "skipLibCheck": true,
19
+ "sourceMap": true,
20
+ "target": "esnext",
21
+ "types": [
22
+ "node",
23
+ "jest"
24
+ ]
6
25
  },
7
- "include": ["src", "tests"]
8
- }
26
+ "include": [
27
+ "src"
28
+ ]
29
+ }
@@ -1,26 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "allowJs": true,
4
- "allowSyntheticDefaultImports": true,
5
- "declaration": true,
6
- "esModuleInterop": true,
7
- "experimentalDecorators": true,
8
- "forceConsistentCasingInFileNames": true,
9
- "lib": ["esnext"],
10
- "module": "esnext",
11
- "moduleResolution": "node",
12
- "noImplicitReturns": true,
13
- "noUnusedLocals": false,
14
- "outDir": "lib",
15
- "preserveWatchOutput": true,
16
- "skipLibCheck": true,
17
- "sourceMap": true,
18
- "target": "esnext",
19
- "types": ["node"],
20
- "baseUrl": ".", // This must be specified if "paths" is.
21
- "paths": {
22
- "meteor/unchained:*": ["node_modules/@unchainedshop/types/index.d.ts"]
23
- }
24
- },
25
- "include": ["src"]
26
- }