Skip to content

Commit

Permalink
feat: remove module aliases to fix output
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedriad1 committed Mar 28, 2022
1 parent e4b1fd5 commit 87076b4
Show file tree
Hide file tree
Showing 15 changed files with 12 additions and 44 deletions.
17 changes: 1 addition & 16 deletions dts.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
const alias = require('@rollup/plugin-alias');
const resolve = require('@rollup/plugin-node-resolve').nodeResolve;
const analyze = require('rollup-plugin-analyzer');
const path = require('path');

const customResolver = resolve({
extensions: ['.mjs', '.js', '.json', '.ts'],
});
const projectRootDir = path.resolve(__dirname);

const plugins = [
alias({
entries: [{ find: '@', replacement: path.resolve(projectRootDir, 'src') }],
customResolver,
}),
resolve(),
analyze(),
];
const plugins = [analyze()];

module.exports = {
rollup(config, options) {
Expand Down
4 changes: 0 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
/** @type {import('@jest/types').Config.InitialOptions} */
const config = {
verbose: true,
moduleNameMapper: {
'@/(.*)': '<rootDir>/src/$1',
},
moduleFileExtensions: ['js', 'json', 'ts'],
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
};

Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
"analyze": "size-limit --why"
},
"devDependencies": {
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-node-resolve": "^13.1.3",
"@size-limit/preset-small-lib": "^7.0.8",
"@types/humps": "^2.0.1",
"dts-cli": "^1.4.0",
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/v4/_fetcher.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fetch from 'cross-fetch';
import { camelizeKeys, decamelizeKeys } from 'humps';
import stringify from '@/utils/qs-stringify';
import { removeBeginningSlash } from '@/utils/misc';
import stringify from '../../utils/qs-stringify';
import { removeBeginningSlash } from '../../utils/misc';

export const API_BASE_URL = 'https://api.quran.com/api/v4/';

Expand Down
2 changes: 1 addition & 1 deletion src/sdk/v4/audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
RubNumber,
VerseKey,
VerseRecitationField,
} from '@/types';
} from '../../types';
import { decamelize } from 'humps';
import Utils from '../utils';
import { fetcher } from './_fetcher';
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/v4/chapters.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Chapter, ChapterId, ChapterInfo, Language } from '@/types';
import { Chapter, ChapterId, ChapterInfo, Language } from '../../types';
import { fetcher } from './_fetcher';
import Utils from '../utils';

Expand Down
2 changes: 1 addition & 1 deletion src/sdk/v4/juzs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Juz } from '@/types';
import { Juz } from '../../types';
import { fetcher } from './_fetcher';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/v4/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
// TranslationInfoResource,
TranslationResource,
VerseMediaResource,
} from '@/types';
} from '../../types';
import { fetcher } from './_fetcher';

type GetResourcesOptions = Partial<{
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/v4/search.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Language, SearchResponse } from '@/types';
import { Language, SearchResponse } from '../../types';
import { fetcher } from './_fetcher';

type SearchOptions = Partial<{
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/v4/verses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
VerseField,
VerseKey,
WordField,
} from '@/types';
} from '../../types';
import { decamelize } from 'humps';
import Utils from '../utils';
import { fetcher } from './_fetcher';
Expand Down
2 changes: 1 addition & 1 deletion test/qs-stringify.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stringify from '@/utils/qs-stringify';
import stringify from '../src/utils/qs-stringify';

describe('Stringify Utils', () => {
describe('stringify', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { quran } from '@/index';
import { quran } from '../src/index';

const utils = quran.utils;

Expand Down
2 changes: 1 addition & 1 deletion test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { quran } from '@/index';
import { quran } from '../src/index';

type ApiName = keyof typeof quran['v4'];
type ArgumentTypes<F extends Function> = F extends (...args: infer A) => any
Expand Down
4 changes: 0 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
"noEmit": true
}
}
7 changes: 0 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1219,13 +1219,6 @@
resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-1.0.3.tgz#db9cc719191a62e7d9200f6e7bab21c5b848adca"
integrity sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q==

"@rollup/plugin-alias@^3.1.9":
version "3.1.9"
resolved "https://registry.yarnpkg.com/@rollup/plugin-alias/-/plugin-alias-3.1.9.tgz#a5d267548fe48441f34be8323fb64d1d4a1b3fdf"
integrity sha512-QI5fsEvm9bDzt32k39wpOwZhVzRcL5ydcffUHMyLVaVaLeC70I8TJZ17F1z1eMoLu4E/UOcH9BWVkKpIKdrfiw==
dependencies:
slash "^3.0.0"

"@rollup/plugin-babel@^5.3.0":
version "5.3.1"
resolved "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz"
Expand Down

0 comments on commit 87076b4

Please sign in to comment.