-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: base pkg structure #8
Closed
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
60d759b
chore: add intermediate packages structure
0xjjojo 5664ddb
chore: add intermediate structure for base packages and modularize pa…
0xjjojo d41540d
fix: update coingecko package.json
0xjjojo 194a387
Add: coingecko readme
0xjjojo 3837b07
add: example package to follow guidelines
0xjjojo 049187d
add: base config files for example pkg
0xjjojo 74cb3f2
wip: single package errors working from building individually
0xjjojo 6409c41
chore: set correct dependencies, fix tsconfig.json for individual pkg…
0xjjojo 2076128
chore: set .env.example over individual pkg
0xjjojo da3c9f2
remove: deprecated js output
0xjjojo ab960ca
misc: remove unnecesary path key from base tsconfig, and within test-…
0xjjojo feeaa35
chore: add EOF
0xjjojo f001408
add: declaration and declarationMap for error packages .d.ts output
0xjjojo c6d6cd0
Add: errors package to serverless
0xjjojo 3e1462b
chore: fix lockfile
0xjjojo 8308e08
Add: ^ to build pipeline
0xjjojo cdc21b4
refactor: cg constructor w dep inyection
0xjjojo d46267e
add: rebase last commits, add coingecko readme and packages, fix depr…
0xjjojo 14a6981
fix: conflicts
0xjjojo e91cdba
fix: merge upstream conflcits
0xjjojo b9e4f20
add: declaration and declaration map to errors pkg
0xjjojo 2b50c45
fix: yarn.lock
0xjjojo 78ed5c2
chore: add EOF
0xjjojo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,3 @@ | ||
## Example Package | ||
|
||
Easily kickoff a package replicating this structure. |
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,5 @@ | ||
import { describe, it } from 'vitest' | ||
|
||
describe('examplePackage test', () => { | ||
it.skip("Implement tests") | ||
}); |
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,17 @@ | ||
{ | ||
"name": "@hyperhub/example", | ||
"private": true, | ||
"version": "0.0.0", | ||
"scripts": { | ||
"build": "tsc -p tsconfig.json", | ||
"lint": "eslint --fix --ext .js,.jsx,.ts,.tsx src", | ||
"test": "vitest", | ||
"coverage": "vitest run --coverage", | ||
"tsc": "tsc --noEmit" | ||
}, | ||
"devDependencies": { | ||
"@hyperhub/errors": "workspace:*", | ||
"@hyperhub/test-config": "workspace:*", | ||
"@hyperhub/typescript-config": "workspace:*" | ||
} | ||
} |
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,3 @@ | ||
export const example = () => { | ||
// Implement | ||
}; |
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,9 @@ | ||
{ | ||
"extends": "@hyperhub/typescript-config/base.json", | ||
"include": ["./src/**/*.ts"], | ||
"exclude": ["dist", "node_modules"], | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist" | ||
} | ||
} |
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,11 @@ | ||
import { baseConfig } from "@hyperhub/test-config"; | ||
import { mergeConfig, defineConfig } from "vitest/config"; | ||
|
||
export default mergeConfig( | ||
baseConfig, | ||
defineConfig({ | ||
test: { | ||
exclude: ["coverage/*"], | ||
}, | ||
}), | ||
); |
File renamed without changes.
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,17 @@ | ||
{ | ||
"name": "@hyperhub/errors", | ||
"version": "0.0.0", | ||
"private": true, | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "tsc -p tsconfig.json" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"devDependencies": { | ||
"@hyperhub/test-config": "workspace:*", | ||
"@hyperhub/typescript-config": "workspace:*" | ||
} | ||
} |
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 @@ | ||
export abstract class BaseError extends Error { | ||
readonly name: string; | ||
readonly description: string; | ||
|
||
constructor({ name, description }: { name: string; description: string }) { | ||
super(description); | ||
this.name = name; | ||
this.description = description; | ||
Object.setPrototypeOf(this, BaseError.prototype); | ||
} | ||
|
||
public getDescription(): string { | ||
return this.description; | ||
} | ||
} |
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,11 @@ | ||
{ | ||
"extends": "@hyperhub/typescript-config/base.json", | ||
"include": ["./src/**/*.ts"], | ||
"exclude": ["dist", "node_modules"], | ||
"compilerOptions": { | ||
"outDir": "./dist", | ||
"rootDir": "./src", | ||
"declaration": true, | ||
"declarationMap": true | ||
} | ||
} |
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,11 @@ | ||
import { baseConfig } from "@hyperhub/test-config"; | ||
import { mergeConfig, defineConfig } from "vitest/config"; | ||
|
||
export default mergeConfig( | ||
baseConfig, | ||
defineConfig({ | ||
test: { | ||
exclude: ["coverage/*"], | ||
}, | ||
}), | ||
); |
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,3 @@ | ||
## Coingecko Package | ||
|
||
Adds coingecko API utilities. |
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,7 @@ | ||
import { describe, test, expect } from 'vitest' | ||
|
||
describe('exampleHandler', () => { | ||
test('Sample coingecko test', () => { | ||
expect(true).toBe(true); | ||
}) | ||
}); |
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,17 @@ | ||
{ | ||
"name": "@hyperhub/coingecko", | ||
"private": true, | ||
"version": "0.0.0", | ||
"scripts": { | ||
"build": "tsc -p tsconfig.json", | ||
"lint": "eslint --fix --ext .js,.jsx,.ts,.tsx src", | ||
"test": "vitest", | ||
"coverage": "vitest run --coverage", | ||
"tsc": "tsc --noEmit" | ||
}, | ||
"devDependencies": { | ||
"@hyperhub/errors": "workspace:*", | ||
"@hyperhub/test-config": "workspace:*", | ||
"@hyperhub/typescript-config": "workspace:*" | ||
} | ||
} |
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,7 @@ | ||
import { BaseError } from "@hyperhub/errors"; | ||
|
||
export class CoingeckoError extends BaseError { | ||
constructor(description: string) { | ||
super({ name: "CoingeckoError", description }); | ||
} | ||
} |
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,24 @@ | ||
import type { AxiosInstance, CreateAxiosDefaults } from "axios"; | ||
import axios from "axios"; | ||
|
||
export default class CoingeckoService { | ||
private instance: AxiosInstance; | ||
|
||
constructor(private url: string, private apiKey:string){ | ||
const config: CreateAxiosDefaults = { | ||
baseURL: url, | ||
headers: { | ||
"x-cg-demo-api-key": this.apiKey, | ||
}, | ||
}; | ||
|
||
this.instance = axios.create(config); | ||
} | ||
|
||
get(): AxiosInstance { | ||
if (!this.instance) { | ||
throw new Error("Client not initialized"); | ||
} | ||
return this.instance; | ||
} | ||
} |
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,9 @@ | ||
{ | ||
"extends": "@hyperhub/typescript-config/base.json", | ||
"include": ["./src/**/*.ts"], | ||
"exclude": ["dist", "node_modules"], | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist" | ||
} | ||
} |
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,11 @@ | ||
import { baseConfig } from "@hyperhub/test-config"; | ||
import { mergeConfig, defineConfig } from "vitest/config"; | ||
|
||
export default mergeConfig( | ||
baseConfig, | ||
defineConfig({ | ||
test: { | ||
exclude: ["coverage/*"], | ||
}, | ||
}), | ||
); |
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,2 @@ | ||
COINGECKO_API_URL="" | ||
COINGECKO_API_KEY="" |
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,4 @@ | ||
## Serverless Package | ||
|
||
|
||
Adds serverless utils to build lambda functions. |
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,7 @@ | ||
import { describe, test, expect } from 'vitest' | ||
|
||
describe('exampleHandler', () => { | ||
test('Sample exampleHandler test', () => { | ||
expect(true).toBe(true); | ||
}) | ||
}); |
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,7 @@ | ||
import { BaseError } from "@hyperhub/errors"; | ||
|
||
export default class LambdaError extends BaseError { | ||
constructor(description: string) { | ||
super({ name: "LambdaError", description }); | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
export { example } from './handlers/exampleHandler'; | ||
export const buildHandler = () => { | ||
console.log('@@//TODO'); | ||
}; |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should stay