qtex 1.1.11 → 1.1.12

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/updater.js +12 -10
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "qtex",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "description": "Ultra-fast cloud LaTeX compiler. Compile .tex documents in milliseconds without installing TeXLive or MikTeX. Zero config, sub-second builds, live watch mode.",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",
8
- "build": "bun build ./index.js --outfile=dist/qtex.js --bundle --minify --target=node",
9
- "compile": "bun build ./index.js --compile --outfile=qtex-bin"
8
+ "build": "bun build ./index.js --outfile=dist/qtex.js --bundle --minify --format=esm --target=bun",
9
+ "compile-legacy": "bun build ./index.js --compile --outfile=qtex-bin"
10
10
  },
11
11
  "keywords": [
12
12
  "latex",
package/src/updater.js CHANGED
@@ -98,22 +98,24 @@ export async function selfUpdate(currentVersion) {
98
98
  ui.warn(`You are using a version (${colors.bold}v${currentVersion}${colors.reset}) that is ahead of the latest release (${colors.bold}v${latestVersion}${colors.reset}).`);
99
99
  return;
100
100
  }
101
-
102
101
  ui.success(`qtex is already up to date (${colors.bold}v${currentVersion}${colors.reset}).`);
103
102
  return;
104
103
  }
105
104
 
106
- ui.info(`New version found: ${colors.bold}v${latestVersion}${colors.reset}. Updating...`);
105
+ ui.info(`New version found: ${colors.bold}v${latestVersion}${colors.reset}. Updating cartbridge...`);
107
106
 
108
- if (process.platform === 'win32') {
109
- const installCmd = `powershell -Command "irm https://raw.githubusercontent.com/${REPO}/main/install.ps1 | iex"`;
110
- execSync(installCmd, { stdio: 'inherit' });
111
- } else {
112
- const installScriptCmd = `curl -fsSL https://raw.githubusercontent.com/${REPO}/main/install.sh | bash`;
113
- execSync(installScriptCmd, { stdio: 'inherit' });
114
- }
107
+ // location of the current running script (qtex.js)
108
+ const currentScriptPath = process.argv[1];
109
+
110
+ // Download new bundle
111
+ const bundleUrl = `https://github.com/${REPO}/releases/latest/download/qtex.js`;
112
+ const bundleRes = await fetch(bundleUrl);
113
+ if (!bundleRes.ok) throw new Error('Failed to download update bundle');
114
+
115
+ const newCode = await bundleRes.text();
116
+ await writeFile(currentScriptPath, newCode);
115
117
 
116
- ui.success('qtex has been updated successfully!');
118
+ ui.success(`qtex updated to v${latestVersion}! (Size: ${(newCode.length / 1024).toFixed(2)} KB)`);
117
119
  } catch (error) {
118
120
  ui.error(`Update failed: ${error.message}`);
119
121
  }