@intlpullhq/cli 0.1.11 → 0.1.12

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 (2) hide show
  1. package/dist/index.js +6 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1613,6 +1613,9 @@ function detectCaseCollisions(names) {
1613
1613
  function hasNamespacePlaceholder(pattern) {
1614
1614
  return pattern.includes("[namespace]") || pattern.includes("{namespace}");
1615
1615
  }
1616
+ function hasLocalePlaceholder(pattern) {
1617
+ return pattern.includes("[locale]") || pattern.includes("{locale}");
1618
+ }
1616
1619
  function getFormatExtension(format) {
1617
1620
  switch (format) {
1618
1621
  case "yaml":
@@ -2692,9 +2695,10 @@ Or use a project-scoped API key for automatic selection.`
2692
2695
  let totalKeyCount = 0;
2693
2696
  const writeErrors = [];
2694
2697
  const newCache = cache || createEmptyCache();
2695
- const filePattern = libraryConfig?.filePattern || "{locale}.json";
2698
+ const userProvidedPattern = options.output && (hasLocalePlaceholder(options.output) || hasNamespacePlaceholder(options.output));
2699
+ const filePattern = userProvidedPattern ? options.output : libraryConfig?.filePattern || "{locale}.json";
2696
2700
  const useNamespaceFiles = hasNamespacePlaceholder(filePattern) && namespacedBundle && namespaces.length > 0;
2697
- const outputPattern = filePattern.startsWith("./") ? filePattern : join6(outputDir, filePattern);
2701
+ const outputPattern = userProvidedPattern ? filePattern : filePattern.startsWith("./") ? filePattern : join6(outputDir, filePattern);
2698
2702
  if (namespaces.length > 0) {
2699
2703
  const collisions = detectCaseCollisions(namespaces);
2700
2704
  if (collisions.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlpullhq/cli",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "The official CLI for IntlPull - intelligent i18n for modern apps. Manage translations, sync with cloud, and automate localization workflows.",
5
5
  "type": "module",
6
6
  "bin": {