Skip to content

0.2.1 #252

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

Merged
merged 14 commits into from
Jun 25, 2020
Merged

0.2.1 #252

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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ jobs:
ref: 'develop'
- name: install
run: yarn
- name: build
run: yarn build
- name: verify version
run: |
if [ "$(jq -r '.version' 'lerna.json')" != "${{ needs.details.outputs.title }}" ] ; then
Expand Down Expand Up @@ -120,7 +122,8 @@ jobs:
run: |
git fetch
yarn lerna publish from-git --yes

- name: Verify
run: scripts/./verify ${{needs.details.outputs.title}}
# - name: patch
# run: |
# git config --global user.email "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"],
"version": "0.2.0"
"version": "0.2.1"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"test-dom-env": "lerna run test-dom-env",
"test-node-env": "lerna run test-node-env",
"lint": "remark . --output && lerna run lint",
"version": "lerna version --no-push --force-publish",
"bumb": "lerna version --no-push --force-publish",
"doc": "lerna run doc"
},
"author": "Scalecube (https://github.com/scalecube/scalecube-js)",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scalecube/api",
"version": "0.2.0",
"version": "0.2.1",
"private": false,
"main": "lib/index.js",
"module": "lib/index.js",
Expand Down
14 changes: 7 additions & 7 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scalecube/browser",
"version": "0.2.0",
"version": "0.2.1",
"private": false,
"unpkg": "dist/index.js",
"main": "lib/index.js",
Expand All @@ -24,7 +24,7 @@
"@babel/core": "^7.7.4",
"@babel/plugin-transform-arrow-functions": "^7.7.4",
"@babel/preset-env": "^7.7.4",
"@scalecube/api": "^0.2.0",
"@scalecube/api": "^0.2.1",
"regenerator-runtime": "^0.13.3",
"rollup": "^1.27.4",
"rollup-plugin-babel": "^4.3.3",
Expand All @@ -41,11 +41,11 @@
"typescript": "^3.2.4"
},
"dependencies": {
"@scalecube/cluster-browser": "^0.2.0",
"@scalecube/routers": "^0.2.0",
"@scalecube/scalecube-microservice": "^0.2.0",
"@scalecube/transport-browser": "^0.2.0",
"@scalecube/utils": "^0.2.0",
"@scalecube/cluster-browser": "^0.2.1",
"@scalecube/routers": "^0.2.1",
"@scalecube/scalecube-microservice": "^0.2.1",
"@scalecube/transport-browser": "^0.2.1",
"@scalecube/utils": "^0.2.1",
"rxjs": "^6.4.0"
}
}
6 changes: 3 additions & 3 deletions packages/cluster-browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scalecube/cluster-browser",
"version": "0.2.0",
"version": "0.2.1",
"private": false,
"main": "cjs/index.js",
"module": "es/index.js",
Expand All @@ -20,7 +20,7 @@
},
"author": "Scalecube (https://github.com/scalecube/scalecube-js)",
"devDependencies": {
"@scalecube/api": "^0.2.0",
"@scalecube/api": "^0.2.1",
"jest": "^24.6.0",
"rollup": "^1.14.6",
"rollup-plugin-filesize": "^6.1.1",
Expand All @@ -31,7 +31,7 @@
"typescript": "^3.2.4"
},
"dependencies": {
"@scalecube/utils": "^0.2.0",
"@scalecube/utils": "^0.2.1",
"rxjs": "^6.4.0"
}
}
6 changes: 3 additions & 3 deletions packages/cluster-nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scalecube/cluster-nodejs",
"version": "0.2.0",
"version": "0.2.1",
"private": false,
"main": "lib/index.js",
"module": "es/index.js",
Expand All @@ -20,7 +20,7 @@
},
"author": "Scalecube (https://github.com/scalecube/scalecube-js)",
"devDependencies": {
"@scalecube/api": "^0.2.0",
"@scalecube/api": "^0.2.1",
"jest": "^24.6.0",
"rollup": "^1.14.6",
"rollup-plugin-babel": "^4.3.3",
Expand All @@ -35,7 +35,7 @@
"typescript": "^3.2.4"
},
"dependencies": {
"@scalecube/utils": "^0.2.0",
"@scalecube/utils": "^0.2.1",
"rxjs": "^6.4.0",
"swim": "^0.6.0"
}
Expand Down
17 changes: 17 additions & 0 deletions packages/examples/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# this docker is using us to verify published version
FROM node:alpine
RUN apk add python make g++
COPY . /var/app
WORKDIR /var/app
ARG VERSION=next
RUN yarn add \
@scalecube/browser@${VERSION} \
@scalecube/node@${VERSION} \
@scalecube/routers@${VERSION} \
@scalecube/transport-nodejs@${VERSION} \
@scalecube/utils@${VERSION} \
@scalecube/api@${VERSION}

RUN yarn build

CMD /bin/sh
2 changes: 1 addition & 1 deletion packages/examples/k8s/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"license": "MIT",
"private": false,
"dependencies": {
"@scalecube/node": "^0.0.2-alpha.1584274445.3"
"@scalecube/node": "snapshot"
}
}
14 changes: 7 additions & 7 deletions packages/examples/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scalecube/examples",
"version": "0.2.0",
"version": "0.2.1",
"private": false,
"rollup": "rollup/index.js",
"license": "MIT",
Expand All @@ -22,7 +22,6 @@
"@babel/plugin-transform-arrow-functions": "^7.7.4",
"@babel/plugin-transform-async-to-generator": "^7.7.4",
"@babel/preset-env": "^7.7.4",
"@scalecube/api": "^0.2.0",
"jest": "^25.4.0",
"npm-run-all": "^4.1.5",
"parcel-bundler": "^1.12.3",
Expand All @@ -39,11 +38,12 @@
"typescript": "^3.2.4"
},
"dependencies": {
"@scalecube/browser": "^0.2.0",
"@scalecube/node": "^0.2.0",
"@scalecube/routers": "^0.2.0",
"@scalecube/transport-nodejs": "^0.2.0",
"@scalecube/utils": "^0.2.0"
"@scalecube/api": "^0.2.1",
"@scalecube/browser": "^0.2.1",
"@scalecube/node": "^0.2.1",
"@scalecube/routers": "^0.2.1",
"@scalecube/transport-nodejs": "^0.2.1",
"@scalecube/utils": "^0.2.1"
},
"browserslist": [
"ie 11",
Expand Down
13 changes: 10 additions & 3 deletions packages/examples/tests/greeting.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@ describe('k8s', () => {
});
// The whole response has been received. Print out the result.
resp.on('end', () => {
expect(data).toBe('"hello: test"');
execSync('/bin/bash -c "cd k8s && ./stop"', { stdio: 'inherit' });
done();
if (data === '"hello: test"') {
expect(data).toBe('"hello: test"');
execSync('/bin/bash -c "cd k8s && ./stop"', { stdio: 'inherit' });
done();
} else {
tries--;
if (tries <= 0) {
expect(data).toBe('"hello: test"');
}
}
});
resp.on('error', (err: Error) => {
throw Error('Service responded with error: ' + err.message);
Expand Down
14 changes: 7 additions & 7 deletions packages/node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scalecube/node",
"version": "0.2.0",
"version": "0.2.1",
"private": false,
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -18,7 +18,7 @@
},
"author": "Scalecube (https://github.com/scalecube/scalecube-js)",
"devDependencies": {
"@scalecube/api": "^0.2.0",
"@scalecube/api": "^0.2.1",
"rollup": "^1.27.4",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-filesize": "^6.1.1",
Expand All @@ -28,11 +28,11 @@
"typescript": "^3.2.4"
},
"dependencies": {
"@scalecube/cluster-nodejs": "^0.2.0",
"@scalecube/routers": "^0.2.0",
"@scalecube/scalecube-microservice": "^0.2.0",
"@scalecube/transport-nodejs": "^0.2.0",
"@scalecube/utils": "^0.2.0",
"@scalecube/cluster-nodejs": "^0.2.1",
"@scalecube/routers": "^0.2.1",
"@scalecube/scalecube-microservice": "^0.2.1",
"@scalecube/transport-nodejs": "^0.2.1",
"@scalecube/utils": "^0.2.1",
"rxjs": "^6.4.0"
}
}
6 changes: 3 additions & 3 deletions packages/routers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scalecube/routers",
"version": "0.2.0",
"version": "0.2.1",
"private": false,
"main": "cjs/index.js",
"module": "es/index.js",
Expand All @@ -20,7 +20,7 @@
},
"author": "Scalecube (https://github.com/scalecube/scalecube-js)",
"devDependencies": {
"@scalecube/api": "^0.2.0",
"@scalecube/api": "^0.2.1",
"jest": "^24.6.0",
"rollup": "^1.14.6",
"rollup-plugin-filesize": "^6.1.1",
Expand All @@ -31,6 +31,6 @@
"typescript": "^3.2.4"
},
"dependencies": {
"@scalecube/utils": "^0.2.0"
"@scalecube/utils": "^0.2.1"
}
}
6 changes: 3 additions & 3 deletions packages/rsocket-adapter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scalecube/rsocket-adapter",
"version": "0.2.0",
"version": "0.2.1",
"private": false,
"main": "cjs/index.js",
"module": "es/index.js",
Expand All @@ -20,7 +20,7 @@
},
"author": "Scalecube (https://github.com/scalecube/scalecube-js)",
"devDependencies": {
"@scalecube/api": "^0.2.0",
"@scalecube/api": "^0.2.1",
"jest": "^24.6.0",
"rollup": "^1.14.6",
"rollup-plugin-commonjs": "^10.0.1",
Expand All @@ -32,7 +32,7 @@
"typescript": "^3.2.4"
},
"dependencies": {
"@scalecube/utils": "^0.2.0",
"@scalecube/utils": "^0.2.1",
"rsocket-core": "^0.0.16",
"rsocket-flowable": "^0.0.14",
"rsocket-types": "^0.0.16",
Expand Down
8 changes: 4 additions & 4 deletions packages/rsocket-ws-gateway/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scalecube/rsocket-ws-gateway",
"version": "0.2.0",
"version": "0.2.1",
"private": false,
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -21,8 +21,8 @@
},
"author": "Scalecube (https://github.com/scalecube/scalecube-js)",
"devDependencies": {
"@scalecube/api": "^0.2.0",
"@scalecube/browser": "^0.2.0",
"@scalecube/api": "^0.2.1",
"@scalecube/browser": "^0.2.1",
"jest": "^24.6.0",
"rollup": "^1.14.6",
"rollup-plugin-babel": "^4.3.3",
Expand All @@ -35,7 +35,7 @@
"typescript": "^3.2.4"
},
"dependencies": {
"@scalecube/utils": "^0.2.0",
"@scalecube/utils": "^0.2.1",
"rsocket-core": "^0.0.16",
"rsocket-flowable": "^0.0.14",
"rsocket-websocket-client": "^0.0.16",
Expand Down
22 changes: 15 additions & 7 deletions packages/rsocket-ws-gateway/src/createGatewayProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,31 @@ interface Proxy {
[state: string]: any;
}

type ConnectionOptions = Partial<{
keepAlive: number;
lifetime: number;
}>

export function createGatewayProxy(
url: string,
definition: MicroserviceApi.ServiceDefinition,
requestResponse?: any,
requestStream?: any
requestStream?: any,
options?: ConnectionOptions
): Promise<Proxy>;
export function createGatewayProxy(
url: string,
definition: MicroserviceApi.ServiceDefinition[],
requestResponse?: any,
requestStream?: any
requestStream?: any,
options?: ConnectionOptions
): Promise<Proxy[]>;
export function createGatewayProxy(
url: string,
definitions: any,
customRequestResponse?: any,
customRequestStream?: any
customRequestStream?: any,
options?: ConnectionOptions
): any {
const isDefinitionsArray = Array.isArray(definitions);
let defs: MicroserviceApi.ServiceDefinition[];
Expand All @@ -36,7 +44,7 @@ export function createGatewayProxy(
const proxies: Proxy[] = [];
let socket;
return new Promise(async (resolve, reject) => {
socket = await connect(url).catch((e) => {
socket = await connect(url, options).catch((e) => {
reject(e);
});

Expand Down Expand Up @@ -67,14 +75,14 @@ export function createGatewayProxy(
});
}

const connect = (url) => {
const connect = (url, options: ConnectionOptions = {}) => {
return new Promise((resolve, reject) => {
const client = new RSocketClient({
serializers: JsonSerializers,
setup: {
dataMimeType: 'application/json',
keepAlive: 100000,
lifetime: 100000,
keepAlive: options.keepAlive || 100000,
lifetime: options.lifetime || 100000,
metadataMimeType: 'application/json',
},
transport: new RSocketWebSocketClient({ url }),
Expand Down
Loading