Skip to content

[mailparser] Add support for MailParser options#56983

Merged
typescript-bot merged 1 commit intoDefinitelyTyped:masterfrom
webstech:cw/nodemailer
Nov 7, 2021
Merged

[mailparser] Add support for MailParser options#56983
typescript-bot merged 1 commit intoDefinitelyTyped:masterfrom
webstech:cw/nodemailer

Conversation

@webstech
Copy link
Contributor

@webstech webstech commented Nov 5, 2021

Extend both simpleParser and MailParser to support the documented options. simpleParserOptions was kept for compatibility.

To support iconv-lite, a package.json has been added.

  • Use a meaningful title for the pull request. Include the name of the package modified.

  • Test the change in your own code. (Compile and run.)

  • Add or edit tests to reflect the change.

  • Follow the advice from the readme.

  • Avoid common mistakes.

  • Run npm test <package to test>.
    NOTE this gets errors:
    Error: Errors in typescript@3.6 for external dependencies:
    ../node/assert.d.ts(12,64): error TS2304: Cannot find name 'asserts'.
    UPDATE: Need fresh npm install to update old install.

  • Provide a URL to documentation or source code which provides context for the suggested changes: https://nodemailer.com/extras/mailparser/#options

  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.

@typescript-bot
Copy link
Contributor

typescript-bot commented Nov 5, 2021

@webstech Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners, DT maintainers or others

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 56983,
  "author": "webstech",
  "headCommitOid": "1f0c6a84e2815e4303802a763c41dfb71a4fb545",
  "lastPushDate": "2021-11-06T18:43:06.000Z",
  "lastActivityDate": "2021-11-07T17:43:50.000Z",
  "mergeOfferDate": "2021-11-07T10:40:23.000Z",
  "mergeRequestDate": "2021-11-07T17:43:50.000Z",
  "mergeRequestUser": "webstech",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "popularityLevel": "Well-liked by everyone",
  "pkgInfo": [
    {
      "name": "mailparser",
      "kind": "edit",
      "files": [
        {
          "path": "types/mailparser/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/mailparser/mailparser-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/mailparser/package.json",
          "kind": "package-meta-ok"
        }
      ],
      "owners": [
        "psnider",
        "Avol-V",
        "peterblazejewicz"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "peterblazejewicz",
      "date": "2021-11-07T10:39:47.000Z",
      "isMaintainer": true
    }
  ],
  "mainBotCommentID": 961652281,
  "ciResult": "pass"
}

@typescript-bot
Copy link
Contributor

typescript-bot commented Nov 5, 2021

🔔 @psnider @Avol-V @peterblazejewicz — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Nov 5, 2021
@typescript-bot
Copy link
Contributor

@webstech The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review.

@typescript-bot
Copy link
Contributor

@webstech The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review.

@webstech
Copy link
Contributor Author

webstech commented Nov 5, 2021

Apologies to the reviewers. I need to figure out what this error means. iconv-lite is in the notNeededPackages.json. I added it in the package.json to get the compile to work but that may not be correct. iconv-lite has ts definitions in its package.

Any suggestions are welcome.

Error: In package.json: Dependency iconv-lite not in the allowed dependencies list.
If you are depending on another `@types` package, do *not* add it to a `package.json`. Path mapping should make the import work.
For namespaced dependencies you then have to add a `paths` mapping from `@namespace/*` to `namespace__*` in `tsconfig.json`.
If this is an external library that provides typings,  please make a pull request to microsoft/DefinitelyTyped-tools adding it to `packages/definitions-parser/allowedPackageJsonDependencies.txt`.

@peterblazejewicz
Copy link
Member

Error: In package.json: Dependency iconv-lite not in the allowed dependencies list

You need to submit PR to microsoft/DefinitelyTyped-tools, see similar one:
microsoft/DefinitelyTyped-tools#333
iconv-lite ships internal DT, so it needs to be installed, and there is a whitesource list

@typescript-bot typescript-bot added Check Config Changes a module config files and removed The CI failed When GH Actions fails labels Nov 5, 2021
@typescript-bot
Copy link
Contributor

@peterblazejewicz Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@webstech
Copy link
Contributor Author

webstech commented Nov 5, 2021

You need to submit PR to microsoft/DefinitelyTyped-tools, see similar one: microsoft/DefinitelyTyped-tools#333 iconv-lite ships internal DT, so it needs to be installed, and there is a whitesource list

Thanks for pointing me in the right direction. Yes, the message pretty much says that but the DT README does not really talk about it in the package.json discussion.

@webstech webstech changed the title (mailparser) Add support for MailParser options [mailparser] Add support for MailParser options Nov 5, 2021
Extend both simpleParser and MailParser to support the documented
options.  simpleParserOptions was kept for compatability.

To support `iconv-lite`, a `package.json` has been added.

Signed-off-by: Chris. Webster <chris@webstech.net>
@typescript-bot typescript-bot removed the Check Config Changes a module config files label Nov 6, 2021
@typescript-bot
Copy link
Contributor

@peterblazejewicz Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

Copy link
Member

@peterblazejewicz peterblazejewicz left a comment

Choose a reason for hiding this comment

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

LGTM!
@webstech thx!

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Nov 7, 2021
@typescript-bot
Copy link
Contributor

@webstech: Everything looks good here. I am ready to merge this PR (at 1f0c6a8) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@psnider, @Avol-V, @peterblazejewicz: you can do this too.)

@webstech
Copy link
Contributor Author

webstech commented Nov 7, 2021

Ready to merge

@typescript-bot typescript-bot merged commit 9233976 into DefinitelyTyped:master Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants