File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333 const fs = require('fs');
3434 const rootPkg = require('./package.json');
3535
36+ // Combine all dependencies from the root package.json
37+ const rootDeps = { ...rootPkg.dependencies, ...rootPkg.devDependencies };
38+ const typeDeps = {};
39+
40+ // List of packages that are type-only but don"t start with @types/
41+ // Add other packages here if needed.
42+ const explicitTypePackages = ["@xterm/xterm", "howler"];
43+
44+ for (const [pkgName, version] of Object.entries(rootDeps)) {
45+ // Add if it"s an @types package OR in our explicit list
46+ if (pkgName.startsWith("@types/") || explicitTypePackages.includes(pkgName)) {
47+ typeDeps[pkgName] = version;
48+ }
49+ }
50+
3651 // Define the package.json for the 'types' branch
3752 // It reuses many fields from the root package.json
3853 const typesPkg = {
4661 license: rootPkg.license,
4762 keywords: rootPkg.keywords,
4863 bugs: rootPkg.bugs,
49- homepage: rootPkg.homepage
64+ homepage: rootPkg.homepage,
65+ dependencies: typeDeps
5066 };
5167
5268 // Write the new package.json into the 'types' directory
You can’t perform that action at this time.
0 commit comments