@ewyn/client 0.6.0 → 0.7.0

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.
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAwIA,4BAA4B;AAC5B,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuC/D"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AA8IA,4BAA4B;AAC5B,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyC/D"}
package/dist/cli.js CHANGED
@@ -3,6 +3,7 @@ import fs from 'node:fs';
3
3
  import { createRequire } from 'node:module';
4
4
  import path from 'node:path';
5
5
  import { fileURLToPath, pathToFileURL } from 'node:url';
6
+ import { config as dotenvConfig } from 'dotenv';
6
7
  const EWYN_API_BASE_URL = 'https://www.ewyn.ai/api/v1';
7
8
  const CONFIG_NAMES = ['ewyn.config.ts', 'ewyn.config.mjs', 'ewyn.config.js'];
8
9
  const DEFAULT_OUTPUT_FILE = 'ewynTemplates.ts';
@@ -115,10 +116,15 @@ function serializeTemplates(templates) {
115
116
  lines.push(json + ' as const;');
116
117
  return lines.join('\n');
117
118
  }
119
+ function loadEnvFiles(cwd) {
120
+ dotenvConfig({ path: path.join(cwd, '.env') });
121
+ dotenvConfig({ path: path.join(cwd, '.env.local') });
122
+ }
118
123
  /** Exported for testing. */
119
124
  export async function runFetchConfig(cwd) {
120
125
  console.log('Fetching Ewyn template config...');
121
126
  debug(`CWD: ${cwd}`);
127
+ loadEnvFiles(cwd);
122
128
  const configPath = findConfigPath(cwd);
123
129
  if (!configPath) {
124
130
  console.error('Error: ewyn.config.ts (or ewyn.config.mjs / ewyn.config.js) not found in current directory.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ewyn/client",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Official TypeScript SDK for Ewyn email service with full type safety",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -32,14 +32,15 @@
32
32
  "node": ">=18.0.0"
33
33
  },
34
34
  "dependencies": {
35
+ "dotenv": "^16.4.5",
35
36
  "tsx": "^4.19.0"
36
37
  },
37
38
  "devDependencies": {
38
39
  "@types/node": "^20.11.0",
39
40
  "typescript": "^5.7.3",
40
41
  "vitest": "^1.2.0",
41
- "@workspace/typescript-config": "0.0.0",
42
- "@workspace/eslint-config": "0.0.0"
42
+ "@workspace/eslint-config": "0.0.0",
43
+ "@workspace/typescript-config": "0.0.0"
43
44
  },
44
45
  "scripts": {
45
46
  "build": "tsc",