question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generate metadata about Modules

See original GitHub issue

Proposed Changes

  1. Create new class Module
class Module {
    // Pointer to "native" module; created by system; assigned to all native types such as number, string, Array etc..
    static readonly Native: Module;

    // Name of the module?? File name maybe..
    readonly name: string;

    // Relative path to the module
    readonly path: string;

    // List of Types exported from the module
    getExports(): Type[];

    static find(filter: (module: Module) => boolean): Module | undefined;
    static getModules(): Module[];
}
  1. add property module into Type
class Type{
    readonly module: Module;
    // ...
}
  1. add new config option reflection.metadata.modules: boolean = false.

Notes

This can be very handy for server usage, but somebody might find this useful on client too so it should be optional. Disabled by default.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Hookynscommented, Feb 4, 2022

Wow, I think it is simple but I didn’t think about it that much,…

Transformer visit all the project files. It has to. So…

  1. Grab includes and excludes from config and create list of RegExps from those glob patterns. (It’s a must,… performance; no need for globing etc. to work with FS).
  2. In index.ts check if (!includeRegexes.some(regex => regex.test(node.fileName) || ...exluded ...) return;
  3. ts.isDeclaration(node) => add to metadata // typeChecker.getTypeAtLocation(node)
  4. Done!
1reaction
iDevelopThingscommented, Feb 4, 2022

I like this idea… this would probably be a better solution to my idea for include/exclude to find types, since types are just an easy way to find a module(with the problem I’m trying to solve atleast)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding Gradle Module Metadata - Gradle User Manual
Gradle Module Metadata is a format used to serialize the Gradle component model. It is similar to Apache Maven™'s POM file or Apache...
Read more >
Module metadata - Puppet
The Forge uses the metadata to create the module's information page and to provide important information to users installing the module. The metadata.json ......
Read more >
ModuleMetadata | Android Open Source Project
The ModuleMetadata module contains metadata about the list of modules on a given device. The metadata is parsed and cached as soon as...
Read more >
Input Module Tutorial #2: Using the Metadata ... - cloudfront.net
This tutorial describes how to use the Metadata module for connecting information about the images (i.e., metadata) to your list of images for...
Read more >
What is the Metadata module—ArcGIS Pro | Documentation
The Metadata module, arcpy.metadata, is a Python module for accessing and managing an item's metadata. You can explore information describing your maps and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found