@alwatr/dedupe 6.0.1 → 9.1.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.
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AA6BA;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,IAAI,CAAA;CAAC,GAAG,IAAI,CAiBrE;AAID;;;GAGG;AAEH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAGnE"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AA2BA;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,IAAI,CAAA;CAAC,GAAG,IAAI,CAiBrE;AAID;;;GAGG;AAEH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAGnE"}
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
- /* 📦 @alwatr/dedupe v6.0.1 */
2
- import{getGlobalThis as B}from"@alwatr/global-this";import{hasOwn as C}from"@alwatr/has-own";var j=B();if(typeof j.__alwatr_dedupe__>"u")j.__alwatr_dedupe__="6.0.1";else{if(j.__alwatr_dedupe__===!0)j.__alwatr_dedupe__="1.0.x";console.error(Error("duplication_detected",{cause:{name:"@alwatr/dedupe",oldVersion:j.__alwatr_dedupe__,newVersion:"6.0.1"}}))}var z={};function A(f){if(C(z,f.name)){let q=Error("duplication_detected",{cause:{name:f.name}});if(f.strict)throw q;else console.error(q)}z[f.name]=!0}A({name:"@alwatr/dedupe"});function F(f,q){console.warn("`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead."),A({name:f})}export{F as definePackage,A as deduplicate};
1
+ /* 📦 @alwatr/dedupe v9.1.0 */
2
+ import{getGlobalThis as B}from"@alwatr/global-this";import{hasOwn as C}from"@alwatr/has-own";var j=B();if(typeof j.__alwatr_dedupe__>"u")j.__alwatr_dedupe__="9.1.0";else{if(j.__alwatr_dedupe__===!0)j.__alwatr_dedupe__="1.0.x";console.error(Error("duplication_detected",{cause:{name:"@alwatr/dedupe",oldVersion:j.__alwatr_dedupe__,newVersion:"9.1.0"}}))}var z={};function A(f){if(C(z,f.name)){let q=Error("duplication_detected",{cause:{name:f.name}});if(f.strict)throw q;else console.error(q)}z[f.name]=!0}A({name:"@alwatr/dedupe"});function F(f,q){console.warn("`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead."),A({name:f})}export{F as definePackage,A as deduplicate};
3
3
 
4
- //# debugId=8C55800879DE6B0464756E2164756E21
4
+ //# debugId=B7DDF497515F00A464756E2164756E21
5
5
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
4
  "sourcesContent": [
5
- "import {getGlobalThis} from '@alwatr/global-this';\nimport {hasOwn} from '@alwatr/has-own';\n\nimport type {} from '@alwatr/nano-build';\nimport type {} from '@alwatr/type-helper';\n\nconst globalThis_ = getGlobalThis<{__alwatr_dedupe__: string | true}>();\n\nif (typeof globalThis_.__alwatr_dedupe__ === 'undefined') {\n globalThis_.__alwatr_dedupe__ = __package_version__;\n}\nelse {\n if (globalThis_.__alwatr_dedupe__ === true) {\n globalThis_.__alwatr_dedupe__ = '1.0.x';\n }\n\n console.error(\n new Error('duplication_detected', {\n cause: {\n name: __package_name__,\n oldVersion: globalThis_.__alwatr_dedupe__,\n newVersion: __package_version__,\n },\n }),\n );\n}\n\nconst list: DictionaryOpt<true> = {};\n\n/**\n * Prevent duplication in any entities like loading node packages.\n * @param name package name including scope. e.g. `@scope/package-name`\n * @param version package version (optional)\n *\n * @example\n * ```typescript\n * deduplicate({name: __package_name__, strict: true});\n * ```\n */\nexport function deduplicate(args: {name: string; strict?: true}): void {\n if (hasOwn(list, args.name)) {\n const error = new Error('duplication_detected', {\n cause: {\n name: args.name,\n },\n });\n\n if (args.strict) {\n throw error;\n }\n else {\n console.error(error);\n }\n }\n\n list[args.name] = true;\n}\n\ndeduplicate({name: __package_name__});\n\n/**\n * Old `definePackage` for backward compatibility.\n * @deprecated Use `deduplicate` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function definePackage(packageName: string, _?: string): void {\n console.warn('`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead.');\n deduplicate({name: packageName});\n}\n"
5
+ "import {getGlobalThis} from '@alwatr/global-this';\nimport {hasOwn} from '@alwatr/has-own';\n\n\nconst globalThis_ = getGlobalThis<{__alwatr_dedupe__: string | true}>();\n\nif (typeof globalThis_.__alwatr_dedupe__ === 'undefined') {\n globalThis_.__alwatr_dedupe__ = __package_version__;\n}\nelse {\n if (globalThis_.__alwatr_dedupe__ === true) {\n globalThis_.__alwatr_dedupe__ = '1.0.x';\n }\n\n console.error(\n new Error('duplication_detected', {\n cause: {\n name: __package_name__,\n oldVersion: globalThis_.__alwatr_dedupe__,\n newVersion: __package_version__,\n },\n }),\n );\n}\n\nconst list: DictionaryOpt<true> = {};\n\n/**\n * Prevent duplication in any entities like loading node packages.\n * @param name package name including scope. e.g. `@scope/package-name`\n * @param version package version (optional)\n *\n * @example\n * ```typescript\n * deduplicate({name: __package_name__, strict: true});\n * ```\n */\nexport function deduplicate(args: {name: string; strict?: true}): void {\n if (hasOwn(list, args.name)) {\n const error = new Error('duplication_detected', {\n cause: {\n name: args.name,\n },\n });\n\n if (args.strict) {\n throw error;\n }\n else {\n console.error(error);\n }\n }\n\n list[args.name] = true;\n}\n\ndeduplicate({name: __package_name__});\n\n/**\n * Old `definePackage` for backward compatibility.\n * @deprecated Use `deduplicate` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function definePackage(packageName: string, _?: string): void {\n console.warn('`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead.');\n deduplicate({name: packageName});\n}\n"
6
6
  ],
7
- "mappings": ";AAAA,wBAAQ,4BACR,iBAAQ,wBAKR,IAAM,EAAc,EAAkD,EAEtE,GAAI,OAAO,EAAY,kBAAsB,IAC3C,EAAY,kBAAoB,QAE7B,KACH,GAAI,EAAY,oBAAsB,GACpC,EAAY,kBAAoB,QAGlC,QAAQ,MACF,MAAM,uBAAwB,CAChC,MAAO,CACL,KAAM,iBACN,WAAY,EAAY,kBACxB,WAAY,OACd,CACF,CAAC,CACH,EAGF,IAAM,EAA4B,CAAC,EAY5B,SAAS,CAAW,CAAC,EAA2C,CACrE,GAAI,EAAO,EAAM,EAAK,IAAI,EAAG,CAC3B,IAAM,EAAY,MAAM,uBAAwB,CAC9C,MAAO,CACL,KAAM,EAAK,IACb,CACF,CAAC,EAED,GAAI,EAAK,OACP,MAAM,EAGN,aAAQ,MAAM,CAAK,EAIvB,EAAK,EAAK,MAAQ,GAGpB,EAAY,CAAC,KAAM,gBAAgB,CAAC,EAO7B,SAAS,CAAa,CAAC,EAAqB,EAAkB,CACnE,QAAQ,KAAK,+EAA+E,EAC5F,EAAY,CAAC,KAAM,CAAW,CAAC",
8
- "debugId": "8C55800879DE6B0464756E2164756E21",
7
+ "mappings": ";AAAA,wBAAQ,4BACR,iBAAQ,wBAGR,IAAM,EAAc,EAAkD,EAEtE,GAAI,OAAO,EAAY,kBAAsB,IAC3C,EAAY,kBAAoB,QAE7B,KACH,GAAI,EAAY,oBAAsB,GACpC,EAAY,kBAAoB,QAGlC,QAAQ,MACF,MAAM,uBAAwB,CAChC,MAAO,CACL,KAAM,iBACN,WAAY,EAAY,kBACxB,WAAY,OACd,CACF,CAAC,CACH,EAGF,IAAM,EAA4B,CAAC,EAY5B,SAAS,CAAW,CAAC,EAA2C,CACrE,GAAI,EAAO,EAAM,EAAK,IAAI,EAAG,CAC3B,IAAM,EAAY,MAAM,uBAAwB,CAC9C,MAAO,CACL,KAAM,EAAK,IACb,CACF,CAAC,EAED,GAAI,EAAK,OACP,MAAM,EAGN,aAAQ,MAAM,CAAK,EAIvB,EAAK,EAAK,MAAQ,GAGpB,EAAY,CAAC,KAAM,gBAAgB,CAAC,EAO7B,SAAS,CAAa,CAAC,EAAqB,EAAkB,CACnE,QAAQ,KAAK,+EAA+E,EAC5F,EAAY,CAAC,KAAM,CAAW,CAAC",
8
+ "debugId": "B7DDF497515F00A464756E2164756E21",
9
9
  "names": []
10
10
  }
package/package.json CHANGED
@@ -1,55 +1,57 @@
1
1
  {
2
2
  "name": "@alwatr/dedupe",
3
- "version": "6.0.1",
3
+ "version": "9.1.0",
4
4
  "description": "A package manager helper tool for debug list of defined (imported) packages in your ecosystem and prevent to duplicate import (install) multiple versions of the same package in your project (deduplicate packages).",
5
5
  "license": "MPL-2.0",
6
- "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
6
+ "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com> (https://ali.mihandoost.com)",
7
7
  "type": "module",
8
8
  "repository": {
9
- "directory": "packages/dedupe",
10
9
  "type": "git",
11
- "url": "https://github.com/Alwatr/nanolib"
10
+ "url": "https://github.com/Alwatr/alwatr",
11
+ "directory": "pkg/nanolib/dedupe"
12
12
  },
13
- "homepage": "https://github.com/Alwatr/nanolib/tree/next/packages/dedupe#readme",
14
- "bugs": "https://github.com/Alwatr/nanolib/issues",
13
+ "homepage": "https://github.com/Alwatr/alwatr/tree/main/pkg/nanolib/dedupe#readme",
14
+ "bugs": "https://github.com/Alwatr/alwatr/issues",
15
15
  "exports": {
16
16
  ".": {
17
17
  "types": "./dist/main.d.ts",
18
+ "import": "./dist/main.js",
18
19
  "default": "./dist/main.js"
19
20
  }
20
21
  },
21
22
  "sideEffects": true,
22
23
  "dependencies": {
23
- "@alwatr/global-this": "6.0.1",
24
- "@alwatr/has-own": "6.0.1"
24
+ "@alwatr/global-this": "9.1.0",
25
+ "@alwatr/has-own": "9.1.0"
25
26
  },
26
27
  "devDependencies": {
27
- "@alwatr/nano-build": "7.0.1",
28
- "@alwatr/prettier-config": "7.0.1",
29
- "@alwatr/tsconfig-base": "8.0.0",
30
- "@alwatr/type-helper": "8.0.1",
31
- "typescript": "^5.9.3"
28
+ "@alwatr/nano-build": "9.1.0",
29
+ "@alwatr/tsconfig-base": "9.1.0",
30
+ "@alwatr/type-helper": "9.1.0",
31
+ "typescript": "^6.0.2"
32
32
  },
33
33
  "scripts": {
34
34
  "b": "bun run build",
35
35
  "build": "bun run build:ts && bun run build:es",
36
36
  "build:es": "nano-build --preset=module src/main.ts",
37
37
  "build:ts": "tsc --build",
38
- "c": "bun run clean",
39
- "cb": "bun run clean && bun run build",
38
+ "cl": "bun run clean",
40
39
  "clean": "rm -rfv dist *.tsbuildinfo",
41
- "d": "bun run build:es && DEBUG=1 bun",
40
+ "format": "prettier --write \"src/**/*.ts\"",
41
+ "lint": "eslint src/ --ext .ts",
42
+ "t": "bun run test",
43
+ "test": "ALWATR_DEBUG=0 bun test",
42
44
  "w": "bun run watch",
43
45
  "watch": "bun run watch:ts & bun run watch:es",
44
46
  "watch:es": "bun run build:es --watch",
45
47
  "watch:ts": "bun run build:ts --watch --preserveWatchOutput"
46
48
  },
47
49
  "files": [
48
- "**/*.{js,mjs,cjs,ts,map,d.ts,html,LEGAL.txt}",
50
+ "dist",
51
+ "src/**/*.ts",
52
+ "!src/**/*.test.ts",
49
53
  "README.md",
50
- "LICENSE",
51
- "!demo/**/*",
52
- "!**/*.test.js"
54
+ "LICENSE"
53
55
  ],
54
56
  "publishConfig": {
55
57
  "access": "public"
@@ -74,6 +76,5 @@
74
76
  "utility",
75
77
  "utils"
76
78
  ],
77
- "prettier": "@alwatr/prettier-config",
78
- "gitHead": "f843742e94d6ebed3921d57b624d9deb35c2c102"
79
+ "gitHead": "4a25cd3e0499cf61dd761e87d3711abf9b0cd208"
79
80
  }
package/src/main.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  import {getGlobalThis} from '@alwatr/global-this';
2
2
  import {hasOwn} from '@alwatr/has-own';
3
3
 
4
- import type {} from '@alwatr/nano-build';
5
- import type {} from '@alwatr/type-helper';
6
4
 
7
5
  const globalThis_ = getGlobalThis<{__alwatr_dedupe__: string | true}>();
8
6