From 7513a91604e845093c2d74d01216ee19316ccced Mon Sep 17 00:00:00 2001 From: nigiri <168690269+0xnigir1@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:06:08 -0300 Subject: [PATCH] refactor: delete old packages folder --- packages/errors/README.md | 1 - packages/errors/__test__/example.test.ts | 7 ----- packages/errors/eslint.config.js | 12 --------- packages/errors/package.json | 24 ----------------- packages/errors/src/index.ts | 15 ----------- packages/errors/tsconfig.json | 9 ------- packages/errors/vitest.config.ts | 12 --------- packages/lib/coingecko/README.md | 3 --- .../lib/coingecko/__test__/example.test.ts | 7 ----- packages/lib/coingecko/eslint.config.js | 12 --------- packages/lib/coingecko/package.json | 20 -------------- packages/lib/coingecko/src/errors.ts | 7 ----- packages/lib/coingecko/src/index.ts | 27 ------------------- packages/lib/coingecko/tsconfig.json | 9 ------- packages/lib/coingecko/vitest.config.ts | 12 --------- 15 files changed, 177 deletions(-) delete mode 100644 packages/errors/README.md delete mode 100644 packages/errors/__test__/example.test.ts delete mode 100644 packages/errors/eslint.config.js delete mode 100644 packages/errors/package.json delete mode 100644 packages/errors/src/index.ts delete mode 100644 packages/errors/tsconfig.json delete mode 100644 packages/errors/vitest.config.ts delete mode 100644 packages/lib/coingecko/README.md delete mode 100644 packages/lib/coingecko/__test__/example.test.ts delete mode 100644 packages/lib/coingecko/eslint.config.js delete mode 100644 packages/lib/coingecko/package.json delete mode 100644 packages/lib/coingecko/src/errors.ts delete mode 100644 packages/lib/coingecko/src/index.ts delete mode 100644 packages/lib/coingecko/tsconfig.json delete mode 100644 packages/lib/coingecko/vitest.config.ts diff --git a/packages/errors/README.md b/packages/errors/README.md deleted file mode 100644 index 7c1eaa8..0000000 --- a/packages/errors/README.md +++ /dev/null @@ -1 +0,0 @@ -## Errors package diff --git a/packages/errors/__test__/example.test.ts b/packages/errors/__test__/example.test.ts deleted file mode 100644 index 59d7aac..0000000 --- a/packages/errors/__test__/example.test.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { describe, expect, test } from "vitest"; - -describe("exampleHandler", () => { - test("Sample exampleHandler test", () => { - expect(true).toBe(true); - }); -}); diff --git a/packages/errors/eslint.config.js b/packages/errors/eslint.config.js deleted file mode 100644 index 45fa763..0000000 --- a/packages/errors/eslint.config.js +++ /dev/null @@ -1,12 +0,0 @@ -import parentConfig from "@zkchainhub/eslint-config"; - -/** @type {import('eslint').Linter.FlatConfig[]} */ -export default [ - ...parentConfig, - { - files: ["src/**/*.ts"], - rules: { - "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "_+" }], - }, - }, -]; diff --git a/packages/errors/package.json b/packages/errors/package.json deleted file mode 100644 index d4b6032..0000000 --- a/packages/errors/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@zkchainhub/errors", - "version": "0.0.0", - "private": true, - "license": "MIT", - "type": "module", - "types": "./dist/index.d.ts", - "main": "./dist/index.js", - "module": "./dist/index.js", - "scripts": { - "test": "vitest", - "build": "tsc -p tsconfig.json", - "lint": "eslint --fix . --max-warnings 0" - }, - "publishConfig": { - "access": "public" - }, - "devDependencies": { - "@zkchainhub/eslint-config": "workspace:*", - "@zkchainhub/test-config": "workspace:*", - "eslint": "8.56.0", - "vitest": "1.6.0" - } -} diff --git a/packages/errors/src/index.ts b/packages/errors/src/index.ts deleted file mode 100644 index 4a77c5a..0000000 --- a/packages/errors/src/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -export abstract class BaseError extends Error { - override 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; - } -} diff --git a/packages/errors/tsconfig.json b/packages/errors/tsconfig.json deleted file mode 100644 index f3224ab..0000000 --- a/packages/errors/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "@total-typescript/tsconfig/tsc/no-dom/library-monorepo", - "compilerOptions": { - "rootDir": "./src", - "outDir": "./dist" - }, - "include": ["./src/**/*.ts"], - "exclude": ["dist", "node_modules"] -} diff --git a/packages/errors/vitest.config.ts b/packages/errors/vitest.config.ts deleted file mode 100644 index 9eb83d2..0000000 --- a/packages/errors/vitest.config.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { defineConfig, mergeConfig } from "vitest/config"; - -import { baseConfig } from "@zkchainhub/test-config"; - -export default mergeConfig( - baseConfig, - defineConfig({ - test: { - exclude: ["coverage/*"], - }, - }), -); diff --git a/packages/lib/coingecko/README.md b/packages/lib/coingecko/README.md deleted file mode 100644 index a692238..0000000 --- a/packages/lib/coingecko/README.md +++ /dev/null @@ -1,3 +0,0 @@ -## Coingecko Package - -Adds coingecko API utilities. diff --git a/packages/lib/coingecko/__test__/example.test.ts b/packages/lib/coingecko/__test__/example.test.ts deleted file mode 100644 index 59d7aac..0000000 --- a/packages/lib/coingecko/__test__/example.test.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { describe, expect, test } from "vitest"; - -describe("exampleHandler", () => { - test("Sample exampleHandler test", () => { - expect(true).toBe(true); - }); -}); diff --git a/packages/lib/coingecko/eslint.config.js b/packages/lib/coingecko/eslint.config.js deleted file mode 100644 index 45fa763..0000000 --- a/packages/lib/coingecko/eslint.config.js +++ /dev/null @@ -1,12 +0,0 @@ -import parentConfig from "@zkchainhub/eslint-config"; - -/** @type {import('eslint').Linter.FlatConfig[]} */ -export default [ - ...parentConfig, - { - files: ["src/**/*.ts"], - rules: { - "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "_+" }], - }, - }, -]; diff --git a/packages/lib/coingecko/package.json b/packages/lib/coingecko/package.json deleted file mode 100644 index 42fe027..0000000 --- a/packages/lib/coingecko/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@zkchainhub/coingecko", - "private": true, - "version": "0.0.0", - "type": "module", - "scripts": { - "build": "tsc -p tsconfig.json", - "test": "vitest", - "lint": "eslint --fix . --max-warnings 0", - "coverage": "vitest run --coverage", - "tsc": "tsc --noEmit" - }, - "devDependencies": { - "@zkchainhub/errors": "workspace:*", - "@zkchainhub/eslint-config": "workspace:*", - "@zkchainhub/test-config": "workspace:*", - "eslint": "8.56.0", - "vitest": "1.6.0" - } -} diff --git a/packages/lib/coingecko/src/errors.ts b/packages/lib/coingecko/src/errors.ts deleted file mode 100644 index bfcf756..0000000 --- a/packages/lib/coingecko/src/errors.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { BaseError } from "@zkchainhub/errors"; - -export class CoingeckoError extends BaseError { - constructor(description: string) { - super({ name: "CoingeckoError", description }); - } -} diff --git a/packages/lib/coingecko/src/index.ts b/packages/lib/coingecko/src/index.ts deleted file mode 100644 index ca29028..0000000 --- a/packages/lib/coingecko/src/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -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; - } -} diff --git a/packages/lib/coingecko/tsconfig.json b/packages/lib/coingecko/tsconfig.json deleted file mode 100644 index 530239c..0000000 --- a/packages/lib/coingecko/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "@total-typescript/tsconfig/tsc/no-dom/library-monorepo", - "include": ["./src/**/*.ts"], - "exclude": ["dist", "node_modules"], - "compilerOptions": { - "rootDir": "./src", - "outDir": "./dist" - } -} diff --git a/packages/lib/coingecko/vitest.config.ts b/packages/lib/coingecko/vitest.config.ts deleted file mode 100644 index 9eb83d2..0000000 --- a/packages/lib/coingecko/vitest.config.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { defineConfig, mergeConfig } from "vitest/config"; - -import { baseConfig } from "@zkchainhub/test-config"; - -export default mergeConfig( - baseConfig, - defineConfig({ - test: { - exclude: ["coverage/*"], - }, - }), -);