Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Official release 1.0.0 #9

Merged
merged 5 commits into from
Mar 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0 (March 15, 2016)

* Initial public release
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {yyyy} {name of copyright owner}
Copyright 2016 Split Software

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -199,4 +199,3 @@
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.

3 changes: 3 additions & 0 deletions NEWS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0 (March 15, 2016)

* Initial public release
121 changes: 67 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,67 @@
# NodeJS and Browser SDK

## Technologies

- ES6 (generators are blacklisted).
- TAPE for unit tests.
- [MonoRepo approach](https://github.com/babel/babel/blob/development/doc/design/monorepo.md).
- As simple as possible.

## Development mode

In order to simplify the startup, please execute `npm run dev`. The script will
do all the necessary steps to:

1. Install dependencies.
2. Link packages to be used locally.
3. Try to prune any packages which is possible to be removed.

## Release process

We have 4 packages (for now) handling different parts of the system as isolated
as possible.

### Checklist

Each packages should pass:

1. `npm lint` (it's available at root level).
2. `npm test` (it's available at package level).
3. Demos should continue working each time we tag a version.

### Building process

This step is required to run the tests, and each packages provides his own
`npm run build`. At root level we provide a `npm run build` which builds all
the packages in the correct order, so please, each time you want to release
a bundled version, remember to run `npm run build` at the root dir of the
repository.

### NPM Publish

Once everything works, you could continue with the official release of a new
version, to help in the process, we are using a custom version of [lerna](https://github.com/kittens/lerna).

1. Go and update the 6 `package.json`s manually switching to the version you
will release. (This will change in a near future).
2. `lerna publish`

### How to install the custom version of lerna

1. `nvm use 4.2.4` (this version matches with the current version used for development).
2. `git clone ?` (I deleted the repo => update this once I push it again).
3. `npm link` inside the directory where you cloned the custom version of lerna.
4. `lerna --version` should show 2.0.0.
# Split SDK for JavaScript

Split SDK is the library you should use for integrate [Split](http://split.io/)
into your web platform.

Quick links:

- [CHANGES](./CHANGES.txt)
- [NEWS](./NEWS.txt)

## Example for the Browser

If you want an in depth intro, please read [here](http://docs.split.io/docs/javascript-sdk-overview),
but for a quick example:

```js
// SDK instantiation.
var sdk = splitio({
core: {
authorizationKey: 'c1l5vkd50gimccout3c03pntbu', // [1] your API key
key: '4a2c4490-ced1-11e5-9b97-d8a25e8b1578' // [2] your customer id
}
});

// SDK evaluation after initialization completed.
sdk.ready().then(function () {
var treatment = sdk.getTreatment('payment_method');

if (treatment === 'method_1') {
// payment method 1
} else if (treatment === 'method_2') {
// payment method 2
} else {
// default payment method
}
});
```

This example will allow you to **switch** between different treatments you have
created in the [split editor](http://docs.split.io/docs/using-the-split-editor).

## Example for the NodeJS (still WIP, not ready for production usage).

For NodeJS, we are allowed to evaluate multiple keys using the same instance, so
the API is is slightly different:

```js
// SDK instantiation.
var sdk = require('@splitsoftware/splitio')({
core: {
authorizationKey: 'c1l5vkd50gimccout3c03pntbu' // [1] your API key
}
});

// SDK evaluation after initialization completed.
sdk.ready().then(function () {
var treatment = sdk.getTreatment('4a2c4490-ced1-11e5-9b97-d8a25e8b1578', 'payment_method');

if (treatment === 'method_1') {
// payment method 1
} else if (treatment === 'method_2') {
// payment method 2
} else {
// default payment method
}
});
```
2 changes: 1 addition & 1 deletion demos/browser-split/offline/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div id="main">
Hello SPLIT! => Please use the devTools to start testing the engine!
</div>
<script src="https://cdn.split.io/sdk/offline-0.29.0.js"></script>
<script src="https://cdn.split.io/sdk/offline-1.0.0-canary.0.js"></script>
<script src="/offline/app.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion demos/browser-split/online/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div id="main">
Hello SPLIT! => Please use the devTools to start testing the engine!
</div>
<script src="https://cdn.split.io/sdk/online-0.29.0.js"></script>
<script src="https://cdn.split.io/sdk/online-1.0.0-canary.0.js"></script>
<script src="/online/app.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion demos/browser-split/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"http-server": "^0.9.0"
},
"devDependencies": {
"@splitsoftware/splitio-browser": "0.29.0"
"@splitsoftware/splitio-browser": "1.0.0-canary.0"
}
}
2 changes: 1 addition & 1 deletion demos/express-split/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"npm": "3.x"
},
"dependencies": {
"@splitsoftware/splitio": "0.29.0",
"@splitsoftware/splitio": "1.0.0-canary.0",
"express": "^4.13.3"
}
}
32 changes: 32 additions & 0 deletions docs/modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Modules

The SDK implementation was splitted into several modules:

### @splitsoftware/splitio-utils

Common package where you could find some of the shared libraries (extremely
simple libs).

### @splitsoftware/splitio-services

Services layer which isolate how we communicate with the Split backend.

### @splitsoftware/splitio-metrics

Everything about SDK tracking is defined in this module.

### @splitsoftware/splitio-engine

Split runtime which all the evaluation mechanism.

### @splitsoftware/splitio-cache

Data layer used by splitio-engine.

### @splitsoftware/splitio

SDK public API.

### @splitsoftware/splitio-browser

Tools for export the NodeJS SDK into a browser bundle using browserify.
30 changes: 30 additions & 0 deletions docs/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Release

### Building process (transpilation to ES5)

This step is required to run the tests, and each packages provides his own
`npm run build`. At root level we provide a `npm run build-all` which builds all
the packages in the correct order, so please, each time you want to release
a bundled version, remember to run `npm run build-all` at the root dir of the
repository.

### Checklist

Each package should pass:

1. `npm run lint` (it's available at root level).
2. `npm run test-all` (it's available at package level).
3. `npm run karma-local` in any package you have changed.
4. `npm run karma-sauce` in any package you have changed.

### NPM Publish

Once everything works :smile: you could continue with the official release of a
new version.

1. Following the SDK versioning spec, move the version forward of all the
packages, doesn't matter if you have make changes or not.
2. You have 2 options, release an incremental canary version, in that case use
`npm run canary-all`
3. If you want to officially release a stable version, please use
`npm run release-all`
16 changes: 16 additions & 0 deletions e2e/es6/e2e.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/**
Copyright 2016 Split Software

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.
**/

require('@splitsoftware/splitio');
const Split = global.splitio;

Expand Down
16 changes: 16 additions & 0 deletions e2e/local.karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/**
Copyright 2016 Split Software

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.
**/

const istanbul = require('browserify-istanbul');
const browserifyCoverageTransform = istanbul({
ignore: [ '**/*.spec.js' ]
Expand Down
6 changes: 3 additions & 3 deletions e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splitsoftware/splitio-e2e",
"version": "0.29.0",
"version": "1.0.0-canary.0",
"description": "Split SDK - E2E",
"author": {
"email": "[email protected]",
Expand All @@ -14,8 +14,8 @@
"watch": "babel es6 --out-dir lib --source-maps --watch"
},
"dependencies": {
"@splitsoftware/splitio": "0.29.0",
"@splitsoftware/splitio-utils": "0.29.0",
"@splitsoftware/splitio": "1.0.0-canary.0",
"@splitsoftware/splitio-utils": "1.0.0-canary.0",
"babel-runtime": "^5.8.35",
"core-js": "^1.2.6"
},
Expand Down
16 changes: 16 additions & 0 deletions e2e/sauce.karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/**
Copyright 2016 Split Software

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.
**/

var pkg = require('./package.json');

module.exports = function(config) {
Expand Down
15 changes: 15 additions & 0 deletions e2e/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
#!/usr/bin/env bash

# Copyright 2016 Split Software
#
# 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.

##
# Bundle system for transpile everything from ES6 to ES5 and copying any json
# file used as package descriptor or mock.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"license": "Apache-2",
"version": "0.29.0",
"version": "1.0.0-canary.0",
"scripts": {
"lint": "./scripts/lint.sh",
"install-all": "./scripts/install-all.sh",
Expand Down
15 changes: 15 additions & 0 deletions packages/splitio-browser/COPYRIGHT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
Copyright 2016 Split Software

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.
**/
18 changes: 0 additions & 18 deletions packages/splitio-browser/README.md

This file was deleted.

Loading