commit e8440b217ad25d401b1d5fdf9a5dd3fac6f71bd2 Author: Andre Staltz Date: Fri Nov 24 14:13:03 2023 +0200 initial commit diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..b3558e2 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,25 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 10 + + strategy: + matrix: + node-version: [18.x, 20.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3ef31a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.vscode +node_modules +pnpm-lock.yaml +package-lock.json +coverage +*~ diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 0000000..1d2127c --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,2 @@ +semi: false +singleQuote: true diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fcb6945 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2023 Andre 'Staltz' Medeiros + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a9722ca --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +**Work in progress** + +## Installation + +We're not on npm yet. In your package.json, include this as + +```js +"ppppp-gc": "github:staltz/ppppp-conductor" +``` diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..f2939e4 --- /dev/null +++ b/lib/index.js @@ -0,0 +1,10 @@ +const makeDebug = require('debug') + +function initConductor(peer, config) { + + return { + } +} + +exports.name = 'conductor' +exports.init = initConductor diff --git a/package.json b/package.json new file mode 100644 index 0000000..9c003e4 --- /dev/null +++ b/package.json @@ -0,0 +1,59 @@ +{ + "name": "ppppp-conductor", + "version": "1.0.0", + "description": "PPPPP manager that sets tangle goals", + "author": "Andre Staltz ", + "license": "MIT", + "homepage": "https://github.com/staltz/ppppp-conductor", + "repository": { + "type": "git", + "url": "git@github.com:staltz/ppppp-conductor.git" + }, + "main": "index.js", + "files": [ + "*.js", + "lib/*.js" + ], + "exports": { + ".": { + "require": "./lib/index.js" + } + }, + "type": "commonjs", + "engines": { + "node": ">=16" + }, + "dependencies": { + "debug": "^4.3.4" + }, + "devDependencies": { + "@types/node": "18.x", + "@types/debug": "4.1.9", + "bs58": "^5.0.0", + "c8": "7", + "ppppp-caps": "github:staltz/ppppp-caps", + "ppppp-db": "github:staltz/ppppp-db", + "ppppp-dict": "github:staltz/ppppp-dict", + "ppppp-gc": "github:staltz/ppppp-gc", + "ppppp-goals": "github:staltz/ppppp-goals", + "ppppp-keypair": "github:staltz/ppppp-keypair", + "ppppp-tangle-sync": "github:staltz/ppppp-tangle-sync", + "prettier": "^2.6.2", + "pretty-quick": "^3.1.3", + "rimraf": "^4.4.0", + "secret-handshake-ext": "~0.0.9", + "secret-stack": "~7.1.1", + "ssb-box": "^1.0.1" + }, + "scripts": { + "test": "node --test", + "format-code": "prettier --write \"(lib|test)/**/*.js\"", + "format-code-staged": "pretty-quick --staged --pattern \"(lib|test)/**/*.js\"", + "coverage": "c8 --reporter=lcov npm run test" + }, + "husky": { + "hooks": { + "pre-commit": "npm run format-code-staged" + } + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..bd2acd5 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,16 @@ +{ + "include": ["lib/**/*.js"], + "exclude": ["coverage/", "node_modules/", "test/"], + "compilerOptions": { + "checkJs": true, + "declaration": true, + "emitDeclarationOnly": true, + "exactOptionalPropertyTypes": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es2022", "dom"], + "module": "node16", + "skipLibCheck": true, + "strict": true, + "target": "es2021" + } +} \ No newline at end of file