Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into pr/13
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech authored Jun 1, 2020
2 parents 53d6f29 + bf1bb90 commit 7279254
Show file tree
Hide file tree
Showing 31 changed files with 1,408 additions and 163 deletions.
19 changes: 19 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"plugins": [ "joyent" ],
"extends": [
"eslint:recommended",
"plugin:joyent/style",
"plugin:joyent/lint"
],
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script",
"ecmaFeatures": {
}
},
"env": {
"node": true
},
"rules": {
}
}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
/build
/coverage
/node_modules
*.log
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "deps/jsstyle"]
path = deps/jsstyle
url = https://github.com/joyent/jsstyle.git
12 changes: 12 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*.log
/Makefile
/deps
/test
/tools
/.gitmodules
/.npmignore
/.eslintrc
/.travis.yml
/CONTRIBUTING.md
/build
/coverage
4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Contributing

This repository uses GitHub pull requests for code review.

See the [Joyent Engineering
Guidelines](https://github.com/joyent/eng/blob/master/docs/index.md) for general
best practices expected in this repository.

Contributions should be "make prepush" clean. The "prepush" target runs the
"check" target, which will check for linting and style errors.

If you're changing something non-trivial or user-facing, you may want to submit
an issue first.
65 changes: 65 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
@Library('jenkins-joylib@v1.0.3') _

pipeline {

agent none

options {
buildDiscarder(logRotator(numToKeepStr: '45'))
timestamps()
}

stages {
stage('top') {
parallel {
stage('v4-zone') {
agent {
label joyCommonLabels(image_ver: '15.4.1')
}
tools {
nodejs 'sdcnode-v4-zone'
}
stages {
stage('check') {
steps{
sh('make check')
}
}
stage('test') {
steps{
sh('make test')
}
}
}
}

stage('v6-zone64') {
agent {
label joyCommonLabels(image_ver: '18.4.0')
}
tools {
nodejs 'sdcnode-v6-zone64'
}
stages {
stage('check') {
steps{
sh('make check')
}
}
stage('test') {
steps{
sh('make test')
}
}
}
}
}
}
}

post {
always {
joyMattermostNotification()
}
}
}
59 changes: 59 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

#
# Copyright 2019, Joyent, Inc.
#

#
# node-asn1 Makefile
#

#
# Tools
#

ISTANBUL := node_modules/.bin/istanbul
FAUCET := node_modules/.bin/faucet
NODE := node
NPM := npm

#
# Files
#

JS_FILES := $(shell find lib test -name '*.js')
JSSTYLE_FILES = $(JS_FILES)
JSSTYLE_FLAGS = -f tools/jsstyle.conf
ESLINT = ./node_modules/.bin/eslint
ESLINT_FILES = $(JS_FILES)

include ./tools/mk/Makefile.defs
include ./tools/mk/Makefile.smf.defs

#
# Repo-specific targets
#

.PHONY: all
all: $(TAPE)
$(NPM) rebuild

$(ISTANBUL): | $(NPM_EXEC)
$(NPM) install

$(FAUCET): | $(NPM_EXEC)
$(NPM) install

CLEAN_FILES += ./node_modules/

.PHONY: test
test: $(ISTANBUL) $(FAUCET)
$(ISTANBUL) cover --print none test/run.js | $(FAUCET)

include ./tools/mk/Makefile.deps
include ./tools/mk/Makefile.smf.targ
include ./tools/mk/Makefile.targ
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The following reads an ASN.1 sequence with a boolean.

var Ber = require('asn1').Ber;

var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));
var reader = new Ber.Reader(Buffer.from([0x30, 0x03, 0x01, 0x01, 0xff]));

reader.readSequence();
console.log('Sequence len: ' + reader.length);
Expand Down Expand Up @@ -47,4 +47,4 @@ MIT.

## Bugs

See <https://github.com/mcavage/node-asn1/issues>.
See <https://github.com/joyent/node-asn1/issues>.
1 change: 1 addition & 0 deletions deps/jsstyle
Submodule jsstyle added at 52dc97
2 changes: 1 addition & 1 deletion lib/ber/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module.exports = {

newInvalidAsn1Error: function(msg) {
newInvalidAsn1Error: function (msg) {
var e = new Error();
e.name = 'InvalidAsn1Error';
e.message = msg || '';
Expand Down
2 changes: 1 addition & 1 deletion lib/ber/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var Reader = require('./reader');
var Writer = require('./writer');


///--- Exports
// --- Exports

module.exports = {

Expand Down
Loading

0 comments on commit 7279254

Please sign in to comment.