gtx-cli 1.2.5-alpha.2 → 1.2.5-alpha.4

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/base.js CHANGED
@@ -178,7 +178,8 @@ See the docs for more information: https://generaltranslation.com/docs/react/tut
178
178
  else {
179
179
  dataFormat = 'JSX';
180
180
  }
181
- if (!settings.files) {
181
+ if (!settings.files ||
182
+ (Object.keys(settings.files).length === 1 && settings.files.gt)) {
182
183
  return;
183
184
  }
184
185
  const { resolvedPaths: sourceFiles, placeholderPaths, transformPaths, } = settings.files;
@@ -31,8 +31,7 @@ exports.warnNonStaticExpression = warnNonStaticExpression;
31
31
  exports.warnTemplateLiteral = warnTemplateLiteral;
32
32
  exports.warnTernary = warnTernary;
33
33
  const prompts_1 = require("@clack/prompts");
34
- const chalk_1 = __importDefault(require("chalk")); // @ts-expect-error
35
- const ora_1 = __importDefault(require("ora"));
34
+ const chalk_1 = __importDefault(require("chalk"));
36
35
  // Basic logging functions
37
36
  function logInfo(message) {
38
37
  prompts_1.log.info(message);
@@ -105,7 +104,8 @@ function createSpinner(indicator = 'timer') {
105
104
  }
106
105
  // Spinner functionality
107
106
  async function createOraSpinner(indicator = 'circleHalves') {
108
- return (0, ora_1.default)({ spinner: indicator });
107
+ const ora = await import('ora');
108
+ return ora.default({ spinner: indicator });
109
109
  }
110
110
  // Input prompts
111
111
  async function promptText({ message, defaultValue, validate, }) {
@@ -30,11 +30,10 @@ async function createDictionaryUpdates(options, dictionaryPath, esbuildConfig) {
30
30
  const bundledCode = result.outputFiles[0].text;
31
31
  const tempFilePath = node_path_1.default.join(os_1.default.tmpdir(), 'bundled-dictionary.js');
32
32
  await node_fs_1.default.promises.writeFile(tempFilePath, bundledCode);
33
- // Load the module using dynamic import
33
+ // Load the module using require
34
34
  let dictionaryModule;
35
35
  try {
36
- const fileUrl = new URL(`file://${tempFilePath}`);
37
- dictionaryModule = await import(fileUrl.href);
36
+ dictionaryModule = require(tempFilePath);
38
37
  }
39
38
  catch (error) {
40
39
  (0, console_1.logError)(`Failed to load the bundled dictionary code: ${error}`);
@@ -7,8 +7,6 @@ exports.retrieveCredentials = retrieveCredentials;
7
7
  exports.generateCredentialsSession = generateCredentialsSession;
8
8
  exports.areCredentialsSet = areCredentialsSet;
9
9
  exports.setCredentials = setCredentials;
10
- // @ts-expect-error
11
- const open_1 = __importDefault(require("open"));
12
10
  const console_1 = require("../console");
13
11
  const node_path_1 = __importDefault(require("node:path"));
14
12
  const node_fs_1 = __importDefault(require("node:fs"));
@@ -18,9 +16,9 @@ async function retrieveCredentials(settings) {
18
16
  // Generate a session ID
19
17
  const { sessionId } = await generateCredentialsSession(settings.baseUrl);
20
18
  const urlToOpen = `${settings.dashboardUrl}/cli/wizard/${sessionId}`;
21
- (0, open_1.default)(urlToOpen, {
19
+ await import('open').then((open) => open.default(urlToOpen, {
22
20
  wait: false,
23
- }).then((res) => { });
21
+ }));
24
22
  (0, console_1.logMessage)(`${chalk_1.default.gray(`If the browser window didn't open automatically, please open the following link:`)}\n\n${chalk_1.default.cyan(urlToOpen)}`);
25
23
  const spinner = (0, console_1.createSpinner)('dots');
26
24
  spinner.start('Waiting for response from dashboard...');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtx-cli",
3
- "version": "1.2.5-alpha.2",
3
+ "version": "1.2.5-alpha.4",
4
4
  "main": "dist/index.js",
5
5
  "bin": "dist/main.js",
6
6
  "scripts": {