@el-j/google-sheet-translations 2.2.0-beta.1 → 2.2.0-beta.10

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 (42) hide show
  1. package/README.md +23 -0
  2. package/dist/action-entrypoint.d.ts +10 -0
  3. package/dist/action-entrypoint.d.ts.map +1 -1
  4. package/dist/esm/index.js +1051 -55
  5. package/dist/index.d.ts +16 -4
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1073 -54
  8. package/dist/setup/cli.d.ts +13 -0
  9. package/dist/setup/cli.d.ts.map +1 -0
  10. package/dist/setup/gcpTransport.d.ts +24 -0
  11. package/dist/setup/gcpTransport.d.ts.map +1 -0
  12. package/dist/setup/wifSetup.d.ts +93 -0
  13. package/dist/setup/wifSetup.d.ts.map +1 -0
  14. package/dist/utils/auth.d.ts +44 -4
  15. package/dist/utils/auth.d.ts.map +1 -1
  16. package/dist/utils/docIngester.d.ts +111 -0
  17. package/dist/utils/docIngester.d.ts.map +1 -0
  18. package/dist/utils/docParser.d.ts +77 -0
  19. package/dist/utils/docParser.d.ts.map +1 -0
  20. package/dist/utils/driveDocScanner.d.ts +58 -0
  21. package/dist/utils/driveDocScanner.d.ts.map +1 -0
  22. package/dist/utils/driveFolderScanner.d.ts.map +1 -1
  23. package/dist/utils/driveImageSync.d.ts +30 -0
  24. package/dist/utils/driveImageSync.d.ts.map +1 -1
  25. package/dist/utils/driveProjectIndex.d.ts +113 -0
  26. package/dist/utils/driveProjectIndex.d.ts.map +1 -0
  27. package/dist/utils/driveSpreadsheetBootstrap.d.ts +12 -0
  28. package/dist/utils/driveSpreadsheetBootstrap.d.ts.map +1 -0
  29. package/dist/utils/getDriveTranslations.d.ts +79 -0
  30. package/dist/utils/getDriveTranslations.d.ts.map +1 -1
  31. package/dist/utils/localImageUtils.d.ts +105 -0
  32. package/dist/utils/localImageUtils.d.ts.map +1 -0
  33. package/dist/utils/spreadsheetCreator.d.ts +2 -2
  34. package/dist/utils/spreadsheetCreator.d.ts.map +1 -1
  35. package/dist/utils/spreadsheetFormulas.d.ts +51 -0
  36. package/dist/utils/spreadsheetFormulas.d.ts.map +1 -0
  37. package/dist/utils/spreadsheetUpdater.d.ts +2 -0
  38. package/dist/utils/spreadsheetUpdater.d.ts.map +1 -1
  39. package/dist/utils/validateEnv.d.ts +7 -3
  40. package/dist/utils/validateEnv.d.ts.map +1 -1
  41. package/dist-cli/setup-wif.mjs +19010 -0
  42. package/package.json +38 -31
package/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Google Sheet Translations
2
2
 
3
+ [![CI](https://github.com/el-j/google-sheet-translations/actions/workflows/ci.yml/badge.svg)](https://github.com/el-j/google-sheet-translations/actions/workflows/ci.yml)
4
+ [![Release](https://github.com/el-j/google-sheet-translations/actions/workflows/release.yml/badge.svg)](https://github.com/el-j/google-sheet-translations/actions/workflows/release.yml)
5
+ [![Docs](https://github.com/el-j/google-sheet-translations/actions/workflows/docs.yml/badge.svg)](https://github.com/el-j/google-sheet-translations/actions/workflows/docs.yml)
6
+ [![npm version](https://img.shields.io/npm/v/@el-j/google-sheet-translations.svg)](https://www.npmjs.com/package/@el-j/google-sheet-translations)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
8
+
3
9
  A Node.js package for managing translations stored in Google Sheets.
4
10
 
5
11
  ## Features
@@ -372,6 +378,23 @@ jobs:
372
378
  | `spreadsheet-title` | ❌ | `google-sheet-translations` | Title for the auto-created spreadsheet |
373
379
  | `source-locale` | ❌ | `en` | Source locale used as the base for auto-translate formulas |
374
380
  | `target-locales` | ❌ | `de,fr,es,it,pt,ja,zh` | Comma-separated target locales added to the auto-created spreadsheet |
381
+ | `drive-folder-id` | ❌ | `''` | Drive folder ID used to auto-discover spreadsheets, docs, and images |
382
+ | `scan-for-spreadsheets` | ❌ | `true` | When `drive-folder-id` is set, scan the folder recursively for spreadsheets |
383
+ | `spreadsheet-ids` | ❌ | `''` | Optional extra spreadsheet IDs to merge with any IDs discovered in Drive |
384
+ | `sync-images` | ❌ | `false` | Download Drive images alongside translation sync |
385
+ | `image-output-path` | ❌ | `./public/remote-images` | Output directory for downloaded Drive images when `sync-images` is enabled |
386
+
387
+ ### Drive Folder Mode
388
+
389
+ When `drive-folder-id` is set, the action switches from single-spreadsheet mode to `manageDriveTranslations()`. That enables recursive spreadsheet discovery, optional image sync, and optional explicit `spreadsheet-ids` on the same run.
390
+
391
+ Operational notes:
392
+
393
+ - If the Drive folder is empty and `auto-create` remains enabled, the package creates a spreadsheet and then tries to move it into the target folder.
394
+ - `spreadsheetNameFilter` only applies to discovered sheets in the programmatic API. Explicit `spreadsheet-ids` are never filtered out.
395
+ - `sync-images` supports incremental freshness checks and optional `cleanSync` deletion in the programmatic API. See the Drive Folder guide for those semantics before enabling destructive cleanup.
396
+
397
+ See the full Drive Folder guide in `website/guide/drive-folder.md` for the complete API surface, image sync semantics, and Google Doc ingestion details.
375
398
 
376
399
  ### Outputs
377
400
 
@@ -1,2 +1,12 @@
1
+ /**
2
+ * Main GitHub Action entrypoint.
3
+ *
4
+ * Reads action inputs from the runner environment, configures Google Cloud
5
+ * credentials (WIF or classic service account key), executes either
6
+ * `manageDriveTranslations` (if `drive-folder-id` is present) or `getSpreadSheetData`,
7
+ * and sets step outputs (`translations-dir`, `locales-file`, `data-json-file`).
8
+ *
9
+ * @throws {Error} If authentication or required inputs are missing or sync fails.
10
+ */
1
11
  export declare function run(): Promise<void>;
2
12
  //# sourceMappingURL=action-entrypoint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"action-entrypoint.d.ts","sourceRoot":"","sources":["../src/action-entrypoint.ts"],"names":[],"mappings":"AAMA,wBAAsB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CA2FzC"}
1
+ {"version":3,"file":"action-entrypoint.d.ts","sourceRoot":"","sources":["../src/action-entrypoint.ts"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AACH,wBAAsB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CA8GzC"}