glotstack 0.0.12 → 0.0.15

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/cli.js CHANGED
@@ -23,15 +23,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  __setModuleDefault(result, mod);
24
24
  return result;
25
25
  };
26
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
27
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
- return new (P || (P = Promise))(function (resolve, reject) {
29
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
- step((generator = generator.apply(thisArg, _arguments || [])).next());
33
- });
34
- };
35
26
  var __importDefault = (this && this.__importDefault) || function (mod) {
36
27
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
28
  };
@@ -47,53 +38,12 @@ const eslint_1 = __importDefault(require("eslint"));
47
38
  const readline = __importStar(require("node:readline/promises"));
48
39
  const node_process_1 = require("node:process");
49
40
  const undici_1 = require("undici");
50
- const undici_2 = require("undici");
51
41
  const node_fs_1 = require("node:fs");
52
42
  const promises_1 = require("node:fs/promises");
53
43
  const node_path_1 = require("node:path");
54
- const fetchGlotstack = function (url, apiKey, body, overrideHeaders) {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- console.info(`Fetching glotstack.ai: ${url}`);
57
- const headers = Object.assign({ 'authorization': `Bearer ${apiKey}` }, (overrideHeaders == null ? {} : overrideHeaders));
58
- let payloadBody;
59
- if (!(body instanceof undici_2.FormData)) {
60
- headers['content-type'] = 'application/json';
61
- payloadBody = JSON.stringify(body);
62
- }
63
- else {
64
- payloadBody = body;
65
- }
66
- try {
67
- const res = yield (0, undici_1.fetch)(url, { method: 'POST', body: payloadBody, headers });
68
- if (!res.ok)
69
- throw new Error(`HTTP ${res.status}: ${res.statusText}`);
70
- return res.json();
71
- }
72
- catch (err) {
73
- console.error('Fetch failed:', err);
74
- process.exit(1);
75
- }
76
- });
77
- };
78
- function unflatten(flat) {
79
- const result = {};
80
- for (const flatKey in flat) {
81
- const parts = flatKey.split('.');
82
- let current = result;
83
- parts.forEach((part, idx) => {
84
- if (idx === parts.length - 1) {
85
- current[part] = flat[flatKey];
86
- }
87
- else {
88
- if (!(part in current)) {
89
- current[part] = {};
90
- }
91
- current = current[part];
92
- }
93
- });
94
- }
95
- return result;
96
- }
44
+ const fetchGlotstack_1 = require("./util/fetchGlotstack");
45
+ const logging_1 = __importDefault(require("./logging"));
46
+ const waitForFile_1 = require("./util/waitForFile");
97
47
  const DEFAULT_OPTIONS = {
98
48
  sourcePath: '.',
99
49
  sourceLocale: 'en-US',
@@ -104,213 +54,210 @@ const DEFAULT_OPTIONS = {
104
54
  function downcaseKeys(obj) {
105
55
  return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key.toLowerCase(), value]));
106
56
  }
107
- function resolveConfigAndOptions(options) {
108
- return __awaiter(this, void 0, void 0, function* () {
109
- var _a;
110
- const config = (_a = yield (0, findConfig_1.findGlotstackConfig)((0, process_1.cwd)())) !== null && _a !== void 0 ? _a : {};
111
- const resolved = (0, object_1.merge)({}, DEFAULT_OPTIONS, config, options);
112
- // special case to match source
113
- if (resolved.outputDir == null) {
114
- resolved.outputDir = resolved.sourcePath;
115
- }
116
- if ('outputLocales' in options) {
117
- if (resolved.outputLocales.includes(resolved.sourceLocale)) {
118
- console.warn(`${resolved.sourceLocale} detected in outputLocales, removing`);
119
- options.outputLocales = options.outputLocales.filter((x) => x !== resolved.sourceLocale);
120
- }
57
+ async function resolveConfigAndOptions(options) {
58
+ const config = await (0, findConfig_1.findGlotstackConfig)((0, process_1.cwd)()) ?? {};
59
+ const resolved = (0, object_1.merge)({}, DEFAULT_OPTIONS, config, options);
60
+ // special case to match source
61
+ if (resolved.outputDir == null) {
62
+ resolved.outputDir = resolved.sourcePath;
63
+ }
64
+ if ('outputLocales' in options) {
65
+ if (resolved.outputLocales.includes(resolved.sourceLocale)) {
66
+ logging_1.default.warn(`${resolved.sourceLocale} detected in outputLocales, removing`);
67
+ options.outputLocales = options.outputLocales.filter((x) => x !== resolved.sourceLocale);
121
68
  }
122
- return resolved;
123
- });
69
+ }
70
+ return resolved;
124
71
  }
125
- function run(args) {
126
- return __awaiter(this, void 0, void 0, function* () {
127
- commander_1.program
128
- .command('extract-translations')
129
- .description('extract translations from all compatible source files.')
130
- .option('--source-path [path]', `path directory containing [locale].json files (default=${DEFAULT_OPTIONS['sourcePath']})`)
131
- .option('--source-locale [locale]', `the locale you provide "context" in, your primary locale (default=${DEFAULT_OPTIONS['sourceLocale']})`)
132
- .option('--yaml', 'Use a .yaml source file and allow conversion to JSON')
133
- .option('--api-origin [url]', `glotstack api origin (default=${DEFAULT_OPTIONS['apiOrigin']})`)
134
- .option('--output-dir [path]', 'path to output directory (default=<source-path>')
135
- .option('--api-key [key]', 'api key for glotstack.ai')
136
- .option('--yes', 'skip confirm checks')
137
- .argument('[directories...]', 'Directories to scan', './**/*')
138
- .action((directories, inputOptions) => __awaiter(this, void 0, void 0, function* () {
139
- const options = yield resolveConfigAndOptions(inputOptions);
140
- if (!options.apiOrigin) {
141
- throw new Error('apiOrigin must be specified');
72
+ async function run(args) {
73
+ commander_1.program
74
+ .command('extract-translations')
75
+ .description('extract translations from all compatible source files.')
76
+ .option('--source-path [path]', `path directory containing [locale].json files (default=${DEFAULT_OPTIONS['sourcePath']})`)
77
+ .option('--source-locale [locale]', `the locale you provide "context" in, your primary locale (default=${DEFAULT_OPTIONS['sourceLocale']})`)
78
+ .option('--yaml', 'Use a .yaml source file and allow conversion to JSON')
79
+ .option('--api-origin [url]', `glotstack api origin (default=${DEFAULT_OPTIONS['apiOrigin']})`)
80
+ .option('--output-dir [path]', 'path to output directory (default=<source-path>')
81
+ .option('--api-key [key]', 'api key for glotstack.ai')
82
+ .option('--yes', 'skip confirm checks')
83
+ .argument('[directories...]', 'Directories to scan', './**/*')
84
+ .action(async (directories, inputOptions) => {
85
+ const options = await resolveConfigAndOptions(inputOptions);
86
+ if (!options.apiOrigin) {
87
+ throw new Error('apiOrigin must be specified');
88
+ }
89
+ const linter = new eslint_1.default.ESLint({ overrideConfigFile: path_1.default.join(__dirname, '..', 'eslint-raw-string.mjs') });
90
+ const results = await linter.lintFiles(directories);
91
+ const filesWithIssues = results
92
+ .filter((r) => r.errorCount + r.warningCount > 0)
93
+ .map((r) => r.filePath);
94
+ const rl = readline.createInterface({ input: node_process_1.stdin, output: node_process_1.stdout });
95
+ const askToSend = async () => {
96
+ if (options.yes) {
97
+ return true;
142
98
  }
143
- const linter = new eslint_1.default.ESLint({ overrideConfigFile: path_1.default.join(__dirname, '..', 'eslint-raw-string.mjs') });
144
- const results = yield linter.lintFiles(directories);
145
- const filesWithIssues = results
146
- .filter((r) => r.errorCount + r.warningCount > 0)
147
- .map((r) => r.filePath);
148
- const rl = readline.createInterface({ input: node_process_1.stdin, output: node_process_1.stdout });
149
- const askToSend = () => __awaiter(this, void 0, void 0, function* () {
150
- if (options.yes) {
151
- return true;
152
- }
153
- const response = yield rl.question(`Your source are going to be sent to our LLM -- they should not contain any secrets. Proceed? (yes/no):`);
154
- if (response === 'yes') {
155
- return true;
156
- }
157
- else if (response !== 'no') {
158
- console.error('Please respond with yes or no.');
159
- return askToSend();
160
- }
161
- else {
162
- return false;
163
- }
164
- });
165
- const send = yield askToSend();
166
- if (send) {
167
- console.info('Sending files to generate new source and extracted strings');
168
- let url = `${options.apiOrigin}/uploads/translations/extract`;
169
- if (options.yaml) {
170
- url = `${url}?yaml=true`;
171
- }
172
- const form = new undici_2.FormData();
173
- for (let i = 0; i < filesWithIssues.length; i++) {
174
- const filePath = filesWithIssues[i];
175
- form.append(`file_${i}`, yield (0, node_fs_1.openAsBlob)(filePath), filePath);
176
- console.debug(`Uploading file: ${filePath}`);
177
- }
178
- const data = yield fetchGlotstack(url, options.apiKey, form);
179
- data.translations.map(elem => console.info(`Source and translations available for: ${elem.name}:\n ${elem.modified_source.url}\n\n`));
180
- rl.close();
99
+ const response = await rl.question(`Your source are going to be sent to our LLM -- they should not contain any secrets. Proceed? (yes/no):`);
100
+ if (response === 'yes') {
101
+ return true;
181
102
  }
182
- else {
183
- rl.close();
103
+ else if (response !== 'no') {
104
+ logging_1.default.error('Please respond with yes or no.');
105
+ return askToSend();
184
106
  }
185
- }));
186
- commander_1.program
187
- .command('get-translations')
188
- .description('fetch translations for all [output-locals...]. Use .glotstack.json for repeatable results.')
189
- .option('--source-path [path]', `path directory containing [locale].json files (default=${DEFAULT_OPTIONS['sourcePath']})`)
190
- .option('--source-locale [locale]', `the locale you provide "context" in, your primary locale (default=${DEFAULT_OPTIONS['sourceLocale']})`)
191
- .option('--yaml', 'Expect to use yaml source file')
192
- .option('--api-origin [url]', `glotstack api origin (default=${DEFAULT_OPTIONS['apiOrigin']})`)
193
- .option('--output-dir [path]', 'path to output directory (default=<source-path>')
194
- .option('--api-key [key]', 'api key for glotstack.ai')
195
- .option('--project-id [id]', '(optional) specific project to use')
196
- .option('--only [locale]', '(optional) only translate for this locale')
197
- .argument('[output-locales...]', 'locales to get translations for')
198
- .action((outputLocales, options, command) => __awaiter(this, void 0, void 0, function* () {
199
- const resolved = yield resolveConfigAndOptions(Object.assign(Object.assign({}, options), { outputLocales: outputLocales }));
200
- if (!resolved.sourcePath) {
201
- throw new Error('sourcePath must be specified');
107
+ else {
108
+ return false;
202
109
  }
203
- if (!resolved.apiOrigin) {
204
- throw new Error('apiOrigin must be specified');
110
+ };
111
+ const send = await askToSend();
112
+ if (send) {
113
+ logging_1.default.info('Sending files to generate new source and extracted strings');
114
+ let url = `${options.apiOrigin}/uploads/translations/extract`;
115
+ if (options.yaml) {
116
+ url = `${url}?yaml=true`;
205
117
  }
206
- if (!resolved.outputDir) {
207
- throw new Error('outputDir must be specified');
118
+ const form = new undici_1.FormData();
119
+ for (let i = 0; i < filesWithIssues.length; i++) {
120
+ const filePath = filesWithIssues[i];
121
+ form.append(`file_${i}`, await (0, node_fs_1.openAsBlob)(filePath), filePath);
122
+ logging_1.default.debug(`Uploading file: ${filePath}`);
208
123
  }
209
- const ext = options.yaml == true ? '.yaml' : '.json';
210
- const absPath = path_1.default.resolve(resolved.sourcePath, `${resolved.sourceLocale}${ext}`);
211
- const fileContent = yield fs_1.promises.readFile(absPath, 'utf-8');
212
- let json = null;
124
+ const response = await (0, fetchGlotstack_1.fetchGlotstack)(url, options.apiKey, form);
125
+ const data = (await response.json()).data;
126
+ data.translations.map(elem => logging_1.default.info(`Source and translations available for: ${elem.name}:\n ${elem.modified_source.url}\n\n`));
127
+ rl.close();
128
+ }
129
+ else {
130
+ rl.close();
131
+ }
132
+ });
133
+ commander_1.program
134
+ .command('get-translations')
135
+ .description('fetch translations for all [output-locals...]. Use .glotstack.json for repeatable results.')
136
+ .option('--source-path [path]', `path directory containing [locale].json files (default=${DEFAULT_OPTIONS['sourcePath']})`)
137
+ .option('--source-locale [locale]', `the locale you provide "context" in, your primary locale (default=${DEFAULT_OPTIONS['sourceLocale']})`)
138
+ .option('--yaml', 'Expect to use yaml source file')
139
+ .option('--api-origin [url]', `glotstack api origin (default=${DEFAULT_OPTIONS['apiOrigin']})`)
140
+ .option('--output-dir [path]', 'path to output directory (default=<source-path>')
141
+ .option('--api-key [key]', 'api key for glotstack.ai')
142
+ .option('--project-id [id]', '(optional) specific project to use')
143
+ .option('--only [locale]', '(optional) only translate for this locale')
144
+ .argument('[output-locales...]', 'locales to get translations for')
145
+ .action(async (outputLocales, options, command) => {
146
+ const resolved = await resolveConfigAndOptions({ ...options, outputLocales: outputLocales });
147
+ if (!resolved.sourcePath) {
148
+ throw new Error('sourcePath must be specified');
149
+ }
150
+ if (!resolved.apiOrigin) {
151
+ throw new Error('apiOrigin must be specified');
152
+ }
153
+ if (!resolved.outputDir) {
154
+ throw new Error('outputDir must be specified');
155
+ }
156
+ const ext = options.yaml == true ? '.yaml' : '.json';
157
+ const absPath = path_1.default.resolve(resolved.sourcePath, `${resolved.sourceLocale}${ext}`);
158
+ const fileContent = await fs_1.promises.readFile(absPath, 'utf-8');
159
+ let json = null;
160
+ try {
161
+ json = (0, yaml_1.loadYaml)(fileContent);
162
+ }
163
+ catch (err) {
213
164
  try {
214
- json = (0, yaml_1.loadYaml)(fileContent);
165
+ json = JSON.parse(fileContent);
215
166
  }
216
167
  catch (err) {
217
- try {
218
- json = JSON.parse(fileContent);
219
- }
220
- catch (err) {
221
- console.error('Unable to parse source file ', absPath, err);
222
- throw err;
223
- }
224
- }
225
- let locales = resolved.outputLocales.map(l => l);
226
- if (options.only != null) {
227
- locales = locales.filter(l => l === options.only);
228
- }
229
- // Parallelize by locale
230
- // TODO(jd.cumpson): chunk by file size to not hit LB timeout
231
- const results = locales.map((locale) => __awaiter(this, void 0, void 0, function* () {
232
- const body = Object.assign({ locales: [locale], translations: json, usage: options.usage }, Object.assign({}, (resolved.projectId != null ? { projectId: resolved.projectId } : {})));
233
- const url = `${resolved.apiOrigin}/api/translations`;
234
- console.info('Getting translations for: ', locale);
235
- const data = yield fetchGlotstack(url, resolved.apiKey, body);
236
- return data.data;
237
- }));
238
- const translationData = yield Promise.all(results);
239
- console.info('Received translations for', translationData.flatMap(d => Object.keys(d)));
240
- const merged = translationData.reduce((acc, data) => {
241
- Object.entries(data).forEach(([locale, data]) => {
242
- var _a;
243
- (_a = acc[locale]) !== null && _a !== void 0 ? _a : (acc[locale] = {});
244
- acc[locale] = (0, object_1.merge)(Object.assign({}, acc[locale]), data);
245
- });
246
- return acc;
247
- }, {});
248
- Object.entries(merged).map(([locale, val]) => {
249
- const p = `${resolved.outputDir}/${locale}.json`;
250
- console.info(`Writing file ${p}`);
251
- fs_1.promises.writeFile(`${resolved.outputDir}/${locale}.json`, JSON.stringify(val, null, 2), 'utf-8');
252
- });
253
- if (options.yaml) {
254
- const fp = `${resolved.outputDir}/${path_1.default.parse(absPath).name}.json`;
255
- console.info(`Writing file ${fp}`);
256
- fs_1.promises.writeFile(fp, JSON.stringify(json, null, 2), 'utf-8');
168
+ logging_1.default.error('Unable to parse source file ', absPath, err);
169
+ throw err;
257
170
  }
258
- }));
259
- commander_1.program
260
- .command('yaml-to-json')
261
- .option('--source-path [path]', `path directory containing [locale].json files (default=${DEFAULT_OPTIONS['sourcePath']})`)
262
- .action((inputOptions) => __awaiter(this, void 0, void 0, function* () {
263
- const options = yield resolveConfigAndOptions(inputOptions);
264
- const absPath = path_1.default.resolve(options.sourcePath, `${options.sourceLocale}.yaml`);
265
- const fileContent = yield fs_1.promises.readFile(absPath, 'utf-8');
266
- const fp = `${options.outputDir}/${path_1.default.parse(absPath).name}.json`;
267
- const json = (0, yaml_1.loadYaml)(fileContent);
268
- console.info(`Writing file ${fp}`);
171
+ }
172
+ let locales = resolved.outputLocales.map(l => l);
173
+ if (options.only != null) {
174
+ locales = locales.filter(l => l === options.only);
175
+ }
176
+ const body = {
177
+ locales,
178
+ translations: json,
179
+ usage: options.usage,
180
+ ...{ ...(resolved.projectId != null ? { projectId: resolved.projectId } : {}) },
181
+ };
182
+ logging_1.default.info('Getting translations for: ', locales);
183
+ const url = `${resolved.apiOrigin}/api/translations`;
184
+ const response = await (0, fetchGlotstack_1.fetchGlotstack)(url, resolved.apiKey, body);
185
+ const data = await response.json();
186
+ const urlMap = data.data;
187
+ const translationsMap = Object.entries(urlMap).map(([locale, data]) => {
188
+ return [locale, (0, waitForFile_1.waitForFile)(data.url, resolved.apiKey)];
189
+ })
190
+ .reduce((map, [locale, promise]) => {
191
+ map[locale] = promise;
192
+ return map;
193
+ }, {});
194
+ if (options.yaml) {
195
+ const fp = `${resolved.outputDir}/${path_1.default.parse(absPath).name}.json`;
196
+ logging_1.default.info(`Writing file ${fp}`);
269
197
  fs_1.promises.writeFile(fp, JSON.stringify(json, null, 2), 'utf-8');
198
+ }
199
+ logging_1.default.info('Waiting for translations', Object.keys(translationsMap));
200
+ await Promise.all(Object.entries(translationsMap).map(async ([locale, promise]) => {
201
+ const val = await promise;
202
+ const p = `${resolved.outputDir}/${locale}.json`;
203
+ logging_1.default.info(`Writing file ${p}`);
204
+ await fs_1.promises.writeFile(`${resolved.outputDir}/${locale}.json`, JSON.stringify(val, null, 2), 'utf-8');
270
205
  }));
271
- commander_1.program
272
- .command('format-json')
273
- .description('format files in --source-path [path] to nested (not flat)')
274
- .option('--source-path [path]', `path directory containing [locale].json files (default=${DEFAULT_OPTIONS['sourcePath']})`)
275
- .option('--yes', 'skip confirm checks')
276
- .action((inputOptions) => __awaiter(this, void 0, void 0, function* () {
277
- const options = yield resolveConfigAndOptions(inputOptions);
278
- if (!options.sourcePath) {
279
- throw new Error('sourcePath must be specified');
206
+ });
207
+ commander_1.program
208
+ .command('yaml-to-json')
209
+ .option('--source-path [path]', `path directory containing [locale].json files (default=${DEFAULT_OPTIONS['sourcePath']})`)
210
+ .action(async (inputOptions) => {
211
+ const options = await resolveConfigAndOptions(inputOptions);
212
+ const absPath = path_1.default.resolve(options.sourcePath, `${options.sourceLocale}.yaml`);
213
+ const fileContent = await fs_1.promises.readFile(absPath, 'utf-8');
214
+ const fp = `${options.outputDir}/${path_1.default.parse(absPath).name}.json`;
215
+ const json = (0, yaml_1.loadYaml)(fileContent);
216
+ logging_1.default.info(`Writing file ${fp}`);
217
+ fs_1.promises.writeFile(fp, JSON.stringify(json, null, 2), 'utf-8');
218
+ });
219
+ commander_1.program
220
+ .command('format-json')
221
+ .description('format files in --source-path [path] to nested (not flat)')
222
+ .option('--source-path [path]', `path directory containing [locale].json files (default=${DEFAULT_OPTIONS['sourcePath']})`)
223
+ .option('--yes', 'skip confirm checks')
224
+ .action(async (inputOptions) => {
225
+ const options = await resolveConfigAndOptions(inputOptions);
226
+ if (!options.sourcePath) {
227
+ throw new Error('sourcePath must be specified');
228
+ }
229
+ const rl = readline.createInterface({ input: node_process_1.stdin, output: node_process_1.stdout });
230
+ const askToSend = async () => {
231
+ if (options.yes) {
232
+ return true;
280
233
  }
281
- const rl = readline.createInterface({ input: node_process_1.stdin, output: node_process_1.stdout });
282
- const askToSend = () => __awaiter(this, void 0, void 0, function* () {
283
- if (options.yes) {
284
- return true;
285
- }
286
- const response = yield rl.question(`This will update your source files -- have you checked them into SCM/git? Type yes to proceed (yes/no):`);
287
- if (response === 'yes') {
288
- return true;
289
- }
290
- else if (response !== 'no') {
291
- console.error('Please respond with yes or no.');
292
- return askToSend();
293
- }
294
- else {
295
- return false;
296
- }
297
- });
298
- const yes = yield askToSend();
299
- if (yes) {
300
- const files = yield (0, promises_1.readdir)(options.sourcePath);
301
- for (let i = 0; i < (yield files).length; i++) {
302
- const fp = (0, node_path_1.resolve)(options.sourcePath, files[i]);
303
- const text = yield (0, promises_1.readFile)(fp, 'utf-8');
304
- const json = JSON.parse(text);
305
- const formatted = JSON.stringify(unflatten(json), null, 2);
306
- yield (0, promises_1.writeFile)(fp, formatted, 'utf-8');
307
- }
308
- rl.close();
234
+ const response = await rl.question(`This will update your source files -- have you checked them into SCM/git? Type yes to proceed (yes/no):`);
235
+ if (response === 'yes') {
236
+ return true;
237
+ }
238
+ else if (response !== 'no') {
239
+ logging_1.default.error('Please respond with yes or no.');
240
+ return askToSend();
241
+ }
242
+ else {
243
+ return false;
244
+ }
245
+ };
246
+ const yes = await askToSend();
247
+ if (yes) {
248
+ const files = await (0, promises_1.readdir)(options.sourcePath);
249
+ for (let i = 0; i < (await files).length; i++) {
250
+ const fp = (0, node_path_1.resolve)(options.sourcePath, files[i]);
251
+ const text = await (0, promises_1.readFile)(fp, 'utf-8');
252
+ const json = JSON.parse(text);
253
+ const formatted = JSON.stringify((0, object_1.unflatten)(json), null, 2);
254
+ await (0, promises_1.writeFile)(fp, formatted, 'utf-8');
309
255
  }
310
256
  rl.close();
311
- }));
312
- yield commander_1.program.parseAsync(args);
257
+ }
258
+ rl.close();
313
259
  });
260
+ await commander_1.program.parseAsync(args);
314
261
  }
315
262
  run(process.argv);
316
263
  //# sourceMappingURL=cli.js.map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AM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAA,kBAAS,EAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;gBAC1D,MAAM,IAAA,oBAAS,EAAC,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;YACzC,CAAC;YACD,EAAE,CAAC,KAAK,EAAE,CAAA;QACZ,CAAC;QACD,EAAE,CAAC,KAAK,EAAE,CAAA;IAEZ,CAAC,CAAC,CAAA;IAGJ,MAAM,mBAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;AAChC,CAAC;AAED,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,24 +1,7 @@
1
1
  import * as React from 'react';
2
- export type LocaleRegion = string;
3
- export interface TranslationLeaf {
4
- value: string;
5
- context?: string;
6
- }
7
- export interface Translations {
8
- [key: string]: Translations | TranslationLeaf;
9
- }
10
- interface TranslateOptsBase {
11
- locale?: LocaleRegion;
12
- assigns?: Record<string, React.ReactNode>;
13
- }
14
- export type TranslateFn = {
15
- (key: string, opts: TranslateOptsBase & {
16
- asString: true;
17
- }): string;
18
- (key: string, opts?: TranslateOptsBase & {
19
- asString?: false;
20
- }): React.ReactNode;
21
- };
2
+ export { default as logger, setLogLevel, LogLevel } from "./logging";
3
+ export { LocaleRegion, JSONArray, Translations } from './types';
4
+ import type { LocaleRegion, TranslateFn, Translations } from './types';
22
5
  export interface ContextType {
23
6
  translations: Record<string, Translations>;
24
7
  locale: string | null;
@@ -37,16 +20,8 @@ interface GlotstackProviderProps {
37
20
  importMethod: ContextType['importMethod'];
38
21
  ssr?: boolean;
39
22
  }
40
- export declare enum LogLevel {
41
- DEBUG = 0,
42
- LOG = 1,
43
- INFO = 2,
44
- WARNING = 3,
45
- ERROR = 4
46
- }
47
- export declare const setLogLevel: (level: LogLevel) => void;
48
23
  export declare const access: (key: string, locale: LocaleRegion, translations: Translations) => string;
49
- export declare const GlotstackProvider: ({ children, initialLocale, initialTranslations, onLocaleChange, onTranslationLoaded, importMethod }: GlotstackProviderProps) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const GlotstackProvider: ({ children, initialLocale, initialTranslations, onLocaleChange, onTranslationLoaded, importMethod }: GlotstackProviderProps) => React.JSX.Element;
50
25
  export declare const useGlotstack: () => ContextType;
51
26
  export declare const useTranslations: (_options?: Record<never, never>) => ContextType;
52
27
  export type ParsedSimplePlaceholder = {
@@ -62,4 +37,3 @@ type Renderer = (props: {
62
37
  }) => React.ReactNode;
63
38
  export declare function renderPlaceholdersToNodes(input: string, placeholders: ParsedSimplePlaceholder[], assigns: Record<string, React.ReactNode | Renderer>): React.ReactNode[];
64
39
  export declare function useRenderPlaceholdersToNodes(...args: Parameters<typeof renderPlaceholdersToNodes>): React.ReactNode[];
65
- export {};