Move code to subfolders

This commit is contained in:
Hamcha 2019-11-21 17:06:46 +01:00
parent 5f85d3e0cf
commit 429cd927c4
Signed by: hamcha
GPG Key ID: 44AD3571EB09A39E
9 changed files with 10 additions and 9 deletions

View File

@ -1,6 +1,6 @@
import { existsSync } from "fs";
import { asyncLoadJSON, asyncSaveJSON } from "./utils";
import { asyncLoadJSON, asyncSaveJSON } from "../lib";
interface JSONCard {
mcmId: number;

0
cmd/cube.ts Normal file
View File

View File

@ -1,5 +1,4 @@
import CardMarketApi from "./api";
import { asyncSaveJSON } from "./utils";
import { asyncSaveJSON, CardMarketApi } from "../lib";
async function run() {
if (process.argv.length < 3) {

View File

@ -1,7 +1,6 @@
import { existsSync } from "fs";
import { Article, MCMDB } from "./types";
import { asyncLoadJSON, asyncSaveJSON, leanArticle, leanCard } from "./utils";
import { Article, asyncLoadJSON, asyncSaveJSON, leanArticle, leanCard, MCMDB } from "../lib";
async function run() {
if (process.argv.length < 3) {

View File

@ -5,7 +5,7 @@ import { Article } from "./types";
const URI = "https://api.cardmarket.com/ws/v2.0/output.json";
export default class CardMarketApi {
export class CardMarketApi {
private AppToken: string;
private AppSecret: string;
private AccessToken: string;

3
lib/index.ts Normal file
View File

@ -0,0 +1,3 @@
export * from "./api";
export * from "./types";
export * from "./utils";

View File

@ -6,9 +6,9 @@
"author": "Hamcha <hamcha@crunchy.rocks>",
"license": "MIT",
"scripts": {
"fetch": "ts-node fetch.ts",
"init-db": "ts-node convert.ts",
"find": "ts-node find.ts"
"fetch": "ts-node cmd/fetch.ts",
"init-db": "ts-node cmd/convert.ts",
"find": "ts-node cmd/find.ts"
},
"dependencies": {
"@types/node": "^12.12.11",