Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: improve ts output for create logger #8763

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

mister-ben
Copy link
Contributor

Description

Typescript =< 5.2 generated better types for log than >= 5.3. We're on 5.5 as that has the better import syntax.
Changing createLogger to use function log() rather than const log = function() outputs as before.

Also updates typescript to 5.5.1 (rc) from 5.5.0 (beta).

5.2, or 5.5 with this change

export default log;
declare const log: {
    (...args: any[]): void;
    createLogger(subName: string, subDelimiter?: string, subStyles?: string): any;
    createNewLogger(newName: string, newDelimiter?: string, newStyles?: string): any;
    levels: any;
    level(lvl?: "info" | "error" | "all" | "debug" | "warn" | "off"): string;
    history: {
        (): any[];
        filter(fname: string): any[];
        clear(): void;
        disable(): void;
        enable(): void;
    };
    error(...args: any[]): any;
    warn(...args: any[]): any;
    debug(...args: any[]): any;
};
export const createLogger: (subName: string, subDelimiter?: string, subStyles?: string) => any;
//# sourceMappingURL=log.d.ts.map%

5.3+, without this change

export default log;
declare function log(...args: any[]): void;
declare namespace log { }
export const createLogger: (subName: string, subDelimiter?: string, subStyles?: string) => any;
//# sourceMappingURL=log.d.ts.map%

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chrome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
    • Has no DOM changes which impact accessiblilty or trigger warnings (e.g. Chrome issues tab)
    • Has no changes to JSDoc which cause npm run docs:api to error
  • Reviewed by Two Core Contributors

Copy link

codecov bot commented Jun 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.01%. Comparing base (fc1f7a6) to head (dcc270c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8763   +/-   ##
=======================================
  Coverage   83.01%   83.01%           
=======================================
  Files         119      119           
  Lines        7993     7993           
  Branches     1922     1922           
=======================================
  Hits         6635     6635           
  Misses       1358     1358           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

2 participants