@alwatr/dedupe 6.0.0 → 6.0.2
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/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/package.json +39 -40
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 📦 @alwatr/dedupe v6.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__="6.0.
|
|
1
|
+
/* 📦 @alwatr/dedupe v6.0.2 */
|
|
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.2";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.2"}}))}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=
|
|
4
|
+
//# debugId=96992D8E18361B8464756E2164756E21
|
|
5
5
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
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"
|
|
6
6
|
],
|
|
7
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": "
|
|
8
|
+
"debugId": "96992D8E18361B8464756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -1,26 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwatr/dedupe",
|
|
3
|
+
"version": "6.0.2",
|
|
3
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).",
|
|
4
|
-
"
|
|
5
|
+
"license": "MPL-2.0",
|
|
5
6
|
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"devDependencies": {
|
|
12
|
-
"@alwatr/nano-build": "7.0.0",
|
|
13
|
-
"@alwatr/prettier-config": "7.0.0",
|
|
14
|
-
"@alwatr/tsconfig-base": "7.0.0",
|
|
15
|
-
"@alwatr/type-helper": "8.0.0",
|
|
16
|
-
"typescript": "^5.9.3"
|
|
7
|
+
"type": "module",
|
|
8
|
+
"repository": {
|
|
9
|
+
"directory": "packages/dedupe",
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/Alwatr/nanolib"
|
|
17
12
|
},
|
|
13
|
+
"homepage": "https://github.com/Alwatr/nanolib/tree/next/packages/dedupe#readme",
|
|
14
|
+
"bugs": "https://github.com/Alwatr/nanolib/issues",
|
|
18
15
|
"exports": {
|
|
19
16
|
".": {
|
|
20
17
|
"types": "./dist/main.d.ts",
|
|
21
18
|
"default": "./dist/main.js"
|
|
22
19
|
}
|
|
23
20
|
},
|
|
21
|
+
"sideEffects": true,
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@alwatr/global-this": "6.0.2",
|
|
24
|
+
"@alwatr/has-own": "6.0.2"
|
|
25
|
+
},
|
|
26
|
+
"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.2",
|
|
31
|
+
"typescript": "^6.0.2"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"b": "bun run build",
|
|
35
|
+
"build": "bun run build:ts && bun run build:es",
|
|
36
|
+
"build:es": "nano-build --preset=module src/main.ts",
|
|
37
|
+
"build:ts": "tsc --build",
|
|
38
|
+
"c": "bun run clean",
|
|
39
|
+
"cb": "bun run clean && bun run build",
|
|
40
|
+
"clean": "rm -rfv dist *.tsbuildinfo",
|
|
41
|
+
"d": "bun run build:es && DEBUG=1 bun",
|
|
42
|
+
"w": "bun run watch",
|
|
43
|
+
"watch": "bun run watch:ts & bun run watch:es",
|
|
44
|
+
"watch:es": "bun run build:es --watch",
|
|
45
|
+
"watch:ts": "bun run build:ts --watch --preserveWatchOutput"
|
|
46
|
+
},
|
|
24
47
|
"files": [
|
|
25
48
|
"**/*.{js,mjs,cjs,ts,map,d.ts,html,LEGAL.txt}",
|
|
26
49
|
"README.md",
|
|
@@ -28,7 +51,9 @@
|
|
|
28
51
|
"!demo/**/*",
|
|
29
52
|
"!**/*.test.js"
|
|
30
53
|
],
|
|
31
|
-
"
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
56
|
+
},
|
|
32
57
|
"keywords": [
|
|
33
58
|
"alwatr",
|
|
34
59
|
"cross-platform",
|
|
@@ -49,32 +74,6 @@
|
|
|
49
74
|
"utility",
|
|
50
75
|
"utils"
|
|
51
76
|
],
|
|
52
|
-
"license": "MPL-2.0",
|
|
53
77
|
"prettier": "@alwatr/prettier-config",
|
|
54
|
-
"
|
|
55
|
-
"access": "public"
|
|
56
|
-
},
|
|
57
|
-
"repository": {
|
|
58
|
-
"type": "git",
|
|
59
|
-
"url": "https://github.com/Alwatr/nanolib",
|
|
60
|
-
"directory": "packages/dedupe"
|
|
61
|
-
},
|
|
62
|
-
"scripts": {
|
|
63
|
-
"b": "bun run build",
|
|
64
|
-
"build": "bun run build:ts && bun run build:es",
|
|
65
|
-
"build:es": "nano-build --preset=module src/main.ts",
|
|
66
|
-
"build:ts": "tsc --build",
|
|
67
|
-
"c": "bun run clean",
|
|
68
|
-
"cb": "bun run clean && bun run build",
|
|
69
|
-
"clean": "rm -rfv dist *.tsbuildinfo",
|
|
70
|
-
"d": "bun run build:es && DEBUG=1 bun",
|
|
71
|
-
"w": "bun run watch",
|
|
72
|
-
"watch": "bun run watch:ts & bun run watch:es",
|
|
73
|
-
"watch:es": "bun run build:es --watch",
|
|
74
|
-
"watch:ts": "bun run build:ts --watch --preserveWatchOutput"
|
|
75
|
-
},
|
|
76
|
-
"sideEffects": true,
|
|
77
|
-
"type": "module",
|
|
78
|
-
"types": "./dist/main.d.ts",
|
|
79
|
-
"gitHead": "056102a1c8a563bbae8a290b6830450f467322a3"
|
|
78
|
+
"gitHead": "95bb13efd0a5f485c6b09f1a911b99492017aed1"
|
|
80
79
|
}
|