Commit 75d51afa authored by FlafyDev's avatar FlafyDev
Browse files

webcord-vencord: init at 4.1.1



Co-authored-by: default avatarNotAShelf <itsashelf@gmail.com>
parent 1a41d761
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
diff --git a/sources/code/common/main.ts b/sources/code/common/main.ts
index 3936ee0..bd745ef 100644
--- a/sources/code/common/main.ts
+++ b/sources/code/common/main.ts
@@ -358,6 +358,7 @@ app.userAgentFallback = getUserAgent(process.versions.chrome, userAgent.mobile,
 const singleInstance = app.requestSingleInstanceLock();
 
 function main(): void {
+  session.defaultSession.loadExtension("@vencord@");
   if (overwriteMain) {
     // Execute flag-specific functions for ready application.
     overwriteMain();
+18 −0
Original line number Diff line number Diff line
{ webcord
, substituteAll
, callPackage
, lib
}:
webcord.overrideAttrs (old: {
  patches = (old.patches or [ ]) ++ [
    (substituteAll {
      src = ./add-extension.patch;
      vencord = callPackage ./vencord-web-extension { };
    })
  ];

  meta = with lib; old.meta // {
    description = "Webcord with Vencord web extension";
    maintainers = with maintainers; [ FlafyDev NotAShelf ];
  };
})
+60 −0
Original line number Diff line number Diff line
{ buildNpmPackage
, fetchFromGitHub
, lib
, substituteAll
, esbuild
, buildGoModule
}:
buildNpmPackage rec {
  pname = "vencord-web-extension";
  version = "1.1.6";

  src = fetchFromGitHub {
    owner = "Vendicated";
    repo = "Vencord";
    rev = "v${version}";
    sha256 = "sha256-V9fzSoRqVlk9QqpzzR2x+aOwGHhQhQiSjXZWMC0uLnQ=";
  };

  ESBUILD_BINARY_PATH = lib.getExe (esbuild.override {
    buildGoModule = args: buildGoModule (args // rec {
      version = "0.15.18";
      src = fetchFromGitHub {
        owner = "evanw";
        repo = "esbuild";
        rev = "v${version}";
        hash = "sha256-b9R1ML+pgRg9j2yrkQmBulPuLHYLUQvW+WTyR/Cq6zE=";
      };
      vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
    });
  });

  # Supresses an error about esbuild's version.
  npmRebuildFlags = [ "|| true" ];

  npmDepsHash = "sha256-jKSdeyQ8oHw7ZGby0XzDg4O8mtH276ykVuBcw7dU/Ls=";
  npmFlags = [ "--legacy-peer-deps" ];
  npmBuildScript = "buildWeb";

  prePatch = ''
    cp ${./package-lock.json} ./package-lock.json
  '';

  patches = [
    (substituteAll {
      src = ./replace-git.patch;
      inherit version;
    })
  ];

  installPhase = ''
    cp -r dist/extension-unpacked $out
  '';

  meta = with lib; {
    description = "Vencord web extension";
    homepage = "https://github.com/Vendicated/Vencord";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ FlafyDev NotAShelf ];
  };
}
+4983 −0

File added.

Preview size limit exceeded, changes collapsed.

+26 −0
Original line number Diff line number Diff line
diff --git a/scripts/build/common.mjs b/scripts/build/common.mjs
index 7ff599a..85b3bfa 100644
--- a/scripts/build/common.mjs
+++ b/scripts/build/common.mjs
@@ -24,7 +24,7 @@ import { promisify } from "util";
 
 export const watch = process.argv.includes("--watch");
 export const isStandalone = JSON.stringify(process.argv.includes("--standalone"));
-export const gitHash = execSync("git rev-parse --short HEAD", { encoding: "utf-8" }).trim();
+export const gitHash = "@version@";
 export const banner = {
     js: `
 // Vencord ${gitHash}
@@ -124,11 +124,7 @@ export const gitRemotePlugin = {
             namespace: "git-remote", path: args.path
         }));
         build.onLoad({ filter, namespace: "git-remote" }, async () => {
-            const res = await promisify(exec)("git remote get-url origin", { encoding: "utf-8" });
-            const remote = res.stdout.trim()
-                .replace("https://github.com/", "")
-                .replace("git@github.com:", "")
-                .replace(/.git$/, "");
+            const remote = "Vendicated/Vencord";
 
             return { contents: `export default "${remote}"` };
         });
Loading