Skip to content
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
66 changes: 66 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: 2.1

workflows:
build-test:
jobs:
- prep-deps
- test-lint:
requires:
- prep-deps
- test-build-unit:
requires:
- prep-deps
- all-tests-pass:
requires:
- test-lint
- test-build-unit

jobs:
prep-deps:
docker:
- image: circleci/node:10
steps:
- checkout
- run:
name: Install deps
command: |
.circleci/scripts/deps-install.sh
- run:
name: Collect yarn install HAR logs
command: |
.circleci/scripts/collect-har-artifact.sh
- persist_to_workspace:
root: .
paths:
- node_modules
- build-artifacts

test-lint:
docker:
- image: circleci/node:10
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Lint
command: yarn lint

test-build-unit:
docker:
- image: circleci/node:10
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Unit tests
command: yarn test

all-tests-pass:
docker:
- image: circleci/node:10
steps:
- run:
name: All tests passed
command: echo 'Great success'
9 changes: 9 additions & 0 deletions .circleci/scripts/collect-har-artifact.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -x
set -e
set -u
set -o pipefail

mkdir -p build-artifacts/yarn-install-har
mv ./*.har build-artifacts/yarn-install-har/
8 changes: 8 additions & 0 deletions .circleci/scripts/deps-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -x
set -e
set -u
set -o pipefail

yarn --frozen-lockfile --ignore-scripts --har
32 changes: 32 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
},
extends: [
'@metamask/eslint-config',
'@metamask/eslint-config/config/nodejs',
'@metamask/eslint-config/config/typescript',
],
plugins: [
'json',
],
overrides: [{
files: [
'*.js',
'*.json',
],
parserOptions: {
sourceType: 'script',
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
}],
ignorePatterns: [
'!eslintrc.js',
'dist/',
'node_modules/',
],
};
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ jspm_packages/
# Typescript v1 declaration files
typings/

# Typscript build / generate output
dist/

# package-lock generated by npm
package-lock.json

# Optional npm cache directory
.npm

Expand All @@ -68,7 +74,7 @@ typings/
.LSOverride

# Icon must end with two \r
Icon
Icon

# Thumbnails
._*
Expand Down
Binary file added .nvmrc
Binary file not shown.
15 changes: 15 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ISC License

Copyright (c) 2020 MetaMask

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3 changes: 0 additions & 3 deletions circle.yml

This file was deleted.

108 changes: 0 additions & 108 deletions index.js

This file was deleted.

24 changes: 20 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,35 @@
"name": "obj-multiplex",
"version": "1.0.2",
"description": "",
"main": "index.js",
"main": "dist/index.js",
"files": ["dist"],
"scripts": {
"test": "node test"
"build": "tsc --project .",
"lint": "eslint . --ext ts,js,json",
"lint:fix": "yarn lint --fix",
"test": "yarn build && node test"
},
"author": "",
"license": "ISC",
"dependencies": {
"end-of-stream": "^1.4.0",
"end-of-stream": "^1.4.4",
"once": "^1.4.0",
"readable-stream": "^2.3.3"
},
"devDependencies": {
"@metamask/eslint-config": "^4.1.0",
"@types/end-of-stream": "^1.4.0",
"@types/node": "^14.14.9",
"@types/once": "^1.4.0",
"@types/readable-stream": "^2.3.9",
"@typescript-eslint/eslint-plugin": "^4.8.2",
"@typescript-eslint/parser": "^4.8.2",
"eslint": "^7.14.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-json": "^2.1.2",
"eslint-plugin-node": "^11.1.0",
"pump": "^1.0.2",
"tape": "^4.8.0"
"tape": "^4.8.0",
"typescript": "^4.1.2"
}
}
Loading