@amodalai/amodal 0.1.2 → 0.1.4
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/CHANGELOG.md +22 -0
- package/dist/src/main.js +3 -0
- package/dist/src/main.js.map +1 -1
- package/dist/src/shared/load-env.d.ts +12 -0
- package/dist/src/shared/load-env.d.ts.map +1 -0
- package/dist/src/shared/load-env.js +27 -0
- package/dist/src/shared/load-env.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/main.ts +4 -0
- package/src/shared/load-env.test.ts +89 -0
- package/src/shared/load-env.ts +27 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @amodalai/amodal
|
|
2
2
|
|
|
3
|
+
## 0.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#17](https://github.com/amodalai/amodal/pull/17) [`7a2b7d1`](https://github.com/amodalai/amodal/commit/7a2b7d1dd27588b626a23453f0f97f5e9317b275) Thanks [@gte620v](https://github.com/gte620v)! - Fix GitHub Release creation after npm publish
|
|
8
|
+
|
|
9
|
+
- Updated dependencies []:
|
|
10
|
+
- @amodalai/core@0.1.4
|
|
11
|
+
- @amodalai/runtime@0.1.4
|
|
12
|
+
- @amodalai/runtime-app@0.1.4
|
|
13
|
+
|
|
14
|
+
## 0.1.3
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [#15](https://github.com/amodalai/amodal/pull/15) [`df201b5`](https://github.com/amodalai/amodal/commit/df201b542d943fbb887dd096f4e3e3d170c51030) Thanks [@gte620v](https://github.com/gte620v)! - Automatically load `.env` file from the project directory. No more `source .env &&` before every command.
|
|
19
|
+
|
|
20
|
+
- Updated dependencies []:
|
|
21
|
+
- @amodalai/core@0.1.3
|
|
22
|
+
- @amodalai/runtime@0.1.3
|
|
23
|
+
- @amodalai/runtime-app@0.1.3
|
|
24
|
+
|
|
3
25
|
## 0.1.2
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/src/main.js
CHANGED
|
@@ -8,6 +8,9 @@ import { readFileSync } from 'node:fs';
|
|
|
8
8
|
import yargs from 'yargs';
|
|
9
9
|
import { hideBin } from 'yargs/helpers';
|
|
10
10
|
import { amodalCommands } from './commands/index.js';
|
|
11
|
+
import { loadEnvFile } from './shared/load-env.js';
|
|
12
|
+
// Load .env from current directory before anything else
|
|
13
|
+
loadEnvFile(process.cwd());
|
|
11
14
|
const raw = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf-8'));
|
|
12
15
|
if (typeof raw !== 'object' || raw === null || !('version' in raw) || typeof raw.version !== 'string') {
|
|
13
16
|
throw new Error('Failed to read version from package.json');
|
package/dist/src/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAEjD,wDAAwD;AACxD,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AAE3B,MAAM,GAAG,GAAY,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AACvG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;IACtG,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;AAC9D,CAAC;AACD,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC;AAE/B,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACrC,UAAU,CAAC,QAAQ,CAAC;KACpB,KAAK,CAAC,wBAAwB,CAAC,CAAC;AAEnC,KAAK,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;IACjC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC;AAED,GAAG;KACA,aAAa,CAAC,CAAC,EAAE,uCAAuC,CAAC;KACzD,MAAM,EAAE;KACR,IAAI,EAAE;KACN,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC;KAClB,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,CAAC;KACjD,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAEzB,KAAK,GAAG,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Load a .env file into process.env.
|
|
8
|
+
* Supports comments (#), `export` prefix, and quoted values.
|
|
9
|
+
* Does not override existing env vars.
|
|
10
|
+
*/
|
|
11
|
+
export declare function loadEnvFile(dir: string): void;
|
|
12
|
+
//# sourceMappingURL=load-env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-env.d.ts","sourceRoot":"","sources":["../../../src/shared/load-env.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAY7C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
7
|
+
import { resolve } from 'node:path';
|
|
8
|
+
/**
|
|
9
|
+
* Load a .env file into process.env.
|
|
10
|
+
* Supports comments (#), `export` prefix, and quoted values.
|
|
11
|
+
* Does not override existing env vars.
|
|
12
|
+
*/
|
|
13
|
+
export function loadEnvFile(dir) {
|
|
14
|
+
const envPath = resolve(dir, '.env');
|
|
15
|
+
if (!existsSync(envPath))
|
|
16
|
+
return;
|
|
17
|
+
for (const line of readFileSync(envPath, 'utf-8').split('\n')) {
|
|
18
|
+
const trimmed = line.trim();
|
|
19
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
20
|
+
continue;
|
|
21
|
+
const match = trimmed.replace(/^export\s+/, '').match(/^([^=]+)=(.*)/);
|
|
22
|
+
if (match && !process.env[match[1]]) {
|
|
23
|
+
process.env[match[1]] = match[2].replace(/^["']|["']$/g, '');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=load-env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-env.js","sourceRoot":"","sources":["../../../src/shared/load-env.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO;IAEjC,KAAK,MAAM,IAAI,IAAI,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9D,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QAClD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QACvE,IAAI,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;AACH,CAAC"}
|