mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-01 18:31:24 +01:00
Advanced stats for patreon supporters (#1222)
* auth works * Works after review. * switched to auth flow * all works well in chrome * all works well in chrome and firefox * translations harmonized * translations harmonized * website translations * Translations harmonized. * Everything kinda works * Almost works * all works * all works * all works #2 * Streamline premium analytics range handling * Restore premium analytics selection flow * Fix analytics zoom interactions * Add per-section expansion controls to premium analytics * Adjust map legend visibility for premium analytics * Add missing country synonyms for premium map * Remove legacy premium badge overlay * Polish premium analytics controls for light theme * Refresh map legend when toggling sections * Improve light-mode styling for range selectors * Fix map mode switching regression * Fix for panel expand * Typo fix * webpack fix * before next steps. * split, zero-buckets * bucket size indicated on UI * all works * first/last toggle * breadcrumbs * release
This commit is contained in:
1 parent
fb46b07db6
commit
40fda6dd32
174 files changed
+20235
-2619
No files matched your search
+52
-39
@@ -1,9 +1,9 @@
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const CopyPlugin = require("copy-webpack-plugin");
|
||||
const FileManagerPlugin = require("filemanager-webpack-plugin");
|
||||
|
||||
const extensionVersion = process.env.npm_package_version.replace('-', '.');
|
||||
const entries = ["ryd.content-script", "ryd.background", "popup"];
|
||||
const extensionVersion = process.env.npm_package_version.replace("-", ".");
|
||||
const entries = ["ryd.content-script", "ryd.background", "popup", "ryd.changelog"];
|
||||
|
||||
const ignorePatterns = [
|
||||
"**/manifest-**",
|
||||
@@ -16,9 +16,9 @@ const ignorePatterns = [
|
||||
const manifestTransform = (content, filename) => {
|
||||
const filteredContent = content
|
||||
.toString()
|
||||
.split('\n')
|
||||
.filter(str => !str.trimStart().startsWith("//"))
|
||||
.join('\n');
|
||||
.split("\n")
|
||||
.filter((str) => !str.trimStart().startsWith("//"))
|
||||
.join("\n");
|
||||
|
||||
const manifestData = JSON.parse(filteredContent);
|
||||
manifestData.version = extensionVersion;
|
||||
@@ -26,24 +26,56 @@ const manifestTransform = (content, filename) => {
|
||||
};
|
||||
|
||||
const i18nTransform = (content, filename) => {
|
||||
if (!filename.endsWith('messages.json'))
|
||||
return content;
|
||||
if (!filename.endsWith("messages.json")) return content;
|
||||
|
||||
return content.toString().replace(/__RYD_VERSION__/g, extensionVersion);
|
||||
};
|
||||
|
||||
class MirrorJsOutputsPlugin {
|
||||
constructor(targetDirs) {
|
||||
this.targetDirs = targetDirs;
|
||||
}
|
||||
|
||||
apply(compiler) {
|
||||
compiler.hooks.afterEmit.tapPromise("MirrorJsOutputsPlugin", async () => {
|
||||
const { promises: fsp } = fs;
|
||||
const outputPath = compiler.options.output.path;
|
||||
const entries = await fsp.readdir(outputPath).catch(() => []);
|
||||
const jsAssets = entries.filter((name) => name.endsWith(".js"));
|
||||
|
||||
await Promise.all(
|
||||
this.targetDirs.map(async (dir) => {
|
||||
const targetDir = path.join(outputPath, dir);
|
||||
await fsp.mkdir(targetDir, { recursive: true });
|
||||
|
||||
const existingFiles = await fsp.readdir(targetDir).catch(() => []);
|
||||
await Promise.all(
|
||||
existingFiles
|
||||
.filter((file) => file.endsWith(".js"))
|
||||
.map((file) => fsp.rm(path.join(targetDir, file), { force: true }))
|
||||
);
|
||||
|
||||
await Promise.all(
|
||||
jsAssets.map((asset) =>
|
||||
fsp.copyFile(path.join(outputPath, asset), path.join(targetDir, path.basename(asset))),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
entry: Object.fromEntries(
|
||||
entries.map((entry) => [
|
||||
entry,
|
||||
path.join(__dirname, "./Extensions/combined/", `${entry}.js`),
|
||||
]),
|
||||
entries.map((entry) => [entry, path.join(__dirname, "./Extensions/combined/", `${entry}.js`)]),
|
||||
),
|
||||
output: {
|
||||
filename: "[name].js",
|
||||
path: path.resolve(__dirname, "Extensions/combined/dist"),
|
||||
clean: true,
|
||||
},
|
||||
cache: false,
|
||||
optimization: {
|
||||
minimize: false,
|
||||
},
|
||||
@@ -60,12 +92,12 @@ module.exports = {
|
||||
globOptions: {
|
||||
ignore: ignorePatterns,
|
||||
},
|
||||
transform: i18nTransform
|
||||
transform: i18nTransform,
|
||||
},
|
||||
{
|
||||
from: "./Extensions/combined/manifest-chrome.json",
|
||||
to: "./chrome/manifest.json",
|
||||
transform: manifestTransform
|
||||
transform: manifestTransform,
|
||||
},
|
||||
{
|
||||
from: "./Extensions/combined",
|
||||
@@ -73,12 +105,12 @@ module.exports = {
|
||||
globOptions: {
|
||||
ignore: ignorePatterns,
|
||||
},
|
||||
transform: i18nTransform
|
||||
transform: i18nTransform,
|
||||
},
|
||||
{
|
||||
from: "./Extensions/combined/manifest-firefox.json",
|
||||
to: "./firefox/manifest.json",
|
||||
transform: manifestTransform
|
||||
transform: manifestTransform,
|
||||
},
|
||||
{
|
||||
from: "./Extensions/combined",
|
||||
@@ -86,38 +118,19 @@ module.exports = {
|
||||
globOptions: {
|
||||
ignore: ignorePatterns,
|
||||
},
|
||||
transform: i18nTransform
|
||||
transform: i18nTransform,
|
||||
},
|
||||
{
|
||||
from: "./Extensions/combined/manifest-safari.json",
|
||||
to: "./safari/manifest.json",
|
||||
transform: manifestTransform
|
||||
transform: manifestTransform,
|
||||
},
|
||||
],
|
||||
}),
|
||||
new FileManagerPlugin({
|
||||
events: {
|
||||
onEnd: {
|
||||
copy: [
|
||||
{
|
||||
source: "./Extensions/combined/dist/**.js",
|
||||
destination: "./Extensions/combined/dist/firefox/",
|
||||
},
|
||||
{
|
||||
source: "./Extensions/combined/dist/**.js",
|
||||
destination: "./Extensions/combined/dist/chrome/",
|
||||
},
|
||||
{
|
||||
source: "./Extensions/combined/dist/**.js",
|
||||
destination: "./Extensions/combined/dist/safari/",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}),
|
||||
new MirrorJsOutputsPlugin(["chrome", "firefox", "safari"]),
|
||||
],
|
||||
experiments: {
|
||||
topLevelAwait: true,
|
||||
},
|
||||
devtool: 'inline-source-map',
|
||||
devtool: "inline-source-map",
|
||||
};
|
||||
Reference in new issue
Block a user