tsds-lib-test 1.6.0 → 1.6.3
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/cjs/index.js +3 -16
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/installGitRepo.js.map +1 -1
- package/dist/esm/index.mjs +0 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/lib/installGitRepo.mjs.map +1 -1
- package/dist/types/index.d.ts +0 -2
- package/package.json +3 -4
- package/dist/cjs/lib/linkModule.js +0 -86
- package/dist/cjs/lib/linkModule.js.map +0 -1
- package/dist/cjs/lib/unlinkModule.js +0 -79
- package/dist/cjs/lib/unlinkModule.js.map +0 -1
- package/dist/esm/lib/linkModule.mjs +0 -47
- package/dist/esm/lib/linkModule.mjs.map +0 -1
- package/dist/esm/lib/unlinkModule.mjs +0 -39
- package/dist/esm/lib/unlinkModule.mjs.map +0 -1
- package/dist/types/lib/linkModule.d.ts +0 -1
- package/dist/types/lib/unlinkModule.d.ts +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2,26 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
installGitRepo: function() {
|
|
5
|
+
Object.defineProperty(exports, "installGitRepo", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
13
8
|
return _installGitRepo.default;
|
|
14
|
-
},
|
|
15
|
-
linkModule: function() {
|
|
16
|
-
return _linkModule.default;
|
|
17
|
-
},
|
|
18
|
-
unlinkModule: function() {
|
|
19
|
-
return _unlinkModule.default;
|
|
20
9
|
}
|
|
21
10
|
});
|
|
22
|
-
var _linkModule = /*#__PURE__*/ _interop_require_default(require("./lib/linkModule.js"));
|
|
23
11
|
var _installGitRepo = /*#__PURE__*/ _interop_require_default(require("./lib/installGitRepo.js"));
|
|
24
|
-
var _unlinkModule = /*#__PURE__*/ _interop_require_default(require("./lib/unlinkModule.js"));
|
|
25
12
|
function _interop_require_default(obj) {
|
|
26
13
|
return obj && obj.__esModule ? obj : {
|
|
27
14
|
default: obj
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export { default as
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/@typescript/ts-dev-stack/packages/tsds-lib-test/src/index.ts"],"sourcesContent":["export { default as installGitRepo } from './lib/installGitRepo.js';\n"],"names":["installGitRepo"],"mappings":";;;;+BAAoBA;;;eAAAA,uBAAc;;;qEAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["installGitRepo.ts"],"sourcesContent":["import path from 'path';\nimport spawn from 'cross-spawn-cb';\nimport access from 'fs-access-compat';\nimport mkdirp from 'mkdirp-classic';\nimport Queue from 'queue-cb';\nimport rimraf2 from 'rimraf2';\n\nexport default function installGitRepo(repo: string, dest: string, options, callback?) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n console.log('installGitRepo', repo, dest);\n // options.clean = true;\n\n function checkOrClean(dest, callback) {\n options.clean ? rimraf2(dest, { disableGlob: true }, callback.bind(null, new Error('clone'))) : access(dest, callback);\n }\n\n checkOrClean(dest, (err) => {\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, dest));\n\n // does not exist - clone\n if (err) {\n queue.defer(spawn.bind(null, 'git', ['clone', repo, path.basename(dest)], { stdio: 'inherit', cwd: path.dirname(dest) }));\n }\n // exists - reset git\n else {\n queue.defer(spawn.bind(null, 'git', ['clean', '-fd'], { stdio: 'inherit', cwd: dest }));\n queue.defer(spawn.bind(null, 'git', ['reset', '--hard', 'HEAD'], { stdio: 'inherit', cwd: dest }));\n queue.defer(spawn.bind(null, 'git', ['pull', '--rebase'], { stdio: 'inherit', cwd: dest }));\n }\n\n // install\n queue.defer(spawn.bind(null, 'npm', ['--silent', 'install'], { cwd: dest }));\n\n queue.await(callback);\n });\n}\n"],"names":["installGitRepo","repo","dest","options","callback","console","log","checkOrClean","clean","rimraf2","disableGlob","bind","Error","access","err","queue","Queue","defer","mkdirp","spawn","path","basename","stdio","cwd","dirname","await"],"mappings":";;;;+BAOA;;;eAAwBA;;;2DAPP;mEACC;qEACC;oEACA;8DACD;8DACE;;;;;;AAEL,SAASA,eAAeC,IAAY,EAAEC,IAAY,EAAEC,OAAO,EAAEC,QAAS;IACnF,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBE,QAAQC,GAAG,CAAC,kBAAkBL,MAAMC;IACpC,wBAAwB;IAExB,SAASK,aAAaL,IAAI,EAAEE,QAAQ;QAClCD,QAAQK,KAAK,GAAGC,IAAAA,gBAAO,EAACP,MAAM;YAAEQ,aAAa;QAAK,GAAGN,SAASO,IAAI,CAAC,MAAM,IAAIC,MAAM,aAAaC,IAAAA,uBAAM,EAACX,MAAME;IAC/G;IAEAG,aAAaL,MAAM,SAACY;QAClB,IAAMC,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACC,sBAAM,CAACP,IAAI,CAAC,MAAMT;QAE9B,yBAAyB;QACzB,IAAIY,KAAK;YACPC,MAAME,KAAK,CAACE,qBAAK,CAACR,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAASV;gBAAMmB,aAAI,CAACC,QAAQ,CAACnB;aAAM,EAAE;gBAAEoB,OAAO;gBAAWC,KAAKH,aAAI,CAACI,OAAO,CAACtB;YAAM;QACxH,OAEK;YACHa,MAAME,KAAK,CAACE,qBAAK,CAACR,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAAS;aAAM,EAAE;gBAAEW,OAAO;gBAAWC,KAAKrB;YAAK;YACpFa,MAAME,KAAK,CAACE,qBAAK,CAACR,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAAS;gBAAU;aAAO,EAAE;gBAAEW,OAAO;gBAAWC,KAAKrB;YAAK;YAC/Fa,MAAME,KAAK,CAACE,qBAAK,CAACR,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAAQ;aAAW,EAAE;gBAAEW,OAAO;gBAAWC,KAAKrB;YAAK;QAC1F;QAEA,UAAU;QACVa,MAAME,KAAK,CAACE,qBAAK,CAACR,IAAI,CAAC,MAAM,OAAO;YAAC;YAAY;SAAU,EAAE;YAAEY,KAAKrB;QAAK;QAEzEa,MAAMU,KAAK,CAACrB;IACd;AACF"}
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/@typescript/ts-dev-stack/packages/tsds-lib-test/src/lib/installGitRepo.ts"],"sourcesContent":["import path from 'path';\nimport spawn from 'cross-spawn-cb';\nimport access from 'fs-access-compat';\nimport mkdirp from 'mkdirp-classic';\nimport Queue from 'queue-cb';\nimport rimraf2 from 'rimraf2';\n\nexport default function installGitRepo(repo: string, dest: string, options, callback?) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n console.log('installGitRepo', repo, dest);\n // options.clean = true;\n\n function checkOrClean(dest, callback) {\n options.clean ? rimraf2(dest, { disableGlob: true }, callback.bind(null, new Error('clone'))) : access(dest, callback);\n }\n\n checkOrClean(dest, (err) => {\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, dest));\n\n // does not exist - clone\n if (err) {\n queue.defer(spawn.bind(null, 'git', ['clone', repo, path.basename(dest)], { stdio: 'inherit', cwd: path.dirname(dest) }));\n }\n // exists - reset git\n else {\n queue.defer(spawn.bind(null, 'git', ['clean', '-fd'], { stdio: 'inherit', cwd: dest }));\n queue.defer(spawn.bind(null, 'git', ['reset', '--hard', 'HEAD'], { stdio: 'inherit', cwd: dest }));\n queue.defer(spawn.bind(null, 'git', ['pull', '--rebase'], { stdio: 'inherit', cwd: dest }));\n }\n\n // install\n queue.defer(spawn.bind(null, 'npm', ['--silent', 'install'], { cwd: dest }));\n\n queue.await(callback);\n });\n}\n"],"names":["installGitRepo","repo","dest","options","callback","console","log","checkOrClean","clean","rimraf2","disableGlob","bind","Error","access","err","queue","Queue","defer","mkdirp","spawn","path","basename","stdio","cwd","dirname","await"],"mappings":";;;;+BAOA;;;eAAwBA;;;2DAPP;mEACC;qEACC;oEACA;8DACD;8DACE;;;;;;AAEL,SAASA,eAAeC,IAAY,EAAEC,IAAY,EAAEC,OAAO,EAAEC,QAAS;IACnF,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBE,QAAQC,GAAG,CAAC,kBAAkBL,MAAMC;IACpC,wBAAwB;IAExB,SAASK,aAAaL,IAAI,EAAEE,QAAQ;QAClCD,QAAQK,KAAK,GAAGC,IAAAA,gBAAO,EAACP,MAAM;YAAEQ,aAAa;QAAK,GAAGN,SAASO,IAAI,CAAC,MAAM,IAAIC,MAAM,aAAaC,IAAAA,uBAAM,EAACX,MAAME;IAC/G;IAEAG,aAAaL,MAAM,SAACY;QAClB,IAAMC,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACC,sBAAM,CAACP,IAAI,CAAC,MAAMT;QAE9B,yBAAyB;QACzB,IAAIY,KAAK;YACPC,MAAME,KAAK,CAACE,qBAAK,CAACR,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAASV;gBAAMmB,aAAI,CAACC,QAAQ,CAACnB;aAAM,EAAE;gBAAEoB,OAAO;gBAAWC,KAAKH,aAAI,CAACI,OAAO,CAACtB;YAAM;QACxH,OAEK;YACHa,MAAME,KAAK,CAACE,qBAAK,CAACR,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAAS;aAAM,EAAE;gBAAEW,OAAO;gBAAWC,KAAKrB;YAAK;YACpFa,MAAME,KAAK,CAACE,qBAAK,CAACR,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAAS;gBAAU;aAAO,EAAE;gBAAEW,OAAO;gBAAWC,KAAKrB;YAAK;YAC/Fa,MAAME,KAAK,CAACE,qBAAK,CAACR,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAAQ;aAAW,EAAE;gBAAEW,OAAO;gBAAWC,KAAKrB;YAAK;QAC1F;QAEA,UAAU;QACVa,MAAME,KAAK,CAACE,qBAAK,CAACR,IAAI,CAAC,MAAM,OAAO;YAAC;YAAY;SAAU,EAAE;YAAEY,KAAKrB;QAAK;QAEzEa,MAAMU,KAAK,CAACrB;IACd;AACF"}
|
package/dist/esm/index.mjs
CHANGED
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export { default as
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/@typescript/ts-dev-stack/packages/tsds-lib-test/src/index.ts"],"sourcesContent":["export { default as installGitRepo } from './lib/installGitRepo.js';\n"],"names":["default","installGitRepo"],"mappings":"AAAA,SAASA,WAAWC,cAAc,QAAQ,0BAA0B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["installGitRepo.ts"],"sourcesContent":["import path from 'path';\nimport spawn from 'cross-spawn-cb';\nimport access from 'fs-access-compat';\nimport mkdirp from 'mkdirp-classic';\nimport Queue from 'queue-cb';\nimport rimraf2 from 'rimraf2';\n\nexport default function installGitRepo(repo: string, dest: string, options, callback?) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n console.log('installGitRepo', repo, dest);\n // options.clean = true;\n\n function checkOrClean(dest, callback) {\n options.clean ? rimraf2(dest, { disableGlob: true }, callback.bind(null, new Error('clone'))) : access(dest, callback);\n }\n\n checkOrClean(dest, (err) => {\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, dest));\n\n // does not exist - clone\n if (err) {\n queue.defer(spawn.bind(null, 'git', ['clone', repo, path.basename(dest)], { stdio: 'inherit', cwd: path.dirname(dest) }));\n }\n // exists - reset git\n else {\n queue.defer(spawn.bind(null, 'git', ['clean', '-fd'], { stdio: 'inherit', cwd: dest }));\n queue.defer(spawn.bind(null, 'git', ['reset', '--hard', 'HEAD'], { stdio: 'inherit', cwd: dest }));\n queue.defer(spawn.bind(null, 'git', ['pull', '--rebase'], { stdio: 'inherit', cwd: dest }));\n }\n\n // install\n queue.defer(spawn.bind(null, 'npm', ['--silent', 'install'], { cwd: dest }));\n\n queue.await(callback);\n });\n}\n"],"names":["path","spawn","access","mkdirp","Queue","rimraf2","installGitRepo","repo","dest","options","callback","console","log","checkOrClean","clean","disableGlob","bind","Error","err","queue","defer","basename","stdio","cwd","dirname","await"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AACxB,OAAOC,WAAW,iBAAiB;AACnC,OAAOC,YAAY,mBAAmB;AACtC,OAAOC,YAAY,iBAAiB;AACpC,OAAOC,WAAW,WAAW;AAC7B,OAAOC,aAAa,UAAU;AAE9B,eAAe,SAASC,eAAeC,IAAY,EAAEC,IAAY,EAAEC,OAAO,EAAEC,QAAS;IACnF,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBE,QAAQC,GAAG,CAAC,kBAAkBL,MAAMC;IACpC,wBAAwB;IAExB,SAASK,aAAaL,IAAI,EAAEE,QAAQ;QAClCD,QAAQK,KAAK,GAAGT,QAAQG,MAAM;YAAEO,aAAa;QAAK,GAAGL,SAASM,IAAI,CAAC,MAAM,IAAIC,MAAM,aAAaf,OAAOM,MAAME;IAC/G;IAEAG,aAAaL,MAAM,CAACU;QAClB,MAAMC,QAAQ,IAAIf,MAAM;QACxBe,MAAMC,KAAK,CAACjB,OAAOa,IAAI,CAAC,MAAMR;QAE9B,yBAAyB;QACzB,IAAIU,KAAK;YACPC,MAAMC,KAAK,CAACnB,MAAMe,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAAST;gBAAMP,KAAKqB,QAAQ,CAACb;aAAM,EAAE;gBAAEc,OAAO;gBAAWC,KAAKvB,KAAKwB,OAAO,CAAChB;YAAM;QACxH,OAEK;YACHW,MAAMC,KAAK,CAACnB,MAAMe,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAAS;aAAM,EAAE;gBAAEM,OAAO;gBAAWC,KAAKf;YAAK;YACpFW,MAAMC,KAAK,CAACnB,MAAMe,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAAS;gBAAU;aAAO,EAAE;gBAAEM,OAAO;gBAAWC,KAAKf;YAAK;YAC/FW,MAAMC,KAAK,CAACnB,MAAMe,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAAQ;aAAW,EAAE;gBAAEM,OAAO;gBAAWC,KAAKf;YAAK;QAC1F;QAEA,UAAU;QACVW,MAAMC,KAAK,CAACnB,MAAMe,IAAI,CAAC,MAAM,OAAO;YAAC;YAAY;SAAU,EAAE;YAAEO,KAAKf;QAAK;QAEzEW,MAAMM,KAAK,CAACf;IACd;AACF"}
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/@typescript/ts-dev-stack/packages/tsds-lib-test/src/lib/installGitRepo.ts"],"sourcesContent":["import path from 'path';\nimport spawn from 'cross-spawn-cb';\nimport access from 'fs-access-compat';\nimport mkdirp from 'mkdirp-classic';\nimport Queue from 'queue-cb';\nimport rimraf2 from 'rimraf2';\n\nexport default function installGitRepo(repo: string, dest: string, options, callback?) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n console.log('installGitRepo', repo, dest);\n // options.clean = true;\n\n function checkOrClean(dest, callback) {\n options.clean ? rimraf2(dest, { disableGlob: true }, callback.bind(null, new Error('clone'))) : access(dest, callback);\n }\n\n checkOrClean(dest, (err) => {\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, dest));\n\n // does not exist - clone\n if (err) {\n queue.defer(spawn.bind(null, 'git', ['clone', repo, path.basename(dest)], { stdio: 'inherit', cwd: path.dirname(dest) }));\n }\n // exists - reset git\n else {\n queue.defer(spawn.bind(null, 'git', ['clean', '-fd'], { stdio: 'inherit', cwd: dest }));\n queue.defer(spawn.bind(null, 'git', ['reset', '--hard', 'HEAD'], { stdio: 'inherit', cwd: dest }));\n queue.defer(spawn.bind(null, 'git', ['pull', '--rebase'], { stdio: 'inherit', cwd: dest }));\n }\n\n // install\n queue.defer(spawn.bind(null, 'npm', ['--silent', 'install'], { cwd: dest }));\n\n queue.await(callback);\n });\n}\n"],"names":["path","spawn","access","mkdirp","Queue","rimraf2","installGitRepo","repo","dest","options","callback","console","log","checkOrClean","clean","disableGlob","bind","Error","err","queue","defer","basename","stdio","cwd","dirname","await"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AACxB,OAAOC,WAAW,iBAAiB;AACnC,OAAOC,YAAY,mBAAmB;AACtC,OAAOC,YAAY,iBAAiB;AACpC,OAAOC,WAAW,WAAW;AAC7B,OAAOC,aAAa,UAAU;AAE9B,eAAe,SAASC,eAAeC,IAAY,EAAEC,IAAY,EAAEC,OAAO,EAAEC,QAAS;IACnF,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBE,QAAQC,GAAG,CAAC,kBAAkBL,MAAMC;IACpC,wBAAwB;IAExB,SAASK,aAAaL,IAAI,EAAEE,QAAQ;QAClCD,QAAQK,KAAK,GAAGT,QAAQG,MAAM;YAAEO,aAAa;QAAK,GAAGL,SAASM,IAAI,CAAC,MAAM,IAAIC,MAAM,aAAaf,OAAOM,MAAME;IAC/G;IAEAG,aAAaL,MAAM,CAACU;QAClB,MAAMC,QAAQ,IAAIf,MAAM;QACxBe,MAAMC,KAAK,CAACjB,OAAOa,IAAI,CAAC,MAAMR;QAE9B,yBAAyB;QACzB,IAAIU,KAAK;YACPC,MAAMC,KAAK,CAACnB,MAAMe,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAAST;gBAAMP,KAAKqB,QAAQ,CAACb;aAAM,EAAE;gBAAEc,OAAO;gBAAWC,KAAKvB,KAAKwB,OAAO,CAAChB;YAAM;QACxH,OAEK;YACHW,MAAMC,KAAK,CAACnB,MAAMe,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAAS;aAAM,EAAE;gBAAEM,OAAO;gBAAWC,KAAKf;YAAK;YACpFW,MAAMC,KAAK,CAACnB,MAAMe,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAAS;gBAAU;aAAO,EAAE;gBAAEM,OAAO;gBAAWC,KAAKf;YAAK;YAC/FW,MAAMC,KAAK,CAACnB,MAAMe,IAAI,CAAC,MAAM,OAAO;gBAAC;gBAAQ;aAAW,EAAE;gBAAEM,OAAO;gBAAWC,KAAKf;YAAK;QAC1F;QAEA,UAAU;QACVW,MAAMC,KAAK,CAACnB,MAAMe,IAAI,CAAC,MAAM,OAAO;YAAC;YAAY;SAAU,EAAE;YAAEO,KAAKf;QAAK;QAEzEW,MAAMM,KAAK,CAACf;IACd;AACF"}
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsds-lib-test",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"description": "Development stack for TypeScript libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dev",
|
|
@@ -45,8 +45,7 @@
|
|
|
45
45
|
"fs-access-compat": "^1.0.3",
|
|
46
46
|
"mkdirp-classic": "^0.5.3",
|
|
47
47
|
"queue-cb": "^1.4.4",
|
|
48
|
-
"rimraf2": "^2.8.2"
|
|
49
|
-
"tsds-lib": "^1.6.0"
|
|
48
|
+
"rimraf2": "^2.8.2"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
52
51
|
"@biomejs/biome": "^1.9.4",
|
|
@@ -61,5 +60,5 @@
|
|
|
61
60
|
"tsds": {
|
|
62
61
|
"source": "src/index.ts"
|
|
63
62
|
},
|
|
64
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "dc18ff20b330199faf6ebcf3b385bf262b9c3f3a"
|
|
65
64
|
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return linkModule;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
var _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
12
|
-
var _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
13
|
-
var _url = /*#__PURE__*/ _interop_require_default(require("url"));
|
|
14
|
-
var _fsaccesscompat = /*#__PURE__*/ _interop_require_default(require("fs-access-compat"));
|
|
15
|
-
var _mkdirpclassic = /*#__PURE__*/ _interop_require_default(require("mkdirp-classic"));
|
|
16
|
-
var _queuecb = /*#__PURE__*/ _interop_require_default(require("queue-cb"));
|
|
17
|
-
var _tsdslib = require("tsds-lib");
|
|
18
|
-
function _array_like_to_array(arr, len) {
|
|
19
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
20
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
21
|
-
return arr2;
|
|
22
|
-
}
|
|
23
|
-
function _array_without_holes(arr) {
|
|
24
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
25
|
-
}
|
|
26
|
-
function _interop_require_default(obj) {
|
|
27
|
-
return obj && obj.__esModule ? obj : {
|
|
28
|
-
default: obj
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function _iterable_to_array(iter) {
|
|
32
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
33
|
-
}
|
|
34
|
-
function _non_iterable_spread() {
|
|
35
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
36
|
-
}
|
|
37
|
-
function _to_consumable_array(arr) {
|
|
38
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
39
|
-
}
|
|
40
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
41
|
-
if (!o) return;
|
|
42
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
43
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
44
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
45
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
46
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
47
|
-
}
|
|
48
|
-
var __dirname = _path.default.dirname(typeof __filename !== 'undefined' ? __filename : _url.default.fileURLToPath(require("url").pathToFileURL(__filename).toString()));
|
|
49
|
-
var major = +process.versions.node.split('.')[0];
|
|
50
|
-
var workerWrapper = (0, _tsdslib.wrapWorker)(_path.default.join((0, _tsdslib.packageRoot)(__dirname), 'dist', 'cjs', 'lib', 'data.js'));
|
|
51
|
-
function linkBin(src, binPath, nodeModules, binName, callback) {
|
|
52
|
-
var binFullPath = _path.default.resolve.apply(null, [
|
|
53
|
-
src
|
|
54
|
-
].concat(_to_consumable_array(binPath.split('/'))));
|
|
55
|
-
var destBin = _path.default.resolve(nodeModules, '.bin', binName);
|
|
56
|
-
(0, _fsaccesscompat.default)(binFullPath, function(err) {
|
|
57
|
-
if (!err) return (0, _tsdslib.link)(binFullPath, destBin, callback);
|
|
58
|
-
console.log("bin not found: ".concat(binFullPath, ". Skipping"));
|
|
59
|
-
callback();
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
function worker(src, nodeModules, _options, callback) {
|
|
63
|
-
var pkg = JSON.parse(_fs.default.readFileSync(_path.default.join(src, 'package.json'), 'utf8'));
|
|
64
|
-
var dest = _path.default.resolve.apply(null, [
|
|
65
|
-
nodeModules
|
|
66
|
-
].concat(_to_consumable_array(pkg.name.split('/'))));
|
|
67
|
-
(0, _mkdirpclassic.default)(_path.default.dirname(dest), function(err) {
|
|
68
|
-
if (err) return callback(err);
|
|
69
|
-
var queue = new _queuecb.default();
|
|
70
|
-
queue.defer(_tsdslib.link.bind(null, src, dest));
|
|
71
|
-
if (typeof pkg.bin === 'string') queue.defer(linkBin.bind(null, src, pkg.bin, nodeModules, pkg.name)); // single bins
|
|
72
|
-
else for(var binName in pkg.bin)queue.defer(linkBin.bind(null, src, pkg.bin[binName], nodeModules, binName)); // object of bins
|
|
73
|
-
queue.await(function(err) {
|
|
74
|
-
err ? callback(err) : callback(null, dest);
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
function linkModule(src, nodeModules, options, callback) {
|
|
79
|
-
if (typeof options === 'function') {
|
|
80
|
-
callback = options;
|
|
81
|
-
options = {};
|
|
82
|
-
}
|
|
83
|
-
options = options || {};
|
|
84
|
-
major < 14 ? workerWrapper('stable', src, nodeModules, options, callback) : worker(src, nodeModules, options, callback);
|
|
85
|
-
}
|
|
86
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["linkModule.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport url from 'url';\nimport access from 'fs-access-compat';\nimport mkdirp from 'mkdirp-classic';\nimport Queue from 'queue-cb';\nimport { link, packageRoot, wrapWorker } from 'tsds-lib';\n\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\nconst major = +process.versions.node.split('.')[0];\nconst workerWrapper = wrapWorker(path.join(packageRoot(__dirname), 'dist', 'cjs', 'lib', 'data.js'));\n\nfunction linkBin(src, binPath, nodeModules, binName, callback) {\n const binFullPath = path.resolve.apply(null, [src, ...binPath.split('/')]);\n const destBin = path.resolve(nodeModules, '.bin', binName);\n\n access(binFullPath, (err) => {\n if (!err) return link(binFullPath, destBin, callback);\n console.log(`bin not found: ${binFullPath}. Skipping`);\n callback();\n });\n}\n\nfunction worker(src, nodeModules, _options, callback) {\n const pkg = JSON.parse(fs.readFileSync(path.join(src, 'package.json'), 'utf8'));\n const dest = path.resolve.apply(null, [nodeModules, ...pkg.name.split('/')]);\n\n mkdirp(path.dirname(dest), (err) => {\n if (err) return callback(err);\n\n const queue = new Queue();\n queue.defer(link.bind(null, src, dest));\n\n if (typeof pkg.bin === 'string')\n queue.defer(linkBin.bind(null, src, pkg.bin, nodeModules, pkg.name)); // single bins\n else for (const binName in pkg.bin) queue.defer(linkBin.bind(null, src, pkg.bin[binName], nodeModules, binName)); // object of bins\n\n queue.await((err) => {\n err ? callback(err) : callback(null, dest);\n });\n });\n}\n\nexport default function linkModule(src: string, nodeModules: string, options, callback?) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n major < 14 ? workerWrapper('stable', src, nodeModules, options, callback) : worker(src, nodeModules, options, callback);\n}\n"],"names":["linkModule","__dirname","path","dirname","__filename","url","fileURLToPath","major","process","versions","node","split","workerWrapper","wrapWorker","join","packageRoot","linkBin","src","binPath","nodeModules","binName","callback","binFullPath","resolve","apply","destBin","access","err","link","console","log","worker","_options","pkg","JSON","parse","fs","readFileSync","dest","name","mkdirp","queue","Queue","defer","bind","bin","await","options"],"mappings":";;;;+BA2CA;;;eAAwBA;;;yDA3CT;2DACE;0DACD;qEACG;oEACA;8DACD;uBAC4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9C,IAAMC,YAAYC,aAAI,CAACC,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAaC,YAAG,CAACC,aAAa,CAAC;A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AAI,CAAC,MAAM3B,KAAKgB,IAAIY,GAAG,EAAE1B,aAAac,IAAIM,IAAI,IAAI,cAAc;aACjF,IAAK,IAAMnB,WAAWa,IAAIY,GAAG,CAAEJ,MAAME,KAAK,CAAC3B,QAAQ4B,IAAI,CAAC,MAAM3B,KAAKgB,IAAIY,GAAG,CAACzB,QAAQ,EAAED,aAAaC,WAAW,iBAAiB;QAEnIqB,MAAMK,KAAK,CAAC,SAACnB;YACXA,MAAMN,SAASM,OAAON,SAAS,MAAMiB;QACvC;IACF;AACF;AAEe,SAAStC,WAAWiB,GAAW,EAAEE,WAAmB,EAAE4B,OAAO,EAAE1B,QAAS;IACrF,IAAI,OAAO0B,YAAY,YAAY;QACjC1B,WAAW0B;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IAEtBxC,QAAQ,KAAKK,cAAc,UAAUK,KAAKE,aAAa4B,SAAS1B,YAAYU,OAAOd,KAAKE,aAAa4B,SAAS1B;AAChH"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return unlinkModule;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
var _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
12
|
-
var _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
13
|
-
var _url = /*#__PURE__*/ _interop_require_default(require("url"));
|
|
14
|
-
var _fsaccesscompat = /*#__PURE__*/ _interop_require_default(require("fs-access-compat"));
|
|
15
|
-
var _queuecb = /*#__PURE__*/ _interop_require_default(require("queue-cb"));
|
|
16
|
-
var _tsdslib = require("tsds-lib");
|
|
17
|
-
function _array_like_to_array(arr, len) {
|
|
18
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
19
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
20
|
-
return arr2;
|
|
21
|
-
}
|
|
22
|
-
function _array_without_holes(arr) {
|
|
23
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
24
|
-
}
|
|
25
|
-
function _interop_require_default(obj) {
|
|
26
|
-
return obj && obj.__esModule ? obj : {
|
|
27
|
-
default: obj
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function _iterable_to_array(iter) {
|
|
31
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
32
|
-
}
|
|
33
|
-
function _non_iterable_spread() {
|
|
34
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
35
|
-
}
|
|
36
|
-
function _to_consumable_array(arr) {
|
|
37
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
38
|
-
}
|
|
39
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
40
|
-
if (!o) return;
|
|
41
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
42
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
43
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
44
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
45
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
46
|
-
}
|
|
47
|
-
var __dirname = _path.default.dirname(typeof __filename !== 'undefined' ? __filename : _url.default.fileURLToPath(require("url").pathToFileURL(__filename).toString()));
|
|
48
|
-
var major = +process.versions.node.split('.')[0];
|
|
49
|
-
var workerWrapper = (0, _tsdslib.wrapWorker)(_path.default.join((0, _tsdslib.packageRoot)(__dirname), 'dist', 'cjs', 'lib', 'data.js'));
|
|
50
|
-
function unlinkBin(nodeModules, binName, callback) {
|
|
51
|
-
var destBin = _path.default.resolve(nodeModules, '.bin', binName);
|
|
52
|
-
(0, _fsaccesscompat.default)(destBin, function(err) {
|
|
53
|
-
if (!err) return (0, _tsdslib.unlink)(destBin, callback);
|
|
54
|
-
console.log("bin not found: ".concat(destBin, ". Skipping"));
|
|
55
|
-
callback();
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function worker(src, nodeModules, _options, callback) {
|
|
59
|
-
var pkg = JSON.parse(_fs.default.readFileSync(_path.default.join(src, 'package.json'), 'utf8'));
|
|
60
|
-
var dest = _path.default.resolve.apply(null, [
|
|
61
|
-
nodeModules
|
|
62
|
-
].concat(_to_consumable_array(pkg.name.split('/'))));
|
|
63
|
-
var queue = new _queuecb.default(1);
|
|
64
|
-
queue.defer(_tsdslib.unlink.bind(null, dest));
|
|
65
|
-
if (typeof pkg.bin === 'string') queue.defer(unlinkBin.bind(null, nodeModules, pkg.name)); // single bins
|
|
66
|
-
else for(var binName in pkg.bin)queue.defer(unlinkBin.bind(null, nodeModules, binName)); // object of bins
|
|
67
|
-
queue.await(function(err) {
|
|
68
|
-
err ? callback(err) : callback(null, dest);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
function unlinkModule(src, nodeModules, options, callback) {
|
|
72
|
-
if (typeof options === 'function') {
|
|
73
|
-
callback = options;
|
|
74
|
-
options = {};
|
|
75
|
-
}
|
|
76
|
-
options = options || {};
|
|
77
|
-
major < 14 ? workerWrapper('stable', src, nodeModules, options, callback) : worker(src, nodeModules, options, callback);
|
|
78
|
-
}
|
|
79
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["unlinkModule.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport url from 'url';\nimport access from 'fs-access-compat';\nimport Queue from 'queue-cb';\nimport { packageRoot, unlink, wrapWorker } from 'tsds-lib';\n\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\nconst major = +process.versions.node.split('.')[0];\nconst workerWrapper = wrapWorker(path.join(packageRoot(__dirname), 'dist', 'cjs', 'lib', 'data.js'));\n\nfunction unlinkBin(nodeModules, binName, callback) {\n const destBin = path.resolve(nodeModules, '.bin', binName);\n\n access(destBin, (err) => {\n if (!err) return unlink(destBin, callback);\n console.log(`bin not found: ${destBin}. Skipping`);\n callback();\n });\n}\n\nfunction worker(src, nodeModules, _options, callback) {\n const pkg = JSON.parse(fs.readFileSync(path.join(src, 'package.json'), 'utf8'));\n const dest = path.resolve.apply(null, [nodeModules, ...pkg.name.split('/')]);\n\n const queue = new Queue(1);\n queue.defer(unlink.bind(null, dest));\n\n if (typeof pkg.bin === 'string')\n queue.defer(unlinkBin.bind(null, nodeModules, pkg.name)); // single bins\n else for (const binName in pkg.bin) queue.defer(unlinkBin.bind(null, nodeModules, binName)); // object of bins\n\n queue.await((err) => {\n err ? callback(err) : callback(null, dest);\n });\n}\n\nexport default function unlinkModule(src: string, nodeModules: string, options, callback?) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n major < 14 ? workerWrapper('stable', src, nodeModules, options, callback) : worker(src, nodeModules, options, callback);\n}\n"],"names":["unlinkModule","__dirname","path","dirname","__filename","url","fileURLToPath","major","process","versions","node","split","workerWrapper","wrapWorker","join","packageRoot","unlinkBin","nodeModules","binName","callback","destBin","resolve","access","err","unlink","console","log","worker","src","_options","pkg","JSON","parse","fs","readFileSync","dest","apply","name","queue","Queue","defer","bind","bin","await","options"],"mappings":";;;;+BAqCA;;;eAAwBA;;;yDArCT;2DACE;0DACD;qEACG;8DACD;uBAC8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhD,IAAMC,YAAYC,aAAI,CAACC,OAAO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ACpB;QACXA,MAAMJ,SAASI,OAAOJ,SAAS,MAAMgB;IACvC;AACF;AAEe,SAASnC,aAAa4B,GAAW,EAAEX,WAAmB,EAAE2B,OAAO,EAAEzB,QAAS;IACvF,IAAI,OAAOyB,YAAY,YAAY;QACjCzB,WAAWyB;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IAEtBrC,QAAQ,KAAKK,cAAc,UAAUgB,KAAKX,aAAa2B,SAASzB,YAAYQ,OAAOC,KAAKX,aAAa2B,SAASzB;AAChH"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import url from 'url';
|
|
4
|
-
import access from 'fs-access-compat';
|
|
5
|
-
import mkdirp from 'mkdirp-classic';
|
|
6
|
-
import Queue from 'queue-cb';
|
|
7
|
-
import { link, packageRoot, wrapWorker } from 'tsds-lib';
|
|
8
|
-
const __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));
|
|
9
|
-
const major = +process.versions.node.split('.')[0];
|
|
10
|
-
const workerWrapper = wrapWorker(path.join(packageRoot(__dirname), 'dist', 'cjs', 'lib', 'data.js'));
|
|
11
|
-
function linkBin(src, binPath, nodeModules, binName, callback) {
|
|
12
|
-
const binFullPath = path.resolve.apply(null, [
|
|
13
|
-
src,
|
|
14
|
-
...binPath.split('/')
|
|
15
|
-
]);
|
|
16
|
-
const destBin = path.resolve(nodeModules, '.bin', binName);
|
|
17
|
-
access(binFullPath, (err)=>{
|
|
18
|
-
if (!err) return link(binFullPath, destBin, callback);
|
|
19
|
-
console.log(`bin not found: ${binFullPath}. Skipping`);
|
|
20
|
-
callback();
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
function worker(src, nodeModules, _options, callback) {
|
|
24
|
-
const pkg = JSON.parse(fs.readFileSync(path.join(src, 'package.json'), 'utf8'));
|
|
25
|
-
const dest = path.resolve.apply(null, [
|
|
26
|
-
nodeModules,
|
|
27
|
-
...pkg.name.split('/')
|
|
28
|
-
]);
|
|
29
|
-
mkdirp(path.dirname(dest), (err)=>{
|
|
30
|
-
if (err) return callback(err);
|
|
31
|
-
const queue = new Queue();
|
|
32
|
-
queue.defer(link.bind(null, src, dest));
|
|
33
|
-
if (typeof pkg.bin === 'string') queue.defer(linkBin.bind(null, src, pkg.bin, nodeModules, pkg.name)); // single bins
|
|
34
|
-
else for(const binName in pkg.bin)queue.defer(linkBin.bind(null, src, pkg.bin[binName], nodeModules, binName)); // object of bins
|
|
35
|
-
queue.await((err)=>{
|
|
36
|
-
err ? callback(err) : callback(null, dest);
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
export default function linkModule(src, nodeModules, options, callback) {
|
|
41
|
-
if (typeof options === 'function') {
|
|
42
|
-
callback = options;
|
|
43
|
-
options = {};
|
|
44
|
-
}
|
|
45
|
-
options = options || {};
|
|
46
|
-
major < 14 ? workerWrapper('stable', src, nodeModules, options, callback) : worker(src, nodeModules, options, callback);
|
|
47
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["linkModule.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport url from 'url';\nimport access from 'fs-access-compat';\nimport mkdirp from 'mkdirp-classic';\nimport Queue from 'queue-cb';\nimport { link, packageRoot, wrapWorker } from 'tsds-lib';\n\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\nconst major = +process.versions.node.split('.')[0];\nconst workerWrapper = wrapWorker(path.join(packageRoot(__dirname), 'dist', 'cjs', 'lib', 'data.js'));\n\nfunction linkBin(src, binPath, nodeModules, binName, callback) {\n const binFullPath = path.resolve.apply(null, [src, ...binPath.split('/')]);\n const destBin = path.resolve(nodeModules, '.bin', binName);\n\n access(binFullPath, (err) => {\n if (!err) return link(binFullPath, destBin, callback);\n console.log(`bin not found: ${binFullPath}. Skipping`);\n callback();\n });\n}\n\nfunction worker(src, nodeModules, _options, callback) {\n const pkg = JSON.parse(fs.readFileSync(path.join(src, 'package.json'), 'utf8'));\n const dest = path.resolve.apply(null, [nodeModules, ...pkg.name.split('/')]);\n\n mkdirp(path.dirname(dest), (err) => {\n if (err) return callback(err);\n\n const queue = new Queue();\n queue.defer(link.bind(null, src, dest));\n\n if (typeof pkg.bin === 'string')\n queue.defer(linkBin.bind(null, src, pkg.bin, nodeModules, pkg.name)); // single bins\n else for (const binName in pkg.bin) queue.defer(linkBin.bind(null, src, pkg.bin[binName], nodeModules, binName)); // object of bins\n\n queue.await((err) => {\n err ? callback(err) : callback(null, dest);\n });\n });\n}\n\nexport default function linkModule(src: string, nodeModules: string, options, callback?) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n major < 14 ? workerWrapper('stable', src, nodeModules, options, callback) : worker(src, nodeModules, options, callback);\n}\n"],"names":["fs","path","url","access","mkdirp","Queue","link","packageRoot","wrapWorker","__dirname","dirname","__filename","fileURLToPath","major","process","versions","node","split","workerWrapper","join","linkBin","src","binPath","nodeModules","binName","callback","binFullPath","resolve","apply","destBin","err","console","log","worker","_options","pkg","JSON","parse","readFileSync","dest","name","queue","defer","bind","bin","await","linkModule","options"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,SAAS,MAAM;AACtB,OAAOC,YAAY,mBAAmB;AACtC,OAAOC,YAAY,iBAAiB;AACpC,OAAOC,WAAW,WAAW;AAC7B,SAASC,IAAI,EAAEC,WAAW,EAAEC,UAAU,QAAQ,WAAW;AAEzD,MAAMC,YAAYR,KAAKS,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAaT,IAAIU,aAAa,CAAC,YAAYV,GAAG;AACjH,MAAMW,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAClD,MAAMC,gBAAgBV,WAAWP,KAAKkB,IAAI,C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MI,KAAK,CAAC,CAACf;YACXA,MAAML,SAASK,OAAOL,SAAS,MAAMc;QACvC;IACF;AACF;AAEA,eAAe,SAASO,WAAWzB,GAAW,EAAEE,WAAmB,EAAEwB,OAAO,EAAEtB,QAAS;IACrF,IAAI,OAAOsB,YAAY,YAAY;QACjCtB,WAAWsB;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IAEtBlC,QAAQ,KAAKK,cAAc,UAAUG,KAAKE,aAAawB,SAAStB,YAAYQ,OAAOZ,KAAKE,aAAawB,SAAStB;AAChH"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import url from 'url';
|
|
4
|
-
import access from 'fs-access-compat';
|
|
5
|
-
import Queue from 'queue-cb';
|
|
6
|
-
import { packageRoot, unlink, wrapWorker } from 'tsds-lib';
|
|
7
|
-
const __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));
|
|
8
|
-
const major = +process.versions.node.split('.')[0];
|
|
9
|
-
const workerWrapper = wrapWorker(path.join(packageRoot(__dirname), 'dist', 'cjs', 'lib', 'data.js'));
|
|
10
|
-
function unlinkBin(nodeModules, binName, callback) {
|
|
11
|
-
const destBin = path.resolve(nodeModules, '.bin', binName);
|
|
12
|
-
access(destBin, (err)=>{
|
|
13
|
-
if (!err) return unlink(destBin, callback);
|
|
14
|
-
console.log(`bin not found: ${destBin}. Skipping`);
|
|
15
|
-
callback();
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
function worker(src, nodeModules, _options, callback) {
|
|
19
|
-
const pkg = JSON.parse(fs.readFileSync(path.join(src, 'package.json'), 'utf8'));
|
|
20
|
-
const dest = path.resolve.apply(null, [
|
|
21
|
-
nodeModules,
|
|
22
|
-
...pkg.name.split('/')
|
|
23
|
-
]);
|
|
24
|
-
const queue = new Queue(1);
|
|
25
|
-
queue.defer(unlink.bind(null, dest));
|
|
26
|
-
if (typeof pkg.bin === 'string') queue.defer(unlinkBin.bind(null, nodeModules, pkg.name)); // single bins
|
|
27
|
-
else for(const binName in pkg.bin)queue.defer(unlinkBin.bind(null, nodeModules, binName)); // object of bins
|
|
28
|
-
queue.await((err)=>{
|
|
29
|
-
err ? callback(err) : callback(null, dest);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
export default function unlinkModule(src, nodeModules, options, callback) {
|
|
33
|
-
if (typeof options === 'function') {
|
|
34
|
-
callback = options;
|
|
35
|
-
options = {};
|
|
36
|
-
}
|
|
37
|
-
options = options || {};
|
|
38
|
-
major < 14 ? workerWrapper('stable', src, nodeModules, options, callback) : worker(src, nodeModules, options, callback);
|
|
39
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["unlinkModule.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport url from 'url';\nimport access from 'fs-access-compat';\nimport Queue from 'queue-cb';\nimport { packageRoot, unlink, wrapWorker } from 'tsds-lib';\n\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\nconst major = +process.versions.node.split('.')[0];\nconst workerWrapper = wrapWorker(path.join(packageRoot(__dirname), 'dist', 'cjs', 'lib', 'data.js'));\n\nfunction unlinkBin(nodeModules, binName, callback) {\n const destBin = path.resolve(nodeModules, '.bin', binName);\n\n access(destBin, (err) => {\n if (!err) return unlink(destBin, callback);\n console.log(`bin not found: ${destBin}. Skipping`);\n callback();\n });\n}\n\nfunction worker(src, nodeModules, _options, callback) {\n const pkg = JSON.parse(fs.readFileSync(path.join(src, 'package.json'), 'utf8'));\n const dest = path.resolve.apply(null, [nodeModules, ...pkg.name.split('/')]);\n\n const queue = new Queue(1);\n queue.defer(unlink.bind(null, dest));\n\n if (typeof pkg.bin === 'string')\n queue.defer(unlinkBin.bind(null, nodeModules, pkg.name)); // single bins\n else for (const binName in pkg.bin) queue.defer(unlinkBin.bind(null, nodeModules, binName)); // object of bins\n\n queue.await((err) => {\n err ? callback(err) : callback(null, dest);\n });\n}\n\nexport default function unlinkModule(src: string, nodeModules: string, options, callback?) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n major < 14 ? workerWrapper('stable', src, nodeModules, options, callback) : worker(src, nodeModules, options, callback);\n}\n"],"names":["fs","path","url","access","Queue","packageRoot","unlink","wrapWorker","__dirname","dirname","__filename","fileURLToPath","major","process","versions","node","split","workerWrapper","join","unlinkBin","nodeModules","binName","callback","destBin","resolve","err","console","log","worker","src","_options","pkg","JSON","parse","readFileSync","dest","apply","name","queue","defer","bind","bin","await","unlinkModule","options"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,SAAS,MAAM;AACtB,OAAOC,YAAY,mBAAmB;AACtC,OAAOC,WAAW,WAAW;AAC7B,SAASC,WAAW,EAAEC,MAAM,EAAEC,UAAU,QAAQ,WAAW;AAE3D,MAAMC,YAAYP,KAAKQ,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAaR,IAAIS,aAAa,CAAC,YAAYT,GAAG;AACjH,MAAMU,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAClD,MAAMC,gBAAgBV,WAAWN,KAAKiB,IAAI,CAACb,YAAYG,YAAY,QAAQ,OAAO,OAAO;AAEzF,SAASW,UAAUC,WAAW,EAAEC,OAAO,EAAEC,QAAQ;IAC/C,MAAMC,UAAUtB,KAAKuB,OAAO,CAACJ,aAAa,QAAQC;IAElDlB,OAAOoB,SAAS,CAACE;QACf,IAAI,CAACA,KAAK,OAAOnB,OAAOiB,SAASD;QACjCI,QAAQC,GAAG,CAAC,CAAC,eAAe,EAAEJ,QAAQ,UAAU,CAAC;QACjDD;IACF;AACF;AAEA,SAASM,OAAOC,GAAG,EAAET,WAAW,EAAEU,QAAQ,EAAER,QAAQ;IAClD,MAAMS,MAAMC,KAAKC,KAAK,CAACjC,GAAGkC,YAAY,CAACjC,KAAKiB,IAAI,CAACW,KAAK,iBAAiB;IACvE,MAAMM,OAAOlC,KAAKuB,OAAO,CAACY,KAAK,CAAC,MAAM;QAAChB;WAAgBW,IAAIM,IAAI,CAACrB,KAAK,CAAC;KAAK;IAE3E,MAAMsB,QAAQ,IAAIlC,MAAM;IACxBkC,MAAMC,KAAK,CAACjC,OAAOkC,IAAI,CAAC,MAAML;IAE9B,IAAI,OAAOJ,IAAIU,GAAG,KAAK,UACrBH,MAAMC,KAAK,CAACpB,UAAUqB,IAAI,CAAC,MAAMpB,aAAaW,IAAIM,IAAI,IAAI,cAAc;SACrE,IAAK,MAAMhB,WAAWU,IAAIU,GAAG,CAAEH,MAAMC,KAAK,CAACpB,UAAUqB,IAAI,CAAC,MAAMpB,aAAaC,WAAW,iBAAiB;IAE9GiB,MAAMI,KAAK,CAAC,CAACjB;QACXA,MAAMH,SAASG,OAAOH,SAAS,MAAMa;IACvC;AACF;AAEA,eAAe,SAASQ,aAAad,GAAW,EAAET,WAAmB,EAAEwB,OAAO,EAAEtB,QAAS;IACvF,IAAI,OAAOsB,YAAY,YAAY;QACjCtB,WAAWsB;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IAEtBhC,QAAQ,KAAKK,cAAc,UAAUY,KAAKT,aAAawB,SAAStB,YAAYM,OAAOC,KAAKT,aAAawB,SAAStB;AAChH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function linkModule(src: string, nodeModules: string, options: any, callback?: any): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function unlinkModule(src: string, nodeModules: string, options: any, callback?: any): void;
|