Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tolgee/cli

Package Overview
Dependencies
Maintainers
2
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tolgee/cli - npm Package Compare versions

Comparing version 1.3.2 to 1.4.0

dist/arguments.js

7

dist/commands/extract/check.js

@@ -6,5 +6,6 @@ import { relative } from 'path';

import { loading } from '../../utils/logger.js';
async function lintHandler(filesPattern) {
import { FILE_PATTERNS } from '../../arguments.js';
async function lintHandler(filesPatterns) {
const opts = this.optsWithGlobals();
const extracted = await loading('Analyzing code...', extractKeysOfFiles(filesPattern, opts.extractor));
const extracted = await loading('Analyzing code...', extractKeysOfFiles(filesPatterns, opts.extractor));
let warningCount = 0;

@@ -39,3 +40,3 @@ let filesCount = 0;

.description('Checks if the keys can be extracted automatically, and reports problems if any')
.argument('<pattern>', 'File pattern to include (hint: make sure to escape it in quotes, or your shell might attempt to unroll some tokens like *)')
.addArgument(FILE_PATTERNS)
.action(lintHandler);

@@ -6,5 +6,6 @@ import { relative } from 'path';

import { loading } from '../../utils/logger.js';
async function printHandler(filesPattern) {
import { FILE_PATTERNS } from '../../arguments.js';
async function printHandler(filesPatterns) {
const opts = this.optsWithGlobals();
const extracted = await loading('Analyzing code...', extractKeysOfFiles(filesPattern, opts.extractor));
const extracted = await loading('Analyzing code...', extractKeysOfFiles(filesPatterns, opts.extractor));
let warningCount = 0;

@@ -49,3 +50,3 @@ const keySet = new Set();

.description('Prints extracted data to the console')
.argument('<pattern>', 'File glob pattern to include (hint: make sure to escape it in quotes, or your shell might attempt to unroll some tokens like *)')
.addArgument(FILE_PATTERNS)
.action(printHandler);

@@ -8,5 +8,6 @@ import { Command } from 'commander';

import { loading } from '../../utils/logger.js';
async function compareHandler(pattern) {
import { FILE_PATTERNS } from '../../arguments.js';
async function compareHandler(filesPatterns) {
const opts = this.optsWithGlobals();
const rawKeys = await loading('Analyzing code...', extractKeysOfFiles(pattern, opts.extractor));
const rawKeys = await loading('Analyzing code...', extractKeysOfFiles(filesPatterns, opts.extractor));
dumpWarnings(rawKeys);

@@ -44,4 +45,4 @@ const localKeys = filterExtractionResult(rawKeys);

.description('Compares the keys in your code project and in the Tolgee project.')
.argument('<pattern>', 'File pattern to include (hint: make sure to escape it in quotes, or your shell might attempt to unroll some tokens like *)')
.addArgument(FILE_PATTERNS)
.addOption(EXTRACTOR)
.action(compareHandler);

@@ -11,2 +11,3 @@ import { Command } from 'commander';

import { EXTRACTOR } from '../../options.js';
import { FILE_PATTERNS } from '../../arguments.js';
async function backup(client, dest) {

@@ -34,5 +35,5 @@ const blob = await client.export.export({

}
async function syncHandler(pattern) {
async function syncHandler(filesPatterns) {
const opts = this.optsWithGlobals();
const rawKeys = await loading('Analyzing code...', extractKeysOfFiles(pattern, opts.extractor));
const rawKeys = await loading('Analyzing code...', extractKeysOfFiles(filesPatterns, opts.extractor));
const warnCount = dumpWarnings(rawKeys);

@@ -101,3 +102,3 @@ if (!opts.continueOnWarning && warnCount) {

.description('Synchronizes the keys in your code project and in the Tolgee project, by creating missing keys and optionally deleting unused ones. For a dry-run, use `tolgee compare`.')
.argument('<pattern>', 'File pattern to include (hint: make sure to escape it in quotes, or your shell might attempt to unroll some tokens like *)')
.addArgument(FILE_PATTERNS)
.addOption(EXTRACTOR)

@@ -104,0 +105,0 @@ .option('-B, --backup <path>', 'Path where a backup should be downloaded before performing the sync. If something goes wrong, the backup can be used to restore the project to its previous state.')

@@ -10,4 +10,4 @@ import { glob } from 'glob';

}
export async function extractKeysOfFiles(filesPattern, extractor) {
const files = await glob(filesPattern, { nodir: true });
export async function extractKeysOfFiles(filesPatterns, extractor) {
const files = await glob(filesPatterns, { nodir: true });
const result = new Map();

@@ -14,0 +14,0 @@ await Promise.all(files.map(async (file) => {

{
"name": "@tolgee/cli",
"version": "1.3.2",
"version": "1.4.0",
"type": "module",

@@ -5,0 +5,0 @@ "description": "A tool to interact with the Tolgee Platform through CLI",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc