@translation-cms/sync 1.2.26 → 1.2.29
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.
- package/dist/commands/init.js +1 -1
- package/dist/commands/pull.d.ts +1 -1
- package/dist/commands/pull.js +1 -1
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/status.js +2 -2
- package/dist/commands/sync.d.ts +2 -2
- package/dist/commands/sync.js +3 -3
- package/dist/commands/watch.d.ts +2 -2
- package/dist/commands/watch.js +2 -2
- package/dist/config/config-internals/resolve.js +1 -1
- package/dist/core/api-internals/pull.d.ts +1 -1
- package/dist/core/api-internals/pull.js +1 -1
- package/dist/core/api-internals/route-config.d.ts +1 -1
- package/dist/core/api-internals/sync.d.ts +2 -2
- package/dist/core/api-internals/sync.js +1 -1
- package/dist/core/cache-internals/format.d.ts +1 -1
- package/dist/core/cache-internals/types.d.ts +1 -1
- package/dist/next.d.ts +1 -1
- package/package.json +4 -3
package/dist/commands/init.js
CHANGED
package/dist/commands/pull.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Config, TranslationsConfig } from '
|
|
1
|
+
import type { Config, TranslationsConfig } from '../config/resolve-config.js';
|
|
2
2
|
/**
|
|
3
3
|
* `pull` command — fetches published translations from the CMS and writes
|
|
4
4
|
* them as JSON dictionary files to the output directory.
|
package/dist/commands/pull.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
-
import { pullTranslations } from '
|
|
2
|
+
import { pullTranslations } from '../core/api.js';
|
|
3
3
|
/**
|
|
4
4
|
* `pull` command — fetches published translations from the CMS and writes
|
|
5
5
|
* them as JSON dictionary files to the output directory.
|
package/dist/commands/status.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { scanProject } from '
|
|
2
|
-
import { serializeNamespaces, loadSyncCache, computeDiff, formatPreviewRoutes, } from '
|
|
1
|
+
import { scanProject } from '../core/scanner.js';
|
|
2
|
+
import { serializeNamespaces, loadSyncCache, computeDiff, formatPreviewRoutes, } from '../core/cache.js';
|
|
3
3
|
/**
|
|
4
4
|
* `status` command — scans the project for translation keys and compares
|
|
5
5
|
* the result against the last sync cache (.cms-sync-cache.json).
|
package/dist/commands/sync.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Config } from '
|
|
2
|
-
import { type ScanOptions } from '
|
|
1
|
+
import type { Config } from '../config/resolve-config.js';
|
|
2
|
+
import { type ScanOptions } from '../core/scanner.js';
|
|
3
3
|
export interface SyncCommandOptions {
|
|
4
4
|
outputDir: string;
|
|
5
5
|
dryRun: boolean;
|
package/dist/commands/sync.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { scanProject, routeKey } from '
|
|
4
|
-
import { postToSync, pullTranslations } from '
|
|
5
|
-
import { generateRouteParams, saveRouteParamsCache, writeMockDataFile, } from '
|
|
3
|
+
import { scanProject, routeKey } from '../core/scanner.js';
|
|
4
|
+
import { postToSync, pullTranslations } from '../core/api.js';
|
|
5
|
+
import { generateRouteParams, saveRouteParamsCache, writeMockDataFile, } from '../core/cache.js';
|
|
6
6
|
/**
|
|
7
7
|
* `sync` command — the main push/pull cycle:
|
|
8
8
|
*
|
package/dist/commands/watch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Config } from '
|
|
2
|
-
import { type ScanOptions } from '
|
|
1
|
+
import type { Config } from '../config/resolve-config.js';
|
|
2
|
+
import { type ScanOptions } from '../core/scanner.js';
|
|
3
3
|
/**
|
|
4
4
|
* `watch` command — runs a full sync on startup, then re-syncs automatically
|
|
5
5
|
* whenever a source file changes.
|
package/dist/commands/watch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import fs from 'fs';
|
|
3
|
-
import { scanProject } from '
|
|
4
|
-
import { postToSync, pullTranslations } from '
|
|
3
|
+
import { scanProject } from '../core/scanner.js';
|
|
4
|
+
import { postToSync, pullTranslations } from '../core/api.js';
|
|
5
5
|
/**
|
|
6
6
|
* `watch` command — runs a full sync on startup, then re-syncs automatically
|
|
7
7
|
* whenever a source file changes.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* CLI args > env vars > config file
|
|
6
6
|
*/
|
|
7
7
|
import path from 'path';
|
|
8
|
-
import { loadRouteParamsCache } from '
|
|
8
|
+
import { loadRouteParamsCache } from '../../core/cache.js';
|
|
9
9
|
import { loadEnvLocal } from './env.js';
|
|
10
10
|
import { parseArgs } from './args.js';
|
|
11
11
|
import { findProjectRoot } from './root.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pull (fetch) published translations from CMS to local JSON files.
|
|
3
3
|
*/
|
|
4
|
-
import type { Config } from '
|
|
4
|
+
import type { Config } from '../../config/resolve-config.js';
|
|
5
5
|
import type { PullOptions } from './types.js';
|
|
6
6
|
/**
|
|
7
7
|
* Fetch published translations from the CMS and write them to local JSON files.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import fs from 'fs';
|
|
5
5
|
import path from 'path';
|
|
6
|
-
import { getLastPulledTime, saveLastPulledTime, PULL_META_FILE, DEFAULT_PULL_TTL_MS, } from '
|
|
6
|
+
import { getLastPulledTime, saveLastPulledTime, PULL_META_FILE, DEFAULT_PULL_TTL_MS, } from '../../core/cache.js';
|
|
7
7
|
/**
|
|
8
8
|
* Returns an error message string if any required config field is missing,
|
|
9
9
|
* or null when all fields are present.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Fetch preview route configuration from CMS.
|
|
3
3
|
*/
|
|
4
|
-
import type { Config } from '
|
|
4
|
+
import type { Config } from '../../config/resolve-config.js';
|
|
5
5
|
/**
|
|
6
6
|
* Fetches the project's preview route config from the CMS and returns it as
|
|
7
7
|
* a routeParams Record (route pattern → params), ready to pass to scanProject.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Sync (push) translation keys to CMS.
|
|
3
3
|
*/
|
|
4
|
-
import type { Config } from '
|
|
5
|
-
import type { NamespaceMap } from '
|
|
4
|
+
import type { Config } from '../../config/resolve-config.js';
|
|
5
|
+
import type { NamespaceMap } from '../../core/scanner.js';
|
|
6
6
|
import type { PostToSyncOptions } from './types.js';
|
|
7
7
|
/**
|
|
8
8
|
* Push discovered translation keys to the CMS sync endpoint.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Sync (push) translation keys to CMS.
|
|
3
3
|
*/
|
|
4
|
-
import { loadSyncCache, saveSyncCache, isSyncNeeded, computeDiff, writeReport, serializeNamespaces, formatPreviewRoutes, } from '
|
|
4
|
+
import { loadSyncCache, saveSyncCache, isSyncNeeded, computeDiff, writeReport, serializeNamespaces, formatPreviewRoutes, } from '../../core/cache.js';
|
|
5
5
|
import { resolveReportPath } from './helpers.js';
|
|
6
6
|
/**
|
|
7
7
|
* Push discovered translation keys to the CMS sync endpoint.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PreviewRoute } from '
|
|
1
|
+
import type { PreviewRoute } from '../../core/scanner.js';
|
|
2
2
|
/**
|
|
3
3
|
* The serialized form of a NamespaceMap written to the sync cache and sent to
|
|
4
4
|
* the CMS API. Each namespace maps to an ordered array of key entries so the
|
package/dist/next.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* pullOnDev: true, // default
|
|
10
10
|
* });
|
|
11
11
|
*/
|
|
12
|
-
import type { NextConfig } from 'next';
|
|
12
|
+
import type { NextConfig } from './next';
|
|
13
13
|
export interface TranslationsCMSPluginOptions {
|
|
14
14
|
/** Automatically pull translations on `next build` (default: true) */
|
|
15
15
|
pullOnBuild?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@translation-cms/sync",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.29",
|
|
4
4
|
"description": "Scan translation keys in your codebase and sync them to the Translations CMS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"next.d.ts"
|
|
34
34
|
],
|
|
35
35
|
"scripts": {
|
|
36
|
-
"build": "tsc",
|
|
36
|
+
"build": "rm -rf dist tsconfig.tsbuildinfo && tsc && tsc-alias",
|
|
37
37
|
"dev": "tsc --watch",
|
|
38
38
|
"typecheck": "tsc --noEmit",
|
|
39
|
-
"release": "
|
|
39
|
+
"release": "pnpm build && npm version patch && npm publish"
|
|
40
40
|
},
|
|
41
41
|
"keywords": [
|
|
42
42
|
"translations",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/react": "^18",
|
|
63
|
+
"tsc-alias": "^1.8.10",
|
|
63
64
|
"typescript": "^5.9.3"
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|