@backstage/cli-module-translations 0.1.2 → 0.1.3
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/CHANGELOG.md +9 -0
- package/bin/backstage-cli-module-translations +2 -2
- package/dist/commands/export.cjs.js +1 -1
- package/dist/commands/export.cjs.js.map +1 -1
- package/dist/commands/import.cjs.js +1 -1
- package/dist/commands/import.cjs.js.map +1 -1
- package/dist/package.json.cjs.js +5 -5
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @backstage/cli-module-translations
|
|
2
2
|
|
|
3
|
+
## 0.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 696c78c: The `--help` output for commands now shows a generated usage line that lists the available flags and any positional arguments the command accepts.
|
|
8
|
+
- 2e6ffe6: Updated the standalone CLI executable to use the new CLI module runner.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @backstage/cli-node@0.3.3
|
|
11
|
+
|
|
3
12
|
## 0.1.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -26,7 +26,7 @@ if (isLocal) {
|
|
|
26
26
|
require('@backstage/cli-node/config/nodeTransform.cjs');
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
const {
|
|
29
|
+
const { runCli } = require('@backstage/cli-node');
|
|
30
30
|
const cliModule = require(isLocal ? '../src/index' : '..').default;
|
|
31
31
|
const pkg = require('../package.json');
|
|
32
|
-
|
|
32
|
+
runCli({ modules: [cliModule], name: pkg.name, version: pkg.version });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export.cjs.js","sources":["../../src/commands/export.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { cli } from 'cleye';\nimport { targetPaths } from '@backstage/cli-common';\nimport fs from 'fs-extra';\nimport { dirname, resolve as resolvePath } from 'node:path';\nimport {\n discoverFrontendPackages,\n readTargetPackage,\n} from '../lib/discoverPackages';\nimport {\n createTranslationProject,\n extractTranslationRefsFromSourceFile,\n TranslationRefInfo,\n} from '../lib/extractTranslations';\nimport {\n DEFAULT_LANGUAGE,\n DEFAULT_MESSAGE_PATTERN,\n formatMessagePath,\n validatePattern,\n} from '../lib/messageFilePath';\nimport type { CliCommandContext } from '@backstage/cli-node';\n\nexport default async ({ args, info }: CliCommandContext) => {\n const {\n flags: { output, pattern },\n } = cli(\n {\n
|
|
1
|
+
{"version":3,"file":"export.cjs.js","sources":["../../src/commands/export.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { cli } from 'cleye';\nimport { targetPaths } from '@backstage/cli-common';\nimport fs from 'fs-extra';\nimport { dirname, resolve as resolvePath } from 'node:path';\nimport {\n discoverFrontendPackages,\n readTargetPackage,\n} from '../lib/discoverPackages';\nimport {\n createTranslationProject,\n extractTranslationRefsFromSourceFile,\n TranslationRefInfo,\n} from '../lib/extractTranslations';\nimport {\n DEFAULT_LANGUAGE,\n DEFAULT_MESSAGE_PATTERN,\n formatMessagePath,\n validatePattern,\n} from '../lib/messageFilePath';\nimport type { CliCommandContext } from '@backstage/cli-node';\n\nexport default async ({ args, info }: CliCommandContext) => {\n const {\n flags: { output, pattern },\n } = cli(\n {\n name: info.usage,\n booleanFlagNegation: true,\n flags: {\n output: {\n type: String,\n default: 'translations',\n description: 'Output directory for exported messages and manifest',\n },\n pattern: {\n type: String,\n default: DEFAULT_MESSAGE_PATTERN,\n description:\n 'File path pattern for message files, with {id} and {lang} placeholders',\n },\n },\n },\n undefined,\n args,\n );\n\n const options = { output, pattern };\n\n validatePattern(options.pattern);\n\n const targetPackageJson = await readTargetPackage(\n targetPaths.dir,\n targetPaths.rootDir,\n );\n\n const outputDir = resolvePath(targetPaths.dir, options.output);\n const manifestPath = resolvePath(outputDir, 'manifest.json');\n\n const tsconfigPath = targetPaths.resolveRoot('tsconfig.json');\n if (!(await fs.pathExists(tsconfigPath))) {\n throw new Error(\n `No tsconfig.json found at ${tsconfigPath}. ` +\n 'The translations export command requires a tsconfig.json in the repo root.',\n );\n }\n\n console.log(\n `Discovering frontend dependencies of ${targetPackageJson.name}...`,\n );\n const packages = await discoverFrontendPackages(\n targetPackageJson,\n targetPaths.dir,\n );\n console.log(`Found ${packages.length} frontend packages to scan`);\n\n console.log('Creating TypeScript project...');\n const project = createTranslationProject(tsconfigPath);\n\n const allRefs: TranslationRefInfo[] = [];\n\n for (const pkg of packages) {\n for (const [exportPath, filePath] of pkg.entryPoints) {\n try {\n const sourceFile = project.addSourceFileAtPath(filePath);\n const refs = extractTranslationRefsFromSourceFile(\n sourceFile,\n pkg.name,\n exportPath,\n );\n allRefs.push(...refs);\n } catch (error) {\n console.warn(\n ` Warning: failed to process ${pkg.name} (${exportPath}): ${error}`,\n );\n }\n }\n }\n\n if (allRefs.length === 0) {\n console.log('No translation refs found.');\n return;\n }\n\n console.log(`Found ${allRefs.length} translation ref(s):`);\n for (const ref of allRefs) {\n const messageCount = Object.keys(ref.messages).length;\n console.log(` ${ref.id} (${ref.packageName}, ${messageCount} messages)`);\n }\n\n // Write message files using the configured pattern\n for (const ref of allRefs) {\n const relPath = formatMessagePath(\n options.pattern,\n ref.id,\n DEFAULT_LANGUAGE,\n );\n const filePath = resolvePath(outputDir, relPath);\n await fs.ensureDir(dirname(filePath));\n await fs.writeJson(filePath, ref.messages, { spaces: 2 });\n }\n\n // Write manifest\n const manifest: Record<string, object> = {};\n for (const ref of allRefs) {\n manifest[ref.id] = {\n package: ref.packageName,\n exportPath: ref.exportPath,\n exportName: ref.exportName,\n };\n }\n await fs.writeJson(\n manifestPath,\n { pattern: options.pattern, refs: manifest },\n { spaces: 2 },\n );\n\n const examplePath = formatMessagePath(\n options.pattern,\n '<ref-id>',\n DEFAULT_LANGUAGE,\n );\n console.log(\n `\\nExported ${allRefs.length} translation ref(s) to ${options.output}/`,\n );\n console.log(` Messages: ${options.output}/${examplePath}`);\n console.log(` Manifest: ${options.output}/manifest.json`);\n};\n"],"names":["cli","DEFAULT_MESSAGE_PATTERN","validatePattern","readTargetPackage","targetPaths","resolvePath","fs","discoverFrontendPackages","createTranslationProject","extractTranslationRefsFromSourceFile","formatMessagePath","DEFAULT_LANGUAGE","dirname"],"mappings":";;;;;;;;;;;;;;;;AAqCA,cAAe,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,KAAyB;AAC1D,EAAA,MAAM;AAAA,IACJ,KAAA,EAAO,EAAE,MAAA,EAAQ,OAAA;AAAQ,GAC3B,GAAIA,SAAA;AAAA,IACF;AAAA,MACE,MAAM,IAAA,CAAK,KAAA;AAAA,MACX,mBAAA,EAAqB,IAAA;AAAA,MACrB,KAAA,EAAO;AAAA,QACL,MAAA,EAAQ;AAAA,UACN,IAAA,EAAM,MAAA;AAAA,UACN,OAAA,EAAS,cAAA;AAAA,UACT,WAAA,EAAa;AAAA,SACf;AAAA,QACA,OAAA,EAAS;AAAA,UACP,IAAA,EAAM,MAAA;AAAA,UACN,OAAA,EAASC,uCAAA;AAAA,UACT,WAAA,EACE;AAAA;AACJ;AACF,KACF;AAAA,IACA,MAAA;AAAA,IACA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A,EAAU,GAAA,CAAI,UAAU,EAAE,MAAA,EAAQ,GAAG,CAAA;AAAA,EAC1D;AAGA,EAAA,MAAM,WAAmC,EAAC;AAC1C,EAAA,KAAA,MAAW,OAAO,OAAA,EAAS;AACzB,IAAA,QAAA,CAAS,GAAA,CAAI,EAAE,CAAA,GAAI;AAAA,MACjB,SAAS,GAAA,CAAI,WAAA;AAAA,MACb,YAAY,GAAA,CAAI,UAAA;AAAA,MAChB,YAAY,GAAA,CAAI;AAAA,KAClB;AAAA,EACF;AACA,EAAA,MAAMA,mBAAA,CAAG,SAAA;AAAA,IACP,YAAA;AAAA,IACA,EAAE,OAAA,EAAS,OAAA,CAAQ,OAAA,EAAS,MAAM,QAAA,EAAS;AAAA,IAC3C,EAAE,QAAQ,CAAA;AAAE,GACd;AAEA,EAAA,MAAM,WAAA,GAAcI,iCAAA;AAAA,IAClB,OAAA,CAAQ,OAAA;AAAA,IACR,UAAA;AAAA,IACAC;AAAA,GACF;AACA,EAAA,OAAA,CAAQ,GAAA;AAAA,IACN;AAAA,SAAA,EAAc,OAAA,CAAQ,MAAM,CAAA,uBAAA,EAA0B,OAAA,CAAQ,MAAM,CAAA,CAAA;AAAA,GACtE;AACA,EAAA,OAAA,CAAQ,IAAI,CAAA,YAAA,EAAe,OAAA,CAAQ,MAAM,CAAA,CAAA,EAAI,WAAW,CAAA,CAAE,CAAA;AAC1D,EAAA,OAAA,CAAQ,GAAA,CAAI,CAAA,YAAA,EAAe,OAAA,CAAQ,MAAM,CAAA,cAAA,CAAgB,CAAA;AAC3D,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.cjs.js","sources":["../../src/commands/import.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { cli } from 'cleye';\nimport { targetPaths } from '@backstage/cli-common';\nimport fs from 'fs-extra';\nimport {\n resolve as resolvePath,\n relative as relativePath,\n sep,\n} from 'node:path';\nimport { readTargetPackage } from '../lib/discoverPackages';\nimport {\n DEFAULT_LANGUAGE,\n createMessagePathParser,\n formatMessagePath,\n} from '../lib/messageFilePath';\nimport type { CliCommandContext } from '@backstage/cli-node';\n\ninterface ManifestRefEntry {\n package: string;\n exportPath: string;\n exportName: string;\n}\n\ninterface Manifest {\n pattern?: string;\n refs: Record<string, ManifestRefEntry>;\n}\n\nexport default async ({ args, info }: CliCommandContext) => {\n const {\n flags: { input, output },\n } = cli(\n {\n help: info,\n booleanFlagNegation: true,\n flags: {\n input: {\n type: String,\n default: 'translations',\n description:\n 'Input directory containing the manifest and translated message files',\n },\n output: {\n type: String,\n default: 'src/translations/resources.ts',\n description: 'Output path for the generated wiring module',\n },\n },\n },\n undefined,\n args,\n );\n\n const options = { input, output };\n await readTargetPackage(targetPaths.dir, targetPaths.rootDir);\n\n const inputDir = resolvePath(targetPaths.dir, options.input);\n const manifestPath = resolvePath(inputDir, 'manifest.json');\n const outputPath = resolvePath(targetPaths.dir, options.output);\n\n if (!(await fs.pathExists(manifestPath))) {\n throw new Error(\n `No manifest.json found at ${manifestPath}. ` +\n 'Run \"backstage-cli translations export\" first.',\n );\n }\n\n const manifest: Manifest = await fs.readJson(manifestPath);\n\n if (!manifest.pattern) {\n throw new Error(\n 'No pattern found in manifest.json. Re-run \"backstage-cli translations export\" to regenerate it.',\n );\n }\n const pattern = manifest.pattern;\n\n const parsePath = createMessagePathParser(pattern);\n\n // Discover all JSON files under the translations directory\n const allFiles = (await collectJsonFiles(inputDir)).filter(\n f => f !== 'manifest.json',\n );\n\n // Parse each file to extract id + lang, filtering out default language files\n const translationsByRef = new Map<\n string,\n Array<{ lang: string; relPath: string }>\n >();\n let skipped = 0;\n\n for (const relPath of allFiles) {\n const parsed = parsePath(relPath);\n if (!parsed) {\n skipped++;\n continue;\n }\n\n if (parsed.lang === DEFAULT_LANGUAGE) {\n continue;\n }\n\n if (!manifest.refs[parsed.id]) {\n console.warn(\n ` Warning: skipping ${relPath} - ref '${parsed.id}' not found in manifest`,\n );\n continue;\n }\n\n const existing = translationsByRef.get(parsed.id) ?? [];\n existing.push({ lang: parsed.lang, relPath });\n translationsByRef.set(parsed.id, existing);\n }\n\n if (skipped > 0) {\n console.warn(\n ` Warning: ${skipped} file(s) did not match the pattern '${pattern}'`,\n );\n }\n\n if (translationsByRef.size === 0) {\n console.log('No translated message files found.');\n const example = formatMessagePath(pattern, '<ref-id>', 'sv');\n console.log(\n `Add translated files as ${example} in the translations directory.`,\n );\n return;\n }\n\n // Generate the wiring module\n const importLines: string[] = [];\n const resourceLines: string[] = [];\n\n importLines.push(\n \"import { createTranslationResource } from '@backstage/frontend-plugin-api';\",\n );\n\n for (const [refId, entries] of [...translationsByRef.entries()].sort(\n ([a], [b]) => a.localeCompare(b),\n )) {\n const refEntry = manifest.refs[refId];\n const importPath =\n refEntry.exportPath === '.'\n ? refEntry.package\n : `${refEntry.package}/${refEntry.exportPath.replace(/^\\.\\//, '')}`;\n\n importLines.push(`import { ${refEntry.exportName} } from '${importPath}';`);\n\n const translationEntries = entries\n .sort((a, b) => a.lang.localeCompare(b.lang))\n .map(({ lang, relPath }) => {\n const jsonRelPath = relativePath(\n resolvePath(outputPath, '..'),\n resolvePath(inputDir, relPath),\n )\n .split(sep)\n .join('/');\n return ` ${JSON.stringify(lang)}: () => import('./${jsonRelPath}'),`;\n })\n .join('\\n');\n\n resourceLines.push(\n [\n ` createTranslationResource({`,\n ` ref: ${refEntry.exportName},`,\n ` translations: {`,\n translationEntries,\n ` },`,\n ` }),`,\n ].join('\\n'),\n );\n }\n\n const fileContent = [\n '// This file is auto-generated by backstage-cli translations import',\n '// Do not edit manually.',\n '',\n ...importLines,\n '',\n 'export default [',\n ...resourceLines,\n '];',\n '',\n ].join('\\n');\n\n await fs.ensureDir(resolvePath(outputPath, '..'));\n await fs.writeFile(outputPath, fileContent, 'utf8');\n\n const totalFiles = [...translationsByRef.values()].reduce(\n (sum, e) => sum + e.length,\n 0,\n );\n console.log(`Generated translation resources at ${options.output}`);\n console.log(\n ` ${translationsByRef.size} ref(s), ${totalFiles} translation file(s)`,\n );\n console.log(\n '\\nImport this file in your app and pass the resources to your translation API setup.',\n );\n};\n\n/**\n * Recursively collects all .json files under a directory, returning paths\n * relative to that directory using forward slashes.\n */\nasync function collectJsonFiles(dir: string, prefix = ''): Promise<string[]> {\n const entries = await fs.readdir(dir, { withFileTypes: true });\n const results: string[] = [];\n\n for (const entry of entries) {\n const relPath = prefix ? `${prefix}/${entry.name}` : entry.name;\n if (entry.isDirectory()) {\n results.push(\n ...(await collectJsonFiles(resolvePath(dir, entry.name), relPath)),\n );\n } else if (entry.isFile() && entry.name.endsWith('.json')) {\n results.push(relPath);\n }\n }\n\n return results;\n}\n"],"names":["cli","readTargetPackage","targetPaths","resolvePath","fs","createMessagePathParser","DEFAULT_LANGUAGE","formatMessagePath","relativePath","sep"],"mappings":";;;;;;;;;;;;;;;AA2CA,cAAe,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,KAAyB;AAC1D,EAAA,MAAM;AAAA,IACJ,KAAA,EAAO,EAAE,KAAA,EAAO,MAAA;AAAO,GACzB,GAAIA,SAAA;AAAA,IACF;AAAA,MACE,IAAA,EAAM,IAAA;AAAA,MACN,mBAAA,EAAqB,IAAA;AAAA,MACrB,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,UACL,IAAA,EAAM,MAAA;AAAA,UACN,OAAA,EAAS,cAAA;AAAA,UACT,WAAA,EACE;AAAA,SACJ;AAAA,QACA,MAAA,EAAQ;AAAA,UACN,IAAA,EAAM,MAAA;AAAA,UACN,OAAA,EAAS,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W,SAAS,OAAA,EAAS;AAC3B,IAAA,MAAM,OAAA,GAAU,SAAS,CAAA,EAAG,MAAM,IAAI,KAAA,CAAM,IAAI,KAAK,KAAA,CAAM,IAAA;AAC3D,IAAA,IAAI,KAAA,CAAM,aAAY,EAAG;AACvB,MAAA,OAAA,CAAQ,IAAA;AAAA,QACN,GAAI,MAAM,gBAAA,CAAiBD,iBAAA,CAAY,KAAK,KAAA,CAAM,IAAI,GAAG,OAAO;AAAA,OAClE;AAAA,IACF,CAAA,MAAA,IAAW,MAAM,MAAA,EAAO,IAAK,MAAM,IAAA,CAAK,QAAA,CAAS,OAAO,CAAA,EAAG;AACzD,MAAA,OAAA,CAAQ,KAAK,OAAO,CAAA;AAAA,IACtB;AAAA,EACF;AAEA,EAAA,OAAO,OAAA;AACT;;;;"}
|
|
1
|
+
{"version":3,"file":"import.cjs.js","sources":["../../src/commands/import.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { cli } from 'cleye';\nimport { targetPaths } from '@backstage/cli-common';\nimport fs from 'fs-extra';\nimport {\n resolve as resolvePath,\n relative as relativePath,\n sep,\n} from 'node:path';\nimport { readTargetPackage } from '../lib/discoverPackages';\nimport {\n DEFAULT_LANGUAGE,\n createMessagePathParser,\n formatMessagePath,\n} from '../lib/messageFilePath';\nimport type { CliCommandContext } from '@backstage/cli-node';\n\ninterface ManifestRefEntry {\n package: string;\n exportPath: string;\n exportName: string;\n}\n\ninterface Manifest {\n pattern?: string;\n refs: Record<string, ManifestRefEntry>;\n}\n\nexport default async ({ args, info }: CliCommandContext) => {\n const {\n flags: { input, output },\n } = cli(\n {\n name: info.usage,\n booleanFlagNegation: true,\n flags: {\n input: {\n type: String,\n default: 'translations',\n description:\n 'Input directory containing the manifest and translated message files',\n },\n output: {\n type: String,\n default: 'src/translations/resources.ts',\n description: 'Output path for the generated wiring module',\n },\n },\n },\n undefined,\n args,\n );\n\n const options = { input, output };\n await readTargetPackage(targetPaths.dir, targetPaths.rootDir);\n\n const inputDir = resolvePath(targetPaths.dir, options.input);\n const manifestPath = resolvePath(inputDir, 'manifest.json');\n const outputPath = resolvePath(targetPaths.dir, options.output);\n\n if (!(await fs.pathExists(manifestPath))) {\n throw new Error(\n `No manifest.json found at ${manifestPath}. ` +\n 'Run \"backstage-cli translations export\" first.',\n );\n }\n\n const manifest: Manifest = await fs.readJson(manifestPath);\n\n if (!manifest.pattern) {\n throw new Error(\n 'No pattern found in manifest.json. Re-run \"backstage-cli translations export\" to regenerate it.',\n );\n }\n const pattern = manifest.pattern;\n\n const parsePath = createMessagePathParser(pattern);\n\n // Discover all JSON files under the translations directory\n const allFiles = (await collectJsonFiles(inputDir)).filter(\n f => f !== 'manifest.json',\n );\n\n // Parse each file to extract id + lang, filtering out default language files\n const translationsByRef = new Map<\n string,\n Array<{ lang: string; relPath: string }>\n >();\n let skipped = 0;\n\n for (const relPath of allFiles) {\n const parsed = parsePath(relPath);\n if (!parsed) {\n skipped++;\n continue;\n }\n\n if (parsed.lang === DEFAULT_LANGUAGE) {\n continue;\n }\n\n if (!manifest.refs[parsed.id]) {\n console.warn(\n ` Warning: skipping ${relPath} - ref '${parsed.id}' not found in manifest`,\n );\n continue;\n }\n\n const existing = translationsByRef.get(parsed.id) ?? [];\n existing.push({ lang: parsed.lang, relPath });\n translationsByRef.set(parsed.id, existing);\n }\n\n if (skipped > 0) {\n console.warn(\n ` Warning: ${skipped} file(s) did not match the pattern '${pattern}'`,\n );\n }\n\n if (translationsByRef.size === 0) {\n console.log('No translated message files found.');\n const example = formatMessagePath(pattern, '<ref-id>', 'sv');\n console.log(\n `Add translated files as ${example} in the translations directory.`,\n );\n return;\n }\n\n // Generate the wiring module\n const importLines: string[] = [];\n const resourceLines: string[] = [];\n\n importLines.push(\n \"import { createTranslationResource } from '@backstage/frontend-plugin-api';\",\n );\n\n for (const [refId, entries] of [...translationsByRef.entries()].sort(\n ([a], [b]) => a.localeCompare(b),\n )) {\n const refEntry = manifest.refs[refId];\n const importPath =\n refEntry.exportPath === '.'\n ? refEntry.package\n : `${refEntry.package}/${refEntry.exportPath.replace(/^\\.\\//, '')}`;\n\n importLines.push(`import { ${refEntry.exportName} } from '${importPath}';`);\n\n const translationEntries = entries\n .sort((a, b) => a.lang.localeCompare(b.lang))\n .map(({ lang, relPath }) => {\n const jsonRelPath = relativePath(\n resolvePath(outputPath, '..'),\n resolvePath(inputDir, relPath),\n )\n .split(sep)\n .join('/');\n return ` ${JSON.stringify(lang)}: () => import('./${jsonRelPath}'),`;\n })\n .join('\\n');\n\n resourceLines.push(\n [\n ` createTranslationResource({`,\n ` ref: ${refEntry.exportName},`,\n ` translations: {`,\n translationEntries,\n ` },`,\n ` }),`,\n ].join('\\n'),\n );\n }\n\n const fileContent = [\n '// This file is auto-generated by backstage-cli translations import',\n '// Do not edit manually.',\n '',\n ...importLines,\n '',\n 'export default [',\n ...resourceLines,\n '];',\n '',\n ].join('\\n');\n\n await fs.ensureDir(resolvePath(outputPath, '..'));\n await fs.writeFile(outputPath, fileContent, 'utf8');\n\n const totalFiles = [...translationsByRef.values()].reduce(\n (sum, e) => sum + e.length,\n 0,\n );\n console.log(`Generated translation resources at ${options.output}`);\n console.log(\n ` ${translationsByRef.size} ref(s), ${totalFiles} translation file(s)`,\n );\n console.log(\n '\\nImport this file in your app and pass the resources to your translation API setup.',\n );\n};\n\n/**\n * Recursively collects all .json files under a directory, returning paths\n * relative to that directory using forward slashes.\n */\nasync function collectJsonFiles(dir: string, prefix = ''): Promise<string[]> {\n const entries = await fs.readdir(dir, { withFileTypes: true });\n const results: string[] = [];\n\n for (const entry of entries) {\n const relPath = prefix ? `${prefix}/${entry.name}` : entry.name;\n if (entry.isDirectory()) {\n results.push(\n ...(await collectJsonFiles(resolvePath(dir, entry.name), relPath)),\n );\n } else if (entry.isFile() && entry.name.endsWith('.json')) {\n results.push(relPath);\n }\n }\n\n return results;\n}\n"],"names":["cli","readTargetPackage","targetPaths","resolvePath","fs","createMessagePathParser","DEFAULT_LANGUAGE","formatMessagePath","relativePath","sep"],"mappings":";;;;;;;;;;;;;;;AA2CA,cAAe,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,KAAyB;AAC1D,EAAA,MAAM;AAAA,IACJ,KAAA,EAAO,EAAE,KAAA,EAAO,MAAA;AAAO,GACzB,GAAIA,SAAA;AAAA,IACF;AAAA,MACE,MAAM,IAAA,CAAK,KAAA;AAAA,MACX,mBAAA,EAAqB,IAAA;AAAA,MACrB,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,UACL,IAAA,EAAM,MAAA;AAAA,UACN,OAAA,EAAS,cAAA;AAAA,UACT,WAAA,EACE;AAAA,SACJ;AAAA,QACA,MAAA,EAAQ;AAAA,UACN,IAAA,EAAM,MAAA;AAAA,UACN,OAAA,EAAS,+BAAA;AAAA,UACT,WAAA,EAAa;AAAA;AACf;AACF,KACF;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,OAAA,GAAU,EAAE,KAAA,EAAO,MAAA,EAAO;AAChC,EAAA,MAAMC,kCAAA,CAAkBC,qBAAA,CAAY,GAAA,EAAKA,qBAAA,CAAY,OAAO,CAAA;AAE5D,EAAA,MAAM,QAAA,GAAWC,iBAAA,CAAYD,qBAAA,CAAY,GAAA,EAAK,QAAQ,KAAK,CAAA;AAC3D,EAAA,MAAM,YAAA,GAAeC,iBAAA,CAAY,QAAA,EAAU,eAAe,CAAA;AAC1D,EAAA,MAAM,UAAA,GAAaA,iBAAA,CAAYD,qBAAA,CAAY,GAAA,EAAK,QAAQ,MAAM,CAA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AA;AACT;;;;"}
|
package/dist/package.json.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var name = "@backstage/cli-module-translations";
|
|
6
|
-
var version = "0.1.
|
|
6
|
+
var version = "0.1.3";
|
|
7
7
|
var description = "CLI module for Backstage CLI";
|
|
8
8
|
var backstage = {
|
|
9
9
|
role: "cli-module"
|
|
@@ -22,6 +22,7 @@ var repository = {
|
|
|
22
22
|
var license = "Apache-2.0";
|
|
23
23
|
var main = "src/index.ts";
|
|
24
24
|
var types = "src/index.ts";
|
|
25
|
+
var bin = "bin/backstage-cli-module-translations";
|
|
25
26
|
var files = [
|
|
26
27
|
"dist",
|
|
27
28
|
"bin"
|
|
@@ -37,7 +38,7 @@ var scripts = {
|
|
|
37
38
|
var dependencies = {
|
|
38
39
|
"@backstage/cli-common": "workspace:^",
|
|
39
40
|
"@backstage/cli-node": "workspace:^",
|
|
40
|
-
cleye: "^2.
|
|
41
|
+
cleye: "^2.6.0",
|
|
41
42
|
"fs-extra": "^11.2.0",
|
|
42
43
|
"ts-morph": "^24.0.0"
|
|
43
44
|
};
|
|
@@ -45,7 +46,6 @@ var devDependencies = {
|
|
|
45
46
|
"@backstage/cli": "workspace:^",
|
|
46
47
|
"@types/fs-extra": "^11.0.0"
|
|
47
48
|
};
|
|
48
|
-
var bin = "bin/backstage-cli-module-translations";
|
|
49
49
|
var packageJson = {
|
|
50
50
|
name: name,
|
|
51
51
|
version: version,
|
|
@@ -57,11 +57,11 @@ var packageJson = {
|
|
|
57
57
|
license: license,
|
|
58
58
|
main: main,
|
|
59
59
|
types: types,
|
|
60
|
+
bin: bin,
|
|
60
61
|
files: files,
|
|
61
62
|
scripts: scripts,
|
|
62
63
|
dependencies: dependencies,
|
|
63
|
-
devDependencies: devDependencies
|
|
64
|
-
bin: bin
|
|
64
|
+
devDependencies: devDependencies
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
exports.backstage = backstage;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/cli-module-translations",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "CLI module for Backstage CLI",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "cli-module"
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"license": "Apache-2.0",
|
|
20
20
|
"main": "dist/index.cjs.js",
|
|
21
21
|
"types": "dist/index.d.ts",
|
|
22
|
+
"bin": "bin/backstage-cli-module-translations",
|
|
22
23
|
"files": [
|
|
23
24
|
"dist",
|
|
24
25
|
"bin"
|
|
@@ -33,16 +34,15 @@
|
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
36
|
"@backstage/cli-common": "^0.2.2",
|
|
36
|
-
"@backstage/cli-node": "^0.3.
|
|
37
|
-
"cleye": "^2.
|
|
37
|
+
"@backstage/cli-node": "^0.3.3",
|
|
38
|
+
"cleye": "^2.6.0",
|
|
38
39
|
"fs-extra": "^11.2.0",
|
|
39
40
|
"ts-morph": "^24.0.0"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
|
-
"@backstage/cli": "^0.36.
|
|
43
|
+
"@backstage/cli": "^0.36.3",
|
|
43
44
|
"@types/fs-extra": "^11.0.0"
|
|
44
45
|
},
|
|
45
|
-
"bin": "bin/backstage-cli-module-translations",
|
|
46
46
|
"typesVersions": {
|
|
47
47
|
"*": {
|
|
48
48
|
"package.json": [
|