@solongate/proxy 0.28.6 → 0.28.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +28 -12
  2. package/dist/init.js +28 -12
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -743,26 +743,42 @@ GROQ_API_KEY=gsk_your_groq_key_here
743
743
  console.log(` Created .env`);
744
744
  console.log(` \u2192 Set your API key in .env (get one at https://dashboard.solongate.com)`);
745
745
  console.log("");
746
+ } else {
747
+ const existingEnv = readFileSync4(envPath, "utf-8");
748
+ if (!existingEnv.includes("SOLONGATE_API_KEY")) {
749
+ const separator = existingEnv.endsWith("\n") ? "" : "\n";
750
+ const appendContent = `${separator}
751
+ # SolonGate API key \u2014 get one at https://dashboard.solongate.com
752
+ SOLONGATE_API_KEY=sg_live_your_key_here
753
+ `;
754
+ writeFileSync2(envPath, existingEnv + appendContent);
755
+ console.log(` Updated .env (added SOLONGATE_API_KEY)`);
756
+ console.log(` \u2192 Set your API key in .env (get one at https://dashboard.solongate.com)`);
757
+ console.log("");
758
+ }
746
759
  }
747
760
  const gitignorePath = resolve3(".gitignore");
761
+ const requiredEntries = [
762
+ { pattern: ".env", lines: ".env\n.env.local" },
763
+ { pattern: ".mcp.json", lines: ".mcp.json" },
764
+ { pattern: ".solongate", lines: ".solongate/" }
765
+ ];
748
766
  if (existsSync4(gitignorePath)) {
749
767
  let gitignore = readFileSync4(gitignorePath, "utf-8");
750
- let updated = false;
751
- if (!gitignore.includes(".env")) {
752
- gitignore = gitignore.trimEnd() + "\n.env\n.env.local\n";
753
- updated = true;
754
- }
755
- if (!gitignore.includes(".mcp.json")) {
756
- gitignore = gitignore.trimEnd() + "\n.mcp.json\n";
757
- updated = true;
768
+ const added = [];
769
+ for (const entry of requiredEntries) {
770
+ if (!gitignore.includes(entry.pattern)) {
771
+ gitignore = gitignore.trimEnd() + "\n" + entry.lines + "\n";
772
+ added.push(entry.pattern);
773
+ }
758
774
  }
759
- if (updated) {
775
+ if (added.length > 0) {
760
776
  writeFileSync2(gitignorePath, gitignore);
761
- console.log(` Updated .gitignore (added .env + .mcp.json)`);
777
+ console.log(` Updated .gitignore (added ${added.join(", ")})`);
762
778
  }
763
779
  } else {
764
- writeFileSync2(gitignorePath, ".env\n.env.local\n.mcp.json\nnode_modules/\n");
765
- console.log(` Created .gitignore (with .env and .mcp.json excluded)`);
780
+ writeFileSync2(gitignorePath, ".env\n.env.local\n.mcp.json\n.solongate/\nnode_modules/\n");
781
+ console.log(` Created .gitignore (with .env, .mcp.json, .solongate/ excluded)`);
766
782
  }
767
783
  }
768
784
  async function main() {
package/dist/init.js CHANGED
@@ -326,26 +326,42 @@ GROQ_API_KEY=gsk_your_groq_key_here
326
326
  console.log(` Created .env`);
327
327
  console.log(` \u2192 Set your API key in .env (get one at https://dashboard.solongate.com)`);
328
328
  console.log("");
329
+ } else {
330
+ const existingEnv = readFileSync(envPath, "utf-8");
331
+ if (!existingEnv.includes("SOLONGATE_API_KEY")) {
332
+ const separator = existingEnv.endsWith("\n") ? "" : "\n";
333
+ const appendContent = `${separator}
334
+ # SolonGate API key \u2014 get one at https://dashboard.solongate.com
335
+ SOLONGATE_API_KEY=sg_live_your_key_here
336
+ `;
337
+ writeFileSync(envPath, existingEnv + appendContent);
338
+ console.log(` Updated .env (added SOLONGATE_API_KEY)`);
339
+ console.log(` \u2192 Set your API key in .env (get one at https://dashboard.solongate.com)`);
340
+ console.log("");
341
+ }
329
342
  }
330
343
  const gitignorePath = resolve(".gitignore");
344
+ const requiredEntries = [
345
+ { pattern: ".env", lines: ".env\n.env.local" },
346
+ { pattern: ".mcp.json", lines: ".mcp.json" },
347
+ { pattern: ".solongate", lines: ".solongate/" }
348
+ ];
331
349
  if (existsSync(gitignorePath)) {
332
350
  let gitignore = readFileSync(gitignorePath, "utf-8");
333
- let updated = false;
334
- if (!gitignore.includes(".env")) {
335
- gitignore = gitignore.trimEnd() + "\n.env\n.env.local\n";
336
- updated = true;
337
- }
338
- if (!gitignore.includes(".mcp.json")) {
339
- gitignore = gitignore.trimEnd() + "\n.mcp.json\n";
340
- updated = true;
351
+ const added = [];
352
+ for (const entry of requiredEntries) {
353
+ if (!gitignore.includes(entry.pattern)) {
354
+ gitignore = gitignore.trimEnd() + "\n" + entry.lines + "\n";
355
+ added.push(entry.pattern);
356
+ }
341
357
  }
342
- if (updated) {
358
+ if (added.length > 0) {
343
359
  writeFileSync(gitignorePath, gitignore);
344
- console.log(` Updated .gitignore (added .env + .mcp.json)`);
360
+ console.log(` Updated .gitignore (added ${added.join(", ")})`);
345
361
  }
346
362
  } else {
347
- writeFileSync(gitignorePath, ".env\n.env.local\n.mcp.json\nnode_modules/\n");
348
- console.log(` Created .gitignore (with .env and .mcp.json excluded)`);
363
+ writeFileSync(gitignorePath, ".env\n.env.local\n.mcp.json\n.solongate/\nnode_modules/\n");
364
+ console.log(` Created .gitignore (with .env, .mcp.json, .solongate/ excluded)`);
349
365
  }
350
366
  }
351
367
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.28.6",
3
+ "version": "0.28.7",
4
4
  "description": "MCP security proxy — protect any MCP server with customizable policies, path/command constraints, rate limiting, and audit logging. Zero code changes required.",
5
5
  "type": "module",
6
6
  "bin": {