Socket
Socket
Sign inDemoInstall

@idrinth/typescript-language-from-yaml

Package Overview
Dependencies
1
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @idrinth/typescript-language-from-yaml

Translates yaml files to ts for translation autocompletion, autocorrection and better developer support


Version published
Weekly downloads
1.3K
decreased by-37.52%
Maintainers
1
Install size
678 kB
Created
Weekly downloads
 

Readme

Source

@idrinth/typescript-language-from-yaml

This small project handles the conversion of transslation files from yaml to typescript. Install it and run the command itlfy to use it.

check

The check command will check if the yaml files in your current working directory's language folder are valid and match. It will error for unparseable files and keys not available in english, while warning if keys are missing in other languages.

ilfy check or itlfy chheck root-folder-name

generate

Generate provides typescript language files according to your specification. It only works in your current working directoy's language folder and will output to ssrc/locales by default.

Options:

  • --strict-types apply strict types, so that typescript will error on build if the structures missmatch
  • --verbatim-module-syntax will export the type as a named export instead of a default one
  • --split splits the language files at the top level keys.. Thhis leads to smaller files when using dynamic imports. Usually you want --no-translations-file as well in case of splitting.
  • --no-translations-file dissables the creation of a translation object containing all languages

watch

Watching will watch one or more language folders and rebuild the typescript files whenever the yaml files change.If you don't give it a root folder, it will assume the current working directory.

  • ilfy watch rootfolder1 rootfolder2

init

Generates a configuration file with the current values for the given folder or folders.

configuration

use a .idrinth-typesscript-language-from-yaml.yml file in the root of your project to configure the tool with defaults that can be overwritten by the command line.

hasNoTranslationsFile: false
isSplit: false
originDirectory: language
isFailOnWarning: false
targetDirectory: src/locales
isStrictTypes: false
isVerbatimModuleSyntax: false

Keywords

FAQs

Last updated on 05 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc