mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 18:32:22 +00:00
commit
7f2a37f692
21
.babelrc
21
.babelrc
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"presets": [
|
|
||||||
[
|
|
||||||
"@babel/preset-env",
|
|
||||||
{
|
|
||||||
"targets": {
|
|
||||||
"node": "10"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
["@babel/preset-typescript", {
|
|
||||||
"allowNamespaces": true
|
|
||||||
}]
|
|
||||||
],
|
|
||||||
"plugins": [
|
|
||||||
"@babel/plugin-proposal-object-rest-spread",
|
|
||||||
"@babel/plugin-proposal-export-default-from",
|
|
||||||
"@babel/plugin-proposal-async-generator-functions",
|
|
||||||
"@babel/plugin-proposal-class-properties"
|
|
||||||
]
|
|
||||||
}
|
|
21
.eslintrc
21
.eslintrc
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./tsconfig.json"
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"mocha": true
|
|
||||||
},
|
|
||||||
"plugins": ["@typescript-eslint"],
|
|
||||||
"extends": ["plugin:@typescript-eslint/recommended"],
|
|
||||||
"rules": {
|
|
||||||
"new-parens": "error",
|
|
||||||
"no-caller": "error",
|
|
||||||
"no-bitwise": "off",
|
|
||||||
"@typescript-eslint/indent": ["error", 2],
|
|
||||||
"@typescript-eslint/no-use-before-define": "off",
|
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
|
||||||
"@typescript-eslint/interface-name-prefix": ["error", { "prefixWithI": "always" }],
|
|
||||||
"no-console": "warn"
|
|
||||||
}
|
|
||||||
}
|
|
56
.travis.yml
56
.travis.yml
@ -1,12 +1,52 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
|
cache: yarn
|
||||||
|
stages:
|
||||||
|
- check
|
||||||
|
- test
|
||||||
|
- cov
|
||||||
|
|
||||||
cache: false
|
node_js:
|
||||||
|
- '12'
|
||||||
|
- '14'
|
||||||
|
|
||||||
install:
|
os:
|
||||||
- yarn install --frozen-lockfile --network-timeout 1000000
|
- linux
|
||||||
|
- osx
|
||||||
|
- windows
|
||||||
|
|
||||||
script:
|
script: npx nyc -s yarn run test:node --bail
|
||||||
set -e;
|
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
|
||||||
yarn run lint;
|
|
||||||
yarn run build;
|
jobs:
|
||||||
yarn run test
|
include:
|
||||||
|
- stage: check
|
||||||
|
script:
|
||||||
|
- yarn aegir dep-check
|
||||||
|
- yarn run lint
|
||||||
|
|
||||||
|
- stage: test
|
||||||
|
name: chrome
|
||||||
|
addons:
|
||||||
|
chrome: stable
|
||||||
|
script: npx aegir test -t browser -t webworker --ts
|
||||||
|
|
||||||
|
- stage: test
|
||||||
|
name: firefox
|
||||||
|
addons:
|
||||||
|
firefox: latest
|
||||||
|
script: npx aegir test -t browser -t webworker --ts -- --browsers FirefoxHeadless
|
||||||
|
|
||||||
|
- stage: test
|
||||||
|
name: electron-main
|
||||||
|
os: osx
|
||||||
|
script:
|
||||||
|
- npx aegir test -t electron-main --bail --ts
|
||||||
|
|
||||||
|
- stage: test
|
||||||
|
name: electron-renderer
|
||||||
|
os: osx
|
||||||
|
script:
|
||||||
|
- npx aegir test -t electron-renderer --bail --ts
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
email: false
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
require('@babel/register')({
|
|
||||||
extensions: ['.ts'],
|
|
||||||
ignore: ['node_modules'],
|
|
||||||
})
|
|
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"presets": [
|
|
||||||
[
|
|
||||||
"@babel/preset-env",
|
|
||||||
{
|
|
||||||
"targets": {
|
|
||||||
"node": "10"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
["@babel/preset-typescript", {
|
|
||||||
"allowNamespaces": true
|
|
||||||
}]
|
|
||||||
],
|
|
||||||
"plugins": [
|
|
||||||
"@babel/plugin-proposal-object-rest-spread",
|
|
||||||
"@babel/plugin-proposal-export-default-from",
|
|
||||||
"@babel/plugin-proposal-async-generator-functions",
|
|
||||||
"@babel/plugin-proposal-class-properties"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"presets": [
|
|
||||||
[
|
|
||||||
"@babel/preset-env",
|
|
||||||
{
|
|
||||||
"targets": {
|
|
||||||
"browsers": ">1% and not ie <= 11 and not dead"
|
|
||||||
},
|
|
||||||
"modules": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
["@babel/preset-typescript", {
|
|
||||||
"allowNamespaces": true
|
|
||||||
}]
|
|
||||||
],
|
|
||||||
"plugins": [
|
|
||||||
"@babel/plugin-proposal-object-rest-spread",
|
|
||||||
"@babel/plugin-proposal-export-default-from",
|
|
||||||
"@babel/plugin-proposal-async-generator-functions",
|
|
||||||
"@babel/plugin-proposal-class-properties"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
||||||
const webpackConfig = require("./webpack.config");
|
|
||||||
|
|
||||||
module.exports = function(config) {
|
|
||||||
config.set({
|
|
||||||
|
|
||||||
basePath: "",
|
|
||||||
frameworks: ["mocha", "chai"],
|
|
||||||
files: ["test/**/*.test.ts"],
|
|
||||||
exclude: [],
|
|
||||||
preprocessors: {
|
|
||||||
"test/**/*.ts": ["webpack"]
|
|
||||||
},
|
|
||||||
webpack: {
|
|
||||||
mode: "production",
|
|
||||||
node: webpackConfig.node,
|
|
||||||
module: webpackConfig.module,
|
|
||||||
resolve: webpackConfig.resolve
|
|
||||||
},
|
|
||||||
reporters: ["spec"],
|
|
||||||
|
|
||||||
browsers: ["ChromeHeadless"],
|
|
||||||
|
|
||||||
singleRun: true
|
|
||||||
});
|
|
||||||
};
|
|
59
package.json
59
package.json
@ -1,13 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "libp2p-noise",
|
"name": "libp2p-noise",
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"main": "dist/index.js",
|
"main": "dist/src/index.js",
|
||||||
"types": "dist/index.d.ts",
|
|
||||||
"module": "lib/index.js",
|
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist"
|
||||||
"lib",
|
|
||||||
"src"
|
|
||||||
],
|
],
|
||||||
"repository": "git@github.com:NodeFactoryIo/js-libp2p-noise.git",
|
"repository": "git@github.com:NodeFactoryIo/js-libp2p-noise.git",
|
||||||
"author": "NodeFactory <info@nodefactory.io>",
|
"author": "NodeFactory <info@nodefactory.io>",
|
||||||
@ -18,53 +14,21 @@
|
|||||||
"crypto"
|
"crypto"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "rm -rf lib && rm -rf dist",
|
"build": "aegir build --ts",
|
||||||
"build": "yarn run build:node && yarn run build:web && yarn run build:types",
|
"lint": "aegir lint --ts",
|
||||||
"bundle": "webpack --config webpack.bundle.config.js",
|
"test": "aegir test --ts",
|
||||||
"build:node": "babel --no-babelrc --config-file ./babel.config.json src --copy-files -x .ts -d dist --source-maps",
|
"test:node": "aegir test -t node --ts",
|
||||||
"build:web": "babel --no-babelrc --config-file ./babel.web.config.json src --copy-files -x .ts -d lib --source-maps",
|
"test:browser": "aegir test -t browser --ts",
|
||||||
"build:types": "tsc --declaration --outDir dist --emitDeclarationOnly",
|
"proto:gen": "pbjs -t static-module -o ./src/proto/payload.js ./src/proto/payload.proto && pbts -o ./src/proto/payload.d.ts ./src/proto/payload.js && yarn run lint --fix"
|
||||||
"proto:gen": "pbjs -t static-module -o ./src/proto/payload.js ./src/proto/payload.proto && pbts -o ./src/proto/payload.d.ts ./src/proto/payload.js && yarn run lint --fix",
|
|
||||||
"check-types": "tsc --noEmit",
|
|
||||||
"lint": "eslint --ext .ts src/",
|
|
||||||
"pretest": "yarn check-types",
|
|
||||||
"test": "yarn run test:node && yarn run test:web",
|
|
||||||
"test:node": "mocha -r ./babel-register.js \"test/**/*.test.ts\"",
|
|
||||||
"test:web": "karma start"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.6.4",
|
|
||||||
"@babel/core": "^7.6.4",
|
|
||||||
"@babel/plugin-proposal-async-generator-functions": "^7.7.0",
|
|
||||||
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
|
||||||
"@babel/plugin-proposal-export-default-from": "^7.8.3",
|
|
||||||
"@babel/plugin-proposal-object-rest-spread": "^7.6.2",
|
|
||||||
"@babel/preset-env": "^7.6.3",
|
|
||||||
"@babel/preset-typescript": "^7.6.0",
|
|
||||||
"@babel/register": "^7.6.2",
|
|
||||||
"@babel/runtime": "^7.6.3",
|
|
||||||
"@types/bl": "^2.1.0",
|
"@types/bl": "^2.1.0",
|
||||||
"@types/chai": "^4.2.4",
|
"@types/chai": "^4.2.4",
|
||||||
"@types/mocha": "^5.2.7",
|
"@types/mocha": "^5.2.7",
|
||||||
"@typescript-eslint/eslint-plugin": "^2.6.0",
|
"aegir": "ipfs/aegir#feat/cosmiconfig",
|
||||||
"@typescript-eslint/parser": "^2.6.0",
|
|
||||||
"babel-loader": "^8.1.0",
|
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
"eslint": "^6.6.0",
|
|
||||||
"karma": "^4.4.1",
|
|
||||||
"karma-chai": "^0.1.0",
|
|
||||||
"karma-chrome-launcher": "^3.1.0",
|
|
||||||
"karma-cli": "^2.0.0",
|
|
||||||
"karma-mocha": "^1.3.0",
|
|
||||||
"karma-spec-reporter": "^0.0.32",
|
|
||||||
"karma-webpack": "^4.0.2",
|
|
||||||
"mocha": "^6.2.2",
|
"mocha": "^6.2.2",
|
||||||
"sinon": "^8.1.0",
|
"sinon": "^8.1.0"
|
||||||
"ts-loader": "^6.2.1",
|
|
||||||
"typescript": "^3.6.4",
|
|
||||||
"webpack": "^4.41.5",
|
|
||||||
"webpack-bundle-analyzer": "^3.6.1",
|
|
||||||
"webpack-cli": "^3.3.11"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bcrypto": "5.1.0",
|
"bcrypto": "5.1.0",
|
||||||
@ -81,5 +45,8 @@
|
|||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"bn.js": "4.4.0"
|
"bn.js": "4.4.0"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": "./node_modules/aegir/src/config/eslintrc-ts.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es6",
|
"target": "ES2018",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
|
"allowJs": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
@ -12,9 +13,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"**/src/**/*.ts"
|
"**/src/**/*.ts",
|
||||||
|
"**/src/**/*.js"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules",
|
||||||
|
"dist"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
|
|
||||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
entry: "./src/index.ts",
|
|
||||||
mode: "production",
|
|
||||||
output: {
|
|
||||||
filename: "../bundle/bundle.js"
|
|
||||||
},
|
|
||||||
node: {
|
|
||||||
fs: "empty"
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
extensions: [".ts", ".js"],
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{test: /\.ts$/, exclude: [/node_modules/], use: {loader: "babel-loader", options: require("./babel.web.config")}}
|
|
||||||
],
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
new BundleAnalyzerPlugin()
|
|
||||||
]
|
|
||||||
};
|
|
@ -1,19 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
entry: "./src/index.ts",
|
|
||||||
mode: "production",
|
|
||||||
output: {
|
|
||||||
filename: "dist/bundle.js"
|
|
||||||
},
|
|
||||||
node: {
|
|
||||||
fs: "empty"
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
extensions: [".ts", ".js"],
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{test: /\.ts$/, use: {loader: "ts-loader", options: {transpileOnly: true}}}
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
};
|
|
Loading…
x
Reference in New Issue
Block a user