1.0.0 • Published 5 years ago

respresso v1.0.0

Weekly downloads
96
License
SEE LICENSE IN RE...
Repository
-
Last release
5 years ago

Respresso Node.js client

A Node.js client for synchronizing Respresso resources

Getting Started

Prerequisites

  • You need Java (version 7 or higher) installed on your machine!
  • You need a Respresso project token (you can copy it from the project's main page)

Installing

npm install respresso

Initializing

To initialize the client, run the following command in your project directory

respresso init

Here you can change the name of the config file and set the project token

Note: If you don't set the token here, you have to set it in the config file before you can synchronize your resources

Usage

Adding resources

You can add a new resource to be synchronized using the command line

respresso install category:group@version

Note: You have to specify the version

For example:

respresso install localization:android@1.0.0

Alternatively you can add new resources by modifying the config file

{
  "resources": [
    {
      "category": "localization",
      "group": "android",
      "version": "1.0.0"
    },
    {
      "category": "color",
      "group": "android",
      "version": "1.0.1"
    }
  ]
}

Synchronizing resources

To update your local resources from the server, use the following command

respresso sync

Cleaning up

To remove all files generated by this client, use the following command

respresso clean

Note: This will remove all files synchronized from the server, as well as the files generated by this client. The configuration file will not be removed.

API Reference

Command line

You can use the client from the command line

respresso <command> [arguments]
Available commands
  • initialize (alias: init)
  • install <resource> (alias: i)
    • resource: category:group@version (example: localization:android@1.0.0)
  • synchronize (alias: sync)
  • clean

You can use --help after each command to print out the usage of that command

If you changed the name of the config file, you can specify it after each command (except for initialize)

respresso sync --config my-config-file.json

Alternatively

respresso sync -c my-config-file.json

You can also print out the version of the client

respresso --version

From Javascript

You can also use the client from Javascript

For example

const respresso = require("respresso");

respresso.synchronize().then(function() {
  console.log("Synchronized");
});

Or

import {synchronize} from "respresso";

synchronize().then(function() {
  console.log("Synchronized");
});
Available methods
Initialize
initialize(options)

options:

{
  configFile: string (optional) (default: "respresso.json"),
  projectToken: string (optional)
}
Install
install(resource, configFile)

resource:

{
  category: string,
  version: string,
  group: string
}

configFile:

string (optional) (default: "respresso.json")

returns an empty Promise

Synchronize
synchronize(configFile)

configFile:

string (optional) (default: "respresso.json")

returns an empty Promise

Clean
clean(configFile)

configFile:

string (optional) (default: "respresso.json")

returns an empty Promise

Note: Typescript type definitions are included in the package

Config file

Example config file

{
  "projectToken": "60a50cf9-818e-4c46-aeb1-8b50169a5354",
  "serverUrl": "https://app.respresso.io",
  "targetDirectory": "./respresso",
  "lockFile": "./respresso-lock.json",
  "changesFile": "./respresso-changes.json",
  "logFile": "./respresso.log",
  "strictMode": true,
  "resources": [
    {
      "category": "localization",
      "group": "android",
      "version": "1.0.0"
    },
    {
      "category": "color",
      "group": "android",
      "version": "1.0.1"
    }
  ]
}

The only required field is the projectToken

Example projects: https://github.com/pontehu/respresso-sync-for-clients

Licence

Copyright 2019 Ponte.hu Kft

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
1.0.0

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago