Skip to content

chore(NODE-5277): add definition clean up script #576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 18, 2023

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented May 10, 2023

Description

What is changing?

  • Add definition clean up script from driver
  • Add file list validation from FLE

What is the motivation for this change?

Clean extraneous files

Double check the following

  • Ran npm run lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

Comment on lines +29 to +30
const emptyDirectories = Array.from(walk(libPath))
.filter(filePath => fs.statSync(filePath).isDirectory() && fs.readdirSync(filePath).length === 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike the driver, BSON has only the top-level bundles in lib/ so the lib/parser/ and lib/utils/ directories can be cleaned up.

@baileympearson baileympearson marked this pull request as ready for review May 16, 2023 21:06
baileympearson
baileympearson previously approved these changes May 16, 2023
@@ -0,0 +1,35 @@
#! /usr/bin/env node
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious - any reason we're using a cjs module if we're not using top level await?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few non binding reasons:

  • aligning with the choice made in the driver
  • esm and await is slower for scripting tasks like this
  • cjs has greater compatibility, it can be a nice-to-have that little scripts like this run fine on node 8 (still a common version on linux package managers) despite the package src having a higher node requirement.

let tarFileList;
before(function () {
this.timeout(120_000); // npm pack can be slow
expect(fs.existsSync(packFile)).to.equal(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(fs.existsSync(packFile)).to.equal(false);
expect(fs.existsSync(packFile), 'expected pack file not to exist, but it does').to.equal(false);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put the file name in the expectation

@baileympearson
Copy link
Contributor

one question, one optional change

@baileympearson baileympearson added the Team Review Needs review from team label May 16, 2023
@baileympearson baileympearson merged commit 915c517 into main May 18, 2023
@baileympearson baileympearson deleted the NODE-5277-port-dts-script branch May 18, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants