mirror of
https://github.com/sortedcord/omnia.git
synced 2026-07-22 03:52:48 +05:30
refactor: switch to process.env for all packages, fix typos
This commit is contained in:
@@ -5,5 +5,8 @@
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./dist/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"dotenv": "^17.4.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
import dotenv from "dotenv";
|
||||
|
||||
// Load environment variables once at CLI application entry point
|
||||
dotenv.config();
|
||||
|
||||
export {};
|
||||
|
||||
@@ -73,7 +73,7 @@ export interface IAttribute {
|
||||
value: string,
|
||||
visibility: AttributeVisibility,
|
||||
): void;
|
||||
getVisibileAttributesFor(viewerId: string): Attribute[];
|
||||
getVisibleAttributesFor(viewerId: string): Attribute[];
|
||||
}
|
||||
|
||||
export abstract class AttributableObject implements IAttribute {
|
||||
@@ -107,7 +107,7 @@ export abstract class AttributableObject implements IAttribute {
|
||||
this.attributes.delete(name);
|
||||
}
|
||||
|
||||
getVisibileAttributesFor(viewerId: string): Attribute[] {
|
||||
getVisibleAttributesFor(viewerId: string): Attribute[] {
|
||||
return Array.from(this.attributes.values()).filter((attr) =>
|
||||
attr.hasAccess(viewerId),
|
||||
);
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
import { config } from "dotenv";
|
||||
import path from "node:path";
|
||||
config({ path: path.resolve(__dirname, "../.env") });
|
||||
|
||||
export * from "./attribute.js";
|
||||
export * from "./entity.js";
|
||||
export * from "./world.js";
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
import { z } from "zod";
|
||||
import dotenv from "dotenv";
|
||||
import path from "path";
|
||||
|
||||
// Load environment variables from .env file
|
||||
dotenv.config();
|
||||
// In a monorepo, the cwd might be a package subdirectory, so check parent directories as well
|
||||
dotenv.config({ path: path.resolve(process.cwd(), "../.env") });
|
||||
dotenv.config({ path: path.resolve(process.cwd(), "../../.env") });
|
||||
|
||||
const LLMConfigSchema = z.object({
|
||||
GOOGLE_API_KEY: z.string().min(1, "GOOGLE_API_KEY is required"),
|
||||
|
||||
6
pnpm-lock.yaml
generated
6
pnpm-lock.yaml
generated
@@ -251,7 +251,11 @@ importers:
|
||||
specifier: ^4.4.3
|
||||
version: 4.4.3
|
||||
|
||||
cli: {}
|
||||
cli:
|
||||
dependencies:
|
||||
dotenv:
|
||||
specifier: ^17.4.2
|
||||
version: 17.4.2
|
||||
|
||||
content/scenario-builder:
|
||||
dependencies:
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
import dotenv from "dotenv";
|
||||
|
||||
// Load environment variables for evals at test process startup
|
||||
dotenv.config();
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
|
||||
Reference in New Issue
Block a user