@tandem-language-exchange/content-store 1.2.5 → 1.2.6

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.
@@ -16,8 +16,8 @@ function printResources(project) {
16
16
  console.log(`
17
17
  Resources for "${project}":
18
18
  `);
19
- for (const r of resources) {
20
- console.log(` ${r.resource}`);
19
+ for (let i = 0; i < resources.length; i++) {
20
+ console.log(` ${i + 1}. ${resources[i].resource} (${resources[i].fileName})`);
21
21
  }
22
22
  }
23
23
  async function promptForProject() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/client/list-resources.ts"],"sourcesContent":["import { createInterface } from 'node:readline/promises';\nimport { Command } from 'commander';\nimport { allProjects } from '../shared/lingohub';\n\nconst projectNames = Object.keys(allProjects);\n\nfunction printResources(project: string): void {\n const resources = allProjects[project];\n if (!resources) {\n console.error(`Unknown project \"${project}\".`);\n process.exit(1);\n }\n console.log(`\\nResources for \"${project}\":\\n`);\n for (const r of resources) {\n console.log(` ${r.resource}`);\n }\n}\n\nasync function promptForProject(): Promise<void> {\n console.log('Available projects:\\n');\n for (let i = 0; i < projectNames.length; i++) {\n console.log(` ${i + 1}. ${projectNames[i]}`);\n }\n\n const rl = createInterface({ input: process.stdin, output: process.stdout });\n const answer = await rl.question('\\nSelect a project number: ');\n rl.close();\n\n const idx = parseInt(answer, 10) - 1;\n if (isNaN(idx) || idx < 0 || idx >= projectNames.length) {\n console.error(`Invalid selection \"${answer}\". Enter a number between 1 and ${projectNames.length}.`);\n process.exit(1);\n }\n\n printResources(projectNames[idx]!);\n}\n\nconst program = new Command();\n\nprogram\n .name('list-resources')\n .description('List all resource names for a given Lingohub project')\n .argument('[project]', 'Lingohub project name (omit for interactive selection)')\n .action(async (project?: string) => {\n if (project) {\n printResources(project);\n } else {\n await promptForProject();\n }\n });\n\nprogram.parse();\n"],"mappings":";;;;;;AAAA,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAGxB,IAAM,eAAe,OAAO,KAAK,WAAW;AAE5C,SAAS,eAAe,SAAuB;AAC3C,QAAM,YAAY,YAAY,OAAO;AACrC,MAAI,CAAC,WAAW;AACZ,YAAQ,MAAM,oBAAoB,OAAO,IAAI;AAC7C,YAAQ,KAAK,CAAC;AAAA,EAClB;AACA,UAAQ,IAAI;AAAA,iBAAoB,OAAO;AAAA,CAAM;AAC7C,aAAW,KAAK,WAAW;AACvB,YAAQ,IAAI,KAAK,EAAE,QAAQ,EAAE;AAAA,EACjC;AACJ;AAEA,eAAe,mBAAkC;AAC7C,UAAQ,IAAI,uBAAuB;AACnC,WAAS,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;AAC1C,YAAQ,IAAI,KAAK,IAAI,CAAC,KAAK,aAAa,CAAC,CAAC,EAAE;AAAA,EAChD;AAEA,QAAM,KAAK,gBAAgB,EAAE,OAAO,QAAQ,OAAO,QAAQ,QAAQ,OAAO,CAAC;AAC3E,QAAM,SAAS,MAAM,GAAG,SAAS,6BAA6B;AAC9D,KAAG,MAAM;AAET,QAAM,MAAM,SAAS,QAAQ,EAAE,IAAI;AACnC,MAAI,MAAM,GAAG,KAAK,MAAM,KAAK,OAAO,aAAa,QAAQ;AACrD,YAAQ,MAAM,sBAAsB,MAAM,mCAAmC,aAAa,MAAM,GAAG;AACnG,YAAQ,KAAK,CAAC;AAAA,EAClB;AAEA,iBAAe,aAAa,GAAG,CAAE;AACrC;AAEA,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACK,KAAK,gBAAgB,EACrB,YAAY,sDAAsD,EAClE,SAAS,aAAa,wDAAwD,EAC9E,OAAO,OAAO,YAAqB;AAChC,MAAI,SAAS;AACT,mBAAe,OAAO;AAAA,EAC1B,OAAO;AACH,UAAM,iBAAiB;AAAA,EAC3B;AACJ,CAAC;AAEL,QAAQ,MAAM;","names":[]}
1
+ {"version":3,"sources":["../../src/client/list-resources.ts"],"sourcesContent":["import { createInterface } from 'node:readline/promises';\nimport { Command } from 'commander';\nimport { allProjects } from '../shared/lingohub';\n\nconst projectNames = Object.keys(allProjects);\n\nfunction printResources(project: string): void {\n const resources = allProjects[project];\n if (!resources) {\n console.error(`Unknown project \"${project}\".`);\n process.exit(1);\n }\n console.log(`\\nResources for \"${project}\":\\n`);\n for (let i = 0; i < resources.length; i++) {\n console.log(` ${i + 1}. ${resources[i].resource} (${resources[i].fileName})`);\n }\n}\n\nasync function promptForProject(): Promise<void> {\n console.log('Available projects:\\n');\n for (let i = 0; i < projectNames.length; i++) {\n console.log(` ${i + 1}. ${projectNames[i]}`);\n }\n\n const rl = createInterface({ input: process.stdin, output: process.stdout });\n const answer = await rl.question('\\nSelect a project number: ');\n rl.close();\n\n const idx = parseInt(answer, 10) - 1;\n if (isNaN(idx) || idx < 0 || idx >= projectNames.length) {\n console.error(`Invalid selection \"${answer}\". Enter a number between 1 and ${projectNames.length}.`);\n process.exit(1);\n }\n\n printResources(projectNames[idx]!);\n}\n\nconst program = new Command();\n\nprogram\n .name('list-resources')\n .description('List all resource names for a given Lingohub project')\n .argument('[project]', 'Lingohub project name (omit for interactive selection)')\n .action(async (project?: string) => {\n if (project) {\n printResources(project);\n } else {\n await promptForProject();\n }\n });\n\nprogram.parse();\n"],"mappings":";;;;;;AAAA,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAGxB,IAAM,eAAe,OAAO,KAAK,WAAW;AAE5C,SAAS,eAAe,SAAuB;AAC3C,QAAM,YAAY,YAAY,OAAO;AACrC,MAAI,CAAC,WAAW;AACZ,YAAQ,MAAM,oBAAoB,OAAO,IAAI;AAC7C,YAAQ,KAAK,CAAC;AAAA,EAClB;AACA,UAAQ,IAAI;AAAA,iBAAoB,OAAO;AAAA,CAAM;AAC7C,WAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AACvC,YAAQ,IAAI,KAAK,IAAI,CAAC,KAAK,UAAU,CAAC,EAAE,QAAQ,MAAM,UAAU,CAAC,EAAE,QAAQ,GAAG;AAAA,EAClF;AACJ;AAEA,eAAe,mBAAkC;AAC7C,UAAQ,IAAI,uBAAuB;AACnC,WAAS,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;AAC1C,YAAQ,IAAI,KAAK,IAAI,CAAC,KAAK,aAAa,CAAC,CAAC,EAAE;AAAA,EAChD;AAEA,QAAM,KAAK,gBAAgB,EAAE,OAAO,QAAQ,OAAO,QAAQ,QAAQ,OAAO,CAAC;AAC3E,QAAM,SAAS,MAAM,GAAG,SAAS,6BAA6B;AAC9D,KAAG,MAAM;AAET,QAAM,MAAM,SAAS,QAAQ,EAAE,IAAI;AACnC,MAAI,MAAM,GAAG,KAAK,MAAM,KAAK,OAAO,aAAa,QAAQ;AACrD,YAAQ,MAAM,sBAAsB,MAAM,mCAAmC,aAAa,MAAM,GAAG;AACnG,YAAQ,KAAK,CAAC;AAAA,EAClB;AAEA,iBAAe,aAAa,GAAG,CAAE;AACrC;AAEA,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACK,KAAK,gBAAgB,EACrB,YAAY,sDAAsD,EAClE,SAAS,aAAa,wDAAwD,EAC9E,OAAO,OAAO,YAAqB;AAChC,MAAI,SAAS;AACT,mBAAe,OAAO;AAAA,EAC1B,OAAO;AACH,UAAM,iBAAiB;AAAA,EAC3B;AACJ,CAAC;AAEL,QAAQ,MAAM;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tandem-language-exchange/content-store",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",