From 2fc37d6892d2717dd6bb4f1d7b3c0ff15e121b74 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Sat, 8 Jul 2023 16:24:53 +0200 Subject: [PATCH] fix(core): update --- package.json | 4 +- pnpm-lock.yaml | 113 ++++++++++++----------- ts/00_commitinfo_data.ts | 2 +- ts/smartfile.classes.virtualdirectory.ts | 22 ++++- 4 files changed, 82 insertions(+), 59 deletions(-) diff --git a/package.json b/package.json index cf558ff..9eac380 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@types/glob": "^8.1.0", "@types/js-yaml": "^4.0.5", "fs-extra": "^11.1.1", - "glob": "^10.3.0", + "glob": "^10.3.2", "js-yaml": "^4.1.0" }, "devDependencies": { @@ -49,7 +49,7 @@ "@gitzone/tsrun": "^1.2.42", "@gitzone/tstest": "^1.0.74", "@pushrocks/tapbundle": "^5.0.8", - "@types/node": "^20.3.1" + "@types/node": "^20.4.1" }, "files": [ "ts/**/*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b18e33c..8e0c300 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,8 +51,8 @@ dependencies: specifier: ^11.1.1 version: 11.1.1 glob: - specifier: ^10.3.0 - version: 10.3.0 + specifier: ^10.3.2 + version: 10.3.2 js-yaml: specifier: ^4.1.0 version: 4.1.0 @@ -63,16 +63,16 @@ devDependencies: version: 2.1.66 '@gitzone/tsrun': specifier: ^1.2.42 - version: 1.2.42(@types/node@20.3.1) + version: 1.2.42(@types/node@20.4.1) '@gitzone/tstest': specifier: ^1.0.74 - version: 1.0.74(@types/node@20.3.1) + version: 1.0.74(@types/node@20.4.1) '@pushrocks/tapbundle': specifier: ^5.0.8 version: 5.0.8 '@types/node': - specifier: ^20.3.1 - version: 20.3.1 + specifier: ^20.4.1 + version: 20.4.1 packages: @@ -392,13 +392,13 @@ packages: - supports-color dev: true - /@gitzone/tsrun@1.2.42(@types/node@20.3.1): + /@gitzone/tsrun@1.2.42(@types/node@20.4.1): resolution: {integrity: sha512-56TC2F09FeyFE74dJHSS0QMKdoXVNx1XsFOsOWGiOAjt8bkXenktsUN9s5vy53TYBS4HYXo5pyvRZ7Xym+TD7g==} hasBin: true dependencies: '@pushrocks/smartfile': 10.0.7 '@pushrocks/smartshell': 2.0.30 - ts-node: 10.9.1(@types/node@20.3.1)(typescript@5.1.3) + ts-node: 10.9.1(@types/node@20.4.1)(typescript@5.1.3) typescript: 5.1.3 transitivePeerDependencies: - '@swc/core' @@ -407,12 +407,12 @@ packages: - supports-color dev: true - /@gitzone/tstest@1.0.74(@types/node@20.3.1): + /@gitzone/tstest@1.0.74(@types/node@20.4.1): resolution: {integrity: sha512-6V8bsfvpnODWqrkdooVqcOS1z5GA8dMDnLCOHnr/SUTeie3ox8KGpckwiZ+gTfz9WvzX6+KLVTZNYKGOaNbmMQ==} hasBin: true dependencies: '@gitzone/tsbundle': 2.0.8 - '@gitzone/tsrun': 1.2.42(@types/node@20.3.1) + '@gitzone/tsrun': 1.2.42(@types/node@20.4.1) '@pushrocks/consolecolor': 2.0.1 '@pushrocks/smartbrowser': 2.0.5 '@pushrocks/smartdelay': 2.0.13 @@ -1149,7 +1149,7 @@ packages: /@types/accepts@1.3.5: resolution: {integrity: sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==} dependencies: - '@types/node': 20.3.1 + '@types/node': 20.4.1 dev: true /@types/babel__code-frame@7.0.3: @@ -1160,7 +1160,7 @@ packages: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 20.3.1 + '@types/node': 20.4.1 dev: true /@types/buffer-json@2.0.1: @@ -1179,14 +1179,14 @@ packages: /@types/clean-css@4.2.6: resolution: {integrity: sha512-Ze1tf+LnGPmG6hBFMi0B4TEB0mhF7EiMM5oyjLDNPE9hxrPU0W+5+bHvO+eFPA+bt0iC1zkQMoU/iGdRVjcRbw==} dependencies: - '@types/node': 20.3.1 + '@types/node': 20.4.1 source-map: 0.6.1 dev: true /@types/co-body@6.1.0: resolution: {integrity: sha512-3e0q2jyDAnx/DSZi0z2H0yoZ2wt5yRDZ+P7ymcMObvq0ufWRT4tsajyO+Q1VwVWiv9PRR4W3YEjEzBjeZlhF+w==} dependencies: - '@types/node': 20.3.1 + '@types/node': 20.4.1 '@types/qs': 6.9.7 dev: true @@ -1199,7 +1199,7 @@ packages: /@types/connect@3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 20.3.1 + '@types/node': 20.4.1 dev: true /@types/content-disposition@0.5.5: @@ -1220,13 +1220,13 @@ packages: '@types/connect': 3.4.35 '@types/express': 4.17.17 '@types/keygrip': 1.0.2 - '@types/node': 20.3.1 + '@types/node': 20.4.1 dev: true /@types/cors@2.8.13: resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} dependencies: - '@types/node': 20.3.1 + '@types/node': 20.4.1 dev: true /@types/debounce@1.2.1: @@ -1240,7 +1240,7 @@ packages: /@types/express-serve-static-core@4.17.35: resolution: {integrity: sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==} dependencies: - '@types/node': 20.3.1 + '@types/node': 20.4.1 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 '@types/send': 0.17.1 @@ -1258,25 +1258,25 @@ packages: /@types/finalhandler@1.2.0: resolution: {integrity: sha512-NgEZKOhxUSXkwNnWNaMXZaopQ5aFGPAYiEpEWIkQ6Dzc4iS0M1oQsvWne2t+ex9QZUAdTz/ZT4tOXJhWtP6mCw==} dependencies: - '@types/node': 20.3.1 + '@types/node': 20.4.1 dev: true /@types/from2@2.3.2: resolution: {integrity: sha512-s1pdctxW2+CA4FOxxTBRxC3RKQL9Br1a2s2LngP4jh1BI84JBL3mDXj87EwcckN9z/IXp8o3ySmvZveGEAAwqw==} dependencies: - '@types/node': 20.3.1 + '@types/node': 20.4.1 /@types/fs-extra@11.0.1: resolution: {integrity: sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==} dependencies: '@types/jsonfile': 6.1.1 - '@types/node': 20.3.1 + '@types/node': 20.4.1 /@types/glob@8.1.0: resolution: {integrity: sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 20.3.1 + '@types/node': 20.4.1 /@types/html-minifier@4.0.2: resolution: {integrity: sha512-4IkmkXJP/25R2fZsCHDX2abztXuQRzUAZq39PfCMz2loLFj8vS9y7aF6vDl58koXSTpsF+eL4Lc5Y4Aww/GCTQ==} @@ -1324,7 +1324,7 @@ packages: /@types/jsonfile@6.1.1: resolution: {integrity: sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==} dependencies: - '@types/node': 20.3.1 + '@types/node': 20.4.1 /@types/keygrip@1.0.2: resolution: {integrity: sha512-GJhpTepz2udxGexqos8wgaBx4I/zWIDPh/KOGEwAqtuGDkOUJu5eFvwmdBX4AmB8Odsr+9pHCQqiAqDL/yKMKw==} @@ -1346,7 +1346,7 @@ packages: '@types/http-errors': 2.0.1 '@types/keygrip': 1.0.2 '@types/koa-compose': 3.2.5 - '@types/node': 20.3.1 + '@types/node': 20.4.1 dev: true /@types/mime-types@2.1.1: @@ -1367,8 +1367,8 @@ packages: /@types/minimatch@5.1.2: resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} - /@types/node@20.3.1: - resolution: {integrity: sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==} + /@types/node@20.4.1: + resolution: {integrity: sha512-JIzsAvJeA/5iY6Y/OxZbv1lUcc8dNSE77lb2gnBH+/PJ3lFR1Ccvgwl5JWnHAkNHcRsT0TbpVOsiMKZ1F/yyJg==} /@types/parse5@6.0.3: resolution: {integrity: sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==} @@ -1397,7 +1397,7 @@ packages: resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==} dependencies: '@types/mime': 1.3.2 - '@types/node': 20.3.1 + '@types/node': 20.4.1 dev: true /@types/serve-static@1.15.2: @@ -1405,7 +1405,7 @@ packages: dependencies: '@types/http-errors': 2.0.1 '@types/mime': 3.0.1 - '@types/node': 20.3.1 + '@types/node': 20.4.1 dev: true /@types/shortid@0.0.29: @@ -1435,7 +1435,7 @@ packages: /@types/through2@2.0.38: resolution: {integrity: sha512-YFu+nHmjxMurkH1BSzA0Z1WrKDAY8jUKPZctNQn7mc+/KKtp2XxnclHFXxdB1m7Iqnzb5aywgP8TMK283LezGQ==} dependencies: - '@types/node': 20.3.1 + '@types/node': 20.4.1 /@types/trusted-types@2.0.3: resolution: {integrity: sha512-NfQ4gyz38SL8sDNrSixxU2Os1a5xcdFxipAFxYEuLUlvU2uDwS4NUpsImcf1//SlWItCVMMLiylsxbmNMToV/g==} @@ -1458,14 +1458,14 @@ packages: /@types/ws@7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 20.3.1 + '@types/node': 20.4.1 dev: true /@types/yauzl@2.10.0: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 20.3.1 + '@types/node': 20.4.1 dev: true optional: true @@ -1560,6 +1560,11 @@ packages: - utf-8-validate dev: true + /@xmldom/xmldom@0.8.8: + resolution: {integrity: sha512-0LNz4EY8B/8xXY86wMrQ4tz6zEHZv9ehFMJPm8u2gq5lQ71cfRKdaKyxfJAx5aUoyzx0qzgURblTisPGgz3d+Q==} + engines: {node: '>=10.0.0'} + dev: true + /accepts@1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} engines: {node: '>= 0.6'} @@ -2222,7 +2227,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.13 - '@types/node': 20.3.1 + '@types/node': 20.4.1 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -2242,7 +2247,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.13 - '@types/node': 20.3.1 + '@types/node': 20.4.1 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -2579,16 +2584,16 @@ packages: is-glob: 4.0.3 dev: true - /glob@10.3.0: - resolution: {integrity: sha512-AQ1/SB9HH0yCx1jXAT4vmCbTOPe5RQ+kCurjbel5xSCGhebumUv+GJZfa1rEqor3XIViqwSEmlkZCQD43RWrBg==} + /glob@10.3.2: + resolution: {integrity: sha512-vsuLzB3c/uyDLLEdBZtT8vGnN0z57rwOxHV2oYZib/7HWmBspUaja/McYIobBjC4qaUTuNpUyFO2IdqM4DZIJA==} engines: {node: '>=16 || 14 >=14.17'} hasBin: true dependencies: foreground-child: 3.1.1 jackspeak: 2.2.1 - minimatch: 9.0.1 - minipass: 6.0.2 - path-scurry: 1.9.2 + minimatch: 9.0.3 + minipass: 7.0.1 + path-scurry: 1.10.1 dev: false /glob@7.2.3: @@ -3197,6 +3202,11 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true + /lru-cache@10.0.0: + resolution: {integrity: sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==} + engines: {node: 14 || >=16.14} + dev: false + /lru-cache@8.0.5: resolution: {integrity: sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==} engines: {node: '>=16.14'} @@ -3207,11 +3217,6 @@ packages: engines: {node: 14 || >=16.14} dev: true - /lru-cache@9.1.2: - resolution: {integrity: sha512-ERJq3FOzJTxBbFjZ7iDs+NiK4VI9Wz+RdrrAB8dio1oV+YvdPzUEE4QNiT2VD51DkIbCYRUUzCRkssXCHqSnKQ==} - engines: {node: 14 || >=16.14} - dev: false - /make-dir@3.1.0: resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} engines: {node: '>=8'} @@ -3320,15 +3325,15 @@ packages: brace-expansion: 2.0.1 dev: true - /minimatch@9.0.1: - resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} + /minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 dev: false - /minipass@6.0.2: - resolution: {integrity: sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w==} + /minipass@7.0.1: + resolution: {integrity: sha512-NQ8MCKimInjVlaIqx51RKJJB7mINVkLTJbsZKmto4UAAOC/CWXES8PGaOgoBZyqoUsUA/U3DToGK7GJkkHbjJw==} engines: {node: '>=16 || 14 >=14.17'} dev: false @@ -3533,12 +3538,12 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} - /path-scurry@1.9.2: - resolution: {integrity: sha512-qSDLy2aGFPm8i4rsbHd4MNyTcrzHFsLQykrtbuGRknZZCBBVXSv2tSCDN2Cg6Rt/GFRw8GoW9y9Ecw5rIPG1sg==} + /path-scurry@1.10.1: + resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} engines: {node: '>=16 || 14 >=14.17'} dependencies: - lru-cache: 9.1.2 - minipass: 6.0.2 + lru-cache: 10.0.0 + minipass: 7.0.1 dev: false /path-to-regexp@0.1.7: @@ -3560,6 +3565,8 @@ packages: resolution: {integrity: sha512-mXF9AIgnvq1DP/ZM2R28tAfxP2wKZHYa2DjV0R1KCwcqSzm5Iqh1XQq9rdfAt6dp2DuPP0VHZIaCALc2v1cL5A==} engines: {node: '>=14.18.0', npm: '>=6.14.15'} hasBin: true + dependencies: + '@xmldom/xmldom': 0.8.8 dev: true bundledDependencies: - '@xmldom/xmldom' @@ -4178,7 +4185,7 @@ packages: hasBin: true dev: true - /ts-node@10.9.1(@types/node@20.3.1)(typescript@5.1.3): + /ts-node@10.9.1(@types/node@20.4.1)(typescript@5.1.3): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -4197,7 +4204,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.3.1 + '@types/node': 20.4.1 acorn: 8.9.0 acorn-walk: 8.2.0 arg: 4.1.3 diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 6c11913..10918ea 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@pushrocks/smartfile', - version: '10.0.25', + version: '10.0.26', description: 'offers smart ways to work with files in nodejs' } diff --git a/ts/smartfile.classes.virtualdirectory.ts b/ts/smartfile.classes.virtualdirectory.ts index 46d6f78..cc9de5e 100644 --- a/ts/smartfile.classes.virtualdirectory.ts +++ b/ts/smartfile.classes.virtualdirectory.ts @@ -47,7 +47,7 @@ export class VirtualDirectory { } public async saveToDisk(dirArg: string) { - console.log(`writing VirtualDirectory with ${this.smartfileArray.length} to directory: + console.log(`writing VirtualDirectory with ${this.smartfileArray.length} files to directory: --> ${dirArg}`); for (const smartfileArg of this.smartfileArray) { const filePath = await smartfileArg.writeToDir(dirArg); @@ -56,6 +56,22 @@ export class VirtualDirectory { } } - // TODO implement root shifting to get subdirectories as new virtual directories - // TODO implement root shifting to combine VirtualDirecotries in a parent virtual directory + public async shiftToSubdirectory(subDir: string): Promise { + const newVirtualDir = new VirtualDirectory(); + for (const file of this.smartfileArray) { + if (file.path.startsWith(subDir)) { + const adjustedFilePath = plugins.path.relative(subDir, file.path); + file.path = adjustedFilePath; + newVirtualDir.addSmartfiles([file]); + } + } + return newVirtualDir; + } + + public async addVirtualDirectory(virtualDir: VirtualDirectory, newRoot: string): Promise { + for (const file of virtualDir.smartfileArray) { + file.path = plugins.path.join(newRoot, file.path); + } + this.addSmartfiles(virtualDir.smartfileArray); + } }