Skip to content
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

Problem whith generated types declarations #73

Open
euberdeveloper opened this issue Mar 20, 2021 · 0 comments
Open

Problem whith generated types declarations #73

euberdeveloper opened this issue Mar 20, 2021 · 0 comments

Comments

@euberdeveloper
Copy link

Hi, this is my webpack.config.js:

const path = require('path');
const nodeExternals = require('webpack-node-externals');
const DtsBundleWebpack = require('dts-bundle-webpack');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');

module.exports = {
    target: 'node',
    mode: 'production',
    // devtool: 'source-map',
    entry: {
        index: './source/index.ts',
    },
    resolve: {
        extensions: ['.ts', '.js'],
        plugins: [new TsconfigPathsPlugin({
            configFile: './source/tsconfig.json',
            extensions: ['.ts', '.js']
        })]
    },
    module: {
        rules: [
            {
                test: /\.ts?$/,
                include: path.resolve(__dirname, 'source'),
                use: [
                    {
                        loader: 'ts-loader',
                    }
                ]
            }
        ]
    },
    plugins: [
        new DtsBundleWebpack({
            name: 'whdt-scraper',
            main: 'dist/index.d.ts',
            out: '../bundled/index.d.ts'
        })
    ],
    externals: [nodeExternals()],
    output: {
        path: path.resolve(__dirname, './bundled'),
        filename: 'index.js',
        library: 'whdt-scraper',
        libraryTarget: 'umd',
        globalObject: 'this',
        umdNamedDefine: true,
    }
}

The problem is that here, in the generated typings:

// Generated by dts-bundle v0.7.3
// Dependencies for this module:
//   ../@/types

declare module 'whdt-scraper' {
    import { Dump, Wiki, Version, DumpOptions, WikiOptions, VersionOptions } from '@/types';
    export * from '@/types';
    /**
        * Fetches the dumps of a wiki of the wikimedia history dump
        * @param version The version of the wiki (yyyy-mm or 'latest')
        * @param wiki The wiki whose dumps will be returned (e.g. 'itwiki')
        * @param options The options of the function
        * @returns The fetched dumps
        */
    export function fetchDumps(version: string, wiki: string, options?: DumpOptions): Promise<Dump[]>;
    /**
        * Fetches the wikies of a version of the wikimedia history dump
        * @param version The version of the wiki (yyyy-mm or 'latest')
        * @param options The options of the function
        * @returns The fetched wikies
        */
    export function fetchWikies(version: string, options?: WikiOptions): Promise<Wiki[]>;
    /**
        * Fetches the versions of the wikimedia history dump
        * @param options The options of the function
        * @returns The fetched versions
        */
    export function fetchVersions(options?: VersionOptions): Promise<Version[]>;
    /**
        * Fetches the latest version the wikimedia history dump
        * @param options The options of the function
        * @returns The latest version
        */
    export function fetchLatestVersion(options?: VersionOptions): Promise<Version | null>;
}

Only tha ones of the main file are included, the other are skipped with a // ../@/types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant