@tandem-language-exchange/content-store 1.0.6 → 1.0.7

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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from 'commander';
3
+ import { config } from './config';
4
+ import { ContentStore } from '../shared/s3';
5
+ import { fetchBundles } from '../shared/bundles';
6
+ const program = new Command();
7
+ program
8
+ .name('fetch-content-bundles')
9
+ .description('Download latest bundles from S3 to the local filesystem')
10
+ .requiredOption('--cms <provider>', 'CMS provider: contentful | sanity')
11
+ .requiredOption('--types <types>', 'Comma-separated content types to fetch')
12
+ .option('--output <directory>', 'Output directory', './content-cache')
13
+ .action(async (opts) => {
14
+ const cms = opts.cms;
15
+ if (!['contentful', 'sanity'].includes(cms)) {
16
+ console.error(`Invalid CMS provider: ${cms}`);
17
+ process.exit(1);
18
+ }
19
+ const contentTypes = opts.types.split(',').map((s) => s.trim());
20
+ const store = new ContentStore(config.s3);
21
+ try {
22
+ const files = await fetchBundles(store, opts.output, {
23
+ cms,
24
+ contentTypes,
25
+ });
26
+ console.log('Fetched bundles:');
27
+ for (const [type, filePath] of Object.entries(files)) {
28
+ console.log(` ${type} -> ${filePath}`);
29
+ }
30
+ }
31
+ catch (err) {
32
+ console.error('Fetch failed:', err);
33
+ process.exit(1);
34
+ }
35
+ });
36
+ program.parse();
37
+ //# sourceMappingURL=fetch-bundles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-bundles.js","sourceRoot":"","sources":["../../src/client/fetch-bundles.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,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AO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tandem-language-exchange/content-store",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",