This commit is contained in:
Pedro Gomes 2020-05-13 20:03:53 +02:00
parent 00e523fff1
commit 30a497b4f7
11 changed files with 7678 additions and 3 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*.log
.DS_Store
node_modules
dist

View File

@ -1,2 +1,3 @@
# waku-ts # waku-ts [![npm version](https://badge.fury.io/js/waku-ts.svg)](https://badge.fury.io/js/waku-ts)
A Typescript client for waku
Waku Typescript Client

62
package.json Normal file
View File

@ -0,0 +1,62 @@
{
"name": "waku-ts",
"description": "Waku Typescript Client",
"version": "0.1.0",
"author": "Vac <github.com/vacp2p>",
"license": "MIT",
"keywords": [
"waku",
"whisper",
"messaging",
"networking",
"libp2p",
"devp2p",
"vac",
"p2p"
],
"files": [
"dist"
],
"main": "dist/cjs/index.js",
"types": "dist/cjs/index.d.ts",
"unpkg": "dist/umd/index.min.js",
"homepage": "https://github.com/vacp2p/waku-ts",
"repository": {
"type": "git",
"url": "git+https://github.com/vacp2p/waku-ts.git"
},
"bugs": {
"url": "https://github.com/vacp2p/waku-ts/issues"
},
"scripts": {
"start": "tsdx watch",
"clean": "rm -rf dist",
"build:cjs": "./node_modules/.bin/tsc -p tsconfig.cjs.json",
"build:umd": "webpack",
"build": "yarn clean && yarn build:cjs && yarn build:umd",
"test": "tsdx test ./test",
"lint": "tsdx lint src test",
"prepare": "yarn lint && yarn build && yarn test"
},
"devDependencies": {
"@types/jest": "25.1.1",
"@types/node": "13.7.0",
"husky": "4.2.1",
"tsdx": "0.12.3",
"tslib": "1.10.0",
"typescript": "3.7.5",
"webpack": "4.41.6",
"webpack-cli": "3.3.11"
},
"husky": {
"hooks": {
"pre-commit": "yarn lint"
}
},
"prettier": {
"printWidth": 80,
"semi": true,
"singleQuote": false,
"trailingComma": "es5"
}
}

1
src/client.ts Normal file
View File

@ -0,0 +1 @@
export class Waku {}

1
src/index.ts Normal file
View File

@ -0,0 +1 @@
export * from "./client";

8
test/client.test.ts Normal file
View File

@ -0,0 +1,8 @@
import { Waku } from "../src";
describe("Waku", () => {
it("needs tests", async () => {
const waku = new Waku();
expect(waku).toBeTruthy();
});
});

12
tsconfig.cjs.json Normal file
View File

@ -0,0 +1,12 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/cjs",
"rootDir": "./src",
"target": "es6",
"module": "commonjs",
"incremental": true,
"noUnusedLocals": false,
"strict": false
}
}

33
tsconfig.json Normal file
View File

@ -0,0 +1,33 @@
{
"include": ["./src/**/*"],
"compilerOptions": {
"allowJs": false,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"declaration": true,
"declarationMap": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"lib": ["es2017", "dom", "esnext.asynciterable"],
"module": "esnext",
"moduleResolution": "node",
"noImplicitAny": false,
"noImplicitReturns": true,
"noImplicitThis": true,
"noFallthroughCasesInSwitch": true,
"noLib": false,
"noUnusedLocals": false,
"noUnusedParameters": false,
"removeComments": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"target": "es2017"
}
}

16
webpack.config.js Normal file
View File

@ -0,0 +1,16 @@
const path = require("path");
module.exports = {
mode: "production",
entry: {
index: path.resolve(__dirname, "dist", "cjs", "index.js"),
},
output: {
path: path.resolve(__dirname, "dist", "umd"),
filename: "[name].min.js",
libraryTarget: "umd",
library: "Waku",
umdNamedDefine: true,
globalObject: "this",
},
};

7537
yarn.lock Normal file

File diff suppressed because it is too large Load Diff