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

NODE_ENV=production fixes and test fixes. #14

Merged
merged 14 commits into from Jul 25, 2020
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
7 changes: 2 additions & 5 deletions jasmine.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"spec_dir": "test",
"spec_files": ["**/*[tT]est.ts"],
"helpers": [
"../node_modules/ts-node/register/type-check.js"
],
"spec_dir": "lib/test",
"spec_files": ["**/*[tT]est.js"],
"stopSpecOnExpectationFailure": false,
"random": false
}
2,275 changes: 1,774 additions & 501 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"name": "jszmq",
"version": "0.1.3",
"description": "Port of zeromq to Javascript over Web Socket transport",
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"type": "module",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build": "tsc -p tsconfig.json",
"check": "tsc -p tsconfig.json --noEmit",
"clear": "rm -rf dist/ coverage/ .nyc_output/",
"clear": "rm -rf lib/ dist/ coverage/ .nyc_output/",
"clear:all": "rm -rf node_modules/ npm-debug.log && npm run clear",
"test": "jasmine --reporter=jasmine-console-reporter --config=jasmine.json",
"build:test": "npm run clear && tsc -p tsconfig-test.json",
"test": "npm run build:test && jasmine --reporter=jasmine-console-reporter --config=jasmine.json",
"coverage": "nyc npm run test && nyc report --reporter=html",
"coveralls": "nyc npm run test && nyc report --reporter=text-lcov | coveralls -v"
},
Expand All @@ -25,25 +25,25 @@
},
"homepage": "https://github.com/zeromq/jszmq#readme",
"dependencies": {
"@types/events": "^3.0.0",
"@types/lodash": "^4.14.158",
"@types/node": "^14.0.26",
"@types/setasap": "^2.0.0",
"@types/ws": "^7.2.6",
"assert": "^2.0.0",
"buffer": "^5.6.0",
"events": "^3.1.0",
"events": "^3.2.0",
"isomorphic-ws": "^4.0.1",
"lodash": "^4.17.19",
"setasap": "^2.0.1",
"ws": "^7.3.1"
},
"devDependencies": {
"@types/events": "^3.0.0",
"@types/jasmine": "^3.5.11",
"@types/lodash": "^4.14.157",
"@types/node": "^14.0.23",
"@types/setasap": "^2.0.0",
"@types/ws": "^6.0.4",
"coveralls": "^3.1.0",
"jasmine": "^3.5.0",
"jasmine": "^3.6.1",
"jasmine-console-reporter": "^3.1.0",
"nyc": "^14.1.1",
"nyc": "^15.1.0",
"ts-node": "^8.10.2",
"typescript": "^3.9.7"
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/multiTrie.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert'
import * as assert from 'assert'
import {IEndpoint} from '../types'
import {Buffer} from 'buffer'
import {isUndefined} from 'lodash'
Expand Down
2 changes: 1 addition & 1 deletion src/utils/trie.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert'
import * as assert from 'assert'
import {Buffer} from 'buffer'
import {resize} from './array'

Expand Down
2 changes: 1 addition & 1 deletion src/webSocketEndpoint.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter } from 'events'
import WebSocket from 'isomorphic-ws'
import * as WebSocket from 'isomorphic-ws'
import {Buffer} from 'buffer'
import SocketOptions from './socketOptions'
import {isString} from 'lodash'
Expand Down
2 changes: 1 addition & 1 deletion src/webSocketListener.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import WebSocket from 'isomorphic-ws'
import * as WebSocket from 'isomorphic-ws'
import {URL} from 'url'
import {toNumber} from 'lodash'
import { EventEmitter } from 'events'
Expand Down
8 changes: 8 additions & 0 deletions tsconfig-test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDirs": ["./src", "./test"]
},
"include": ["./test"],
"exclude": ["**/*.d.ts", "./lib", "node_modules"]
}
7 changes: 4 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
"sourceMap": true, /* Generates corresponding '.map' file. */
"outDir": "./lib", /* Redirect output structure to the directory. */
"rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
"rootDirs": ["./src"], /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
"strict": true, /* Enable all strict type-checking options. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
}
"allowSyntheticDefaultImports": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
},
"exclude": ["./test", "**/*.d.ts", "./lib", "node_modules"]
}