Skip to content

Commit

Permalink
chore: Update public api check for esm (#5198)
Browse files Browse the repository at this point in the history
* mock package json

* Changes from lint:fix

---------

Co-authored-by: cloud-sdk-js <[email protected]>
  • Loading branch information
deekshas8 and cloud-sdk-js authored Nov 21, 2024
1 parent 7ccc9a3 commit b86d333
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/actions/check-public-api/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion build-packages/check-public-api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,26 @@ export interface ExportedObject {

function paths(pathToPackage: string): {
pathToSource: string;
pathToPackageJson: string;
pathToTsConfig: string;
pathToNodeModules: string;
pathCompiled: string;
} {
return {
pathToSource: join(pathToPackage, 'src'),
pathToPackageJson: join(pathToPackage, 'package.json'),
pathToTsConfig: join(pathToPackage, 'tsconfig.json'),
pathToNodeModules: join(pathToPackage, 'node_modules'),
pathCompiled: 'dist'
};
}

function mockFileSystem(pathToPackage: string) {
const { pathToSource, pathToTsConfig, pathToNodeModules } =
const { pathToSource, pathToTsConfig, pathToNodeModules, pathToPackageJson } =
paths(pathToPackage);
mock({
[pathToTsConfig]: mock.load(pathToTsConfig),
[pathToPackageJson]: mock.load(pathToPackageJson),
[pathToSource]: mock.load(pathToSource),
[pathRootNodeModules]: mock.load(pathRootNodeModules),
[pathToNodeModules]: mock.load(pathToNodeModules),
Expand Down

0 comments on commit b86d333

Please sign in to comment.