transduck 0.6.0 → 0.6.1
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 +1 -0
- package/dist/cli.js +2 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.js +1 -0
- package/package.json +4 -2
- package/src/cli.ts +2 -1
- package/src/config.ts +1 -0
- package/tests/config.test.ts +14 -0
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import 'dotenv/config';
|
|
2
3
|
import { createHash } from 'crypto';
|
|
3
4
|
import { readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
4
5
|
import { join, dirname } from 'path';
|
|
@@ -543,7 +544,7 @@ export async function runStats(opts) {
|
|
|
543
544
|
}
|
|
544
545
|
// CLI entry point
|
|
545
546
|
const program = new Command();
|
|
546
|
-
program.name('transduck').description('AI-native translation tool').version('0.6.
|
|
547
|
+
program.name('transduck').description('AI-native translation tool').version('0.6.1');
|
|
547
548
|
program.command('init')
|
|
548
549
|
.description('Initialize a new transduck project')
|
|
549
550
|
.action(async () => {
|
package/dist/config.d.ts
CHANGED
package/dist/config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "transduck",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "AI-native translation tool using source text as keys",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,8 +24,9 @@
|
|
|
24
24
|
"test:watch": "vitest"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"commander": "^12.0.0",
|
|
28
27
|
"better-sqlite3": "^11.0.0",
|
|
28
|
+
"commander": "^12.0.0",
|
|
29
|
+
"dotenv": "^16.6.1",
|
|
29
30
|
"openai": "^4.0.0",
|
|
30
31
|
"yaml": "^2.0.0"
|
|
31
32
|
},
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"@testing-library/react": "^16.0.0",
|
|
34
35
|
"@types/better-sqlite3": "^7.0.0",
|
|
35
36
|
"@types/node": "^22.0.0",
|
|
37
|
+
"@types/pg": "^8.18.0",
|
|
36
38
|
"@types/react": "^19.0.0",
|
|
37
39
|
"@types/react-dom": "^19.0.0",
|
|
38
40
|
"jsdom": "^25.0.0",
|
package/src/cli.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import 'dotenv/config';
|
|
3
4
|
import { createHash } from 'crypto';
|
|
4
5
|
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
|
|
5
6
|
import { resolve, join, dirname } from 'path';
|
|
@@ -660,7 +661,7 @@ export async function runStats(opts: StatsOptions): Promise<string> {
|
|
|
660
661
|
// CLI entry point
|
|
661
662
|
const program = new Command();
|
|
662
663
|
|
|
663
|
-
program.name('transduck').description('AI-native translation tool').version('0.6.
|
|
664
|
+
program.name('transduck').description('AI-native translation tool').version('0.6.1');
|
|
664
665
|
|
|
665
666
|
program.command('init')
|
|
666
667
|
.description('Initialize a new transduck project')
|
package/src/config.ts
CHANGED
package/tests/config.test.ts
CHANGED
|
@@ -116,4 +116,18 @@ describe('loadConfig', () => {
|
|
|
116
116
|
delete process.env.TRANSDUCK_CONFIG;
|
|
117
117
|
expect(() => loadConfig(join(tmpDir, 'nonexistent.yaml'))).toThrow();
|
|
118
118
|
});
|
|
119
|
+
|
|
120
|
+
it('loads env vars from .env file via dotenv', async () => {
|
|
121
|
+
// Write a .env file in a temp dir
|
|
122
|
+
const envDir = makeTmpDir();
|
|
123
|
+
const envPath = join(envDir, '.env');
|
|
124
|
+
writeFileSync(envPath, 'TRANSDUCK_TEST_DOTENV=loaded_from_dotenv\n');
|
|
125
|
+
|
|
126
|
+
// dotenv/config reads from cwd, so we use dotenv.config with explicit path
|
|
127
|
+
const dotenv = await import('dotenv');
|
|
128
|
+
dotenv.config({ path: envPath });
|
|
129
|
+
|
|
130
|
+
expect(process.env.TRANSDUCK_TEST_DOTENV).toBe('loaded_from_dotenv');
|
|
131
|
+
delete process.env.TRANSDUCK_TEST_DOTENV;
|
|
132
|
+
});
|
|
119
133
|
});
|