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

@mollie/crowdin-cli

Package Overview
Dependencies
Maintainers
11
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mollie/crowdin-cli - npm Package Compare versions

Comparing version 3.2.2 to 3.2.3

7

dist/crowdin-cli.cjs.development.js

@@ -288,3 +288,3 @@ 'use strict';

inferredParser
} = prettier.getFileInfo.sync(file);
} = await prettier.getFileInfo(file);
const data = fs.readFileSync(file, "utf-8");

@@ -302,4 +302,5 @@

}
} catch {
log$1.error("No files found, check your glob pattern");
} catch (error) {
log$1.error("Error while prettifying files");
console.error(error);
process.exit(1);

@@ -306,0 +307,0 @@ }

@@ -1,2 +0,2 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var a=require("commander"),t=e(require("fs")),r=e(require("axios")),n=require("@crowdin/crowdin-api-client"),s=e(n),o=e(require("chalk")),i=e(require("shelljs")),l=e(require("dotenv")),c=require("mkdirp"),d=e(require("fast-glob")),u=require("prettier"),p=require("@formatjs/cli-lib");const h=console.log;var f=e=>h("⛔️ "+e),N=e=>h("✅ "+e),w=e=>h("ℹ️ "+e);l.config(),process.env.CROWDIN_PERSONAL_ACCESS_TOKEN&&process.env.CROWDIN_PROJECT_ID&&process.env.CROWDIN_LANGUAGES||(f("Please set all required CROWDIN variables in your .env file."),process.exit(1));const{stdout:m}=i.exec("git rev-parse --abbrev-ref HEAD | tr / -",{silent:!0}),g=m.replace("\n",""),E=process.cwd(),I=E+"/intl",A=process.env.CROWDIN_LANGUAGES.split(","),O=process.env.CROWDIN_DEEPL_SUPPORTED_LANGUAGES?process.env.CROWDIN_DEEPL_SUPPORTED_LANGUAGES.split(","):[],_={BRANCH_NAME:g,FILE_NAME:"source.json",CROWDIN_PERSONAL_ACCESS_TOKEN:process.env.CROWDIN_PERSONAL_ACCESS_TOKEN||"",CROWDIN_PROJECT_ID:Number(process.env.CROWDIN_PROJECT_ID),CROWDIN_LANGUAGES:A,INTL_DIR:I,TRANSLATIONS_DIR:E+"/src/intl",TRANSLATIONS_FILE:I+"/english.source.json",DEEPL_ENGINE_ID:process.env.CROWDIN_DEEPL_ENGINE_ID?Number(process.env.CROWDIN_DEEPL_ENGINE_ID):void 0,DEEPL_SUPPORTED_LANGUAGES:O},{CROWDIN_PERSONAL_ACCESS_TOKEN:S,CROWDIN_PROJECT_ID:b,FILE_NAME:y,DEEPL_ENGINE_ID:D,DEEPL_SUPPORTED_LANGUAGES:T}=_,R=n.TasksModel.Type,{translationsApi:C,sourceFilesApi:L,uploadStorageApi:v,tasksApi:P}=new s({token:S}),G=e=>{var a,t,r;return F(e)?null==e?void 0:e.error:null==e||null==(a=e.errors)||null==(t=a[0])||null==(r=t.error)?void 0:r.errors[0]};function F(e){return void 0!==e.error}const k=e=>L.listProjectBranches(b,e),U=e=>L.listProjectFiles(b,e),W=e=>v.addStorage(y,e),x=async e=>{if("finished"!==(await C.preTranslationStatus(b,e)).data.status)return new Promise(a=>{setTimeout(async()=>{await x(e),a()},1e3)})},$=async({branchName:e,file:a,clearTranslationsAndApprovals:t=!1})=>{var r,s;const i=await W(a),l=await k(e),c=null==l||null==(r=l.data[0])||null==(s=r.data)?void 0:s.id;if(!c)return{error:{code:"branchNotFound",message:"Couldn’t find a branch with the name "+o.bold(e)}};const d=await U(c);return L.updateOrRestoreFile(b,d.data[0].data.id,{storageId:i.data.id,updateOption:t?n.SourceFilesModel.UpdateOption.CLEAR_TRANSLATIONS_AND_APPROVALS:n.SourceFilesModel.UpdateOption.KEEP_TRANSLATIONS})},j=e=>P.listTasks(b,{limit:500,status:n.TasksModel.Status.TODO,...e||{}}),q=async(e,a,t,r,n)=>P.addTask(b,{title:e,fileIds:a,languageId:t,type:r,description:n}),M=async e=>P.deleteTask(b,e),B={printWidth:100,singleQuote:!0,trailingComma:"all",bracketSpacing:!0},K=async e=>{const a=await u.resolveConfigFile(),r=await u.resolveConfig(a||"")||B;try{const a=await d.glob(e);for(const e of a){const{inferredParser:a}=u.getFileInfo.sync(e),n=t.readFileSync(e,"utf-8");try{const s=await u.format(n,{...r,parser:a||"babel"});t.writeFileSync(e,s),N("Prettified "+e)}catch(a){f("Something went wrong while prettifying the file: "+e)}}}catch{f("No files found, check your glob pattern"),process.exit(1)}};var J=async e=>{w("Extracting messages"),c.sync(_.INTL_DIR);const a=await d.glob(e);0===a.length&&(f("No files found, check your glob pattern"),process.exit(1));const r=await p.extract(a,{format:"crowdin"});t.writeFileSync(_.TRANSLATIONS_FILE,r),await K(_.TRANSLATIONS_FILE)};class H extends a.Option{constructor(e){super("-b, --branch-name [string]",e),this.default(_.BRANCH_NAME)}}class Q extends a.Option{constructor(e){super("-p, --pre-translate",e),this.default(!1)}}class V extends a.Option{constructor(e){super("-p, --delete-tasks",e),this.default(!1)}}exports.default=async e=>{const s=new a.Command,i=require("../package.json").version;s.name("mollie-crowdin").usage("<upload | collect | download | delete-branch> [options]").version(i),s.command("upload <glob>").description("scan the directory for new messages and upload them").addOption(new H("the Crowdin branch where to sync the translations to")).addOption(new a.Option("-t, --create-tasks","type of tasks to create")).addOption(new Q("whether to generate pre-translations for the uploaded files")).action(async(e,a)=>{await J(e);const r=await(async e=>{w("Uploading source file to Crowdin");const a=t.createReadStream(e.translationsFile);try{const t=await(r=e.branchName,L.createBranch(b,{name:r}));if(!F(t)){const e=await(async(e,a)=>{const t=await W(a),r=await k(e);return L.createFile(b,{storageId:t.data.id,name:y,branchId:r.data[0].data.id})})(t.data.name,a);return N("Created branch "+o.bold(t.data.name)),N(`Uploaded source file (id: ${e.data.id}) to branch: ${o.bold(t.data.name)}`),{fileId:e.data.id}}f(t.error.message)}catch(t){const r=G(t);if("notUnique"===r.code){w(`Branch ${o.bold(e.branchName)} already exists`),w("Updating source file in branch: "+o.bold(e.branchName));try{const t=await $({branchName:e.branchName,clearTranslationsAndApprovals:e.clearOnUpdate,file:a});return F(t)?void f(`${t.error.code}: ${t.error.message}`):(N("Source file updated"),{fileId:t.data.id})}catch(e){f(e)}}else f(r.code+": "+r.message)}var r})({translationsFile:_.TRANSLATIONS_FILE,branchName:a.branchName,clearOnUpdate:a.preTranslate});r&&r.fileId&&(a.preTranslate&&await async function(e){try{await(async e=>{if(!D)throw new Error("To apply pre-translations, please set the CROWDIN_DEEPL_ENGINE_ID variable in your .env file.");if(0===T.length)throw new Error("To apply pre-translations, please set the CROWDIN_DEEPL_SUPPORTED_LANGUAGES variable in your .env file.");const a=await C.applyPreTranslation(b,{languageIds:T,fileIds:[e],method:n.TranslationsModel.Method.MT,engineId:D});return x(a.data.identifier)})(e),N("Successfully applied pre-translations")}catch(e){f(e)}}(r.fileId),a.createTasks&&await(async e=>{w("Creating tasks...");const a=(await k(e.branchName)).data[0].data.id,t=await j({branchId:a});await Promise.allSettled(t.data.filter(a=>a.data.fileIds.includes(e.fileId)).map(e=>M(e.data.id)));for await(const a of e.languages){const t="Review translations for "+e.branchName,r=`${e.branchName} (${a})`;try{w(`Creating task for language ${a}: ${t}`);const n=await q(t,[e.fileId],a,"proofread"===e.type?R.PROOFREAD:R.TRANSLATE,r);F(n)&&f(n.error.message),w("Successfully created task for language "+a)}catch(e){const a=G(e);f(null==a?void 0:a.message)}}})({branchName:a.branchName,fileId:r.fileId,languages:_.CROWDIN_LANGUAGES,type:"proofread"}))}),s.command("collect <glob>").description("scan the directory for new messages and save them to english.source.json").action(async e=>{await J(e)}),s.command("download").description("download new translations from Crowdin").option("--typescript","write to TypeScript files (.ts)",!1).addOption(new H("the Crowdin branch from where to download the translations")).action(async e=>{await(async e=>{t.existsSync(e.translationsFile)||(f(e.translationsFile+" does not exist."),process.exit(1)),w("Syncing source file"),c.sync(e.translationsDir);const a=t.createReadStream(e.translationsFile),n=e.typescript?"ts":"js",s=await $({branchName:e.branchName,file:a});F(s)&&(f(s.error.message||"Something went wrong while uploading the source file"),process.exit(1)),w("Downloading translations from Crowdin");const i=await Promise.all(e.languages.map(a=>(async(e,a)=>{const t=(await k(e)).data[0].data.id,n=(await U(t)).data.map(e=>e.data.id),s=await C.exportProjectTranslation(b,{fileIds:n,targetLanguageId:a});return r.get(s.data.url)})(e.branchName,a))).catch(e=>{var a;F(e)&&f(e.error.message),"notInArray"===(null==(a=G(e))?void 0:a.code)&&f("Target language not found. Make sure `CROWDIN_LANGUAGES` is correct."),process.exit(1)});w("Writing translations to: "+o.bold(e.translationsDir)),await Promise.all(e.languages.map((a,r)=>{const s=i[r];if(!s||"OK"!==s.statusText)return;const o=(e=>{const a={};return Object.keys(e).sort().forEach(t=>{a[t]=e[t].message}),a})(s.data),l=JSON.stringify(o,null,4),c=`${e.translationsDir}/${a}.${n}`,d=`// Auto generated file. Do no change. Go to Crowdin to update the translations and run './node_modules/.bin/mollie-crowdin download' to update this file.\nexport default ${l};`;return new Promise(e=>t.writeFile(c,d,()=>e(!0)))})),await K(`${e.translationsDir}/*.${n}`),N("Translations updated")})({translationsFile:_.TRANSLATIONS_FILE,translationsDir:_.TRANSLATIONS_DIR,languages:_.CROWDIN_LANGUAGES,branchName:e.branchName,typescript:e.typescript})}),s.command("delete-branch").description("clean up branches in Crowdin").addOption(new H("the Crowdin branch to be deleted")).addOption(new V("whether to delete any associated tasks")).action(async e=>{await(async({branchName:e,deleteTasks:a})=>{var t,r;w("Deleting branch from Crowdin");const n=function(e){return e.replace(/\//g,"-")}(e);let s=null;try{s=await k(n)}catch(e){return f("Error while fetching branches from Crowdin")}if(0===(null==(t=s)?void 0:t.data.length))return f(`Couldn’t find a branch with the name: "${n}"`);const o=null==(r=s)?void 0:r.data[0].data.id;if(!o)return f(`Error determining the ID for branch: "${n}"`);try{if(a){const e=await U(o),a=await j({branchId:o});await Promise.allSettled(a.data.filter(a=>a.data.fileIds.some(a=>e.data.some(e=>e.data.id===a))).map(e=>M(e.data.id))).then(e=>e.forEach(e=>{"rejected"===e.status&&f(e.reason)}))}await(async e=>L.deleteBranch(b,e))(o),N(`Deleted branch: ${n} (${o})`)}catch(e){f(e)}})(e)}),await s.parseAsync(e)};
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var a=require("commander"),t=e(require("fs")),r=e(require("axios")),n=require("@crowdin/crowdin-api-client"),s=e(n),i=e(require("chalk")),o=e(require("shelljs")),l=e(require("dotenv")),c=require("mkdirp"),d=e(require("fast-glob")),u=require("prettier"),p=require("@formatjs/cli-lib");const h=console.log;var f=e=>h("⛔️ "+e),w=e=>h("✅ "+e),N=e=>h("ℹ️ "+e);l.config(),process.env.CROWDIN_PERSONAL_ACCESS_TOKEN&&process.env.CROWDIN_PROJECT_ID&&process.env.CROWDIN_LANGUAGES||(f("Please set all required CROWDIN variables in your .env file."),process.exit(1));const{stdout:m}=o.exec("git rev-parse --abbrev-ref HEAD | tr / -",{silent:!0}),g=m.replace("\n",""),E=process.cwd(),I=E+"/intl",A=process.env.CROWDIN_LANGUAGES.split(","),O=process.env.CROWDIN_DEEPL_SUPPORTED_LANGUAGES?process.env.CROWDIN_DEEPL_SUPPORTED_LANGUAGES.split(","):[],_={BRANCH_NAME:g,FILE_NAME:"source.json",CROWDIN_PERSONAL_ACCESS_TOKEN:process.env.CROWDIN_PERSONAL_ACCESS_TOKEN||"",CROWDIN_PROJECT_ID:Number(process.env.CROWDIN_PROJECT_ID),CROWDIN_LANGUAGES:A,INTL_DIR:I,TRANSLATIONS_DIR:E+"/src/intl",TRANSLATIONS_FILE:I+"/english.source.json",DEEPL_ENGINE_ID:process.env.CROWDIN_DEEPL_ENGINE_ID?Number(process.env.CROWDIN_DEEPL_ENGINE_ID):void 0,DEEPL_SUPPORTED_LANGUAGES:O},{CROWDIN_PERSONAL_ACCESS_TOKEN:S,CROWDIN_PROJECT_ID:b,FILE_NAME:y,DEEPL_ENGINE_ID:D,DEEPL_SUPPORTED_LANGUAGES:T}=_,R=n.TasksModel.Type,{translationsApi:C,sourceFilesApi:L,uploadStorageApi:v,tasksApi:P}=new s({token:S}),G=e=>{var a,t,r;return F(e)?null==e?void 0:e.error:null==e||null==(a=e.errors)||null==(t=a[0])||null==(r=t.error)?void 0:r.errors[0]};function F(e){return void 0!==e.error}const U=e=>L.listProjectBranches(b,e),k=e=>L.listProjectFiles(b,e),W=e=>v.addStorage(y,e),x=async e=>{if("finished"!==(await C.preTranslationStatus(b,e)).data.status)return new Promise(a=>{setTimeout(async()=>{await x(e),a()},1e3)})},$=async({branchName:e,file:a,clearTranslationsAndApprovals:t=!1})=>{var r,s;const o=await W(a),l=await U(e),c=null==l||null==(r=l.data[0])||null==(s=r.data)?void 0:s.id;if(!c)return{error:{code:"branchNotFound",message:"Couldn’t find a branch with the name "+i.bold(e)}};const d=await k(c);return L.updateOrRestoreFile(b,d.data[0].data.id,{storageId:o.data.id,updateOption:t?n.SourceFilesModel.UpdateOption.CLEAR_TRANSLATIONS_AND_APPROVALS:n.SourceFilesModel.UpdateOption.KEEP_TRANSLATIONS})},j=e=>P.listTasks(b,{limit:500,status:n.TasksModel.Status.TODO,...e||{}}),q=async(e,a,t,r,n)=>P.addTask(b,{title:e,fileIds:a,languageId:t,type:r,description:n}),M=async e=>P.deleteTask(b,e),B={printWidth:100,singleQuote:!0,trailingComma:"all",bracketSpacing:!0},K=async e=>{const a=await u.resolveConfigFile(),r=await u.resolveConfig(a||"")||B;try{const a=await d.glob(e);for(const e of a){const{inferredParser:a}=await u.getFileInfo(e),n=t.readFileSync(e,"utf-8");try{const s=await u.format(n,{...r,parser:a||"babel"});t.writeFileSync(e,s),w("Prettified "+e)}catch(a){f("Something went wrong while prettifying the file: "+e)}}}catch(e){f("Error while prettifying files"),console.error(e),process.exit(1)}};var J=async e=>{N("Extracting messages"),c.sync(_.INTL_DIR);const a=await d.glob(e);0===a.length&&(f("No files found, check your glob pattern"),process.exit(1));const r=await p.extract(a,{format:"crowdin"});t.writeFileSync(_.TRANSLATIONS_FILE,r),await K(_.TRANSLATIONS_FILE)};class H extends a.Option{constructor(e){super("-b, --branch-name [string]",e),this.default(_.BRANCH_NAME)}}class Q extends a.Option{constructor(e){super("-p, --pre-translate",e),this.default(!1)}}class V extends a.Option{constructor(e){super("-p, --delete-tasks",e),this.default(!1)}}exports.default=async e=>{const s=new a.Command,o=require("../package.json").version;s.name("mollie-crowdin").usage("<upload | collect | download | delete-branch> [options]").version(o),s.command("upload <glob>").description("scan the directory for new messages and upload them").addOption(new H("the Crowdin branch where to sync the translations to")).addOption(new a.Option("-t, --create-tasks","type of tasks to create")).addOption(new Q("whether to generate pre-translations for the uploaded files")).action(async(e,a)=>{await J(e);const r=await(async e=>{N("Uploading source file to Crowdin");const a=t.createReadStream(e.translationsFile);try{const t=await(r=e.branchName,L.createBranch(b,{name:r}));if(!F(t)){const e=await(async(e,a)=>{const t=await W(a),r=await U(e);return L.createFile(b,{storageId:t.data.id,name:y,branchId:r.data[0].data.id})})(t.data.name,a);return w("Created branch "+i.bold(t.data.name)),w(`Uploaded source file (id: ${e.data.id}) to branch: ${i.bold(t.data.name)}`),{fileId:e.data.id}}f(t.error.message)}catch(t){const r=G(t);if("notUnique"===r.code){N(`Branch ${i.bold(e.branchName)} already exists`),N("Updating source file in branch: "+i.bold(e.branchName));try{const t=await $({branchName:e.branchName,clearTranslationsAndApprovals:e.clearOnUpdate,file:a});return F(t)?void f(`${t.error.code}: ${t.error.message}`):(w("Source file updated"),{fileId:t.data.id})}catch(e){f(e)}}else f(r.code+": "+r.message)}var r})({translationsFile:_.TRANSLATIONS_FILE,branchName:a.branchName,clearOnUpdate:a.preTranslate});r&&r.fileId&&(a.preTranslate&&await async function(e){try{await(async e=>{if(!D)throw new Error("To apply pre-translations, please set the CROWDIN_DEEPL_ENGINE_ID variable in your .env file.");if(0===T.length)throw new Error("To apply pre-translations, please set the CROWDIN_DEEPL_SUPPORTED_LANGUAGES variable in your .env file.");const a=await C.applyPreTranslation(b,{languageIds:T,fileIds:[e],method:n.TranslationsModel.Method.MT,engineId:D});return x(a.data.identifier)})(e),w("Successfully applied pre-translations")}catch(e){f(e)}}(r.fileId),a.createTasks&&await(async e=>{N("Creating tasks...");const a=(await U(e.branchName)).data[0].data.id,t=await j({branchId:a});await Promise.allSettled(t.data.filter(a=>a.data.fileIds.includes(e.fileId)).map(e=>M(e.data.id)));for await(const a of e.languages){const t="Review translations for "+e.branchName,r=`${e.branchName} (${a})`;try{N(`Creating task for language ${a}: ${t}`);const n=await q(t,[e.fileId],a,"proofread"===e.type?R.PROOFREAD:R.TRANSLATE,r);F(n)&&f(n.error.message),N("Successfully created task for language "+a)}catch(e){const a=G(e);f(null==a?void 0:a.message)}}})({branchName:a.branchName,fileId:r.fileId,languages:_.CROWDIN_LANGUAGES,type:"proofread"}))}),s.command("collect <glob>").description("scan the directory for new messages and save them to english.source.json").action(async e=>{await J(e)}),s.command("download").description("download new translations from Crowdin").option("--typescript","write to TypeScript files (.ts)",!1).addOption(new H("the Crowdin branch from where to download the translations")).action(async e=>{await(async e=>{t.existsSync(e.translationsFile)||(f(e.translationsFile+" does not exist."),process.exit(1)),N("Syncing source file"),c.sync(e.translationsDir);const a=t.createReadStream(e.translationsFile),n=e.typescript?"ts":"js",s=await $({branchName:e.branchName,file:a});F(s)&&(f(s.error.message||"Something went wrong while uploading the source file"),process.exit(1)),N("Downloading translations from Crowdin");const o=await Promise.all(e.languages.map(a=>(async(e,a)=>{const t=(await U(e)).data[0].data.id,n=(await k(t)).data.map(e=>e.data.id),s=await C.exportProjectTranslation(b,{fileIds:n,targetLanguageId:a});return r.get(s.data.url)})(e.branchName,a))).catch(e=>{var a;F(e)&&f(e.error.message),"notInArray"===(null==(a=G(e))?void 0:a.code)&&f("Target language not found. Make sure `CROWDIN_LANGUAGES` is correct."),process.exit(1)});N("Writing translations to: "+i.bold(e.translationsDir)),await Promise.all(e.languages.map((a,r)=>{const s=o[r];if(!s||"OK"!==s.statusText)return;const i=(e=>{const a={};return Object.keys(e).sort().forEach(t=>{a[t]=e[t].message}),a})(s.data),l=JSON.stringify(i,null,4),c=`${e.translationsDir}/${a}.${n}`,d=`// Auto generated file. Do no change. Go to Crowdin to update the translations and run './node_modules/.bin/mollie-crowdin download' to update this file.\nexport default ${l};`;return new Promise(e=>t.writeFile(c,d,()=>e(!0)))})),await K(`${e.translationsDir}/*.${n}`),w("Translations updated")})({translationsFile:_.TRANSLATIONS_FILE,translationsDir:_.TRANSLATIONS_DIR,languages:_.CROWDIN_LANGUAGES,branchName:e.branchName,typescript:e.typescript})}),s.command("delete-branch").description("clean up branches in Crowdin").addOption(new H("the Crowdin branch to be deleted")).addOption(new V("whether to delete any associated tasks")).action(async e=>{await(async({branchName:e,deleteTasks:a})=>{var t,r;N("Deleting branch from Crowdin");const n=function(e){return e.replace(/\//g,"-")}(e);let s=null;try{s=await U(n)}catch(e){return f("Error while fetching branches from Crowdin")}if(0===(null==(t=s)?void 0:t.data.length))return f(`Couldn’t find a branch with the name: "${n}"`);const i=null==(r=s)?void 0:r.data[0].data.id;if(!i)return f(`Error determining the ID for branch: "${n}"`);try{if(a){const e=await k(i),a=await j({branchId:i});await Promise.allSettled(a.data.filter(a=>a.data.fileIds.some(a=>e.data.some(e=>e.data.id===a))).map(e=>M(e.data.id))).then(e=>e.forEach(e=>{"rejected"===e.status&&f(e.reason)}))}await(async e=>L.deleteBranch(b,e))(i),w(`Deleted branch: ${n} (${i})`)}catch(e){f(e)}})(e)}),await s.parseAsync(e)};
//# sourceMappingURL=crowdin-cli.cjs.production.min.js.map

@@ -281,3 +281,3 @@ import { Command, Option } from 'commander';

inferredParser
} = getFileInfo.sync(file);
} = await getFileInfo(file);
const data = fs.readFileSync(file, "utf-8");

@@ -295,4 +295,5 @@

}
} catch {
log$1.error("No files found, check your glob pattern");
} catch (error) {
log$1.error("Error while prettifying files");
console.error(error);
process.exit(1);

@@ -299,0 +300,0 @@ }

{
"version": "3.2.2",
"version": "3.2.3",
"license": "MIT",

@@ -4,0 +4,0 @@ "name": "@mollie/crowdin-cli",

@@ -22,3 +22,3 @@ import fs from "fs";

for (const file of files) {
const { inferredParser } = prettier.getFileInfo.sync(file);
const { inferredParser } = await prettier.getFileInfo(file);
const data = fs.readFileSync(file, "utf-8");

@@ -36,4 +36,5 @@ try {

}
} catch {
log.error("No files found, check your glob pattern");
} catch (error) {
log.error("Error while prettifying files");
console.error(error);
process.exit(1);

@@ -40,0 +41,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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