Skip to content

Commit

Permalink
fix: env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
pnd280 committed Oct 19, 2024
1 parent 1e47a07 commit 63a1df6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .env.chromium
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TARGET_BROWSER=chrome
VITE_TARGET_BROWSER=chrome
2 changes: 1 addition & 1 deletion .env.gecko
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TARGET_BROWSER=firefox
VITE_TARGET_BROWSER=firefox
2 changes: 2 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

---

Complexity is going freemium soon, offering access to more advanced features. Features up to the official transition will remain free forever. Read more about it [here](https://github.com/pnd280/complexity/issues/19).

Consider giving a star ⭐ on [Github](https://github.com/pnd280/complexity).

💖 Support the development via [Ko-fi](https://ko-fi.com/pnd280) or [Paypal](https://paypal.me/pnd280).
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function removeUnwantedFiles(cb) {
function zip() {
const require = createRequire(import.meta.url);
const manifest = require("./package.json");
const zipFileName = `${manifest.name.replaceAll(" ", "-")}-${manifest.version}-${process.env.TARGET_BROWSER}.zip`;
const zipFileName = `${manifest.name.replaceAll(" ", "-")}-${manifest.version}-${process.env.VITE_TARGET_BROWSER}.zip`;

return gulp
.src("dist/**")
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "complexity",
"displayName": "Complexity - Perplexity AI Supercharged",
"version": "0.0.4.0",
"version": "0.0.4.1",
"author": "pnd280",
"description": "⚡ Supercharge your Perplexity AI",
"type": "module",
Expand Down
9 changes: 5 additions & 4 deletions src/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ const env = typeof process === "undefined" ? import.meta.env : process.env;

const envSchema = z.object({
NODE_ENV: z.enum(["development", "production", "test"]).optional(),
TARGET_BROWSER: z.enum(["chrome", "firefox"]).optional().default("chrome"),
VITE_TARGET_BROWSER: z
.enum(["chrome", "firefox"])
.optional()
.default("chrome"),
DEV: z.string().or(z.boolean()).optional(),
VITE_METADATA_BRANCH: z.string().optional().default("alpha"),
});

const parsedEnv = envSchema.parse(env);

const appConfig = {
BROWSER: parsedEnv.TARGET_BROWSER,
BROWSER: parsedEnv.VITE_TARGET_BROWSER,
IS_DEV: Boolean(parsedEnv.DEV) || parsedEnv.NODE_ENV === "development",
METADATA_BRANCH: parsedEnv.VITE_METADATA_BRANCH,
"perplexity-ai": {
globalMatches: ["https://www.perplexity.ai/*", "https://perplexity.ai/*"],
globalExcludeMatches: [
Expand Down

0 comments on commit 63a1df6

Please sign in to comment.