diff --git a/build/entryx64.nsi b/build/entryx64.nsi index 52915c080..47c3bd50f 100644 --- a/build/entryx64.nsi +++ b/build/entryx64.nsi @@ -13,7 +13,7 @@ !define MUI_UNICON "icon.ico" !define PRODUCT_NAME "Entry" !define APP_NAME "Entry.exe" -!define PRODUCT_VERSION "2.1.19" +!define PRODUCT_VERSION "2.1.20" !define PRODUCT_PUBLISHER "EntryLabs" !define PRODUCT_WEB_SITE "http://www.playentry.org/" diff --git a/build/entryx86.nsi b/build/entryx86.nsi index 66e37099b..708fd3e1c 100644 --- a/build/entryx86.nsi +++ b/build/entryx86.nsi @@ -13,7 +13,7 @@ !define MUI_UNICON "icon.ico" !define PRODUCT_NAME "Entry" !define APP_NAME "Entry.exe" -!define PRODUCT_VERSION "2.1.19" +!define PRODUCT_VERSION "2.1.20" !define PRODUCT_PUBLISHER "EntryLabs" !define PRODUCT_WEB_SITE "http://www.playentry.org/" diff --git a/package.json b/package.json index f13f38abe..0c38ada8c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "productName": "Entry", "name": "entry", - "version": "2.1.19", + "version": "2.1.20", "description": "Entry for offline", "main": "src/main_build/main.bundle.js", "scripts": { @@ -39,8 +39,8 @@ "async-csv": "^2.1.3", "axios": "^0.19.2", "cross-spawn": "^7.0.3", - "entry-hw": "git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.57_2", - "entry-js": "git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.19", + "entry-hw": "git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.58_2", + "entry-js": "git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.20", "entry-tool": "git+https://github.com/entrylabs/entry-tool.git#dist/20231026", "@entrylabs/legacy-video": "^1.0.0", "excel4node": "^1.7.0", @@ -59,7 +59,7 @@ "sass": "^1.57.1", "socket.io": "^2.2.0", "socket.io-client": "^2.2.0", - "tar": "^4.4.10", + "tar": "^6.1.11", "uid": "^0.0.2", "winston": "^3.2.1", "winston-daily-rotate-file": "^4.4.2", diff --git a/src/main/constants.ts b/src/main/constants.ts index deb131760..17596055e 100644 --- a/src/main/constants.ts +++ b/src/main/constants.ts @@ -7,18 +7,24 @@ export default class { return { fromExternal: (fileUrl) => { let result = fileUrl.replace(/%5C/gi, '\\'); // 1.6.x 버전 대응 - if (result.startsWith('./bower_components')) { // 웹 기본 오브젝트 대응 + if (result.startsWith('./bower_components')) { + // 웹 기본 오브젝트 대응 result = result .replace('./bower_components', '../../../node_modules') .replace('entryjs', 'entry-js'); // 과거 웹 WS 대응 - } else if (result.startsWith('/lib')) { // 신규 웹 기본 오브젝트 대응 + } else if (result.startsWith('/lib')) { + // 신규 웹 기본 오브젝트 대응 result = result.replace('/lib', '../../../node_modules'); - } else if (result.indexOf('temp') > -1) { // 일반 오브젝트 대응 + } else if (result.indexOf('temp') > -1) { + // 일반 오브젝트 대응 result = result.substring(result.indexOf('temp')); - result = path.join(this.appPath, result) - .replace(/\\/gi, '/'); + result = path.join(this.appPath, result).replace(/\\/gi, '/'); + } else if (result.match('/node_modules/@entrylabs/entry') !== null) { + result = result.replace( + '/node_modules/@entrylabs/entry', + '../../../node_modules/entry-js' + ); } - // TODO: 히스토리 파악 후 완전 제거 // if (fileUrl.endsWith('.svg')) { // // svg 파일의 경우 png 파일로 교체한다. @@ -33,15 +39,16 @@ export default class { if (result.startsWith('renderer')) { result = result.replace('renderer', '.'); + } else if (result.startsWith('../../../node_modules')) { + // 웹 업로드시 bower 에서 받던 구조 그대로 사용할 것이므로, 그 사이에 혼동을 주지 않기 위해 + // node_modules 로 링크되는 구조를 과거 로직으로 재치환 하여 export 함 + result = result.replace('../../../node_modules', './bower_components'); + } else if (result.match('/node_modules/@entrylabs/entry') !== null) { + result = result.replace('/node_modules/@entrylabs/entry', './bower_components'); } - // 웹 업로드시 bower 에서 받던 구조 그대로 사용할 것이므로, 그 사이에 혼동을 주지 않기 위해 - // node_modules 로 링크되는 구조를 과거 로직으로 재치환 하여 export 함 - if (result.startsWith('../../../node_modules')) { - result = result.replace('../../../node_modules','./bower_components'); - } - - return result.substring(result.indexOf('temp')) + return result + .substring(result.indexOf('temp')) .replace(/\\/gi, '/') .replace(/.*\/\//, ''); // 외부 접속 프로토콜 스키마 보안 대응 }, @@ -51,7 +58,7 @@ export default class { if (result.startsWith('renderer')) { result = result.replace('renderer', '.'); } else if (result.startsWith('../../../node_modules')) { - result = result.replace('../../../node_modules','./bower_components'); + result = result.replace('../../../node_modules', './bower_components'); } else { result = undefined; } @@ -105,87 +112,43 @@ export default class { } static tempPathForExport(objectId: string) { - return path.join( - this.appPath, - 'import', - objectId, - path.sep, - ); + return path.join(this.appPath, 'import', objectId, path.sep); } // 사용위치는 join 을 사용 (프로젝트 외 경로) static get tempPath() { - return path.join( - this.appPath, - 'temp', - path.sep, - ); + return path.join(this.appPath, 'temp', path.sep); } static tempImagePath(filename: string) { - return path.join( - this.tempPath, - this.subDirectoryPath(filename), - 'image', - path.sep, - ); + return path.join(this.tempPath, this.subDirectoryPath(filename), 'image', path.sep); } static tempThumbnailPath(filename: string) { - return path.join( - this.tempPath, - this.subDirectoryPath(filename), - 'thumb', - path.sep, - ); + return path.join(this.tempPath, this.subDirectoryPath(filename), 'thumb', path.sep); } static tempSoundPath(filename: string) { - return path.join( - this.tempPath, - this.subDirectoryPath(filename), - 'sound', - path.sep, - ); + return path.join(this.tempPath, this.subDirectoryPath(filename), 'sound', path.sep); } static get resourcePath() { - return path.resolve( - app.getAppPath(), 'src', 'renderer', 'resources', 'uploads', - ); + return path.resolve(app.getAppPath(), 'src', 'renderer', 'resources', 'uploads'); } static resourceImagePath(filename: string) { - return path.join( - this.resourcePath, - this.subDirectoryPath(filename), - 'image', - path.sep, - ); + return path.join(this.resourcePath, this.subDirectoryPath(filename), 'image', path.sep); } static resourceThumbnailPath(filename: string) { - return path.join( - this.resourcePath, - this.subDirectoryPath(filename), - 'thumb', - path.sep, - ); + return path.join(this.resourcePath, this.subDirectoryPath(filename), 'thumb', path.sep); } static resourceSoundPath(filename: string) { - return path.join( - this.resourcePath, - this.subDirectoryPath(filename), - path.sep, - ); + return path.join(this.resourcePath, this.subDirectoryPath(filename), path.sep); } static subDirectoryPath(filename: string) { - return path.join( - filename.substr(0, 2), - filename.substr(2, 2), - path.sep, - ); + return path.join(filename.substr(0, 2), filename.substr(2, 2), path.sep); } } diff --git a/src/main/fileUtils.ts b/src/main/fileUtils.ts index 9b8c2633d..5c88d3f33 100644 --- a/src/main/fileUtils.ts +++ b/src/main/fileUtils.ts @@ -6,8 +6,8 @@ import tar, { CreateOptions, FileOptions } from 'tar'; import { nativeImage, NativeImage } from 'electron'; import createLogger from './utils/functions/createLogger'; import ffmpeg from 'fluent-ffmpeg'; -import ffmpegInstaller from '@ffmpeg-installer/ffmpeg' -import ffprobeInstaller from '@ffprobe-installer/ffprobe' +import ffmpegInstaller from '@ffmpeg-installer/ffmpeg'; +import ffprobeInstaller from '@ffprobe-installer/ffprobe'; import get from 'lodash/get'; type tarCreateOption = FileOptions & CreateOptions; @@ -15,14 +15,8 @@ type readFileOption = { encoding?: string | null; flag?: string } | string | und type Dimension = { width: number; height: number }; const logger = createLogger('main/fileUtils.ts'); -const ffmpegPath = ffmpegInstaller.path.replace( - 'app.asar', - 'app.asar.unpacked' -); -const ffprobePath = ffprobeInstaller.path.replace( - 'app.asar', - 'app.asar.unpacked' -); +const ffmpegPath = ffmpegInstaller.path.replace('app.asar', 'app.asar.unpacked'); +const ffprobePath = ffprobeInstaller.path.replace('app.asar', 'app.asar.unpacked'); ffmpeg.setFfmpegPath(ffmpegPath); ffmpeg.setFfprobePath(ffprobePath); diff --git a/src/main/mainUtils.ts b/src/main/mainUtils.ts index 88a87898c..d0bef9c47 100644 --- a/src/main/mainUtils.ts +++ b/src/main/mainUtils.ts @@ -33,7 +33,7 @@ export default class MainUtils { const workingDirectoryPath = path.join(baseAppPath, 'temp'); const tempDirectoryPath = path.join(baseAppPath, 'uploads', CommonUtils.createFileId()); await FileUtils.mkdirRecursive(tempDirectoryPath); - await FileUtils.unpack(filePath, tempDirectoryPath, (path) => path.startsWith('temp/')); + await FileUtils.unpack(filePath, tempDirectoryPath); const projectBuffer = await fsp.readFile( path.resolve(tempDirectoryPath, 'temp', 'project.json') @@ -105,6 +105,10 @@ export default class MainUtils { return; } picture.fileurl = replaceStrategy(fileUrl); + const thumbUrl = picture.thumbUrl; + if (thumbUrl) { + picture.thumbUrl = replaceStrategy(thumbUrl); + } }); sounds.forEach((sound: any) => { const fileUrl = sound.fileurl; diff --git a/yarn.lock b/yarn.lock index 5b15322fd..6be8ed0b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3849,7 +3849,7 @@ chokidar@^2.1.8: optionalDependencies: fsevents "^1.2.7" -chownr@^1.1.1, chownr@^1.1.4: +chownr@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== @@ -5212,9 +5212,9 @@ entities@^2.0.0: dependencies: crypto-js "^4.0.0" -"entry-hw@git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.57_2": - version "1.9.57" - resolved "git+https://github.com/entrylabs/entry-hw.git#d70e282a47ce30f3b779082ec00ac5793e928027" +"entry-hw@git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.58_2": + version "1.9.58" + resolved "git+https://github.com/entrylabs/entry-hw.git#f4c93bdb41ef097df7e501acd30ca8ac98fee3e2" dependencies: cross-spawn "^7.0.0" fs-extra "^8.1.0" @@ -5229,9 +5229,9 @@ entities@^2.0.0: winston "^3.2.1" winston-daily-rotate-file "^4.4.2" -"entry-js@git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.19": - version "4.0.11" - resolved "git+https://github.com/entrylabs/entryjs.git#c8e145020b6b6d447ade26ac837f74bb33ec1aba" +"entry-js@git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.20": + version "4.0.12" + resolved "git+https://github.com/entrylabs/entryjs.git#187cb575facd3c59ecaa9e9f8f867fcd57f061f0" dependencies: uid "^0.0.2" "@entrylabs/event" "^1.0.3" @@ -5264,7 +5264,7 @@ entities@^2.0.0: simplebar "^3.1.1" skmeans "^0.11.3" socket.io-client "^2.3.0" - ua-parser-js "^1.0.35" + ua-parser-js "^1.0.38" webpack "^5.85.0" worker-loader "^3.0.8" xss-filters "^1.2.7" @@ -6254,13 +6254,6 @@ fs-extra@^9.0.0, fs-extra@^9.0.1: jsonfile "^6.0.1" universalify "^2.0.0" -fs-minipass@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" - integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== - dependencies: - minipass "^2.6.0" - fs-minipass@^2.0.0, fs-minipass@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" @@ -8942,14 +8935,6 @@ minipass@*, minipass@^4.0.0: dependencies: yallist "^4.0.0" -minipass@^2.6.0, minipass@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - minipass@^3.0.0, minipass@^3.1.1, minipass@^3.1.6: version "3.3.6" resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" @@ -8957,13 +8942,6 @@ minipass@^3.0.0, minipass@^3.1.1, minipass@^3.1.6: dependencies: yallist "^4.0.0" -minizlib@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" - integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== - dependencies: - minipass "^2.9.0" - minizlib@^2.1.1, minizlib@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" @@ -9013,7 +8991,7 @@ mkdirp@0.5.5: dependencies: minimist "^1.2.5" -mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@^0.5.5: +mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== @@ -11005,7 +10983,7 @@ safe-array-concat@^1.0.0, safe-array-concat@^1.1.2: has-symbols "^1.0.3" isarray "^2.0.5" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -12072,19 +12050,6 @@ tar-stream@^2.1.4: inherits "^2.0.3" readable-stream "^3.1.1" -tar@^4.4.10: - version "4.4.19" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3" - integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA== - dependencies: - chownr "^1.1.4" - fs-minipass "^1.2.7" - minipass "^2.9.0" - minizlib "^1.3.3" - mkdirp "^0.5.5" - safe-buffer "^5.2.1" - yallist "^3.1.1" - tar@^6.0.1, tar@^6.0.5, tar@^6.1.11, tar@^6.1.2: version "6.1.13" resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.13.tgz#46e22529000f612180601a6fe0680e7da508847b" @@ -12545,10 +12510,10 @@ typescript@^5.4.5: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== -ua-parser-js@^1.0.35: - version "1.0.38" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.38.tgz#66bb0c4c0e322fe48edfe6d446df6042e62f25e2" - integrity sha512-Aq5ppTOfvrCMgAPneW1HfWj66Xi7XL+/mIy996R1/CLS/rcyJQm6QZdsKrUeivDFQ+Oc9Wyuwor8Ze8peEoUoQ== +ua-parser-js@^1.0.38: + version "1.0.39" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.39.tgz#bfc07f361549bf249bd8f4589a4cccec18fd2018" + integrity sha512-k24RCVWlEcjkdOxYmVJgeD/0a1TiSpqLg+ZalVGV9lsnr4yqu0w7tX/x2xX6G4zpkgQnRf89lxuZ1wsbjXM8lw== uid@^0.0.2: version "0.0.2" @@ -13301,7 +13266,7 @@ y18n@^5.0.5: resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yallist@^3.0.0, yallist@^3.0.2, yallist@^3.1.1: +yallist@^3.0.2: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==