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 c7cb588 commit 41ca36a
Show file tree
Hide file tree
Showing 165 changed files with 249 additions and 305 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
32 changes: 16 additions & 16 deletions build-extension.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
#!/bin/sh
npx rollup -c rollup.config.js

zip -r singlefile-extension-source.zip manifest.json package.json _locales extension common lib rollup*.js .eslintrc.js build-extension.sh
zip -r singlefile-extension-source.zip manifest.json package.json _locales src rollup*.js .eslintrc.js build-extension.sh

rm singlefile-extension-firefox.zip singlefile-extension-chromium.zip singlefile-extension-edge.zip
cp manifest.json manifest.copy.json
cp extension/core/bg/downloads.js downloads.copy.js
sed -i 's/207618107333-3pj2pmelhnl4sf3rpctghs9cean3q8nj/207618107333-7tjs1im1pighftpoepea2kvkubnfjj44/g' extension/core/bg/downloads.js
cp src/extension/core/bg/downloads.js downloads.copy.js
sed -i 's/207618107333-3pj2pmelhnl4sf3rpctghs9cean3q8nj/207618107333-7tjs1im1pighftpoepea2kvkubnfjj44/g' src/extension/core/bg/downloads.js

cp extension/core/bg/config.js config.copy.js
cp extension/core/bg/companion.js companion.copy.js
cp src/extension/core/bg/config.js config.copy.js
cp src/extension/core/bg/companion.js companion.copy.js
jq "del(.options_page,.background.persistent,.optional_permissions[0],.permissions[3],.oauth2)" manifest.copy.json > manifest.json
sed -i 's/207618107333-3pj2pmelhnl4sf3rpctghs9cean3q8nj/207618107333-7tjs1im1pighftpoepea2kvkubnfjj44/g' manifest.json
sed -i 's/forceWebAuthFlow: false/forceWebAuthFlow: true/g' extension/core/bg/config.js
sed -i 's/enabled: true/enabled: false/g' extension/core/bg/companion.js
zip -r singlefile-extension-firefox.zip manifest.json dist _locales extension
mv config.copy.js extension/core/bg/config.js
mv companion.copy.js extension/core/bg/companion.js
sed -i 's/forceWebAuthFlow: false/forceWebAuthFlow: true/g' src/extension/core/bg/config.js
sed -i 's/enabled: true/enabled: false/g' src/extension/core/bg/companion.js
zip -r singlefile-extension-firefox.zip manifest.json lib _locales src/extension
mv config.copy.js src/extension/core/bg/config.js
mv companion.copy.js src/extension/core/bg/companion.js

jq "del(.browser_specific_settings,.permissions[0],.permissions[1],.options_ui.browser_style)" manifest.copy.json > manifest.json
sed -i 's/207618107333-3pj2pmelhnl4sf3rpctghs9cean3q8nj/207618107333-7tjs1im1pighftpoepea2kvkubnfjj44/g' manifest.json
zip -r singlefile-extension-chromium.zip manifest.json dist _locales extension
zip -r singlefile-extension-chromium.zip manifest.json lib _locales src/extension

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/207618107333-3pj2pmelhnl4sf3rpctghs9cean3q8nj/207618107333-7tjs1im1pighftpoepea2kvkubnfjj44/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 singlefile-extension-edge.zip manifest.json dist _locales extension
zip -r singlefile-extension-edge.zip manifest.json lib _locales src/extension
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
12 changes: 6 additions & 6 deletions cli/back-ends/common/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@
const fs = require("fs");

const SCRIPTS = [
"dist/infobar.js"
"lib/infobar.js"
];

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

const WEB_SCRIPTS = [
"/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"
];

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.

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

This file was deleted.

56 changes: 0 additions & 56 deletions extension/lib/woleet/woleet.js

This file was deleted.

78 changes: 0 additions & 78 deletions extension/ui/pages/editor.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.
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.
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ table {
if (initScriptContentMatch && initScriptContentMatch[0]) {
initScriptContent = initScriptContentMatch[0];
}
content = content.replace(/<script data-template-shadow-root.*<\/script>/g, "<script data-template-shadow-root src=/dist/web/editor/editor-init-web.js></script>");
content = content.replace(/<script data-template-shadow-root.*<\/script>/g, "<script data-template-shadow-root src=/lib/web/editor/editor-init-web.js></script>");
const contentDocument = (new DOMParser()).parseFromString(content, "text/html");
if (detectSavedPage(contentDocument)) {
if (contentDocument.doctype) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 41ca36a

Please sign in to comment.