npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@finderly/onesky

v1.0.2

Published

Utilities to perform tasks on OneSky

Downloads

24

Readme

OneSky CLI

Utilities to perform tasks on OneSky

This tool currently supports working with translations stored in JSON or YAML files. Support for XML and Apple's strings file formats are coming soon.

Install

npm install @finderly/onesky

Prerequisites

To use this utility you will need your OneSky API keys. You can find these by following the guide in this article: How to find your API keys.

The API keys should be stored in a file called .oneskyrc located in your project or home directory. The file contents look like this:

❯ cat $HOME/.oneskyrc
{
  publicKey: "your_public_key_here",
  privateKey: "your_private_key_here"
}

Private key is also known as secret key

Usage

Usage: onesky [options] [command]

Options:

	-h, --help  output usage information

Commands:

	download    download message files
	upload      upload message files
	sync        fetch, merge then upload message files
	help [cmd]  display help for [cmd]

Commands

download

Download a OneSky source file's translations in a given locale.

Example:

onesky download \
	--id 123456 \
	--source messages.json \
	--locale it \
	--destination languages/it.json \
	--force

The --force is used to overwrite the local file if it already exists

upload

Upload translations for a OneSky source file. The --locale flag specifies which language the local file being upload represents.

Note: You need to upload a source file's translations for the base language of your project before uploading it for any other locales

Example:

onesky upload \
	--id 123456 \
	--name en.json \
	--path locale/en/messages.json \
	--locale en \
	--wait

When uploading a file to OneSky the file name will be determined using the value of --path by default (in this case the file name would be messages.json). However, you can override by passing the --name flag. In the above example, the command will upload a file called en.json with contents coming from locale/en/messages.json.

The --wait flag causes the CLI to wait for OneSky to complete the import of the file.

sync

Sync is a workflow command that does three things:

  • Downloads all translations for a given file on OneSky, identified by --source
  • Merges the downloaded translations with ones located locally. It uses --pattern to find locale files.
  • Uploads the merged results back up to OneSky

Running this command periodically creates a tight workflow in which new translations are downloaded and missing translations are submitted up to OneSky for translators to fill out.

Example:

onesky sync \
	--id 123456 \
	--pattern 'locale/[lang]/messages.json' \
	--source myapp.json

The --pattern is the key part in this command. It can be any path pattern and must contain at least one instance of the [lang] token. In the example above if a OneSky project has three languages - such as it, en, de - then the command will sync files at the following locations with the translations for the myapp.json source file:

locale/en/messages.json
locale/de/messages.json
locale/it/messages.json