Skip to content

Commit

Permalink
build: open-source release
Browse files Browse the repository at this point in the history
  • Loading branch information
gerwld committed Mar 3, 2024
1 parent 5036ae0 commit db4adcf
Show file tree
Hide file tree
Showing 58 changed files with 30 additions and 5,657 deletions.
Binary file removed assets/icons/.DS_Store
Binary file not shown.
Binary file removed assets/img/.DS_Store
Binary file not shown.
38 changes: 27 additions & 11 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
// - This file is part of IGPlus Extension
// <https://github.com/gerwld/IGPlus-extension/blob/main/README.md>,
// - Copyright (C) 2023-present IGPlus Extension
// -
// - IGPlus Extension is a software: you can redistribute it, but you are not allowed to modify it under the terms of the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0) License.
// -
// - IGPlus Extension is distributed in the hope that it will be useful,
// - but WITHOUT ANY WARRANTY; without even the implied warranty of
// - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// - Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0) License for more details.
// -
// - You should have received a copy of the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0) License
// - along with IGPlus Extension. If not, see <https://creativecommons.org/licenses/by-nc-nd/4.0/>.


import gulp from 'gulp';
import svgmin from 'gulp-svgmin';
import autoprefix from 'gulp-autoprefixer';
Expand All @@ -8,6 +23,7 @@ import insert from 'gulp-insert';
import uglify from 'gulp-uglify';
import htmlmin from "gulp-htmlmin";
import rename from "gulp-rename";
import concat from "gulp-concat";
import filter from 'gulp-filter';
import replace from "gulp-replace";
import zip from 'gulp-zip';
Expand Down Expand Up @@ -35,40 +51,40 @@ const COPYRIGHT = `// - This file is part of IGPlus Extension

//## Minify Images ##//
task('minifyImg', async function () {
src(['./assets/img/*.svg', './assets/img/**/*.svg'])
src(['./src/assets/img/*.svg', './src/assets/img/**/*.svg'])
.pipe(svgmin())
.pipe(gulpFlatten({ includeParents: 4 }))
.pipe(dest('./public/chromium/assets/img/'))
.pipe(dest('./public/firefox/assets/img/'))

src(['./assets/img/*.png', './assets/img/**/*.png'])
src(['./src/assets/img/*.png', './src/assets/img/**/*.png'])
// .pipe(imagemin())
.pipe(gulpFlatten({ includeParents: 4 }))
.pipe(dest('./public/chromium/assets/img/'))
.pipe(dest('./public/firefox/assets/img/'))

src(['./assets/icons/*.png', './assets/icons/**/*.png'])
src(['./src/assets/icons/*.png', './src/assets/icons/**/*.png'])
// .pipe(imagemin())
.pipe(gulpFlatten({ includeParents: 4 }))
.pipe(dest('./public/chromium/assets/icons/'))
.pipe(dest('./public/firefox/assets/icons/'))

src(['./assets/img/**/*.md'])
src(['./src/assets/img/**/*.md'])
.pipe(gulpFlatten({ includeParents: 4 }))
.pipe(dest('./public/chromium/assets/img/'))
.pipe(dest('./public/firefox/assets/img/'))
});

//## Minify CSS ##//
task('minifyCSS', async function () {
src(['./assets/graphs/*.css', './assets/graphs/**/*.css', './assets/graphs/**/**/*.css'])
src(['./src/assets/graphs/*.css', './src/assets/graphs/**/*.css', './src/assets/graphs/**/**/*.css'])
.pipe(cleanCSS({ compatibility: 'ie8' }))
.pipe(autoprefix('last 2 versions'))
.pipe(insert.prepend(`/*\n${COPYRIGHT}*/\n\n`))
.pipe(gulpFlatten({ includeParents: 4 }))
.pipe(dest('./public/firefox/assets/graphs/'))

src(['./assets/graphs/*.css', './assets/graphs/**/*.css', './assets/graphs/**/**/*.css'])
src(['./src/assets/graphs/*.css', './src/assets/graphs/**/*.css', './src/assets/graphs/**/**/*.css'])
.pipe(replace('moz-extension://', 'chrome-extension://'))
.pipe(cleanCSS({ compatibility: 'ie8' }))
.pipe(autoprefix('last 2 versions'))
Expand All @@ -79,7 +95,7 @@ task('minifyCSS', async function () {

//## Minify JS ##//
task('minifyJS', async function () {
src(['./assets/js/*.js'])
src(['./src/assets/js/*.js'])
.pipe(uglify())
.pipe(insert.prepend(COPYRIGHT))
.pipe(gulpFlatten({ includeParents: 4 }))
Expand All @@ -89,7 +105,7 @@ task('minifyJS', async function () {

//## Minify HTML ##//
task('minifyHTML', async function () {
src(['./content/*.html'])
src(['./src/content/*.html'])
.pipe(htmlmin({ collapseWhitespace: true }))
.pipe(insert.prepend(`<!--\n${COPYRIGHT}-->\n\n`))
.pipe(gulpFlatten({ includeParents: 4 }))
Expand All @@ -105,10 +121,10 @@ task('addOther', async function () {
.pipe(dest('./public/firefox'))
.pipe(dest('./public'));

src('./manifest-chrome.json').pipe(rename("manifest.json")).pipe(dest('./public/chromium'));
src('./manifest-firefox.json').pipe(rename("manifest.json")).pipe(dest('./public/firefox'));
src('./src/manifest-chrome.json').pipe(rename("manifest.json")).pipe(dest('./public/chromium'));
src('./src/manifest-firefox.json').pipe(rename("manifest.json")).pipe(dest('./public/firefox'));

src(['_locales/**/*'])
src(['./src/_locales/**/*'])
.pipe(dest('./public/chromium/_locales'))
.pipe(dest('./public/firefox/_locales'))
});
Expand Down
4 changes: 1 addition & 3 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
{
"matches": [
"https://www.instagram.com/*",
"https://www.instagram.com/",
"https://instagram.com/*",
"https://instagram.com/"
"https://instagram.com/*"
],
"js": ["/assets/js/content.js"],
"css": ["/assets/graphs/main.css"],
Expand Down
Loading

0 comments on commit db4adcf

Please sign in to comment.