Skip to content

Commit

Permalink
Merge pull request #16 from thanhvu1982/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
misa198 authored Jul 2, 2022
2 parents d6d617c + 7ef21ce commit 40d591f
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ typings/

# build
build
*.zip

# .DS_Store
.DS_Store
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

==================

### v1.4.0

- Detect extension more than 1 dot

### v1.3.9

- Fix missing theme on commit diff page
Expand Down
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@
"bugs": {
"url": "https://github.com/misa198/octotree-theme/issues"
},
"version": "1.3.9",
"version": "1.4.0",
"scripts": {
"pre-commit": "lint-staged",
"build:firefox": "rm -rf build/firefox && cross-env PLATFORM=firefox webpack --config webpack.config.js",
"build:chromium": "rm -rf build/chromium && cross-env PLATFORM=chromium webpack --config webpack.config.js",
"build:chromium-v3": "rm -rf build/chromium-v3 && cross-env PLATFORM=chromium-v3 webpack --config webpack.config.js",
"build:chromium-v2": "rm -rf build/chromium-v2 && cross-env PLATFORM=chromium-v2 webpack --config webpack.config.js",
"build": "npm run build:chromium && npm run build:firefox && npm run build:chromium-v2",
"build:firefox": "rm -rf build/firefox && cross-env PLATFORM=firefox webpack --config webpack.config.js",
"build": "npm run build:chromium-v3 && npm run build:firefox && npm run build:chromium-v2",
"lint": "eslint src/**/*.ts",
"lint:fix": "npm run lint -- --fix",
"generate-code-themes": "node tools/generate.js && prettier --write src/scripts/constants"
"generate-code-themes": "node tools/generate.js && prettier --write src/scripts/constants",
"zip:chromium-v3": "cross-env PLATFORM=chromium-v3 node tools/zip.js",
"zip:chromium-v2": "cross-env PLATFORM=chromium-v2 node tools/zip.js",
"zip:firefox": "cross-env PLATFORM=firefox node tools/zip.js",
"zip": "npm run zip:chromium-v3 && npm run zip:chromium-v2 && npm run zip:firefox"
},
"dependencies": {
"adm-zip": "^0.5.9",
"capitalize": "^2.0.4",
"dom-loaded": "^2.0.0",
"file-icons-js": "^1.1.0",
Expand Down Expand Up @@ -57,6 +62,7 @@
"html-minimizer-webpack-plugin": "^3.5.0",
"husky": "^6.0.0",
"lint-staged": "^10.5.4",
"log4js": "^6.5.2",
"mini-css-extract-plugin": "^2.6.0",
"path": "^0.12.7",
"prettier": "^2.2.1",
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/scripts/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ get(
Keys.OT_GITHUB_DIFF,
],
(result) => {
console.log(result);
if (result[Keys.OT_GITHUB] === undefined) {
set({ [Keys.OT_GITHUB]: true });
}
Expand Down
14 changes: 11 additions & 3 deletions src/scripts/libs/mui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ export const getMuiFileIcon = (fileName: string) => {
let iconName = 'file';
const lowerCaseFileName = fileName.toLowerCase();

const ext = lowerCaseFileName.split('.').pop();
if (ext && extentions[ext]) iconName = extentions[ext];
if (files[lowerCaseFileName]) iconName = files[lowerCaseFileName];
if (files[fileName]) iconName = files[fileName];
else if (files[lowerCaseFileName]) iconName = files[lowerCaseFileName];
else {
const splitedName = lowerCaseFileName.split('.').reverse();
let currentPath = '';
splitedName.forEach((path, index) => {
if (index === 0) currentPath = path;
else currentPath = `${path}.${currentPath}`;
console.log(currentPath);
if (extentions[currentPath]) iconName = extentions[currentPath];
});
}

return getResourceURL(`assets/mui/${icons[iconName]}`);
};
Expand Down
14 changes: 14 additions & 0 deletions tools/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const AdmZip = require('adm-zip');
const log4js = require('log4js');

const zip = new AdmZip();
const logger = log4js.getLogger();

const appName = process.env.npm_package_name;
const version = process.env.npm_package_version;
const platform = process.env.PLATFORM;
const outputFileName = `${appName}_${platform}_${version}.zip`;

zip.addLocalFolder(`build/${platform}`);
zip.writeZip(outputFileName);
logger.info(`Zip file created: ${outputFileName}`);
51 changes: 51 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,11 @@ acorn@^8.4.1, acorn@^8.5.0:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf"
integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==

adm-zip@^0.5.9:
version "0.5.9"
resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.5.9.tgz#b33691028333821c0cf95c31374c5462f2905a83"
integrity sha512-s+3fXLkeeLjZ2kLjCBwQufpI5fuN+kIGBxu6530nVQZGVol0d7Y/M88/xw9HGGUcJjKf8LutN3VPRUBq6N7Ajg==

aggregate-error@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a"
Expand Down Expand Up @@ -1072,6 +1077,11 @@ damerau-levenshtein@^1.0.7:
resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7"
integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==

date-format@^4.0.10:
version "4.0.11"
resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.11.tgz#ae0d1e069d7f0687938fd06f98c12f3a6276e526"
integrity sha512-VS20KRyorrbMCQmpdl2hg5KaOUsda1RbnsJg461FfrcyCUg+pkd0b40BSW4niQyTheww4DBXQnS7HwSrKkipLw==

debug@^2.6.9:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
Expand All @@ -1093,6 +1103,13 @@ debug@^4.0.1, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1:
dependencies:
ms "2.1.2"

debug@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
dependencies:
ms "2.1.2"

dedent@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c"
Expand Down Expand Up @@ -1658,6 +1675,11 @@ flatted@^3.1.0:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3"
integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==

flatted@^3.2.5:
version "3.2.6"
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.6.tgz#022e9218c637f9f3fc9c35ab9c9193f05add60b2"
integrity sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==

fs-extra@^10.0.0:
version "10.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.1.tgz#27de43b4320e833f6867cc044bfce29fdf0ef3b8"
Expand All @@ -1667,6 +1689,15 @@ fs-extra@^10.0.0:
jsonfile "^6.0.1"
universalify "^2.0.0"

fs-extra@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^2.0.0"

fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
Expand Down Expand Up @@ -2362,6 +2393,17 @@ log-update@^4.0.0:
slice-ansi "^4.0.0"
wrap-ansi "^6.2.0"

log4js@^6.5.2:
version "6.5.2"
resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.5.2.tgz#9ae371e5b3cb3a3a209c24686e5547f8670834e5"
integrity sha512-DXtpNtt+KDOMT7RHUDIur/WsSA3rntlUh9Zg4XCdV42wUuMmbFkl38+LZ92Z5QvQA7mD5kAVkLiBSEH/tvUB8A==
dependencies:
date-format "^4.0.10"
debug "^4.3.4"
flatted "^3.2.5"
rfdc "^1.3.0"
streamroller "^3.1.1"

loose-envify@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
Expand Down Expand Up @@ -3411,6 +3453,15 @@ stable@^0.1.8:
resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf"
integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==

streamroller@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-3.1.1.tgz#679aae10a4703acdf2740755307df0a05ad752e6"
integrity sha512-iPhtd9unZ6zKdWgMeYGfSBuqCngyJy1B/GPi/lTpwGpa3bajuX30GjUVd0/Tn/Xhg0mr4DOSENozz9Y06qyonQ==
dependencies:
date-format "^4.0.10"
debug "^4.3.4"
fs-extra "^10.1.0"

string-argv@0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da"
Expand Down

0 comments on commit 40d591f

Please sign in to comment.