Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nodemon.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"watch": ["src", "bin", "test", "scripts"],
"ext": ".ts,.js,.pug,.css",
"ignore": [],
"exec": "ts-node --transpile-only ./src/index.ts"
"exec": "ts-node -r tsconfig-paths/register --transpile-only ./src/index.ts"
}
34 changes: 32 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"build": "tsc",
"start": "nodemon",
"get-refresh-token": "ts-node scripts/get-refresh-token.ts",
"get-refresh-token": "ts-node -r tsconfig-paths/register scripts/get-refresh-token.ts",
"codegen": "graphql-codegen --config codegen.yml"
},
"author": "",
Expand All @@ -24,6 +24,7 @@
"apollo-server": "^2.10.1",
"apollo-server-lambda": "^2.10.1",
"axios": "^0.19.2",
"dotenv": "^8.2.0"
"dotenv": "^8.2.0",
"tsconfig-paths": "^3.9.0"
}
}
2 changes: 1 addition & 1 deletion scripts/get-refresh-token.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

require('dotenv').config()
import { spotifyService } from '../src/modules/spotify/services'
import { spotifyService } from '@/modules/spotify/services'

const args = process.argv;
const providedCode = args.length === 3 && !!args[2] === true;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/spotify/mappers/currentPlayingSongMap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import { CurrentSongPlayingResult } from '../../../shared/infra/graphql/generated/types';
import { Mapper } from '../../../shared/core/mapper';
import { CurrentSongPlayingResult } from '@/shared/infra/graphql/generated/types';
import { Mapper } from '@/shared/core/mapper';

export class CurrentSongPlayingResultMap implements Mapper<CurrentSongPlayingResult> {

Expand Down
2 changes: 1 addition & 1 deletion src/modules/spotify/services/spotifyService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import axios from 'axios'
import { CurrentSongPlayingResult } from '../../../shared/infra/graphql/generated/types';
import { CurrentSongPlayingResult } from '@/shared/infra/graphql/generated/types';
import { CurrentSongPlayingResultMap } from '../mappers/currentPlayingSongMap';

type AccessToken = string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

import { UseCase } from "../../../../shared/core/useCase";
import { ISpotifyService } from "../../services/spotifyService";
import { UseCase } from "@/shared/core/useCase";
import { ISpotifyService } from "@/modules/spotify/services/spotifyService";
import { GetCurrentSongPlayingResult } from "./GetCurrentSongPlayingResult";
import { right, left } from "../../../../shared/core/either";
import { right, left } from "@/shared/core/either";

export class GetCurrentSong implements UseCase<any, GetCurrentSongPlayingResult> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Either } from "../../../../shared/core/either";
import { CurrentSongPlayingResult } from "../../../../shared/infra/graphql/generated/types";
import { Either } from "@/shared/core/either";
import { CurrentSongPlayingResult } from "@/shared/infra/graphql/generated/types";

export type GetCurrentSongPlayingResult = Either<
null,
Expand Down
2 changes: 1 addition & 1 deletion src/shared/infra/graphql/server.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { ApolloServer as ApolloServerLambda } from 'apollo-server-lambda';
import { ApolloServer, gql } from 'apollo-server';
import { getCurrentSong } from '../../../modules/spotify/useCases/getCurrentSongPlaying';
import { getCurrentSong } from '@/modules/spotify/useCases/getCurrentSongPlaying';

const resolvers = {
Query: {
Expand Down
11 changes: 9 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@
"typeRoots" : ["./node_modules/@types", "./src/@types"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true
"esModuleInterop": true,
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
]
}
},
"include": [
"src/*.ts",
"src/**/*.ts",
"src/**/*.js"
"src/**/*.js",
"scripts/**/*.ts"
],
"exclude": [
"node_modules",
Expand Down