Skip to content

Commit

Permalink
refactor folders structure
Browse files Browse the repository at this point in the history
  • Loading branch information
gildas-lormeau committed Feb 17, 2022
1 parent 5ffacc2 commit 550ae97
Show file tree
Hide file tree
Showing 133 changed files with 148 additions and 148 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
"sourceType": "module"
},
"ignorePatterns": [
"dist/"
"/lib/"
],
"rules": {
"indent": [
Expand Down
24 changes: 12 additions & 12 deletions build-extension.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ rollup -c rollup.config.js

rm singlefilez-extension-firefox.zip singlefilez-extension-chromium.zip singlefilez-extension-edge.zip
cp manifest.json manifest.copy.json
cp extension/core/bg/downloads.js downloads.copy.js
sed -i 's/7544745492-ig6uqhua0ads4jei52lervm1pqsi6hot/7544745492-oe3q2jjvdluks2st2smslmrofcdederh/g' extension/core/bg/downloads.js
cp src/extension/core/bg/downloads.js downloads.copy.js
sed -i 's/7544745492-ig6uqhua0ads4jei52lervm1pqsi6hot/7544745492-oe3q2jjvdluks2st2smslmrofcdederh/g' src/extension/core/bg/downloads.js

cp extension/core/bg/config.js config.copy.js
cp src/extension/core/bg/config.js config.copy.js
jq "del(.options_page,.background.persistent,.optional_permissions[0],.oauth2)" manifest.copy.json >manifest.json
sed -i 's/7544745492-ig6uqhua0ads4jei52lervm1pqsi6hot/7544745492-oe3q2jjvdluks2st2smslmrofcdederh/g' manifest.json
sed -i 's/forceWebAuthFlow: false/forceWebAuthFlow: true/g' extension/core/bg/config.js
zip -r singlefilez-extension-firefox.zip manifest.json dist _locales extension lib/single-file/vendor/zip/zip.min.js lib/single-file/vendor/zip/z-worker.js
mv config.copy.js extension/core/bg/config.js
sed -i 's/forceWebAuthFlow: false/forceWebAuthFlow: true/g' src/extension/core/bg/config.js
zip -r singlefilez-extension-firefox.zip manifest.json lib _locales src/extension src/single-file/vendor/zip/zip.min.js src/single-file/vendor/zip/z-worker.js
mv config.copy.js src/extension/core/bg/config.js

jq "del(.browser_specific_settings,.permissions[0],.permissions[1],.options_ui.browser_style)" manifest.copy.json >manifest.json
sed -i 's/7544745492-ig6uqhua0ads4jei52lervm1pqsi6hot/7544745492-oe3q2jjvdluks2st2smslmrofcdederh/g' manifest.json
zip -r singlefilez-extension-chromium.zip manifest.json dist _locales extension lib/single-file/vendor/zip/zip.min.js lib/single-file/vendor/zip/z-worker.js
zip -r singlefilez-extension-chromium.zip manifest.json lib _locales src/extension src/single-file/vendor/zip/zip.min.js src/single-file/vendor/zip/z-worker.js

cp extension/core/bg/config.js config.copy.js
cp src/extension/core/bg/config.js config.copy.js
jq "del(.browser_specific_settings,.permissions[0],.permissions[1],.options_ui.browser_style)" manifest.copy.json >manifest.json
sed -i 's/7544745492-ig6uqhua0ads4jei52lervm1pqsi6hot/7544745492-oe3q2jjvdluks2st2smslmrofcdederh/g' manifest.json
sed -i 's/forceWebAuthFlow: false/forceWebAuthFlow: true/g' extension/core/bg/config.js
sed -i 's/forceWebAuthFlow: false/forceWebAuthFlow: true/g' src/extension/core/bg/config.js
mkdir _locales.copy
cp -R _locales/* _locales.copy
rm -rf _locales/*
cp -R _locales.copy/en _locales
zip -r singlefilez-extension-edge.zip manifest.json dist _locales extension lib/single-file/vendor/zip/zip.min.js lib/single-file/vendor/zip/z-worker.js
zip -r singlefilez-extension-edge.zip manifest.json lib _locales src/extension src/single-file/vendor/zip/zip.min.js src/single-file/vendor/zip/z-worker.js
rm -rf _locales/*
mv _locales.copy/* _locales
rmdir _locales.copy
mv config.copy.js extension/core/bg/config.js
mv config.copy.js src/extension/core/bg/config.js

mv manifest.copy.json manifest.json
mv downloads.copy.js extension/core/bg/downloads.js
mv downloads.copy.js src/extension/core/bg/downloads.js
14 changes: 7 additions & 7 deletions cli/back-ends/common/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@
const fs = require("fs");

const SCRIPTS = [
"dist/infobar.js",
"dist/single-file-bootstrap.js"
"lib/infobar.js",
"lib/single-file-bootstrap.js"
];

const INDEX_SCRIPTS = [
"dist/single-file.js"
"lib/single-file.js"
];

const WEB_SCRIPTS = [
"/dist/web/hooks/hooks-web.js",
"/dist/web/hooks/hooks-frames-web.js",
"/dist/web/infobar-web.js",
"lib/single-file/vendor/zip/zip.min.js"
"/lib/web/hooks/hooks-web.js",
"/lib/web/hooks/hooks-frames-web.js",
"/lib/web/infobar-web.js",
"/src/single-file/vendor/zip/zip.min.js"
];

exports.get = async options => {
Expand Down
1 change: 0 additions & 1 deletion dist/extension-background.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/extension-core.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/infobar.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/single-file-bootstrap.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/single-file-frames.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/single-file.js

This file was deleted.

18 changes: 0 additions & 18 deletions extension/core/bg/background.html

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions lib/extension-background.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions lib/extension-core.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions lib/infobar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions lib/single-file-bootstrap.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/single-file-frames.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/single-file.js

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
48 changes: 24 additions & 24 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"author": "Gildas Lormeau",
"homepage_url": "https://github.com/gildas-lormeau/SingleFileZ",
"icons": {
"16": "extension/ui/resources/icon_16.png",
"48": "extension/ui/resources/icon_48.png",
"64": "extension/ui/resources/icon_64.png",
"128": "extension/ui/resources/icon_128.png"
"16": "src/extension/ui/resources/icon_16.png",
"48": "src/extension/ui/resources/icon_48.png",
"64": "src/extension/ui/resources/icon_64.png",
"128": "src/extension/ui/resources/icon_128.png"
},
"version": "1.0.56",
"description": "__MSG_extensionDescription__",
Expand All @@ -17,9 +17,9 @@
],
"run_at": "document_start",
"js": [
"dist/chrome-browser-polyfill.js",
"dist/single-file-frames.js",
"dist/extension-frames.js"
"lib/chrome-browser-polyfill.js",
"lib/single-file-frames.js",
"lib/extension-frames.js"
],
"all_frames": true,
"match_about_blank": true
Expand All @@ -30,36 +30,36 @@
],
"run_at": "document_start",
"js": [
"dist/chrome-browser-polyfill.js",
"dist/single-file-bootstrap.js",
"dist/extension-bootstrap.js",
"dist/web/infobar-web.js"
"lib/chrome-browser-polyfill.js",
"lib/single-file-bootstrap.js",
"lib/extension-bootstrap.js",
"lib/web/infobar-web.js"
]
}
],
"background": {
"page": "extension/core/bg/background.html",
"page": "src/extension/core/bg/background.html",
"persistent": false
},
"options_page": "extension/ui/pages/options.html",
"options_page": "src/extension/ui/pages/options.html",
"sidebar_action": {
"browser_style": true,
"default_title": "SingleFileZ",
"default_panel": "extension/ui/pages/panel.html",
"default_icon": "extension/ui/resources/icon_128.png",
"default_panel": "src/extension/ui/pages/panel.html",
"default_icon": "src/extension/ui/resources/icon_128.png",
"open_at_install": false
},
"options_ui": {
"browser_style": true,
"page": "extension/ui/pages/options.html",
"page": "src/extension/ui/pages/options.html",
"open_in_tab": false
},
"browser_action": {
"default_icon": {
"16": "extension/ui/resources/icon_16.png",
"48": "extension/ui/resources/icon_48.png",
"64": "extension/ui/resources/icon_64.png",
"128": "extension/ui/resources/icon_128.png"
"16": "src/extension/ui/resources/icon_16.png",
"48": "src/extension/ui/resources/icon_48.png",
"64": "src/extension/ui/resources/icon_64.png",
"128": "src/extension/ui/resources/icon_128.png"
},
"default_title": "__MSG_buttonDefaultTooltip__"
},
Expand All @@ -78,9 +78,9 @@
}
},
"web_accessible_resources": [
"dist/web/hooks/hooks-web.js",
"dist/web/hooks/hooks-frames-web.js",
"dist/web/infobar-web.js"
"lib/web/hooks/hooks-web.js",
"lib/web/hooks/hooks-frames-web.js",
"lib/web/infobar-web.js"
],
"oauth2": {
"client_id": "7544745492-ig6uqhua0ads4jei52lervm1pqsi6hot.apps.googleusercontent.com",
Expand Down Expand Up @@ -108,7 +108,7 @@
"id": "{e4db92bc-3213-493d-bd9e-5ff2afc72da6}"
}
},
"devtools_page": "extension/core/devtools/devtools.html",
"devtools_page": "src/extension/core/devtools/devtools.html",
"incognito": "spanning",
"manifest_version": 2,
"default_locale": "en"
Expand Down
60 changes: 30 additions & 30 deletions rollup.config.dev.js
Original file line number Diff line number Diff line change
@@ -1,110 +1,110 @@
export default [{
input: ["lib/single-file/index.js"],
input: ["src/single-file/index.js"],
output: [{
file: "dist/single-file.js",
file: "lib/single-file.js",
format: "umd",
name: "singlefile",
plugins: []
}]
}, {
input: ["lib/single-file/single-file-frames.js"],
input: ["src/single-file/single-file-frames.js"],
output: [{
file: "dist/single-file-frames.js",
file: "lib/single-file-frames.js",
format: "umd",
name: "singlefile",
plugins: []
}]
}, {
input: ["lib/single-file/single-file-bootstrap.js"],
input: ["src/single-file/single-file-bootstrap.js"],
output: [{
file: "dist/single-file-bootstrap.js",
file: "lib/single-file-bootstrap.js",
format: "umd",
name: "singlefileBootstrap",
plugins: []
}]
}, {
input: ["common/ui/content/content-infobar.js"],
input: ["src/common/ui/content/content-infobar.js"],
output: [{
file: "dist/infobar.js",
file: "lib/infobar.js",
format: "umd",
name: "infobar",
plugins: []
}]
}, {
input: ["extension/core/content/content-bootstrap.js"],
input: ["src/extension/core/content/content-bootstrap.js"],
output: [{
file: "dist/extension-bootstrap.js",
file: "lib/extension-bootstrap.js",
format: "iife",
plugins: []
}]
}, {
input: ["extension/core/content/content-frames.js"],
input: ["src/extension/core/content/content-frames.js"],
output: [{
file: "dist/extension-frames.js",
file: "lib/extension-frames.js",
format: "iife",
plugins: []
}]
}, {
input: ["extension/index.js"],
input: ["src/extension/index.js"],
output: [{
file: "dist/extension-core.js",
file: "lib/extension-core.js",
format: "umd",
name: "extension",
plugins: []
}]
}, {
input: ["extension/core/content/content.js"],
input: ["src/extension/core/content/content.js"],
output: [{
file: "dist/extension.js",
file: "lib/extension.js",
format: "iife",
plugins: []
}]
}, {
input: ["lib/single-file/processors/hooks/content/content-hooks-web.js"],
input: ["src/single-file/processors/hooks/content/content-hooks-web.js"],
output: [{
file: "dist/web/hooks/hooks-web.js",
file: "lib/web/hooks/hooks-web.js",
format: "iife",
plugins: []
}]
}, {
input: ["lib/single-file/processors/hooks/content/content-hooks-frames-web.js"],
input: ["src/single-file/processors/hooks/content/content-hooks-frames-web.js"],
output: [{
file: "dist/web/hooks/hooks-frames-web.js",
file: "lib/web/hooks/hooks-frames-web.js",
format: "iife",
plugins: []
}]
}, {
input: ["common/ui/content/content-infobar-web.js"],
input: ["src/common/ui/content/content-infobar-web.js"],
output: [{
file: "dist/web/infobar-web.js",
file: "lib/web/infobar-web.js",
format: "iife",
plugins: []
}]
}, {
input: ["extension/lib/vendor/protobuf/protobuf.js"],
input: ["src/extension/lib/vendor/protobuf/protobuf.js"],
output: [{
file: "dist/protobuf.js",
file: "lib/protobuf.js",
format: "iife",
plugins: []
}]
}, {
input: ["extension/lib/single-file/browser-polyfill/chrome-browser-polyfill.js"],
input: ["src/extension/lib/single-file/browser-polyfill/chrome-browser-polyfill.js"],
output: [{
file: "dist/chrome-browser-polyfill.js",
file: "lib/chrome-browser-polyfill.js",
format: "iife",
plugins: []
}]
}, {
input: ["extension/core/bg/index.js"],
input: ["src/extension/core/bg/index.js"],
output: [{
file: "dist/extension-background.js",
file: "lib/extension-background.js",
format: "iife",
plugins: []
}]
}, {
input: ["extension/lib/single-file/background.js"],
input: ["src/extension/lib/single-file/background.js"],
output: [{
file: "dist/single-file-background.js",
file: "lib/single-file-background.js",
format: "iife",
plugins: []
}]
Expand Down
Loading

0 comments on commit 550ae97

Please sign in to comment.