@alwatr/dedupe 1.0.10 → 1.0.11

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/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.11](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.10...@alwatr/dedupe@1.0.11) (2024-08-31)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **dedupe:** duplicate_dedupe not work issue ([bdf6f52](https://github.com/Alwatr/nanolib/commit/bdf6f52bbb3730e6d791f5f1cba9a4ebe2510e34)) by @AliMD
11
+
12
+ ### Code Refactoring
13
+
14
+ * **dedupe:** prevent throw error on duplicate package and just log it ([9d2b657](https://github.com/Alwatr/nanolib/commit/9d2b6570616c63604b138f2df2e2166afe16c482)) by @AliMD
15
+
6
16
  ## [1.0.10](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.9...@alwatr/dedupe@1.0.10) (2024-08-31)
7
17
 
8
18
  ### Dependencies update
package/dist/main.cjs CHANGED
@@ -1,3 +1,3 @@
1
- /* @alwatr/dedupe v1.0.10 */
2
- "use strict";var _=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var u=(e,r)=>{for(var t in r)_(e,t,{get:r[t],enumerable:!0})},f=(e,r,t,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of p(r))!c.call(e,i)&&i!==t&&_(e,i,{get:()=>r[i],enumerable:!(d=o(r,i))||d.enumerable});return e};var l=e=>f(_({},"__esModule",{value:!0}),e);var s={};u(s,{definePackage:()=>n,definedPackageList:()=>a});module.exports=l(s);if(typeof __dedupe__<"u")throw new Error("duplicate_dedupe");var a={};function n(e,r="v?"){if(e in a)throw new Error("duplicate_package",{cause:e});a[e]=r}n("@alwatr/dedupe","1.0.10");0&&(module.exports={definePackage,definedPackageList});
1
+ /* @alwatr/dedupe v1.0.11 */
2
+ "use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var d=(e,o)=>{for(var t in o)a(e,t,{get:o[t],enumerable:!0})},f=(e,o,t,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of c(o))!s.call(e,r)&&r!==t&&a(e,r,{get:()=>o[r],enumerable:!(i=p(o,r))||i.enumerable});return e};var g=e=>f(a({},"__esModule",{value:!0}),e);var b={};d(b,{definePackage:()=>_,definedPackageList:()=>l});module.exports=g(b);var n=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof global=="object"&&global||self;typeof n.e>"u"?n.e=!0:console.error("duplicate_alwatr_dedupe",{version:"1.0.11"});var l={};function _(e,o="v?"){Object.prototype.hasOwnProperty.call(l,e)&&console.error(new Error("duplicate_package",{cause:{packageName:e,newVersion:o,oldVersion:l[e]}})),l[e]=o}_("@alwatr/dedupe","1.0.11");0&&(module.exports={definePackage,definedPackageList});
3
3
  //# sourceMappingURL=main.cjs.map
package/dist/main.cjs.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
- "sourcesContent": ["import type {Dictionary} from '@alwatr/type-helper';\n\ndeclare global {\n // eslint-disable-next-line no-var\n var __dedupe__: true;\n\n // eslint-disable-next-line no-var\n var __package_version__: string;\n}\n\nif (typeof __dedupe__ !== 'undefined') {\n throw new Error('duplicate_dedupe');\n}\n\nexport const definedPackageList: Dictionary<string> = {};\n\n/**\n * Global define package for managing package versions to prevent version conflicts.\n * @param packageName package name including scope. e.g. `@scope/package-name`\n * @param version package version (optional)\n *\n * @example\n * ```typescript\n * definePackage('@scope/package-name', __package_version__);\n * ```\n */\nexport function definePackage(packageName: string, version = 'v?'): void {\n if (packageName in definedPackageList) {\n throw new Error('duplicate_package', {\n cause: packageName,\n });\n }\n\n definedPackageList[packageName] = version;\n}\n\ndefinePackage('@alwatr/dedupe', __package_version__);\n"],
5
- "mappings": ";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,EAAA,uBAAAC,IAAA,eAAAC,EAAAJ,GAUA,GAAI,OAAO,WAAe,IACxB,MAAM,IAAI,MAAM,kBAAkB,EAG7B,IAAMG,EAAyC,CAAC,EAYhD,SAASD,EAAcG,EAAqBC,EAAU,KAAY,CACvE,GAAID,KAAeF,EACjB,MAAM,IAAI,MAAM,oBAAqB,CACnC,MAAOE,CACT,CAAC,EAGHF,EAAmBE,CAAW,EAAIC,CACpC,CAEAJ,EAAc,iBAAkB,QAAmB",
6
- "names": ["main_exports", "__export", "definePackage", "definedPackageList", "__toCommonJS", "packageName", "version"]
4
+ "sourcesContent": ["import type {Dictionary} from '@alwatr/type-helper';\n\ndeclare global {\n // eslint-disable-next-line no-var\n var __alwatr_dedupe__: true;\n\n // eslint-disable-next-line no-var\n var __package_version__: string;\n}\n\nconst globalScope: typeof globalThis =\n (typeof globalThis === 'object' && globalThis) ||\n (typeof window === 'object' && window) ||\n (typeof global === 'object' && global) ||\n self;\n\nif (typeof globalScope.__alwatr_dedupe__ === 'undefined') {\n globalScope.__alwatr_dedupe__ = true;\n}\nelse {\n console.error('duplicate_alwatr_dedupe', {version: __package_version__});\n}\n\nexport const definedPackageList: Dictionary<string> = {};\n\n/**\n * Global define package for managing package versions to prevent version conflicts.\n * @param packageName package name including scope. e.g. `@scope/package-name`\n * @param version package version (optional)\n *\n * @example\n * ```typescript\n * definePackage('@scope/package-name', __package_version__);\n * ```\n */\nexport function definePackage(packageName: string, version = 'v?'): void {\n if (Object.prototype.hasOwnProperty.call(definedPackageList, packageName)) {\n console.error(\n new Error('duplicate_package', {\n cause: {\n packageName,\n newVersion: version,\n oldVersion: definedPackageList[packageName],\n },\n }),\n );\n }\n\n definedPackageList[packageName] = version;\n}\n\ndefinePackage('@alwatr/dedupe', __package_version__);\n"],
5
+ "mappings": ";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,EAAA,uBAAAC,IAAA,eAAAC,EAAAJ,GAUA,IAAMK,EACH,OAAO,YAAe,UAAY,YAClC,OAAO,QAAW,UAAY,QAC9B,OAAO,QAAW,UAAY,QAC/B,KAEE,OAAOA,EAAYC,EAAsB,IAC3CD,EAAYC,EAAoB,GAGhC,QAAQ,MAAM,0BAA2B,CAAC,QAAS,QAAmB,CAAC,EAGlE,IAAMH,EAAyC,CAAC,EAYhD,SAASD,EAAcK,EAAqBC,EAAU,KAAY,CACnE,OAAO,UAAU,eAAe,KAAKL,EAAoBI,CAAW,GACtE,QAAQ,MACN,IAAI,MAAM,oBAAqB,CAC7B,MAAO,CACL,YAAAA,EACA,WAAYC,EACZ,WAAYL,EAAmBI,CAAW,CAC5C,CACF,CAAC,CACH,EAGFJ,EAAmBI,CAAW,EAAIC,CACpC,CAEAN,EAAc,iBAAkB,QAAmB",
6
+ "names": ["main_exports", "__export", "definePackage", "definedPackageList", "__toCommonJS", "globalScope", "__alwatr_dedupe__", "packageName", "version"]
7
7
  }
package/dist/main.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Dictionary } from '@alwatr/type-helper';
2
2
  declare global {
3
- var __dedupe__: true;
3
+ var __alwatr_dedupe__: true;
4
4
  var __package_version__: string;
5
5
  }
6
6
  export declare const definedPackageList: Dictionary<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAEpD,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,UAAU,EAAE,IAAI,CAAC;IAGrB,IAAI,mBAAmB,EAAE,MAAM,CAAC;CACjC;AAMD,eAAO,MAAM,kBAAkB,EAAE,UAAU,CAAC,MAAM,CAAM,CAAC;AAEzD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,SAAO,GAAG,IAAI,CAQvE"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAEpD,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,iBAAiB,EAAE,IAAI,CAAC;IAG5B,IAAI,mBAAmB,EAAE,MAAM,CAAC;CACjC;AAeD,eAAO,MAAM,kBAAkB,EAAE,UAAU,CAAC,MAAM,CAAM,CAAC;AAEzD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,SAAO,GAAG,IAAI,CAcvE"}
package/dist/main.mjs CHANGED
@@ -1,3 +1,3 @@
1
- /* @alwatr/dedupe v1.0.10 */
2
- if(typeof __dedupe__<"u")throw new Error("duplicate_dedupe");var r={};function t(e,i="v?"){if(e in r)throw new Error("duplicate_package",{cause:e});r[e]=i}t("@alwatr/dedupe","1.0.10");export{t as definePackage,r as definedPackageList};
1
+ /* @alwatr/dedupe v1.0.11 */
2
+ var t=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof global=="object"&&global||self;typeof t.e>"u"?t.e=!0:console.error("duplicate_alwatr_dedupe",{version:"1.0.11"});var o={};function l(e,r="v?"){Object.prototype.hasOwnProperty.call(o,e)&&console.error(new Error("duplicate_package",{cause:{packageName:e,newVersion:r,oldVersion:o[e]}})),o[e]=r}l("@alwatr/dedupe","1.0.11");export{l as definePackage,o as definedPackageList};
3
3
  //# sourceMappingURL=main.mjs.map
package/dist/main.mjs.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
- "sourcesContent": ["import type {Dictionary} from '@alwatr/type-helper';\n\ndeclare global {\n // eslint-disable-next-line no-var\n var __dedupe__: true;\n\n // eslint-disable-next-line no-var\n var __package_version__: string;\n}\n\nif (typeof __dedupe__ !== 'undefined') {\n throw new Error('duplicate_dedupe');\n}\n\nexport const definedPackageList: Dictionary<string> = {};\n\n/**\n * Global define package for managing package versions to prevent version conflicts.\n * @param packageName package name including scope. e.g. `@scope/package-name`\n * @param version package version (optional)\n *\n * @example\n * ```typescript\n * definePackage('@scope/package-name', __package_version__);\n * ```\n */\nexport function definePackage(packageName: string, version = 'v?'): void {\n if (packageName in definedPackageList) {\n throw new Error('duplicate_package', {\n cause: packageName,\n });\n }\n\n definedPackageList[packageName] = version;\n}\n\ndefinePackage('@alwatr/dedupe', __package_version__);\n"],
5
- "mappings": ";AAUA,GAAI,OAAO,WAAe,IACxB,MAAM,IAAI,MAAM,kBAAkB,EAG7B,IAAMA,EAAyC,CAAC,EAYhD,SAASC,EAAcC,EAAqBC,EAAU,KAAY,CACvE,GAAID,KAAeF,EACjB,MAAM,IAAI,MAAM,oBAAqB,CACnC,MAAOE,CACT,CAAC,EAGHF,EAAmBE,CAAW,EAAIC,CACpC,CAEAF,EAAc,iBAAkB,QAAmB",
6
- "names": ["definedPackageList", "definePackage", "packageName", "version"]
4
+ "sourcesContent": ["import type {Dictionary} from '@alwatr/type-helper';\n\ndeclare global {\n // eslint-disable-next-line no-var\n var __alwatr_dedupe__: true;\n\n // eslint-disable-next-line no-var\n var __package_version__: string;\n}\n\nconst globalScope: typeof globalThis =\n (typeof globalThis === 'object' && globalThis) ||\n (typeof window === 'object' && window) ||\n (typeof global === 'object' && global) ||\n self;\n\nif (typeof globalScope.__alwatr_dedupe__ === 'undefined') {\n globalScope.__alwatr_dedupe__ = true;\n}\nelse {\n console.error('duplicate_alwatr_dedupe', {version: __package_version__});\n}\n\nexport const definedPackageList: Dictionary<string> = {};\n\n/**\n * Global define package for managing package versions to prevent version conflicts.\n * @param packageName package name including scope. e.g. `@scope/package-name`\n * @param version package version (optional)\n *\n * @example\n * ```typescript\n * definePackage('@scope/package-name', __package_version__);\n * ```\n */\nexport function definePackage(packageName: string, version = 'v?'): void {\n if (Object.prototype.hasOwnProperty.call(definedPackageList, packageName)) {\n console.error(\n new Error('duplicate_package', {\n cause: {\n packageName,\n newVersion: version,\n oldVersion: definedPackageList[packageName],\n },\n }),\n );\n }\n\n definedPackageList[packageName] = version;\n}\n\ndefinePackage('@alwatr/dedupe', __package_version__);\n"],
5
+ "mappings": ";AAUA,IAAMA,EACH,OAAO,YAAe,UAAY,YAClC,OAAO,QAAW,UAAY,QAC9B,OAAO,QAAW,UAAY,QAC/B,KAEE,OAAOA,EAAYC,EAAsB,IAC3CD,EAAYC,EAAoB,GAGhC,QAAQ,MAAM,0BAA2B,CAAC,QAAS,QAAmB,CAAC,EAGlE,IAAMC,EAAyC,CAAC,EAYhD,SAASC,EAAcC,EAAqBC,EAAU,KAAY,CACnE,OAAO,UAAU,eAAe,KAAKH,EAAoBE,CAAW,GACtE,QAAQ,MACN,IAAI,MAAM,oBAAqB,CAC7B,MAAO,CACL,YAAAA,EACA,WAAYC,EACZ,WAAYH,EAAmBE,CAAW,CAC5C,CACF,CAAC,CACH,EAGFF,EAAmBE,CAAW,EAAIC,CACpC,CAEAF,EAAc,iBAAkB,QAAmB",
6
+ "names": ["globalScope", "__alwatr_dedupe__", "definedPackageList", "definePackage", "packageName", "version"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwatr/dedupe",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
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
  "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
6
6
  "keywords": [
@@ -74,5 +74,5 @@
74
74
  "@types/node": "^22.5.1",
75
75
  "typescript": "^5.5.4"
76
76
  },
77
- "gitHead": "5d81b77988089edb24aa6853d0a98fdeb85dbf77"
77
+ "gitHead": "369275b8713f7f8ae1e44fdfddacd5053e38c95c"
78
78
  }