latinfo 0.13.1 → 0.13.2

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/dist/index.js +24 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -47,7 +47,7 @@ const local_search_1 = require("./local-search");
47
47
  const client_search_1 = require("./client-search");
48
48
  const odis_search_1 = require("./odis-search");
49
49
  const mphf_search_1 = require("./mphf-search");
50
- const VERSION = '0.13.1';
50
+ const VERSION = '0.13.2';
51
51
  const API_URL = process.env.LATINFO_API_URL || 'https://api.latinfo.dev';
52
52
  const GITHUB_CLIENT_ID = process.env.GITHUB_CLIENT_ID || 'Ov23li5fcQaiCsVtaMKK';
53
53
  const CONFIG_DIR = path_1.default.join(os_1.default.homedir(), '.latinfo');
@@ -1923,7 +1923,29 @@ async function pipeStage(args) {
1923
1923
  run(`scp ${devVarsLocal} ${RUNNER}:${remoteRepo}/.dev.vars`, { stdio: 'pipe' });
1924
1924
  }
1925
1925
  catch { }
1926
- // 3. Run import on Linux Mint
1926
+ // 3. Install deps on Linux Mint from YAML
1927
+ const yamlPath = path_1.default.join(repo, 'sources', `${sourceName}.yaml`);
1928
+ const yamlContent = fs_1.default.existsSync(yamlPath) ? fs_1.default.readFileSync(yamlPath, 'utf-8') : '';
1929
+ const depsMatch = yamlContent.match(/dependencies:\n([\s\S]*?)(?=\n\w|\n$|$)/);
1930
+ if (depsMatch) {
1931
+ const deps = depsMatch[1].split('\n').map(l => l.replace(/^\s*-\s*/, '').trim()).filter(Boolean);
1932
+ if (deps.length > 0) {
1933
+ console.log(`[pipe] Installing deps on Linux Mint: ${deps.join(', ')}...`);
1934
+ try {
1935
+ run(`ssh ${RUNNER} "cd ${remoteRepo} && npm install ${deps.join(' ')}"`, { stdio: 'inherit', timeout: 120_000 });
1936
+ // Install playwright browsers if needed
1937
+ if (deps.some(d => d.includes('playwright'))) {
1938
+ console.log(`[pipe] Installing Playwright browser...`);
1939
+ run(`ssh ${RUNNER} "cd ${remoteRepo} && npx playwright install chromium --with-deps"`, { stdio: 'inherit', timeout: 120_000 });
1940
+ }
1941
+ }
1942
+ catch {
1943
+ console.error('[pipe] Failed to install deps on Linux Mint');
1944
+ process.exit(1);
1945
+ }
1946
+ }
1947
+ }
1948
+ // 4. Run import on Linux Mint
1927
1949
  console.log(`[pipe] Running import on Linux Mint...`);
1928
1950
  try {
1929
1951
  run(`ssh ${RUNNER} "cd ${remoteRepo} && set -a && source .env 2>/dev/null; source .dev.vars 2>/dev/null; set +a && R2_BUCKET_NAME=latinfo-data npx tsx src/imports/${sourceName}.ts"`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "latinfo",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "Tax registry & procurement API for Latin America. Query RUC, DNI, NIT, licitaciones from Peru & Colombia. Offline MPHF search, full OCDS data, updated daily.",
5
5
  "homepage": "https://latinfo.dev",
6
6
  "repository": {