Skip to content

metadata.json contains the name of the current module #8225

@alexeagle

Description

@alexeagle

We agreed today that the metadata we produce for a single project should contain only relative paths, because we do not need to reference symbols that originated in a different node package.

This is a smell because we are about to change our package names, and the string 'angular2' does not appear anymore, however the metadata ought to remain unchanged (because the .d.ts files will not be affected)

https://raw.githubusercontent.com/angular/angular/builds-js/src/common/forms/directives/ng_control_name.metadata.json

Is an example of two problems:

  • there is a module in the top-level __symbolic definition, this duplicates information available in the file's path, and differs from .d.ts files, which do not declare their own module name. PROPOSAL: remove module from the schema (https://github.com/angular/angular/blob/master/tools/metadata/src/schema.ts#L5 )
  • references to other angular code should be relative, not absolute names starting with 'angular2'. PROPOSAL: simply use the path.relative function in nodejs to relativize the path of a module from the containing file, whole metadata we are gathering.

cc @tbosch @chuckjaz

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions