@map-colonies/config 1.0.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/README.md +291 -0
- package/dist/avi.d.ts +2 -0
- package/dist/avi.d.ts.map +1 -0
- package/dist/avi.js +16 -0
- package/dist/avi.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +102 -0
- package/dist/config.js.map +1 -0
- package/dist/constants.d.ts +5 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +14 -0
- package/dist/constants.js.map +1 -0
- package/dist/env.d.ts +3 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +90 -0
- package/dist/env.js.map +1 -0
- package/dist/errors.d.ts +74 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +55 -0
- package/dist/errors.js.map +1 -0
- package/dist/httpClient.d.ts +4 -0
- package/dist/httpClient.d.ts.map +1 -0
- package/dist/httpClient.js +64 -0
- package/dist/httpClient.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/options.d.ts +4 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +50 -0
- package/dist/options.js.map +1 -0
- package/dist/schemas.d.ts +296 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +41 -0
- package/dist/schemas.js.map +1 -0
- package/dist/types.d.ts +105 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +23 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/debug.d.ts +3 -0
- package/dist/utils/debug.d.ts.map +1 -0
- package/dist/utils/debug.js +12 -0
- package/dist/utils/debug.js.map +1 -0
- package/dist/validator.d.ts +7 -0
- package/dist/validator.d.ts.map +1 -0
- package/dist/validator.js +43 -0
- package/dist/validator.js.map +1 -0
- package/package.json +85 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { typeSymbol } from '@map-colonies/schemas/build/schemas/symbol';
|
|
3
|
+
import { JSONSchemaType } from 'ajv';
|
|
4
|
+
type Prettify<T> = {
|
|
5
|
+
[K in keyof T]: T[K];
|
|
6
|
+
} & {};
|
|
7
|
+
export type EnvType = 'number' | 'string' | 'boolean' | 'integer' | 'null';
|
|
8
|
+
export interface EnvDetails {
|
|
9
|
+
type: EnvType;
|
|
10
|
+
path: string;
|
|
11
|
+
}
|
|
12
|
+
export type EnvMap = Record<string, EnvDetails>;
|
|
13
|
+
export interface Config {
|
|
14
|
+
configName: string;
|
|
15
|
+
schemaId: string;
|
|
16
|
+
version: number;
|
|
17
|
+
config: {
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
createdAt: number;
|
|
21
|
+
createdBy: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ServerCapabilities {
|
|
24
|
+
serverVersion: string;
|
|
25
|
+
schemasPackageVersion: string;
|
|
26
|
+
pubSubEnabled: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface SchemaWithType {
|
|
29
|
+
$id?: string;
|
|
30
|
+
[typeSymbol]: unknown;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Represents the base options for configuration.
|
|
34
|
+
*/
|
|
35
|
+
export interface BaseOptions {
|
|
36
|
+
/**
|
|
37
|
+
* The name of the remote configuration.
|
|
38
|
+
*/
|
|
39
|
+
configName: string;
|
|
40
|
+
/**
|
|
41
|
+
* The version of the remote configuration. It can be either 'latest' or a number.
|
|
42
|
+
*/
|
|
43
|
+
version: 'latest' | number;
|
|
44
|
+
/**
|
|
45
|
+
* The URL of the configuration server.
|
|
46
|
+
*/
|
|
47
|
+
configServerUrl: string;
|
|
48
|
+
/**
|
|
49
|
+
* Indicates whether the configuration should be loaded in offline mode.
|
|
50
|
+
*/
|
|
51
|
+
offlineMode?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Indicates whether to ignore the error when the server version is older than the requested version.
|
|
54
|
+
*/
|
|
55
|
+
ignoreServerIsOlderVersionError?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The path to the local configuration folder.
|
|
58
|
+
* @default './config'
|
|
59
|
+
*/
|
|
60
|
+
localConfigPath?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Represents the options for configuration.
|
|
64
|
+
*/
|
|
65
|
+
export type ConfigOptions<T extends SchemaWithType> = Prettify<BaseOptions & {
|
|
66
|
+
/**
|
|
67
|
+
* The schema of the configuration object.
|
|
68
|
+
*/
|
|
69
|
+
schema: T;
|
|
70
|
+
}>;
|
|
71
|
+
export declare const optionsSchema: JSONSchemaType<BaseOptions>;
|
|
72
|
+
/**
|
|
73
|
+
* Represents the schema of the configuration object.
|
|
74
|
+
* @template T - The type of the configuration schema.
|
|
75
|
+
*/
|
|
76
|
+
export interface ConfigInstance<T> {
|
|
77
|
+
/**
|
|
78
|
+
* Retrieves the value at the specified path from the configuration object.
|
|
79
|
+
* @template TPath - The type of the path.
|
|
80
|
+
* @param path - The path to the desired value.
|
|
81
|
+
* @returns The value at the specified path.
|
|
82
|
+
*/
|
|
83
|
+
get: <TPath extends string>(path: TPath) => _.GetFieldType<T, TPath>;
|
|
84
|
+
/**
|
|
85
|
+
* Retrieves the entire configuration object.
|
|
86
|
+
* @returns The entire configuration object.
|
|
87
|
+
*/
|
|
88
|
+
getAll: () => T;
|
|
89
|
+
/**
|
|
90
|
+
* Retrieves different parts of the configuration object before being merged and validated.
|
|
91
|
+
* @returns An object containing the localConfig, config, and envConfig parts of the configuration.
|
|
92
|
+
*/
|
|
93
|
+
getConfigParts: () => {
|
|
94
|
+
localConfig: object;
|
|
95
|
+
config: object;
|
|
96
|
+
envConfig: object;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Retrieves the resolved options from the configuration object.
|
|
100
|
+
* @returns The resolved options.
|
|
101
|
+
*/
|
|
102
|
+
getResolvedOptions: () => BaseOptions;
|
|
103
|
+
}
|
|
104
|
+
export {};
|
|
105
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAErC,KAAK,QAAQ,CAAC,CAAC,IAAI;KAChB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAErB,GAAG,EAAE,CAAC;AAEP,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAE3E,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAEhD,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC3B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAC1C;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,cAAc,IAAI,QAAQ,CAC5D,WAAW,GAAG;IACZ;;OAEG;IACH,MAAM,EAAE,CAAC,CAAC;CACX,CACF,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,WAAW,CAiBrD,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B;;;;;OAKG;IACH,GAAG,EAAE,CAAC,KAAK,SAAS,MAAM,EAAE,IAAI,EAAE,KAAK,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAErE;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhB;;;OAGG;IACH,cAAc,EAAE,MAAM;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF;;;OAGG;IACH,kBAAkB,EAAE,MAAM,WAAW,CAAC;CACvC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.optionsSchema = void 0;
|
|
4
|
+
const symbol_1 = require("@map-colonies/schemas/build/schemas/symbol");
|
|
5
|
+
exports.optionsSchema = {
|
|
6
|
+
required: ['configName', 'configServerUrl', 'version'],
|
|
7
|
+
additionalProperties: false,
|
|
8
|
+
type: 'object',
|
|
9
|
+
properties: {
|
|
10
|
+
configName: { type: 'string' },
|
|
11
|
+
version: {
|
|
12
|
+
oneOf: [
|
|
13
|
+
{ type: 'string', const: 'latest' },
|
|
14
|
+
{ type: 'integer', minimum: 1 },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
configServerUrl: { type: 'string' },
|
|
18
|
+
offlineMode: { type: 'boolean', nullable: true },
|
|
19
|
+
ignoreServerIsOlderVersionError: { type: 'boolean', nullable: true },
|
|
20
|
+
localConfigPath: { type: 'string', default: './config', nullable: true },
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAA,uEAAwE;AAkF3D,QAAA,aAAa,GAAgC;IACxD,QAAQ,EAAE,CAAC,YAAY,EAAE,iBAAiB,EAAE,SAAS,CAAC;IACtD,oBAAoB,EAAE,KAAK;IAC3B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC9B,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;gBACnC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE;aAChC;SACF;QACD,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACnC,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;QAChD,+BAA+B,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;QACpE,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;KACzE;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/utils/debug.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,QAAQ,CAExD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createDebug = void 0;
|
|
7
|
+
const debug_1 = __importDefault(require("debug"));
|
|
8
|
+
function createDebug(name) {
|
|
9
|
+
return (0, debug_1.default)(`@map-colonies/config:${name}`);
|
|
10
|
+
}
|
|
11
|
+
exports.createDebug = createDebug;
|
|
12
|
+
//# sourceMappingURL=debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../src/utils/debug.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,SAAgB,WAAW,CAAC,IAAY;IACtC,OAAO,IAAA,eAAK,EAAC,wBAAwB,IAAI,EAAE,CAAC,CAAC;AAC/C,CAAC;AAFD,kCAEC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Ajv, { SchemaObject } from 'ajv/dist/2019';
|
|
2
|
+
import { ValidationError } from '@apideck/better-ajv-errors';
|
|
3
|
+
declare const ajvConfigValidator: import("ajv/dist/core").default;
|
|
4
|
+
export { ajvConfigValidator };
|
|
5
|
+
export declare const ajvOptionsValidator: Ajv;
|
|
6
|
+
export declare function validate<T>(ajv: Ajv, schema: SchemaObject, data: unknown): [ValidationError[], undefined] | [undefined, T];
|
|
7
|
+
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,EAAE,EAAmB,YAAY,EAAE,MAAM,eAAe,CAAC;AAGnE,OAAO,EAAE,eAAe,EAAmB,MAAM,4BAA4B,CAAC;AAS9E,QAAA,MAAM,kBAAkB,iCAOvB,CAAC;AAIF,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B,eAAO,MAAM,mBAAmB,KAK9B,CAAC;AAEH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,GAAG,CAAC,eAAe,EAAE,EAAE,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAc1H"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.validate = exports.ajvOptionsValidator = exports.ajvConfigValidator = void 0;
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const _2019_1 = __importDefault(require("ajv/dist/2019"));
|
|
9
|
+
const ajv_formats_1 = __importDefault(require("ajv-formats"));
|
|
10
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
11
|
+
const better_ajv_errors_1 = require("@apideck/better-ajv-errors");
|
|
12
|
+
const debug_1 = require("./utils/debug");
|
|
13
|
+
const debug = (0, debug_1.createDebug)('validator');
|
|
14
|
+
const draft7MetaSchema = JSON.parse((0, node_fs_1.readFileSync)(require.resolve('ajv/dist/refs/json-schema-draft-07.json'), { encoding: 'utf-8' }));
|
|
15
|
+
const ajvConfigValidator = (0, ajv_formats_1.default)(new _2019_1.default({
|
|
16
|
+
useDefaults: true,
|
|
17
|
+
allErrors: true,
|
|
18
|
+
verbose: true,
|
|
19
|
+
keywords: ['x-env-value'],
|
|
20
|
+
}));
|
|
21
|
+
exports.ajvConfigValidator = ajvConfigValidator;
|
|
22
|
+
ajvConfigValidator.addMetaSchema(draft7MetaSchema);
|
|
23
|
+
exports.ajvOptionsValidator = new _2019_1.default({
|
|
24
|
+
useDefaults: true,
|
|
25
|
+
coerceTypes: true,
|
|
26
|
+
allErrors: true,
|
|
27
|
+
verbose: true,
|
|
28
|
+
});
|
|
29
|
+
function validate(ajv, schema, data) {
|
|
30
|
+
debug('validating data %j with schema %s', data, schema.$id);
|
|
31
|
+
const clonedData = lodash_1.default.cloneDeep(data);
|
|
32
|
+
const valid = ajv.validate(schema, clonedData);
|
|
33
|
+
if (!valid) {
|
|
34
|
+
debug('validation failed with errors %j', ajv.errors);
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
36
|
+
const betterErrors = (0, better_ajv_errors_1.betterAjvErrors)({ schema: schema, data, errors: ajv.errors });
|
|
37
|
+
return [betterErrors, undefined];
|
|
38
|
+
}
|
|
39
|
+
debug('validation successful');
|
|
40
|
+
return [undefined, clonedData];
|
|
41
|
+
}
|
|
42
|
+
exports.validate = validate;
|
|
43
|
+
//# sourceMappingURL=validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAuC;AACvC,0DAAmE;AACnE,8DAAqC;AACrC,oDAA4B;AAC5B,kEAA8E;AAC9E,yCAA4C;AAE5C,MAAM,KAAK,GAAG,IAAA,mBAAW,EAAC,WAAW,CAAC,CAAC;AAEvC,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CACjC,IAAA,sBAAY,EAAC,OAAO,CAAC,OAAO,CAAC,yCAAyC,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAC7E,CAAC;AAErB,MAAM,kBAAkB,GAAG,IAAA,qBAAU,EACnC,IAAI,eAAG,CAAC;IACN,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,CAAC,aAAa,CAAC;CAC1B,CAAC,CACH,CAAC;AAIO,gDAAkB;AAF3B,kBAAkB,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;AAItC,QAAA,mBAAmB,GAAG,IAAI,eAAG,CAAC;IACzC,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;CACd,CAAC,CAAC;AAEH,SAAgB,QAAQ,CAAI,GAAQ,EAAE,MAAoB,EAAE,IAAa;IACvE,KAAK,CAAC,mCAAmC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAE7D,MAAM,UAAU,GAAG,gBAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,KAAK,CAAC,kCAAkC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QACtD,+DAA+D;QAC/D,MAAM,YAAY,GAAG,IAAA,mCAAe,EAAC,EAAE,MAAM,EAAE,MAAyD,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QACtI,OAAO,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC/B,OAAO,CAAC,SAAS,EAAE,UAAe,CAAC,CAAC;AACtC,CAAC;AAdD,4BAcC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@map-colonies/config",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Config package for MapColonies with support for central config management",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"require": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"format": "prettier --check .",
|
|
14
|
+
"format:fix": "prettier --write .",
|
|
15
|
+
"prelint:fix": "npm run format:fix",
|
|
16
|
+
"prelint": "npm run format",
|
|
17
|
+
"lint": "eslint .",
|
|
18
|
+
"lint:fix": "eslint --fix .",
|
|
19
|
+
"test": "cross-env SUPPRESS_NO_CONFIG_WARNING=true NODE_CONFIG_STRICT_MODE=false jest --config=./tests/configurations/jest.config.js",
|
|
20
|
+
"prebuild": "npm run clean",
|
|
21
|
+
"build": "tsc --project tsconfig.build.json",
|
|
22
|
+
"start": "npm run build && cd dist && node ./index.js",
|
|
23
|
+
"clean": "rimraf dist",
|
|
24
|
+
"prepublish": "npm run build"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/MapColonies/config.git"
|
|
29
|
+
},
|
|
30
|
+
"author": "MapColonies",
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/MapColonies/config/issues"
|
|
34
|
+
},
|
|
35
|
+
"husky": {
|
|
36
|
+
"hooks": {
|
|
37
|
+
"pre-commit": "pretty-quick --staged",
|
|
38
|
+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist/**/*"
|
|
46
|
+
],
|
|
47
|
+
"homepage": "https://github.com/MapColonies/config#readme",
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@apideck/better-ajv-errors": "^0.3.6",
|
|
50
|
+
"@apidevtools/json-schema-ref-parser": "^11.6.4",
|
|
51
|
+
"@map-colonies/read-pkg": "^0.0.1",
|
|
52
|
+
"@types/lodash": "^4.17.0",
|
|
53
|
+
"ajv": "^8.16.0",
|
|
54
|
+
"ajv-formats": "^3.0.1",
|
|
55
|
+
"config": "^3.3.11",
|
|
56
|
+
"debug": "^4.3.5",
|
|
57
|
+
"deepmerge": "^4.3.1",
|
|
58
|
+
"http-status-codes": "^2.3.0",
|
|
59
|
+
"lodash": "^4.17.21",
|
|
60
|
+
"semver": "^7.6.2",
|
|
61
|
+
"undici": "^6.18.2"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"@map-colonies/schemas": "^0.2.0"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@commitlint/cli": "^11.0.0",
|
|
68
|
+
"@commitlint/config-conventional": "^11.0.0",
|
|
69
|
+
"@map-colonies/eslint-config": "^4.0.0",
|
|
70
|
+
"@types/config": "^3.3.4",
|
|
71
|
+
"@types/debug": "^4.1.12",
|
|
72
|
+
"@types/jest": "^29.5.12",
|
|
73
|
+
"@types/node": "^14.14.12",
|
|
74
|
+
"commitlint": "^11.0.0",
|
|
75
|
+
"cross-env": "^7.0.3",
|
|
76
|
+
"cz-conventional-changelog": "^3.3.0",
|
|
77
|
+
"eslint": "^8.56.0",
|
|
78
|
+
"husky": "^4.3.5",
|
|
79
|
+
"jest": "^29.7.0",
|
|
80
|
+
"prettier": "^2.2.1",
|
|
81
|
+
"pretty-quick": "^3.1.0",
|
|
82
|
+
"ts-jest": "^29.1.5",
|
|
83
|
+
"typescript": "^5.4.5"
|
|
84
|
+
}
|
|
85
|
+
}
|