-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
40 changed files
with
8,782 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# @taubyte/taucorder | ||
|
||
## Installation | ||
|
||
### npm | ||
```sh | ||
npm install @taubyte/taucorder | ||
``` | ||
|
||
### yarn | ||
```sh | ||
yarn add @taubyte/taucorder | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default { | ||
presets: [ | ||
['@babel/preset-env', { targets: { node: 'current' } }], // Target Node.js environment | ||
'@babel/preset-typescript', // Add TypeScript support | ||
], | ||
plugins: ['@babel/plugin-syntax-import-meta'], // Add support for import.meta | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { | ||
Node, | ||
Empty, | ||
Job, | ||
Peer, | ||
Peers, | ||
ConsensusState, | ||
RepositoryId, | ||
} from "./gen/taucorder/v1/common_pb"; | ||
import { Config } from "./gen/taucorder/v1/node_pb"; | ||
import { StashedItem, StashRequest } from "./gen/taucorder/v1/hoarder_pb"; | ||
import { | ||
Project, | ||
ProjectRepo, | ||
Hook, | ||
X509Certificate, | ||
} from "./gen/taucorder/v1/auth_pb"; | ||
import { | ||
PeerUsage, | ||
PeerLocation, | ||
Location, | ||
LocationArea, | ||
} from "./gen/taucorder/v1/seer_pb"; | ||
import { TNSPath, TNSObject, TNSPaths } from "./gen/taucorder/v1/tns_pb"; | ||
import { Taucorder as Core } from "./src/Taucorder"; | ||
import { Service } from "./src/Service"; | ||
|
||
export { | ||
Node, | ||
Empty, | ||
Job, | ||
Peer, | ||
Peers, | ||
ConsensusState, | ||
RepositoryId, | ||
Config, | ||
StashedItem, | ||
StashRequest, | ||
Project, | ||
ProjectRepo, | ||
Hook, | ||
X509Certificate, | ||
PeerUsage, | ||
PeerLocation, | ||
Location, | ||
LocationArea, | ||
TNSPath, | ||
TNSObject, | ||
TNSPaths, | ||
}; | ||
|
||
export class Taucorder extends Core { | ||
private service: Service; | ||
|
||
constructor(rpcUrl: string, config: Config) { | ||
super(rpcUrl, config); | ||
this.service = new Service(); | ||
} | ||
|
||
public async init(): Promise<void> { | ||
await this.service.run(); | ||
await super.init(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// jest.config.js | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
extensionsToTreatAsEsm: ['.ts'], | ||
transform: { | ||
'^.+\\.tsx?$': 'babel-jest', // Use babel-jest for TypeScript files | ||
}, | ||
moduleNameMapper: { | ||
// Map all imports ending with .js to .ts files | ||
'^(.*)\\.js$': '$1', | ||
}, | ||
testRunner: 'jest-circus/runner', // Optional: use modern test runner | ||
}; | ||
|
Oops, something went wrong.