@forge/cli-shared 6.6.2-next.5 → 6.6.2-next.7
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 +14 -0
- package/out/apps/app-config.d.ts +1 -1
- package/out/apps/app-config.d.ts.map +1 -1
- package/out/apps/app-config.js +3 -6
- package/out/config/config-file-section-reader.d.ts +2 -0
- package/out/config/config-file-section-reader.d.ts.map +1 -1
- package/out/config/config-file-section-reader.js +6 -0
- package/out/config/config-file.d.ts +10 -0
- package/out/config/config-file.d.ts.map +1 -1
- package/out/config/config-file.js +29 -1
- package/out/config/config-section.d.ts +4 -0
- package/out/config/config-section.d.ts.map +1 -1
- package/out/config/config-section.js +6 -0
- package/out/config/config.d.ts +5 -1
- package/out/config/config.d.ts.map +1 -1
- package/out/graphql/graphql-types.d.ts +269 -7
- package/out/graphql/graphql-types.d.ts.map +1 -1
- package/out/graphql/graphql-types.js +36 -18
- package/out/service/statsig-service.d.ts +2 -4
- package/out/service/statsig-service.d.ts.map +1 -1
- package/out/service/statsig-service.js +2 -3
- package/out/ui/text.d.ts +3 -0
- package/out/ui/text.d.ts.map +1 -1
- package/out/ui/text.js +3 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @forge/cli-shared
|
|
2
2
|
|
|
3
|
+
## 6.6.2-next.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [009ab70]
|
|
8
|
+
- Updated dependencies [34db0f6]
|
|
9
|
+
- @forge/manifest@8.7.1-next.3
|
|
10
|
+
|
|
11
|
+
## 6.6.2-next.6
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- dbc077f: Added config file utility method to only read appId and refactored commands to perform validation after command configuration
|
|
16
|
+
|
|
3
17
|
## 6.6.2-next.5
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/out/apps/app-config.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ export declare type AppConfigProvider = () => Promise<AppDetails>;
|
|
|
9
9
|
export declare function adjustLegacyAppId(legacyAppDetails: AppDetails): {
|
|
10
10
|
id: string;
|
|
11
11
|
};
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const assertiveConfigAppIdProvider: (appConfigReader: ConfigSectionReader<AppDetails>) => AppConfigProvider;
|
|
13
13
|
//# sourceMappingURL=app-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/apps/app-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAG3B,OAAO,EAAa,mBAAmB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/apps/app-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAG3B,OAAO,EAAa,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAE3D,eAAO,MAAM,cAAc;;EAEzB,CAAC;AAEH,oBAAY,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AACzD,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,oBAAY,iBAAiB,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;AAE1D,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,UAAU;;EAQ7D;AAED,eAAO,MAAM,4BAA4B,oBACrB,oBAAoB,UAAU,CAAC,KAAG,iBAEyB,CAAC"}
|
package/out/apps/app-config.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.assertiveConfigAppIdProvider = exports.adjustLegacyAppId = exports.appConfigKey = exports.appConfigShape = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const t = tslib_1.__importStar(require("io-ts"));
|
|
6
6
|
const ari_1 = require("../ari");
|
|
7
7
|
const config_1 = require("../config");
|
|
8
|
-
const ui_1 = require("../ui");
|
|
9
8
|
exports.appConfigShape = t.type({
|
|
10
9
|
id: t.string
|
|
11
10
|
});
|
|
@@ -20,7 +19,5 @@ function adjustLegacyAppId(legacyAppDetails) {
|
|
|
20
19
|
};
|
|
21
20
|
}
|
|
22
21
|
exports.adjustLegacyAppId = adjustLegacyAppId;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
.then(adjustLegacyAppId);
|
|
26
|
-
exports.assertiveAppConfigProvider = assertiveAppConfigProvider;
|
|
22
|
+
const assertiveConfigAppIdProvider = (appConfigReader) => () => (0, config_1.assertive)(appConfigReader).readConfigAppIdOrThrow().then(adjustLegacyAppId);
|
|
23
|
+
exports.assertiveConfigAppIdProvider = assertiveConfigAppIdProvider;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as t from 'io-ts';
|
|
2
|
+
import { EcosystemAppAri } from '@forge/util/packages/ari';
|
|
2
3
|
import { ConfigReader } from './config';
|
|
3
4
|
import { Codec, CodecType, InnerType } from './config-codec-types';
|
|
4
5
|
import { ConfigSectionReader } from './config-section';
|
|
@@ -8,6 +9,7 @@ export declare class ConfigFileSectionReader {
|
|
|
8
9
|
private readonly configReader;
|
|
9
10
|
constructor(configReader: ConfigReader);
|
|
10
11
|
readConfigSection<K extends string, V extends Codec>(key: K, schema: CodecType<V>): Promise<InnerType<V> | 'missing' | 'invalid'>;
|
|
12
|
+
readAppId(): Promise<EcosystemAppAri>;
|
|
11
13
|
}
|
|
12
14
|
export declare const configFileReaderForSection: <K extends string, P extends Codec>(key: K, schema: CodecType<P>, configReader: ConfigReader) => ConfigSectionReader<InnerType<P>>;
|
|
13
15
|
//# sourceMappingURL=config-file-section-reader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-file-section-reader.d.ts","sourceRoot":"","sources":["../../src/config/config-file-section-reader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,oBAAY,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AAEhE,qBAAa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,YAAY;IAE1C,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,KAAK,EAC9D,GAAG,EAAE,CAAC,EACN,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"config-file-section-reader.d.ts","sourceRoot":"","sources":["../../src/config/config-file-section-reader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,oBAAY,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AAEhE,qBAAa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,YAAY;IAE1C,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,KAAK,EAC9D,GAAG,EAAE,CAAC,EACN,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,SAAS,CAAC;IAYnC,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC;CAGnD;AAkBD,eAAO,MAAM,0BAA0B,kFAGvB,YAAY,sCAG3B,CAAC"}
|
|
@@ -22,6 +22,9 @@ class ConfigFileSectionReader {
|
|
|
22
22
|
return 'missing';
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
+
async readAppId() {
|
|
26
|
+
return await this.configReader.readAppId();
|
|
27
|
+
}
|
|
25
28
|
}
|
|
26
29
|
exports.ConfigFileSectionReader = ConfigFileSectionReader;
|
|
27
30
|
class ShapedConfigFileSectionReader {
|
|
@@ -36,6 +39,9 @@ class ShapedConfigFileSectionReader {
|
|
|
36
39
|
readConfigSection() {
|
|
37
40
|
return this.configSectionReader.readConfigSection(this.key, this.schema);
|
|
38
41
|
}
|
|
42
|
+
readAppId() {
|
|
43
|
+
return this.configSectionReader.readAppId();
|
|
44
|
+
}
|
|
39
45
|
}
|
|
40
46
|
const configFileReaderForSection = (key, schema, configReader) => {
|
|
41
47
|
return new ShapedConfigFileSectionReader(new ConfigFileSectionReader(configReader), key, schema);
|
|
@@ -3,12 +3,16 @@ import { ConfigReader, ConfigWriter } from './';
|
|
|
3
3
|
import { Modules, ManifestSchema, Resources } from '@forge/manifest';
|
|
4
4
|
import { UserError, ValidationError } from '../shared';
|
|
5
5
|
import { RuntimeType } from '../runtimes';
|
|
6
|
+
import { EcosystemAppAri } from '@forge/util/packages/ari';
|
|
6
7
|
export declare class InvalidManifestError extends ValidationError {
|
|
7
8
|
constructor();
|
|
8
9
|
}
|
|
9
10
|
export declare class ResourceDefinitionMissingError extends UserError {
|
|
10
11
|
constructor(resources: string[]);
|
|
11
12
|
}
|
|
13
|
+
export declare class InvalidConfigAppId extends UserError {
|
|
14
|
+
constructor(appId: string);
|
|
15
|
+
}
|
|
12
16
|
export interface Handler {
|
|
13
17
|
module: string;
|
|
14
18
|
func: string;
|
|
@@ -28,6 +32,7 @@ export declare class ConfigFile implements ConfigReader, ConfigWriter, ConfigInt
|
|
|
28
32
|
private readonly fileWriter;
|
|
29
33
|
private readonly manifestParser;
|
|
30
34
|
constructor(fileReader: FileSystemReader, fileWriter: FileSystemWriter);
|
|
35
|
+
readAppId(): Promise<EcosystemAppAri>;
|
|
31
36
|
getAppHandlers(): Promise<Array<Handler>>;
|
|
32
37
|
readConfig(): Promise<ManifestSchema>;
|
|
33
38
|
snapshotsEnabled(): Promise<boolean>;
|
|
@@ -52,4 +57,9 @@ export declare class ConfigFile implements ConfigReader, ConfigWriter, ConfigInt
|
|
|
52
57
|
getConnectKey(): Promise<string | undefined>;
|
|
53
58
|
private getResourceType;
|
|
54
59
|
}
|
|
60
|
+
export declare class RawConfigFile extends ConfigFile {
|
|
61
|
+
private rawFileReader;
|
|
62
|
+
constructor(fileReader: FileSystemReader, fileWriter: FileSystemWriter);
|
|
63
|
+
readConfig(): Promise<ManifestSchema>;
|
|
64
|
+
}
|
|
55
65
|
//# sourceMappingURL=config-file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-file.d.ts","sourceRoot":"","sources":["../../src/config/config-file.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGpE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAoB,MAAM,IAAI,CAAC;AAGlE,OAAO,EACL,OAAO,EACP,cAAc,EACd,SAAS,EAMV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,SAAS,EAAE,eAAe,EAAQ,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAkB,M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AQ,UAAU;IAC3C,OAAO,CAAC,aAAa,CAAmB;gBAC5B,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB;IAIzD,UAAU,IAAI,OAAO,CAAC,cAAc,CAAC;CAInD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConfigFile = exports.findUIKit1Modules = exports.ResourceDefinitionMissingError = exports.InvalidManifestError = void 0;
|
|
3
|
+
exports.RawConfigFile = exports.ConfigFile = exports.findUIKit1Modules = exports.InvalidConfigAppId = exports.ResourceDefinitionMissingError = exports.InvalidManifestError = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const yaml_1 = require("yaml");
|
|
6
6
|
const ui_1 = require("../ui");
|
|
@@ -11,6 +11,7 @@ const manifest_1 = require("@forge/manifest");
|
|
|
11
11
|
const url_1 = require("url");
|
|
12
12
|
const shared_1 = require("../shared");
|
|
13
13
|
const runtimes_1 = require("../runtimes");
|
|
14
|
+
const ari_1 = require("@forge/util/packages/ari");
|
|
14
15
|
class InvalidManifestError extends shared_1.ValidationError {
|
|
15
16
|
constructor() {
|
|
16
17
|
super(ui_1.Text.artifact.error.invalidYaml(_1.manifestFileName));
|
|
@@ -23,6 +24,12 @@ class ResourceDefinitionMissingError extends shared_1.UserError {
|
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
exports.ResourceDefinitionMissingError = ResourceDefinitionMissingError;
|
|
27
|
+
class InvalidConfigAppId extends shared_1.UserError {
|
|
28
|
+
constructor(appId) {
|
|
29
|
+
super(ui_1.Text.config.appId.invalid(appId));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.InvalidConfigAppId = InvalidConfigAppId;
|
|
26
33
|
const isUIKit1 = (module) => {
|
|
27
34
|
return (typeof module === 'object' &&
|
|
28
35
|
module !== null &&
|
|
@@ -100,6 +107,15 @@ class ConfigFile {
|
|
|
100
107
|
this.fileWriter = fileWriter;
|
|
101
108
|
this.manifestParser = new manifest_1.ManifestParserBuilder().withInterpolators().build();
|
|
102
109
|
}
|
|
110
|
+
async readAppId() {
|
|
111
|
+
const manifestFileContents = await this.readConfig();
|
|
112
|
+
try {
|
|
113
|
+
return ari_1.EcosystemAppAri.parse(manifestFileContents.app?.id);
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
throw new InvalidConfigAppId(manifestFileContents.app?.id);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
103
119
|
async getAppHandlers() {
|
|
104
120
|
const config = await this.readConfig();
|
|
105
121
|
const functions = config.modules?.function ?? [];
|
|
@@ -286,3 +302,15 @@ class ConfigFile {
|
|
|
286
302
|
}
|
|
287
303
|
}
|
|
288
304
|
exports.ConfigFile = ConfigFile;
|
|
305
|
+
class RawConfigFile extends ConfigFile {
|
|
306
|
+
rawFileReader;
|
|
307
|
+
constructor(fileReader, fileWriter) {
|
|
308
|
+
super(fileReader, fileWriter);
|
|
309
|
+
this.rawFileReader = fileReader;
|
|
310
|
+
}
|
|
311
|
+
async readConfig() {
|
|
312
|
+
const manifest = this.rawFileReader.readFile(_1.manifestFileName);
|
|
313
|
+
return (0, yaml_1.parse)(manifest);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
exports.RawConfigFile = RawConfigFile;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { EcosystemAppAri } from '@forge/util/packages/ari';
|
|
2
|
+
import { AppDetails } from '../index';
|
|
1
3
|
export interface ConfigSectionReader<V extends object> {
|
|
2
4
|
readConfigSection(): Promise<V | 'missing' | 'invalid'>;
|
|
5
|
+
readAppId(): Promise<EcosystemAppAri>;
|
|
3
6
|
}
|
|
4
7
|
export interface ConfigSectionWriter<V extends object> {
|
|
5
8
|
writeConfigSection(configSection: V): Promise<void>;
|
|
@@ -13,6 +16,7 @@ export declare class AssertiveConfigSectionReader<V extends object> {
|
|
|
13
16
|
private readonly configSectionReader;
|
|
14
17
|
constructor(configSectionReader: ConfigSectionReader<V>);
|
|
15
18
|
readConfigSectionOrThrow(missingMessage: string, invalidMessage: string): Promise<V>;
|
|
19
|
+
readConfigAppIdOrThrow(): Promise<AppDetails>;
|
|
16
20
|
}
|
|
17
21
|
export declare const assertive: <V extends object>(configSectionReader: ConfigSectionReader<V>) => AssertiveConfigSectionReader<V>;
|
|
18
22
|
//# sourceMappingURL=config-section.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-section.d.ts","sourceRoot":"","sources":["../../src/config/config-section.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM;IACnD,iBAAiB,IAAI,OAAO,CAAC,CAAC,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"config-section.d.ts","sourceRoot":"","sources":["../../src/config/config-section.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM;IACnD,iBAAiB,IAAI,OAAO,CAAC,CAAC,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC;IACxD,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM;IACnD,kBAAkB,CAAC,aAAa,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD;AAED,qBAAa,yBAA0B,SAAQ,KAAK;CAAG;AACvD,qBAAa,0BAA2B,SAAQ,KAAK;CAAG;AAExD,qBAAa,4BAA4B,CAAC,CAAC,SAAS,MAAM;IAC5C,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBAAnB,mBAAmB,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAE3D,wBAAwB,CAAC,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAWpF,sBAAsB,IAAI,OAAO,CAAC,UAAU,CAAC;CAM3D;AAED,eAAO,MAAM,SAAS,oGAEwE,CAAC"}
|
|
@@ -24,6 +24,12 @@ class AssertiveConfigSectionReader {
|
|
|
24
24
|
return configValue;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
+
async readConfigAppIdOrThrow() {
|
|
28
|
+
const appId = await this.configSectionReader.readAppId();
|
|
29
|
+
return {
|
|
30
|
+
id: appId.toString()
|
|
31
|
+
};
|
|
32
|
+
}
|
|
27
33
|
}
|
|
28
34
|
exports.AssertiveConfigSectionReader = AssertiveConfigSectionReader;
|
|
29
35
|
const assertive = (configSectionReader) => new AssertiveConfigSectionReader(configSectionReader);
|
package/out/config/config.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ManifestSchema, Resources } from '@forge/manifest';
|
|
2
|
+
import { EcosystemAppAri } from '@forge/util/packages/ari';
|
|
2
3
|
export declare const manifestFileName = "manifest.yml";
|
|
3
4
|
export declare const dependencyFileNames: string[];
|
|
4
5
|
export declare const ModuleEntryPoints: readonly ["view", "edit", "create", "contextConfig", "config", "target"];
|
|
@@ -14,9 +15,12 @@ export declare type HostedResourcesModule = BaseModule & {
|
|
|
14
15
|
} & {
|
|
15
16
|
[entryPoint in ModuleEntryPoint]?: HostedResourcesModule;
|
|
16
17
|
};
|
|
17
|
-
export interface ConfigReader {
|
|
18
|
+
export interface ConfigReader extends ConfigAppIdReader {
|
|
18
19
|
readConfig(): Promise<ManifestSchema>;
|
|
19
20
|
}
|
|
21
|
+
export interface ConfigAppIdReader {
|
|
22
|
+
readAppId(): Promise<EcosystemAppAri>;
|
|
23
|
+
}
|
|
20
24
|
export interface ConfigWriter {
|
|
21
25
|
writeToConfigFile<K extends string, V extends object>(configKey: K, config: V): Promise<void>;
|
|
22
26
|
prependAppNameToModules(name: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAC/C,eAAO,MAAM,mBAAmB,UAAqD,CAAC;AAEtF,eAAO,MAAM,iBAAiB,0EAA2E,CAAC;AAC1G,oBAAY,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,oBAAY,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;CACb,GAAG;KACD,UAAU,IAAI,gBAAgB,CAAC,CAAC,EAAE,UAAU;CAC9C,CAAC;AAEF,oBAAY,qBAAqB,GAAG,UAAU,GAAG;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC/B,GAAG;KACD,UAAU,IAAI,gBAAgB,CAAC,CAAC,EAAE,qBAAqB;CACzD,CAAC;AAEF,MAAM,WAAW,YAAa,SAAQ,iBAAiB;IACrD,UAAU,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,YAAY;IAC3B,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,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