@lindorm/config 0.2.10 → 0.3.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/CHANGELOG.md +7 -0
- package/README.md +96 -301
- package/dist/cli.js +17 -19
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -17
- package/dist/index.js.map +1 -1
- package/dist/internal/coerce-all.js +13 -17
- package/dist/internal/coerce-all.js.map +1 -1
- package/dist/internal/find-process-env-value.d.ts +1 -1
- package/dist/internal/find-process-env-value.d.ts.map +1 -1
- package/dist/internal/find-process-env-value.js +6 -10
- package/dist/internal/find-process-env-value.js.map +1 -1
- package/dist/internal/index.d.ts +4 -3
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +4 -19
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/load-config.d.ts +2 -2
- package/dist/internal/load-config.d.ts.map +1 -1
- package/dist/internal/load-config.js +7 -14
- package/dist/internal/load-config.js.map +1 -1
- package/dist/internal/load-node-config.d.ts +2 -2
- package/dist/internal/load-node-config.d.ts.map +1 -1
- package/dist/internal/load-node-config.js +5 -9
- package/dist/internal/load-node-config.js.map +1 -1
- package/dist/internal/load-npm-info.d.ts +6 -0
- package/dist/internal/load-npm-info.d.ts.map +1 -0
- package/dist/internal/load-npm-info.js +47 -0
- package/dist/internal/load-npm-info.js.map +1 -0
- package/dist/internal/merge-object-with-process-env.d.ts +2 -2
- package/dist/internal/merge-object-with-process-env.d.ts.map +1 -1
- package/dist/internal/merge-object-with-process-env.js +7 -11
- package/dist/internal/merge-object-with-process-env.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -17
- package/dist/types/index.js.map +1 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js +1 -2
- package/dist/utils/configuration.d.ts +5 -2
- package/dist/utils/configuration.d.ts.map +1 -1
- package/dist/utils/configuration.js +12 -22
- package/dist/utils/configuration.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -17
- package/dist/utils/index.js.map +1 -1
- package/package.json +19 -13
- package/vitest.config.mjs +3 -0
|
@@ -1,39 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.coerceAll = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const coerceAll = (schema) => {
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const coerceAll = (schema) => {
|
|
6
3
|
const def = schema._zod?.def ?? schema._def;
|
|
7
4
|
switch (def.type) {
|
|
8
5
|
case "string":
|
|
9
|
-
return
|
|
6
|
+
return z.coerce.string();
|
|
10
7
|
case "number":
|
|
11
|
-
return
|
|
8
|
+
return z.coerce.number();
|
|
12
9
|
case "boolean":
|
|
13
|
-
return
|
|
10
|
+
return z.coerce.boolean();
|
|
14
11
|
case "date":
|
|
15
|
-
return
|
|
12
|
+
return z.coerce.date();
|
|
16
13
|
case "bigint":
|
|
17
|
-
return
|
|
14
|
+
return z.coerce.bigint();
|
|
18
15
|
case "array":
|
|
19
|
-
return
|
|
16
|
+
return z.array(coerceAll(def.element));
|
|
20
17
|
case "object": {
|
|
21
18
|
const shape = def.shape;
|
|
22
19
|
const newShape = {};
|
|
23
20
|
for (const key in shape) {
|
|
24
|
-
newShape[key] =
|
|
21
|
+
newShape[key] = coerceAll(shape[key]);
|
|
25
22
|
}
|
|
26
|
-
return
|
|
23
|
+
return z.object(newShape);
|
|
27
24
|
}
|
|
28
25
|
case "optional":
|
|
29
|
-
return
|
|
26
|
+
return coerceAll(def.innerType).optional();
|
|
30
27
|
case "nullable":
|
|
31
|
-
return
|
|
28
|
+
return coerceAll(def.innerType).nullable();
|
|
32
29
|
case "default":
|
|
33
|
-
return
|
|
30
|
+
return coerceAll(def.innerType).default(def.defaultValue);
|
|
34
31
|
default:
|
|
35
32
|
return schema;
|
|
36
33
|
}
|
|
37
34
|
};
|
|
38
|
-
exports.coerceAll = coerceAll;
|
|
39
35
|
//# sourceMappingURL=coerce-all.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-all.js","sourceRoot":"","sources":["../../src/internal/coerce-all.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coerce-all.js","sourceRoot":"","sources":["../../src/internal/coerce-all.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAsB,MAAS,EAAK,EAAE;IAC7D,MAAM,GAAG,GAAI,MAAc,CAAC,IAAI,EAAE,GAAG,IAAK,MAAc,CAAC,IAAI,CAAC;IAE9D,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC,MAAM,CAAC,MAAM,EAAS,CAAC;QAElC,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC,MAAM,CAAC,MAAM,EAAS,CAAC;QAElC,KAAK,SAAS;YACZ,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,EAAS,CAAC;QAEnC,KAAK,MAAM;YACT,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,EAAS,CAAC;QAEhC,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC,MAAM,CAAC,MAAM,EAAS,CAAC;QAElC,KAAK,OAAO;YACV,OAAO,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAQ,CAAC;QAEhD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,MAAM,KAAK,GAAG,GAAG,CAAC,KAAwB,CAAC;YAC3C,MAAM,QAAQ,GAAoB,EAAE,CAAC;YACrC,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;gBACxB,QAAQ,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;YACxC,CAAC;YACD,OAAO,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAQ,CAAC;QACnC,CAAC;QAED,KAAK,UAAU;YACb,OAAO,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC;QAE7C,KAAK,UAAU;YACb,OAAO,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC;QAE7C,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAE5D;YACE,OAAO,MAAM,CAAC;IAClB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-process-env-value.d.ts","sourceRoot":"","sources":["../../src/internal/find-process-env-value.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"find-process-env-value.d.ts","sourceRoot":"","sources":["../../src/internal/find-process-env-value.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,mBAAmB,GAC9B,YAAY,UAAU,EACtB,KAAK,MAAM,EACX,SAAS,MAAM,KACd,GAQF,CAAC"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const findProcessEnvValue = (processEnv, key, parent) => {
|
|
7
|
-
const k = (0, case_1.changeCase)(key, "constant");
|
|
8
|
-
const pkey = parent ? (0, case_1.changeCase)(parent, "constant") : undefined;
|
|
1
|
+
import { changeCase } from "@lindorm/case";
|
|
2
|
+
import { safelyParse } from "@lindorm/utils";
|
|
3
|
+
export const findProcessEnvValue = (processEnv, key, parent) => {
|
|
4
|
+
const k = changeCase(key, "constant");
|
|
5
|
+
const pkey = parent ? changeCase(parent, "constant") : undefined;
|
|
9
6
|
const search = pkey ? `${pkey}_${k}` : k;
|
|
10
7
|
const value = processEnv[search] ? processEnv[search] : undefined;
|
|
11
|
-
return value ?
|
|
8
|
+
return value ? safelyParse(value) : undefined;
|
|
12
9
|
};
|
|
13
|
-
exports.findProcessEnvValue = findProcessEnvValue;
|
|
14
10
|
//# sourceMappingURL=find-process-env-value.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-process-env-value.js","sourceRoot":"","sources":["../../src/internal/find-process-env-value.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"find-process-env-value.js","sourceRoot":"","sources":["../../src/internal/find-process-env-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,UAAsB,EACtB,GAAW,EACX,MAAe,EACV,EAAE;IACP,MAAM,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEjE,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAElE,OAAO,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAChD,CAAC,CAAC"}
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export * from "./coerce-all";
|
|
2
|
-
export * from "./load-config";
|
|
3
|
-
export * from "./load-node-config";
|
|
1
|
+
export * from "./coerce-all.js";
|
|
2
|
+
export * from "./load-config.js";
|
|
3
|
+
export * from "./load-node-config.js";
|
|
4
|
+
export * from "./load-npm-info.js";
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/internal/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/internal/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
|
package/dist/internal/index.js
CHANGED
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./coerce-all"), exports);
|
|
18
|
-
__exportStar(require("./load-config"), exports);
|
|
19
|
-
__exportStar(require("./load-node-config"), exports);
|
|
1
|
+
export * from "./coerce-all.js";
|
|
2
|
+
export * from "./load-config.js";
|
|
3
|
+
export * from "./load-node-config.js";
|
|
4
|
+
export * from "./load-npm-info.js";
|
|
20
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internal/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internal/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dict } from "@lindorm/types";
|
|
2
|
-
import { ProcessEnv } from "../types";
|
|
1
|
+
import type { Dict } from "@lindorm/types";
|
|
2
|
+
import type { ProcessEnv } from "../types/index.js";
|
|
3
3
|
export declare const loadConfig: (processEnv: ProcessEnv) => Dict;
|
|
4
4
|
//# sourceMappingURL=load-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../src/internal/load-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../src/internal/load-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,eAAO,MAAM,UAAU,GAAI,YAAY,UAAU,KAAG,IAKnD,CAAC"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { changeKeys } from "@lindorm/case";
|
|
2
|
+
import c from "config";
|
|
3
|
+
import { mergeObjectWithProcessEnv } from "./merge-object-with-process-env.js";
|
|
4
|
+
export const loadConfig = (processEnv) => {
|
|
5
|
+
const config = c.util.toObject();
|
|
6
|
+
const merged = mergeObjectWithProcessEnv(processEnv, config);
|
|
7
|
+
return changeKeys(merged, "camel");
|
|
4
8
|
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.loadConfig = void 0;
|
|
7
|
-
const case_1 = require("@lindorm/case");
|
|
8
|
-
const config_1 = __importDefault(require("config"));
|
|
9
|
-
const merge_object_with_process_env_1 = require("./merge-object-with-process-env");
|
|
10
|
-
const loadConfig = (processEnv) => {
|
|
11
|
-
const config = config_1.default.util.toObject();
|
|
12
|
-
const merged = (0, merge_object_with_process_env_1.mergeObjectWithProcessEnv)(processEnv, config);
|
|
13
|
-
return (0, case_1.changeKeys)(merged, "camel");
|
|
14
|
-
};
|
|
15
|
-
exports.loadConfig = loadConfig;
|
|
16
9
|
//# sourceMappingURL=load-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-config.js","sourceRoot":"","sources":["../../src/internal/load-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load-config.js","sourceRoot":"","sources":["../../src/internal/load-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAE/E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,UAAsB,EAAQ,EAAE;IACzD,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;IACjC,MAAM,MAAM,GAAG,yBAAyB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAE7D,OAAO,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dict } from "@lindorm/types";
|
|
2
|
-
import { ProcessEnv } from "../types";
|
|
1
|
+
import type { Dict } from "@lindorm/types";
|
|
2
|
+
import type { ProcessEnv } from "../types/index.js";
|
|
3
3
|
export declare const loadNodeConfig: (processEnv: ProcessEnv) => Dict;
|
|
4
4
|
//# sourceMappingURL=load-node-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-node-config.d.ts","sourceRoot":"","sources":["../../src/internal/load-node-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"load-node-config.d.ts","sourceRoot":"","sources":["../../src/internal/load-node-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,cAAc,GAAI,YAAY,UAAU,KAAG,IAYvD,CAAC"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const is_1 = require("@lindorm/is");
|
|
5
|
-
const utils_1 = require("@lindorm/utils");
|
|
6
|
-
const loadNodeConfig = (processEnv) => {
|
|
1
|
+
import { isString } from "@lindorm/is";
|
|
2
|
+
import { safelyParse } from "@lindorm/utils";
|
|
3
|
+
export const loadNodeConfig = (processEnv) => {
|
|
7
4
|
if (!processEnv.NODE_CONFIG)
|
|
8
5
|
return {};
|
|
9
|
-
if (!
|
|
6
|
+
if (!isString(processEnv.NODE_CONFIG) ||
|
|
10
7
|
!processEnv.NODE_CONFIG.startsWith("{") ||
|
|
11
8
|
!processEnv.NODE_CONFIG.endsWith("}")) {
|
|
12
9
|
throw new Error("Environment variable NODE_CONFIG must be a valid JSON string");
|
|
13
10
|
}
|
|
14
|
-
return
|
|
11
|
+
return safelyParse(processEnv.NODE_CONFIG);
|
|
15
12
|
};
|
|
16
|
-
exports.loadNodeConfig = loadNodeConfig;
|
|
17
13
|
//# sourceMappingURL=load-node-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-node-config.js","sourceRoot":"","sources":["../../src/internal/load-node-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load-node-config.js","sourceRoot":"","sources":["../../src/internal/load-node-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAsB,EAAQ,EAAE;IAC7D,IAAI,CAAC,UAAU,CAAC,WAAW;QAAE,OAAO,EAAE,CAAC;IAEvC,IACE,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC;QACjC,CAAC,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC;QACvC,CAAC,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EACrC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAClF,CAAC;IAED,OAAO,WAAW,CAAO,UAAU,CAAC,WAAW,CAAC,CAAC;AACnD,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-npm-info.d.ts","sourceRoot":"","sources":["../../src/internal/load-npm-info.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAmDxD,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,KAAG,OAc5C,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
const scopeToDirname = (scope) => {
|
|
5
|
+
const resolved = scope.startsWith("file://") ? fileURLToPath(scope) : scope;
|
|
6
|
+
return dirname(resolved);
|
|
7
|
+
};
|
|
8
|
+
const findPackageJson = (startDir) => {
|
|
9
|
+
let current = startDir;
|
|
10
|
+
while (true) {
|
|
11
|
+
const candidate = join(current, "package.json");
|
|
12
|
+
if (existsSync(candidate))
|
|
13
|
+
return candidate;
|
|
14
|
+
const parent = dirname(current);
|
|
15
|
+
if (parent === current)
|
|
16
|
+
return null;
|
|
17
|
+
current = parent;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const readPackage = (path) => {
|
|
21
|
+
try {
|
|
22
|
+
const pkg = JSON.parse(readFileSync(path, "utf-8"));
|
|
23
|
+
return {
|
|
24
|
+
name: typeof pkg.name === "string" ? pkg.name : "",
|
|
25
|
+
version: typeof pkg.version === "string" ? pkg.version : "",
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export const loadNpmInfo = (scope) => {
|
|
33
|
+
if (scope) {
|
|
34
|
+
const startDir = scopeToDirname(scope);
|
|
35
|
+
const pkgPath = findPackageJson(startDir);
|
|
36
|
+
if (pkgPath) {
|
|
37
|
+
const pkg = readPackage(pkgPath);
|
|
38
|
+
if (pkg)
|
|
39
|
+
return pkg;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
name: process.env.npm_package_name || "",
|
|
44
|
+
version: process.env.npm_package_version || "",
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=load-npm-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-npm-info.js","sourceRoot":"","sources":["../../src/internal/load-npm-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIzC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAU,EAAE;IAC/C,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC5E,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAiB,EAAE;IAC1D,IAAI,OAAO,GAAG,QAAQ,CAAC;IACvB,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAChD,IAAI,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;QAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,MAAM,KAAK,OAAO;YAAE,OAAO,IAAI,CAAC;QACpC,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,IAAY,EAAkB,EAAE;IACnD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAGjD,CAAC;QACF,OAAO;YACL,IAAI,EAAE,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;YAClD,OAAO,EAAE,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;SAC5D,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAoBF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAc,EAAW,EAAE;IACrD,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QACvC,MAAM,OAAO,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;QAC1C,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;YACjC,IAAI,GAAG;gBAAE,OAAO,GAAG,CAAC;QACtB,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE;QACxC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,EAAE;KAC/C,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dict } from "@lindorm/types";
|
|
2
|
-
import { ProcessEnv } from "../types";
|
|
1
|
+
import type { Dict } from "@lindorm/types";
|
|
2
|
+
import type { ProcessEnv } from "../types/index.js";
|
|
3
3
|
export declare const mergeObjectWithProcessEnv: (processEnv: ProcessEnv, config: Dict, parent?: string) => Dict;
|
|
4
4
|
//# sourceMappingURL=merge-object-with-process-env.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-object-with-process-env.d.ts","sourceRoot":"","sources":["../../src/internal/merge-object-with-process-env.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"merge-object-with-process-env.d.ts","sourceRoot":"","sources":["../../src/internal/merge-object-with-process-env.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,eAAO,MAAM,yBAAyB,GACpC,YAAY,UAAU,EACtB,QAAQ,IAAI,EACZ,SAAS,MAAM,KACd,IAqBF,CAAC"}
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const is_1 = require("@lindorm/is");
|
|
5
|
-
const find_process_env_value_1 = require("./find-process-env-value");
|
|
6
|
-
const mergeObjectWithProcessEnv = (processEnv, config, parent) => {
|
|
1
|
+
import { isObject, isUndefined } from "@lindorm/is";
|
|
2
|
+
import { findProcessEnvValue } from "./find-process-env-value.js";
|
|
3
|
+
export const mergeObjectWithProcessEnv = (processEnv, config, parent) => {
|
|
7
4
|
const result = {};
|
|
8
5
|
for (const [key, value] of Object.entries(config)) {
|
|
9
|
-
const env =
|
|
10
|
-
if (!
|
|
6
|
+
const env = findProcessEnvValue(processEnv, key, parent);
|
|
7
|
+
if (!isUndefined(env)) {
|
|
11
8
|
result[key] = env;
|
|
12
9
|
continue;
|
|
13
10
|
}
|
|
14
|
-
if (
|
|
11
|
+
if (isObject(value)) {
|
|
15
12
|
const pkey = parent ? `${parent}_${key}` : key;
|
|
16
|
-
result[key] =
|
|
13
|
+
result[key] = mergeObjectWithProcessEnv(processEnv, value, pkey);
|
|
17
14
|
continue;
|
|
18
15
|
}
|
|
19
16
|
result[key] = value;
|
|
20
17
|
}
|
|
21
18
|
return result;
|
|
22
19
|
};
|
|
23
|
-
exports.mergeObjectWithProcessEnv = mergeObjectWithProcessEnv;
|
|
24
20
|
//# sourceMappingURL=merge-object-with-process-env.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-object-with-process-env.js","sourceRoot":"","sources":["../../src/internal/merge-object-with-process-env.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"merge-object-with-process-env.js","sourceRoot":"","sources":["../../src/internal/merge-object-with-process-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,UAAsB,EACtB,MAAY,EACZ,MAAe,EACT,EAAE;IACR,MAAM,MAAM,GAAS,EAAE,CAAC;IAExB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,MAAM,GAAG,GAAG,mBAAmB,CAAC,UAAU,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAEzD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;YAClB,SAAS;QACX,CAAC;QAED,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACpB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;YAC/C,MAAM,CAAC,GAAG,CAAC,GAAG,yBAAyB,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;YACjE,SAAS;QACX,CAAC;QAED,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./types";
|
|
1
|
+
export * from "./types.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
package/dist/types/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types"), exports);
|
|
1
|
+
export * from "./types.js";
|
|
18
2
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG;IAAE,GAAG,EAAE;QAAE,OAAO,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,CAAC;AAErF,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC"}
|
package/dist/types/types.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { NpmInformation } from "../types";
|
|
3
|
-
export
|
|
2
|
+
import type { NpmInformation } from "../types/index.js";
|
|
3
|
+
export type ConfigurationOptions = {
|
|
4
|
+
scope?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const configuration: <T extends Record<string, z.ZodType>>(schema: T, options?: ConfigurationOptions) => NpmInformation & z.infer<z.ZodObject<T>>;
|
|
4
7
|
//# sourceMappingURL=configuration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/utils/configuration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/utils/configuration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,MAAM,MAAM,oBAAoB,GAAG;IAcjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAC/D,QAAQ,CAAC,EACT,UAAS,oBAAyB,KACjC,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAoBzC,CAAC"}
|
|
@@ -1,32 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const dotenvx_1 = __importDefault(require("@dotenvx/dotenvx"));
|
|
8
|
-
const utils_1 = require("@lindorm/utils");
|
|
9
|
-
const zod_1 = require("zod");
|
|
10
|
-
const index_1 = require("../internal/index");
|
|
11
|
-
const configuration = (schema) => {
|
|
12
|
-
dotenvx_1.default.config({
|
|
1
|
+
import dotenvx from "@dotenvx/dotenvx";
|
|
2
|
+
import { merge } from "@lindorm/utils";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { coerceAll, loadConfig, loadNodeConfig, loadNpmInfo } from "../internal/index.js";
|
|
5
|
+
export const configuration = (schema, options = {}) => {
|
|
6
|
+
dotenvx.config({
|
|
13
7
|
path: process.env.NODE_ENV ? [`.env.${process.env.NODE_ENV}`, ".env"] : ".env",
|
|
14
8
|
quiet: true,
|
|
15
9
|
});
|
|
16
|
-
const config =
|
|
17
|
-
const node =
|
|
18
|
-
const merged =
|
|
19
|
-
const zod =
|
|
10
|
+
const config = loadConfig(process.env);
|
|
11
|
+
const node = loadNodeConfig(process.env);
|
|
12
|
+
const merged = merge(config, node);
|
|
13
|
+
const zod = coerceAll(z.object(schema));
|
|
20
14
|
const parsed = zod.parse(merged);
|
|
21
15
|
const npm = {
|
|
22
16
|
npm: {
|
|
23
|
-
package:
|
|
24
|
-
name: process.env.npm_package_name || "",
|
|
25
|
-
version: process.env.npm_package_version || "",
|
|
26
|
-
},
|
|
17
|
+
package: loadNpmInfo(options.scope),
|
|
27
18
|
},
|
|
28
19
|
};
|
|
29
|
-
return
|
|
20
|
+
return merge(parsed, npm);
|
|
30
21
|
};
|
|
31
|
-
exports.configuration = configuration;
|
|
32
22
|
//# sourceMappingURL=configuration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../src/utils/configuration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../src/utils/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAmB1F,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,MAAS,EACT,UAAgC,EAAE,EACQ,EAAE;IAC5C,OAAO,CAAC,MAAM,CAAC;QACb,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM;QAC9E,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAEnC,MAAM,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAEjC,MAAM,GAAG,GAAG;QACV,GAAG,EAAE;YACH,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC;SACpC;KACF,CAAC;IAEF,OAAO,KAAK,CAAC,MAAa,EAAE,GAAU,CAAC,CAAC;AAC1C,CAAC,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./configuration";
|
|
1
|
+
export * from "./configuration.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./configuration"), exports);
|
|
1
|
+
export * from "./configuration.js";
|
|
18
2
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lindorm/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"license": "AGPL-3.0-or-later",
|
|
5
5
|
"author": "Jonn Nilsson",
|
|
6
6
|
"repository": {
|
|
@@ -11,29 +11,36 @@
|
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
14
|
-
"
|
|
14
|
+
"bin": {
|
|
15
|
+
"config": "dist/cli.js"
|
|
16
|
+
},
|
|
17
|
+
"type": "module",
|
|
15
18
|
"typings": "dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
16
25
|
"scripts": {
|
|
17
26
|
"build": "rimraf dist && tsc -b ./tsconfig.build.json && chmod +x dist/cli.js",
|
|
18
27
|
"example": "ts-node example",
|
|
19
28
|
"prettier": "prettier --write ./src/*",
|
|
20
|
-
"test": "
|
|
21
|
-
"test:
|
|
22
|
-
"test:watch": "
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"test:unit": "vitest run --exclude '**/*.integration.test.ts'",
|
|
31
|
+
"test:watch": "vitest",
|
|
23
32
|
"typecheck": "tsc",
|
|
24
33
|
"typecheck:watch": "tsc --watch",
|
|
25
34
|
"update": "ncu -i",
|
|
26
35
|
"update:auto": "ncu -u",
|
|
27
36
|
"verify": "npm run typecheck && npm run build && npm test"
|
|
28
37
|
},
|
|
29
|
-
"bin": {
|
|
30
|
-
"config": "dist/cli.js"
|
|
31
|
-
},
|
|
32
38
|
"dependencies": {
|
|
33
39
|
"@dotenvx/dotenvx": "^1.54.1",
|
|
34
|
-
"@lindorm/case": "^0.
|
|
35
|
-
"@lindorm/is": "^0.
|
|
36
|
-
"@lindorm/
|
|
40
|
+
"@lindorm/case": "^0.2.0",
|
|
41
|
+
"@lindorm/is": "^0.2.0",
|
|
42
|
+
"@lindorm/types": "^0.6.0",
|
|
43
|
+
"@lindorm/utils": "^0.8.0",
|
|
37
44
|
"commander": "^14.0.3",
|
|
38
45
|
"config": "^4.4.1",
|
|
39
46
|
"dotenv": "^17.3.1",
|
|
@@ -41,9 +48,8 @@
|
|
|
41
48
|
"zod": "^4.3.6"
|
|
42
49
|
},
|
|
43
50
|
"devDependencies": {
|
|
44
|
-
"@lindorm/types": "^0.5.0",
|
|
45
51
|
"@types/config": "^3.3.5",
|
|
46
52
|
"@types/js-yaml": "^4.0.9"
|
|
47
53
|
},
|
|
48
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "a2b0a53295aebda806b4057f34707e8583570265"
|
|
49
55
|
}
|