@intlayer/webpack 1.0.0 → 1.0.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/cjs/index.cjs +16 -21
- package/dist/cjs/index.d.ts +6 -0
- package/dist/cjs/scripts/bundle.cjs +17 -20
- package/dist/cjs/scripts/bundle.d.ts +7 -0
- package/dist/cjs/scripts/index.cjs +11 -19
- package/dist/cjs/scripts/index.d.ts +3 -0
- package/dist/cjs/scripts/startServer.cjs +10 -18
- package/dist/cjs/scripts/startServer.d.ts +5 -0
- package/dist/cjs/transpiler/dictionary_to_main/createDictionaryList.cjs +14 -30
- package/dist/cjs/transpiler/dictionary_to_main/createDictionaryList.d.ts +6 -0
- package/dist/cjs/transpiler/dictionary_to_main/index.cjs +9 -21
- package/dist/cjs/transpiler/dictionary_to_main/index.d.ts +1 -0
- package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.cjs +37 -33
- package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.cjs.map +1 -1
- package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.d.ts +7 -0
- package/dist/cjs/transpiler/dictionary_to_type/createType.cjs +16 -28
- package/dist/cjs/transpiler/dictionary_to_type/createType.d.ts +42 -0
- package/dist/cjs/transpiler/dictionary_to_type/index.cjs +11 -27
- package/dist/cjs/transpiler/dictionary_to_type/index.d.ts +3 -0
- package/dist/cjs/transpiler/intlater_module_to_dictionary/extractNestedJSON.cjs +8 -13
- package/dist/cjs/transpiler/intlater_module_to_dictionary/extractNestedJSON.d.ts +44 -0
- package/dist/cjs/transpiler/intlater_module_to_dictionary/index.cjs +13 -33
- package/dist/cjs/transpiler/intlater_module_to_dictionary/index.d.ts +4 -0
- package/dist/cjs/transpiler/intlater_module_to_dictionary/processModule.cjs +11 -14
- package/dist/cjs/transpiler/intlater_module_to_dictionary/processModule.d.ts +8 -0
- package/dist/cjs/transpiler/intlater_module_to_dictionary/transpileBundledCode.cjs +14 -30
- package/dist/cjs/transpiler/intlater_module_to_dictionary/transpileBundledCode.d.ts +6 -0
- package/dist/cjs/utils.cjs +10 -18
- package/dist/cjs/utils.d.ts +4 -0
- package/dist/cjs/webpack-plugin.cjs +21 -40
- package/dist/cjs/webpack-plugin.d.ts +15 -0
- package/dist/cjs/webpack.config.cjs +34 -47
- package/dist/cjs/webpack.config.d.ts +7 -0
- package/dist/esm/index.d.mts +6 -9
- package/dist/esm/index.mjs +5 -5
- package/dist/esm/scripts/bundle.d.mts +2 -2
- package/dist/esm/scripts/bundle.mjs +13 -8
- package/dist/esm/scripts/index.d.mts +3 -3
- package/dist/esm/scripts/index.mjs +3 -3
- package/dist/esm/scripts/startServer.d.mts +1 -1
- package/dist/esm/scripts/startServer.mjs +5 -3
- package/dist/esm/transpiler/dictionary_to_main/createDictionaryList.mjs +7 -7
- package/dist/esm/transpiler/dictionary_to_main/index.d.mts +1 -1
- package/dist/esm/transpiler/dictionary_to_main/index.mjs +2 -2
- package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs +31 -12
- package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs.map +1 -1
- package/dist/esm/transpiler/dictionary_to_type/createType.d.mts +1 -1
- package/dist/esm/transpiler/dictionary_to_type/createType.mjs +14 -12
- package/dist/esm/transpiler/dictionary_to_type/index.d.mts +3 -10
- package/dist/esm/transpiler/dictionary_to_type/index.mjs +3 -3
- package/dist/esm/transpiler/intlater_module_to_dictionary/extractNestedJSON.d.mts +1 -1
- package/dist/esm/transpiler/intlater_module_to_dictionary/extractNestedJSON.mjs +4 -2
- package/dist/esm/transpiler/intlater_module_to_dictionary/index.d.mts +4 -4
- package/dist/esm/transpiler/intlater_module_to_dictionary/index.mjs +4 -4
- package/dist/esm/transpiler/intlater_module_to_dictionary/processModule.d.mts +2 -4
- package/dist/esm/transpiler/intlater_module_to_dictionary/processModule.mjs +7 -3
- package/dist/esm/transpiler/intlater_module_to_dictionary/transpileBundledCode.d.mts +1 -3
- package/dist/esm/transpiler/intlater_module_to_dictionary/transpileBundledCode.mjs +6 -4
- package/dist/esm/utils.mjs +6 -6
- package/dist/esm/webpack-plugin.d.mts +10 -10
- package/dist/esm/webpack-plugin.mjs +16 -20
- package/dist/esm/webpack.config.d.mts +2 -2
- package/dist/esm/webpack.config.mjs +29 -23
- package/package.json +7 -7
- package/src/transpiler/dictionary_to_type/createModuleAugmentation.ts +30 -5
package/dist/esm/utils.mjs
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { SHA3, enc } from "crypto-js";
|
|
2
2
|
const getFileHash = (filePath) => {
|
|
3
3
|
const hash = SHA3(filePath);
|
|
4
|
-
return hash
|
|
5
|
-
.toString(enc.Base64)
|
|
6
|
-
.replace(/[^A-Z\d]/gi, "")
|
|
7
|
-
.substring(0, 20);
|
|
4
|
+
return hash.toString(enc.Base64).replace(/[^A-Z\d]/gi, "").substring(0, 20);
|
|
8
5
|
};
|
|
9
6
|
const transformToCamelCase = (string) => {
|
|
10
7
|
const words = string.split(/[\s\-_]+/);
|
|
@@ -16,5 +13,8 @@ const transformToCamelCase = (string) => {
|
|
|
16
13
|
});
|
|
17
14
|
return camelCasedWords.join("");
|
|
18
15
|
};
|
|
19
|
-
export {
|
|
20
|
-
|
|
16
|
+
export {
|
|
17
|
+
getFileHash,
|
|
18
|
+
transformToCamelCase
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Compiler } from
|
|
1
|
+
import { Compiler } from 'webpack';
|
|
2
2
|
|
|
3
3
|
declare class IntLayerPlugin {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
private managedFiles;
|
|
5
|
+
private updatedFiles;
|
|
6
|
+
private addedFiles;
|
|
7
|
+
constructor();
|
|
8
|
+
initDictionaries(): Promise<void>;
|
|
9
|
+
processFilesChanges(): Promise<void>;
|
|
10
|
+
processNewFiles(): Promise<void>;
|
|
11
|
+
detectFileAddedOrRemoved(): Promise<void>;
|
|
12
|
+
apply(compiler: Compiler): void;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export { IntLayerPlugin };
|
|
@@ -2,19 +2,18 @@ import { relative, resolve } from "path";
|
|
|
2
2
|
import { getConfiguration } from "@intlayer/config";
|
|
3
3
|
import { sync } from "glob";
|
|
4
4
|
import { DynamicEntryPlugin } from "webpack";
|
|
5
|
-
import { createDictionaryList } from
|
|
6
|
-
import { createModuleAugmentation } from
|
|
7
|
-
import { createTypes } from
|
|
8
|
-
import { transpileBundledCode } from
|
|
9
|
-
import { getFileHash } from
|
|
5
|
+
import { createDictionaryList } from './transpiler/dictionary_to_main/createDictionaryList.mjs';
|
|
6
|
+
import { createModuleAugmentation } from './transpiler/dictionary_to_type/createModuleAugmentation.mjs';
|
|
7
|
+
import { createTypes } from './transpiler/dictionary_to_type/createType.mjs';
|
|
8
|
+
import { transpileBundledCode } from './transpiler/intlater_module_to_dictionary/transpileBundledCode.mjs';
|
|
9
|
+
import { getFileHash } from './utils.mjs';
|
|
10
10
|
const getRelativePath = (filePath) => relative(baseDir, filePath);
|
|
11
11
|
const getBundledFilePathFromIntlayerModule = (filePath) => {
|
|
12
12
|
const hash = getFileHash(filePath);
|
|
13
13
|
return `${bundleDir}/${hash}${bundleFileExtension}`;
|
|
14
14
|
};
|
|
15
15
|
const { content } = getConfiguration();
|
|
16
|
-
const { bundleDir, baseDir, bundleFileExtension, watchedFilesPatternWithPath } =
|
|
17
|
-
content;
|
|
16
|
+
const { bundleDir, baseDir, bundleFileExtension, watchedFilesPatternWithPath } = content;
|
|
18
17
|
class IntLayerPlugin {
|
|
19
18
|
managedFiles;
|
|
20
19
|
updatedFiles;
|
|
@@ -26,10 +25,10 @@ class IntLayerPlugin {
|
|
|
26
25
|
}
|
|
27
26
|
// function to initialize the dictionaries
|
|
28
27
|
async initDictionaries() {
|
|
29
|
-
const outputFiles = [...this.managedFiles].map(
|
|
30
|
-
resolve(bundleDir, file)
|
|
28
|
+
const outputFiles = [...this.managedFiles].map(
|
|
29
|
+
(file) => resolve(bundleDir, file)
|
|
31
30
|
);
|
|
32
|
-
const dictionaries =
|
|
31
|
+
const dictionaries = await transpileBundledCode(outputFiles) ?? [];
|
|
33
32
|
console.info(
|
|
34
33
|
`Dictionaries:
|
|
35
34
|
${dictionaries.map(getRelativePath).join("\n")}`
|
|
@@ -43,8 +42,7 @@ class IntLayerPlugin {
|
|
|
43
42
|
}
|
|
44
43
|
// function to process when intlayer module files content are changed
|
|
45
44
|
async processFilesChanges() {
|
|
46
|
-
const dictionaries =
|
|
47
|
-
(await transpileBundledCode([...this.updatedFiles])) ?? [];
|
|
45
|
+
const dictionaries = await transpileBundledCode([...this.updatedFiles]) ?? [];
|
|
48
46
|
console.info(
|
|
49
47
|
`Updated dictionaries:
|
|
50
48
|
${dictionaries.map(getRelativePath).join("\n")}`
|
|
@@ -55,8 +53,7 @@ class IntLayerPlugin {
|
|
|
55
53
|
}
|
|
56
54
|
// function to process when new intlayer module is detected
|
|
57
55
|
async processNewFiles() {
|
|
58
|
-
const dictionaries =
|
|
59
|
-
(await transpileBundledCode([...this.addedFiles])) ?? [];
|
|
56
|
+
const dictionaries = await transpileBundledCode([...this.addedFiles]) ?? [];
|
|
60
57
|
console.info(
|
|
61
58
|
`New dictionaries:
|
|
62
59
|
${dictionaries.map(getRelativePath).join("\n")}`
|
|
@@ -67,10 +64,7 @@ class IntLayerPlugin {
|
|
|
67
64
|
createModuleAugmentation();
|
|
68
65
|
console.info("Building main...");
|
|
69
66
|
createDictionaryList();
|
|
70
|
-
this.managedFiles = /* @__PURE__ */ new Set([
|
|
71
|
-
...this.managedFiles,
|
|
72
|
-
...this.addedFiles,
|
|
73
|
-
]);
|
|
67
|
+
this.managedFiles = /* @__PURE__ */ new Set([...this.managedFiles, ...this.addedFiles]);
|
|
74
68
|
this.addedFiles.clear();
|
|
75
69
|
}
|
|
76
70
|
async detectFileAddedOrRemoved() {
|
|
@@ -141,5 +135,7 @@ class IntLayerPlugin {
|
|
|
141
135
|
);
|
|
142
136
|
}
|
|
143
137
|
}
|
|
144
|
-
export {
|
|
145
|
-
|
|
138
|
+
export {
|
|
139
|
+
IntLayerPlugin
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=webpack-plugin.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Configuration as Configuration$1 } from
|
|
2
|
-
import { Configuration } from
|
|
1
|
+
import { Configuration as Configuration$1 } from 'webpack';
|
|
2
|
+
import { Configuration } from 'webpack-dev-server';
|
|
3
3
|
|
|
4
4
|
declare const devServerConfig: Configuration;
|
|
5
5
|
declare const webpackConfig: Configuration$1;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { join } from "path";
|
|
2
2
|
import { getConfiguration } from "@intlayer/config";
|
|
3
3
|
import { sync } from "glob";
|
|
4
|
-
import { getFileHash } from
|
|
5
|
-
import { IntLayerPlugin } from
|
|
4
|
+
import { getFileHash } from './utils.mjs';
|
|
5
|
+
import { IntLayerPlugin } from './webpack-plugin.mjs';
|
|
6
6
|
const { content } = getConfiguration({
|
|
7
|
-
verbose: true
|
|
7
|
+
verbose: true
|
|
8
8
|
});
|
|
9
9
|
const { bundleDir, bundleFileExtension, watchedFilesPatternWithPath } = content;
|
|
10
|
-
const getEntry = () =>
|
|
11
|
-
|
|
10
|
+
const getEntry = () => sync(watchedFilesPatternWithPath).reduce(
|
|
11
|
+
(obj, el) => {
|
|
12
12
|
const hash = getFileHash(el);
|
|
13
13
|
obj[hash] = el;
|
|
14
14
|
return obj;
|
|
15
|
-
},
|
|
15
|
+
},
|
|
16
|
+
{}
|
|
17
|
+
);
|
|
16
18
|
const devServerConfig = {
|
|
17
19
|
// Enable hot module replacement
|
|
18
20
|
hot: true,
|
|
@@ -30,12 +32,12 @@ const devServerConfig = {
|
|
|
30
32
|
// watchedFilesPatternWithPath,
|
|
31
33
|
devMiddleware: {
|
|
32
34
|
// Enable write to disk to reuse the output
|
|
33
|
-
writeToDisk: true
|
|
35
|
+
writeToDisk: true
|
|
34
36
|
},
|
|
35
37
|
// Content base
|
|
36
38
|
static: {
|
|
37
|
-
directory: bundleDir
|
|
38
|
-
}
|
|
39
|
+
directory: bundleDir
|
|
40
|
+
}
|
|
39
41
|
};
|
|
40
42
|
const webpackConfig = {
|
|
41
43
|
// Define the environment mode (development or production)
|
|
@@ -51,7 +53,7 @@ const webpackConfig = {
|
|
|
51
53
|
library: "IntlLayerContent",
|
|
52
54
|
libraryTarget: "umd",
|
|
53
55
|
filename: `[name]${bundleFileExtension}`,
|
|
54
|
-
path: bundleDir
|
|
56
|
+
path: bundleDir
|
|
55
57
|
},
|
|
56
58
|
cache: false,
|
|
57
59
|
// devtool: 'source-map',
|
|
@@ -78,9 +80,9 @@ const webpackConfig = {
|
|
|
78
80
|
"node_modules",
|
|
79
81
|
"@intlayer/webpack",
|
|
80
82
|
"node_modules"
|
|
81
|
-
)
|
|
83
|
+
)
|
|
82
84
|
// Or via another project by importing intlayer
|
|
83
|
-
]
|
|
85
|
+
]
|
|
84
86
|
},
|
|
85
87
|
resolveLoader: {
|
|
86
88
|
// Configure how Webpack finds `loader` modules.
|
|
@@ -97,9 +99,9 @@ const webpackConfig = {
|
|
|
97
99
|
"node_modules",
|
|
98
100
|
"@intlayer/webpack",
|
|
99
101
|
"node_modules"
|
|
100
|
-
)
|
|
102
|
+
)
|
|
101
103
|
// Or via another project by importing intlayer
|
|
102
|
-
]
|
|
104
|
+
]
|
|
103
105
|
// roots: [
|
|
104
106
|
// join(process.cwd()), // Project context
|
|
105
107
|
// join(process.cwd(), '@intlayer/webpack'), // Or via CLI in another project
|
|
@@ -110,7 +112,7 @@ const webpackConfig = {
|
|
|
110
112
|
rules: [
|
|
111
113
|
{
|
|
112
114
|
test: /\.node$/,
|
|
113
|
-
loader: "node-loader"
|
|
115
|
+
loader: "node-loader"
|
|
114
116
|
},
|
|
115
117
|
// Use esbuild to compile JavaScript & TypeScript
|
|
116
118
|
{
|
|
@@ -119,18 +121,22 @@ const webpackConfig = {
|
|
|
119
121
|
loader: "esbuild-loader",
|
|
120
122
|
options: {
|
|
121
123
|
// JavaScript version to compile to
|
|
122
|
-
target: "es2015"
|
|
123
|
-
}
|
|
124
|
-
}
|
|
124
|
+
target: "es2015"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
125
127
|
// JSON files are supported natively by Webpack 5, no specific loader required
|
|
126
|
-
]
|
|
128
|
+
]
|
|
127
129
|
},
|
|
128
130
|
devServer: devServerConfig,
|
|
129
131
|
plugins: [
|
|
130
|
-
new IntLayerPlugin()
|
|
132
|
+
new IntLayerPlugin()
|
|
131
133
|
// new HotModuleReplacementPlugin()
|
|
132
|
-
]
|
|
134
|
+
]
|
|
133
135
|
};
|
|
134
136
|
var webpack_config_default = webpackConfig;
|
|
135
|
-
export {
|
|
136
|
-
|
|
137
|
+
export {
|
|
138
|
+
webpack_config_default as default,
|
|
139
|
+
devServerConfig,
|
|
140
|
+
webpackConfig
|
|
141
|
+
};
|
|
142
|
+
//# sourceMappingURL=webpack.config.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/webpack",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Webpack application for IntLayer - Webpack process to transpile TypeScript files to JavaScript files into IntLayer dictionaries.",
|
|
6
6
|
"keywords": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"homepage": "https://github.com/aypineau/intlayer",
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "https://github.com/aypineau/intlayer"
|
|
19
|
+
"url": "git+https://github.com/aypineau/intlayer.git"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"author": {
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"webpack-cli": "^5.1.4",
|
|
58
58
|
"webpack-dev-server": "^5.0.4",
|
|
59
59
|
"yargs": "^17.7.2",
|
|
60
|
-
"@intlayer/cli": "^1.0.
|
|
61
|
-
"@intlayer/config": "^1.0.
|
|
62
|
-
"@intlayer/core": "^1.0.
|
|
60
|
+
"@intlayer/cli": "^1.0.1",
|
|
61
|
+
"@intlayer/config": "^1.0.1",
|
|
62
|
+
"@intlayer/core": "^1.0.1"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@changesets/changelog-github": "0.5.0",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"tsup": "^8.0.2",
|
|
74
74
|
"typescript": "^5.3.3",
|
|
75
75
|
"webpack-watch-files-plugin": "^1.2.1",
|
|
76
|
-
"@utils/eslint-config": "^1.0.
|
|
77
|
-
"@utils/ts-config": "^1.0.
|
|
76
|
+
"@utils/eslint-config": "^1.0.1",
|
|
77
|
+
"@utils/ts-config": "^1.0.1"
|
|
78
78
|
},
|
|
79
79
|
"engines": {
|
|
80
80
|
"node": ">=14.18"
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
2
2
|
import { basename, join, relative } from 'path';
|
|
3
|
-
import { getConfiguration } from '@intlayer/config';
|
|
3
|
+
import { Locales, getConfiguration } from '@intlayer/config';
|
|
4
4
|
import { sync } from 'glob';
|
|
5
5
|
import { getFileHash, transformToCamelCase } from '../../utils';
|
|
6
6
|
|
|
7
|
-
const { content } = getConfiguration();
|
|
7
|
+
const { content, internationalization } = getConfiguration();
|
|
8
8
|
const { typesDir, moduleAugmentationDir } = content;
|
|
9
|
+
const { locales } = internationalization;
|
|
9
10
|
|
|
10
11
|
export const getTypeName = (id: string): string =>
|
|
11
12
|
transformToCamelCase(`${id}Content`);
|
|
@@ -14,7 +15,8 @@ export const getTypeName = (id: string): string =>
|
|
|
14
15
|
* This function generates the content of the module augmentation file
|
|
15
16
|
*/
|
|
16
17
|
const generateTypeIndexContent = (typeFiles: string[]): string => {
|
|
17
|
-
let content =
|
|
18
|
+
let content =
|
|
19
|
+
"/* eslint-disable */\nimport 'intlayer';\nimport { Locales } from '@intlayer/config'\n";
|
|
18
20
|
|
|
19
21
|
const dictionariesRef = typeFiles.map((dictionaryPath) => ({
|
|
20
22
|
relativePath: relative(moduleAugmentationDir, dictionaryPath),
|
|
@@ -35,6 +37,16 @@ const generateTypeIndexContent = (typeFiles: string[]): string => {
|
|
|
35
37
|
.map((dictionary) => ` "${dictionary.id}": ${dictionary.hash};`)
|
|
36
38
|
.join('\n');
|
|
37
39
|
|
|
40
|
+
const formatLocales = locales
|
|
41
|
+
.map((locale) => {
|
|
42
|
+
for (const key in Locales) {
|
|
43
|
+
if (Locales[key as keyof typeof Locales] === locale) {
|
|
44
|
+
return ` ${key} = '${locale}'`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
.join(',\n');
|
|
49
|
+
|
|
38
50
|
/**
|
|
39
51
|
* Write the module augmentation to extend the intlayer module with the dictionaries types
|
|
40
52
|
* Will suggest the type resulting of the dictionaries
|
|
@@ -44,11 +56,24 @@ const generateTypeIndexContent = (typeFiles: string[]): string => {
|
|
|
44
56
|
* dictionaries: {
|
|
45
57
|
* id: DictionaryType;
|
|
46
58
|
* }
|
|
47
|
-
*
|
|
59
|
+
* }
|
|
60
|
+
*
|
|
61
|
+
* enum ConfigLocales {
|
|
62
|
+
* ENGLISH = 'en',
|
|
63
|
+
* FRENCH = 'fr',
|
|
64
|
+
* SPANISH = 'es',
|
|
65
|
+
* }
|
|
48
66
|
*
|
|
67
|
+
* interface IConfigLocales<Content> extends Record<ConfigLocales, Content> {}
|
|
68
|
+
*
|
|
69
|
+
* }
|
|
49
70
|
* See https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation
|
|
50
71
|
*/
|
|
51
|
-
content += `declare module 'intlayer' {\n
|
|
72
|
+
content += `declare module 'intlayer' {\n`;
|
|
73
|
+
content += ` interface IntlayerDictionaryTypesConnector {\n${formattedDictionaryMap}\n }\n\n`;
|
|
74
|
+
content += ` enum ConfigLocales {\n${formatLocales}\n };\n\n`;
|
|
75
|
+
content += ` interface IConfigLocales<Content> extends Record<ConfigLocales, Content> {}\n`;
|
|
76
|
+
content += `};`;
|
|
52
77
|
|
|
53
78
|
return content;
|
|
54
79
|
};
|