You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update APF docs for new .d.ts layout (angular#64168)
The Angular Package Format has been updated to group all TypeScript declaration files (`.d.ts`) under a single `types/` directory within the package. Previously, these files were located at the package root or within entry-point specific directories.
This commit updates the APF documentation to reflect this new structure, including:
- The example file layout.
- The file purpose description table.
- The `package.json` exports field example.
- The legacy typings field example.
This brings the documentation in line with the current package structure, providing accurate guidance for library authors and tool developers.
PR Closeangular#64168
Copy file name to clipboardExpand all lines: adev/src/content/tools/libraries/angular-package-format.md
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,14 +28,14 @@ The following example shows a simplified version of the `@angular/core` package'
28
28
node_modules/@angular/core
29
29
├── README.md
30
30
├── package.json
31
-
├── index.d.ts
32
31
├── fesm2022
33
32
│ ├── core.mjs
34
33
│ ├── core.mjs.map
35
34
│ ├── testing.mjs
36
35
│ └── testing.mjs.map
37
-
└── testing
38
-
└── index.d.ts
36
+
└── types
37
+
│ ├── core.d.ts
38
+
│ ├── testing.d.ts
39
39
```
40
40
41
41
This table describes the file layout under `node_modules/@angular/core` annotated to describe the purpose of files and directories:
@@ -44,10 +44,8 @@ This table describes the file layout under `node_modules/@angular/core` annotate
44
44
|:--- |:--- |
45
45
|`README.md`| Package README, used by npmjs web UI. |
46
46
|`package.json`| Primary `package.json`, describing the package itself as well as all available entrypoints and code formats. This file contains the "exports" mapping used by runtimes and tools to perform module resolution. |
47
-
|`index.d.ts`| Bundled `.d.ts` for the primary entrypoint `@angular/core`. |
48
47
|`fesm2022/` <br />   ─ `core.mjs` <br />   ─ `core.mjs.map` <br />   ─ `testing.mjs` <br />   ─ `testing.mjs.map`| Code for all entrypoints in flattened \(FESM\) ES2022 format, along with source maps. |
49
-
|`testing/`| Directory representing the "testing" entrypoint. |
50
-
|`testing/index.d.ts`| Bundled `.d.ts` for the `@angular/core/testing` entrypoint. |
48
+
|`types/` <br />   ─ `core.d.ts` <br />   ─ `testing.d.ts`| Bundled TypeScript type definitions for all public entrypoints. |
51
49
52
50
## `package.json`
53
51
@@ -88,11 +86,11 @@ The `"exports"` field has the following structure:
88
86
"default": "./package.json"
89
87
},
90
88
".": {
91
-
"types": "./core.d.ts",
89
+
"types": "./types/core.d.ts",
92
90
"default": "./fesm2022/core.mjs"
93
91
},
94
92
"./testing": {
95
-
"types": "./testing/testing.d.ts",
93
+
"types": "./types/testing.d.ts",
96
94
"default": "./fesm2022/testing.mjs"
97
95
}
98
96
}
@@ -122,7 +120,7 @@ For `@angular/core` these are:
0 commit comments