Skip to content

Package declaration file for commonjs packages #3159

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

Closed
wants to merge 13 commits into from

Conversation

rbuckton
Copy link
Contributor

Implements #3089.

  • Adds a packageName compiler option, used to specify the name of the package.
  • Adds a packageMain compiler option, used to specify the path to the main typescript module for the package.
  • Adds a packageDeclaration compiler option, used to specify the output path of the declaration file for the package.
  • Adds a packageDir compiler option to control the root directory of the package (falls back using: rootDir, the common directory path, the current directory).
  • When the first three options above are supplied and either module or a target of ES6, we should emit a single declaration file for the program inputs over and above any individual declaration files generated if declaration is specified.

The output for a packageDeclaration would have the following form:

  • Exports for the main module will be defined inside of an ambient external module that has the name provided via packageName.
  • Exports for relative modules will be defined inside of an ambient external module that has a name derived from the package name, and the path of the module relative to the package directory, the supplied rootDir, the common directory path, or the current directory.

@aboeglin
Copy link

aboeglin commented Sep 1, 2015

What is the status on this ?

@mhegazy
Copy link
Contributor

mhegazy commented Sep 1, 2015

@aboeglin this is tracked by #4433 now.

@mhegazy
Copy link
Contributor

mhegazy commented Sep 29, 2015

closing in favor of #4433

@mhegazy mhegazy closed this Sep 29, 2015
@mhegazy mhegazy deleted the packageDeclaration2 branch November 2, 2017 21:05
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants