diff --git a/packages/core/package.json b/packages/core/package.json index dac9dcb131c45..50f5f03b52b53 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -49,6 +49,12 @@ "types": "./dist-types/submodules/protocols/index.d.ts" } }, + "files": [ + "dist-*/**", + "./client.js", + "./httpAuthSchemes.js", + "./protocols.js" + ], "sideEffects": false, "author": { "name": "AWS SDK for JavaScript Team", diff --git a/packages/core/scripts/lint.js b/packages/core/scripts/lint.js index eb60b3c329039..8766fc133807f 100644 --- a/packages/core/scripts/lint.js +++ b/packages/core/scripts/lint.js @@ -27,6 +27,11 @@ for (const submodule of submodules) { }; fs.writeFileSync(path.join(root, "package.json"), JSON.stringify(pkgJson, null, 2) + "\n"); } + if (!pkgJson.files.includes(`./${submodule}.js`)) { + pkgJson.files.push(`./${submodule}.js`); + errors.push(`package.json files array missing ${submodule}.js compatibility redirect file.`); + fs.writeFileSync(path.join(root, "package.json"), JSON.stringify(pkgJson, null, 2) + "\n"); + } // tsconfig metadata. for (const [kind, tsconfig] of Object.entries(tsconfigs)) { if (!tsconfig.compilerOptions.paths?.[`@aws-sdk/core/${submodule}`]) {