Skip to content

Commit

Permalink
renamed package, version language and others
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilianoSanchez committed Nov 23, 2021
1 parent 34d9ea6 commit 4603420
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 57 deletions.
5 changes: 1 addition & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# Javascript Slim Synchronizer
# Javascript Sync Tools

## What did you accomplish?

## How do we test the changes introduced in this PR?

## Related JIRA tickets and PRs
[](url)

## Extra Notes
16 changes: 9 additions & 7 deletions CONTRIBUTORS-GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to the Split Javascript Synchronizer
# Contributing to the Split Javascript Sync Tools

Split Javascript Synchronizer is an open source project and we welcome feedback and contribution. The information below describes how to build the project with your changes, run the tests, and send the Pull Request(PR).
Split Javascript Sync Tools is an open source project and we welcome feedback and contribution. The information below describes how to build the project with your changes, run the tests, and send the Pull Request(PR).

## Development

Expand All @@ -18,25 +18,27 @@ Split Javascript Synchronizer is an open source project and we welcome feedback
10. Check for conflicts once the pull request is created to make sure your PR can be merged cleanly into `development`.
11. Keep an eye out for any feedback or comments from Split's SDK team.

### Building the Synchronizer
### Building the tools

For widespread use of the Synchronizer with different environments and module formats, we have two different builds:
For widespread use of the tools with different environments and module formats, we have two different builds:
* A **ES2015** modules compatible build.
* A **CommonJS** modules compatible build.

The different builds can be generated all at once with the command `npm run build`. Refer to [package.json](package.json) for more insight on the build scripts.

_Note:_ In order to run build/tests commands, Node 10 or higher is required.

### Building the Synchronizer's CLI
### Building the tools CLI [TO BE DEFINED]

To create the CLI that will be set as `bin` in the package, run the command `npm run make:cli`. Refer to [package.json](package.json) for more insight on the build scripts.
To create the CLI that will be set as `bin` in the package, run the command `npm run build:cli`. Refer to [package.json](package.json) for more insight on the build scripts.
_Note:_ the CLI capabilities rely on [yargs](https://www.npmjs.com/package/yargs), which requires Node 12 or higher.

### Running tests

The project includes unit as well as integration tests for browser environments.

- To execute unit tests, run `npm run test:unit`
- To execute e2e tests, you need a Redis service up and running with the default configurations, and run `npm run test:e2e:ci`.
- To execute e2e tests, you need a Redis service up and running with the default configurations, and run `npm run test:e2e`.

All tests can be run at once with the command `npm run test`.

Expand Down
46 changes: 21 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,64 @@
# Split Javascript Synchronizer
[![Build Status](https://api.travis-ci.com/splitio/javascript-slim-synchronizer.svg?branch=main)](https://api.travis-ci.com/splitio/javascript-slim-synchronizer)
# Split Javascript Sync Tools
[![Build Status](https://api.travis-ci.com/splitio/javascript-sync-tools.svg?branch=main)](https://api.travis-ci.com/splitio/javascript-sync-tools)

## Overview
Thin version of Split Synchronizer supporting the core of the synchronization mechanisms used by Split SDK producer libraries.
This package includes a Javascript synchronizer tool that can be used to synchronize storages used by SDKs in consumer mode.

[![Twitter Follow](https://img.shields.io/twitter/follow/splitsoftware.svg?style=social&label=Follow&maxAge=1529000)](https://twitter.com/intent/follow?screen_name=splitsoftware)

## Compatibility
Split Synchronizer supports:
Split sync tools supports:
- Node version 12 or higher to execute the CLI.
- Node version 8 or higher to import the package as dependency.
- Node version 8 or higher to import the package and use programmatically.

## Getting started
Below is a simple example that describes the execution or instantiation of Split Javascript Synchronizer:
Below is a simple example that describes the execution of the Javascript Synchronizer:

### Install package as global dependency and run CLI
1. Install npm package via `npm install -g @splitsoftware/splitio-node-slim-synchronizer`
2. Then, execute the CLI `split-node-synchronizer [...args]`
1. Install npm package via `npm install -g @splitsoftware/splitio-sync-tools`
2. Then, execute the CLI `split-sync-tools [...args]`

### Install package as a project dependency to run programmatically
1. Install npm package via `npm install @splitsoftware/splitio-node-slim-synchronizer`
1. Install npm package via `npm install @splitsoftware/splitio-sync-tools`
2. Inside your app, import the `Synchronizer`
```
const { Synchronizer } = require('@splitsoftware/splitio-node-slim-synchronizer')
// or if your project supports modules and ESM
import { Synchronizer } from '@splitsoftware/splitio-node-slim-synchronizer';
const { Synchronizer } = require('@splitsoftware/splitio-sync-tools')
// or if your project supports EcmaScript modules
import { Synchronizer } from '@splitsoftware/splitio-sync-tools';
```

3. Set the configurations:
3. Instantiate the Synchronizer:
```
// Example:
const settings = {
const synchronizer = new Synchronizer({
core: {
authorizationKey: '<A_VALID_STAGING_APIKEY>',
},
urls: {
sdk: 'https://sdk.split.io/api', // already a default value
events: 'https://events.split.io/api', // already a default value
},
// Mandatory: provide a valid Storage wrapper.
storage: {
type: 'PLUGGABLE',
prefix: 'storagePrefix',
wrapper: storageWrapper,
},
// @TODO review config params
synchronizerConfigs: {
synchronizerMode: 'MODE_RUN_ALL',
eventsPerPost: 2000,
impressionsPerPost: 4000,
maxRetries: 3,
},
};
const _sync = new Synchronizer(settings);
});
```

4. Run the Synchronizer
```
_sync.execute().then(() => console.log('ready'));
synchronizer.execute().then(() => console.log('ready'));
```

Please refer to [our official docs (@TODO)](https://help.split.io/hc/en-us/articles/360020037072-Split-Evaluator) to learn about all the functionality provided by Split Javascript Synchronizer and the configuration options available.
Please refer to [Javascript Sync Tools](https://help.split.io/hc/en-us/articles/@TODO) to learn about all the functionality provided by the package.

## Submitting issues
The Split team monitors all issues submitted to this [issue tracker](https://github.com/splitio/javascript-slim-synchronizer/issues). We encourage you to use this issue tracker to submit any bug reports, feedback, and feature enhancements. We'll do our best to respond in a timely manner.
The Split team monitors all issues submitted to this [issue tracker](https://github.com/splitio/javascript-sync-tools/issues). We encourage you to use this issue tracker to submit any bug reports, feedback, and feature enhancements. We'll do our best to respond in a timely manner.

## Contributing
Please see [Contributors Guide](CONTRIBUTORS-GUIDE.md) to find all you need to submit a Pull Request (PR).
Expand All @@ -84,12 +80,12 @@ Split has built and maintains SDKs for:
* iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)
* Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK)
* Javascript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
* Javascript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK)
* Node [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
* Javascript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852)
* PHP [Github](https://github.com/splitio/php-client) [Docs](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK)
* Python [Github](https://github.com/splitio/python-client) [Docs](https://help.split.io/hc/en-us/articles/360020359652-Python-SDK)
* React [Github](https://github.com/splitio/react-client) [Docs](https://help.split.io/hc/en-us/articles/360038825091-React-SDK)
* React Native [Github](https://github.com/splitio/react-native-client) [Docs](https://help.split.io/hc/en-us/articles/4406066357901)
* React Native [Github](https://github.com/splitio/react-native-client) [Docs](https://help.split.io/hc/en-us/articles/4406066357901-React-Native-SDK)
* Redux [Github](https://github.com/splitio/redux-client) [Docs](https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK)
* Ruby [Github](https://github.com/splitio/ruby-client) [Docs](https://help.split.io/hc/en-us/articles/360020673251-Ruby-SDK)

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@splitsoftware/splitio-synchronizer",
"version": "0.0.1",
"description": "Split Javascript Synchronizer",
"name": "@splitsoftware/splitio-sync-tools",
"version": "0.0.1-rc.0",
"description": "Split Javascript Sync Tools",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"bin": {
"splitio-synchronizer": "bin/splitio-synchronizer.js"
"splitio-sync-tools": "bin/splitio-sync-tools.js"
},
"files": [
"lib",
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const config = [
{
input: 'lib/cjs/cli.js',
output: {
file: 'bin/splitio-synchronizer.js',
file: 'bin/splitio-sync-tools.js',
format: 'cjs',
// exports: 'auto', // https://rollupjs.org/guide/en/#outputexports
},
Expand Down
4 changes: 2 additions & 2 deletions scripts/make_cli.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
echo "$(echo '#!/usr/bin/env node' | cat - bin/splitio-synchronizer.js)" > bin/splitio-synchronizer.js
chmod u+x bin/splitio-synchronizer.js
echo "$(echo '#!/usr/bin/env node' | cat - bin/splitio-sync-tools.js)" > bin/splitio-sync-tools.js
chmod u+x bin/splitio-sync-tools.js
4 changes: 2 additions & 2 deletions src/settings/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const version = '@VERSION@';

/**
* Default values to create settings for the Synchronizer script.
* Default values to create settings for the Javascrip Synchronizer.
*/
export const defaults = {
startup: {
Expand All @@ -18,6 +18,6 @@ export const defaults = {
// Amount of time we will wait before the first push of events.
eventsFirstPushWindow: 10,
},
version: `synchronizer-${version}`,
version: `synctoolsjs-${version}`,
streamingEnabled: false,
};
20 changes: 10 additions & 10 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Type definitions for Split Javascript Synchronizer
// Type definitions for Split Javascript Sync Tools
// Project: http://www.split.io/
// Definitions by: Emiliano Sanchez <https://github.com/EmilianoSanchez/>

export = JsSynchronizer;
export = JsSyncTools;

declare module JsSynchronizer {
declare module JsSyncTools {
/**
* Javascript synchronizer.
* Javascript synchronizer tool.
*
* @see {@link @TODO}.
*/
Expand Down Expand Up @@ -171,14 +171,14 @@ declare module JsSynchronizer {
impressionsMode?: ImpressionsMode
}
/**
* Type for specific Synchronizer's configs.
* Type for specific Synchronizer configs.
*/
synchronizerConfigs: {
// @TODO document
synchronizerMode?: SynchronizerMode
eventsPerPost?: number
impressionsPerPost?: number
maxRetries?: number
// @TODO review
synchronizerMode?: SynchronizerMode // sync.mode ?
eventsPerPost?: number // sync.eventsPerPost ?
impressionsPerPost?: number // sync.impressionsPerPost ?
maxRetries?: number // sync.maxRetries ?
}
}
}

0 comments on commit 4603420

Please sign in to comment.