Skip to content
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

[Nunjucks] Add dev argument to ConfigureOptions #63968

Conversation

pezholio
Copy link
Contributor

There is an undocumented dev argument that can be sent to nunjucks.configure, which allows a full error trace to the thrown

(See: mozilla/nunjucks#1430)

Please fill in this template.

Select one of these and delete the others:

If adding a new definition:

  • The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration
  • If this is for an npm package, match the name. If not, do not conflict with the name of an npm package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • Represents shape of module/library correctly
  • tslint.json should contain { "extends": "@definitelytyped/dtslint/dt.json" }, and no additional rules.
  • tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>
  • 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.

If removing a declaration:

  • If a package was never on Definitely Typed, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
  • Delete the package's directory.
  • Add it to notNeededPackages.json.

There is an undocumented `dev` argument that can be sent to
`nunjucks.configure`, which allows a full error trace to the thrown

(See: mozilla/nunjucks#1430)
@typescript-bot
Copy link
Contributor

typescript-bot commented Jan 18, 2023

@pezholio Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

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 or DT maintainers

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": 63968,
  "author": "pezholio",
  "headCommitOid": "144638b1f43d1c6bedd6b16be6cbde2efc93257e",
  "mergeBaseOid": "fc41bdd10649879190f2997632d01f338e11c761",
  "lastPushDate": "2023-01-18T11:54:35.000Z",
  "lastActivityDate": "2023-02-15T06:27:26.000Z",
  "mergeOfferDate": "2023-02-14T23:22:25.000Z",
  "mergeRequestDate": "2023-02-15T06:27:26.000Z",
  "mergeRequestUser": "pezholio",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Popular",
  "pkgInfo": [
    {
      "name": "nunjucks",
      "kind": "edit",
      "files": [
        {
          "path": "types/nunjucks/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/nunjucks/nunjucks-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "MatthewBurstein"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "gabritto",
      "date": "2023-02-14T23:21:40.000Z",
      "isMaintainer": true
    }
  ],
  "mainBotCommentID": 1386935253,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added the Popular package This PR affects a popular package (as counted by NPM download counts). label Jan 18, 2023
@typescript-bot
Copy link
Contributor

🔔 @MatthewBurstein — 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 this to Waiting for Code Reviews in New Pull Request Status Board Jan 18, 2023
pezholio added a commit to ministryofjustice/hmpps-approved-premises-ui that referenced this pull request Jan 18, 2023
When a global function in a template throws an error, we don’t see the
full trace of the error, which makes diagnosing issues really hard.

This makes use of the [undocumented dev argument](mozilla/nunjucks#1430)
which allows us to see the cause of the error in our logs and in Sentry.

I’ve had to extend the nunjucks types to allow for this option to be
set, as it’s not in the type definition in `DefinitelyTyped`. However,
I’ve [opened a PR to add this](DefinitelyTyped/DefinitelyTyped#63968)
@DangerBotOSS
Copy link

Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files.
The check for missing properties isn't always right, so take this list as advice, not a requirement.

nunjucks (unpkg)

was missing the following properties:

  1. compiler
  2. parser
  3. lexer
  4. nodes
  5. reset

Generated by 🚫 dangerJS against 144638b

pezholio added a commit to ministryofjustice/hmpps-approved-premises-ui that referenced this pull request Jan 18, 2023
When a global function in a template throws an error, we don’t see the
full trace of the error, which makes diagnosing issues really hard.

This makes use of the [undocumented dev argument](mozilla/nunjucks#1430)
which allows us to see the cause of the error in our logs and in Sentry.

I’ve had to extend the nunjucks types to allow for this option to be
set, as it’s not in the type definition in `DefinitelyTyped`. However,
I’ve [opened a PR to add this](DefinitelyTyped/DefinitelyTyped#63968)
@pezholio pezholio changed the title Add dev argument to ConfigureOptions [Nunjucks] Add dev argument to ConfigureOptions Jan 19, 2023
@typescript-bot typescript-bot added the Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. label Feb 14, 2023
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Action in New Pull Request Status Board Feb 14, 2023
@typescript-bot
Copy link
Contributor

It has been more than two weeks and this PR still has no reviews.

I'll bump it to the DT maintainer queue. Thank you for your patience, @pezholio.

(Ping @MatthewBurstein.)

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner and removed Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. labels Feb 14, 2023
@typescript-bot typescript-bot moved this from Needs Maintainer Action to Waiting for Author to Merge in New Pull Request Status Board Feb 14, 2023
@typescript-bot
Copy link
Contributor

@pezholio: Everything looks good here. I am ready to merge this PR (at 144638b) 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! ❤️

(@MatthewBurstein: you can do this too.)

@pezholio
Copy link
Contributor Author

Ready to merge

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in New Pull Request Status Board Feb 15, 2023
@typescript-bot typescript-bot merged commit 081d7f4 into DefinitelyTyped:master Feb 15, 2023
miccehedin pushed a commit to miccehedin/DefinitelyTyped that referenced this pull request Feb 15, 2023
…nfigureOptions` by @pezholio

There is an undocumented `dev` argument that can be sent to
`nunjucks.configure`, which allows a full error trace to the thrown

(See: mozilla/nunjucks#1430)
typescript-bot pushed a commit that referenced this pull request Feb 20, 2023
* Add two missing mode bar buttons

* Add test with scattermapbox and new button name

* Add two more button names

* Add test for new button names

* 🤖 Merge PR #64342 feat: update @nginstack/engine definitions by @Henato

Co-authored-by: Renato <renato@innovaro.com.br>

* 🤖 Merge PR #64343 feat: update @nginstack/iquery definitions by @Henato

Co-authored-by: Renato <renato@innovaro.com.br>

* 🤖 Merge PR #64344 feat: update @nginstack/orm definitions by @Henato

Co-authored-by: Renato <renato@innovaro.com.br>

* 🤖 Merge PR #64345 feat: update @nginstack/jsunit definitions by @Henato

Co-authored-by: Renato <renato@innovaro.com.br>

* 🤖 Merge PR #64346 feat: update @nginstack/datasource definitions by @Henato

Co-authored-by: Renato <renato@innovaro.com.br>

* 🤖 Merge PR #64348 feat: update @nginstack/dev-tools definitions by @Henato

Co-authored-by: Renato <renato@innovaro.com.br>

* 🤖 Merge PR #64349 feat: update @nginstack/devops definitions by @Henato

Co-authored-by: Renato <renato@innovaro.com.br>

* 🤖 Merge PR #64240 barnard59-validate-shacl: added ValidationError export by @tpluscode

* added ValidationError export

* added test

* 🤖 Merge PR #64331 [oidc-provider] Expose as ESM module by @BendingBender

* 🤖 Merge PR #64198 [plotly.js] Add types for updatemenus by @gjulianm

* [plotly.js] Add types for updatemenus

Added types for the updatemenus property of layout. This includes two types, UpdateMenu and UpdateMenuButton

Reference: https://plotly.com/javascript/reference/layout/updatemenus/#layout-updatemenus-items-updatemenu-visible

* [plotly] run prettier

* 🤖 Merge PR #63976 update(anchor-js): version 5 bump by @peterblazejewicz

- version 5 is breaking (as per release notes)
- option for visiblity removed
- naming alinged with module documentation (options, visiblity,
  AnchorJS, etc) with aliases
- tests updated

https://github.com/bryanbraun/anchorjs/releases/tag/5.0.0

Thanks!

* Use GH_DT_MERGEBOT_TOKEN for starting action on dt-mergebot (#64357)

* [gapi.client.*] Bulk update Google API namespace (#63835)

* 🤖 Merge PR #63909 react-native-sqlite-storage: fixing typos and adding properties by @icehaunter

1. Fixed a typo in a function name
2. Fixed return type of a function
3. Added a missing property

* 🤖 Merge PR #62388 feat(geometric): Add lineRotate method to geometric module (geometric v2.4.0) by @tmcw

* feat(geometric): Add lineRotate method

* Add ScaleX and ScaleY as well

* Fix comment style

* 🤖 Merge PR #63487 fix : distribute key and restprops in react-table component's props by @Doooooring

* fix : distribute key and restprops in react-table component's props

* fix : add semicolon in react-table

* fix : add the semicolon

* [trusted-types] Properly augment global to prevent conflicts with lib… (#64360)

* [trusted-types] Properly augment global to prevent conflicts with lib.dom.d.ts et.all

This is the proper patern to augment global interfaces that are defined by the runtime.

The previous approach would break once `lib.dom.d.ts` declares these interfaces.

The previous approach also made it impossible for other libraries to use these types.
For example, #60691 had to be reverted.
With proper module augmentation we can land #60691 again.

* $ExpectError -> @ts-expect-error

* 🤖 Merge PR #63315 [ejs] adjust options.root parameter by @mshima

* [ejs] adjust root parameter

* Update index.d.ts

* [ejs] add test for root array

* Fix EJS v8 deps

---------

Co-authored-by: Piotr Błażejewicz <peterblazejewicz@users.noreply.github.com>

* 🤖 Merge PR #63879 [paypal-checkout-components] Add missing `style` and callbacks by @phylor

* Add missing `style` and callbacks to paypal-checkout-components

* Fix prettier issues

* 🤖 Merge PR #64249 meteor: Add new async methods from 2.9 by @ebroder

* 🤖 Merge PR #64363 [relay-runtime] Add cacheConfig to subscription config by @merrywhether

* 🤖 Merge PR #64337 add zhoverformat to plotly data type by @BMJHayward

Co-authored-by: Brendan Hayward <email>

* 🤖 Merge PR #64019 Fixed types for types/onfleet__node-onfleet by @YokySantiago

Fixed: property types for worker.teams, function types for task.createBatch task.autoAssign

* 🤖 Merge PR #63929 [d3-sankey] add Node.fixedValue by @simPod

* 🤖 Merge PR #63979 blessed: ListElement.setItems allows string[] by @bennbollay

* blessed: ListElement.setItems allows string[]

* Update blessed-tests.ts

* 🤖 Merge PR #63517 [react-dom] [react-native] fix incorrect typedefs for unstable_batchedUpdates by @k-yle

* 🤖 Merge PR #63877 update "wordcloud" types to align upstream by @g-plane

* update "wordcloud" types to align upstream

* update properties of "wordcloud"

* update tests of "wordcloud"

* `minFontSize` should be readonly

* update library version

* 🤖 Merge PR #63926 Update select2 Options.dropdownParent to allow additional types by @jdufresne

Per the docs at: https://select2.org/configuration/options-api
dropdownParent is allowed to be of type "jQuery selector or DOM node".

This can be further seen by the select2 code at:
https://github.com/select2/select2/blob/0a30b0b3e67843c09b0bcc4d01e65b72d9b1279f/src/js/select2/dropdown/attachBody.js#L6

* 🤖 Merge PR #63794 [@types/async] Fix return types when callback not provided by @nwalters512

* [@types/async] Fix return types when callback not provided

* Remove self as owner

* 🤖 Merge PR #63658 [ref-napi] Replace Value<T> with Pointer<T>. by @yfwz100

According to library description, a buffer is always a pointer to the underly type.

* 🤖 Merge PR #64020 fix(react-native-background-downloader): correct types for DownloadTaskState by @fivecar

It turns out that react-native-background-downloader doesn't actually export this type. Things may seem fine with doing things like `DownloadTaskState.DOWNLOADING` in your code, until you use that in a package that you also then publish yourself. At that point, you'll find the transpiled JS in your package refers to things like react_native_background_downloader_1.DownloadTaskState.DOWNLOADING, which definitely does not exist and will throw at runtime.

* 🤖 Merge PR #63968 [Nunjucks] Add `dev` argument to `ConfigureOptions` by @pezholio

There is an undocumented `dev` argument that can be sent to
`nunjucks.configure`, which allows a full error trace to the thrown

(See: mozilla/nunjucks#1430)

* 🤖 Merge PR #64073 [canvasjs] Added missing ChartOptions properties by @sampie777

Co-authored-by: S. Jansen <sa.jansen1@gmail.com>

* 🤖 Merge PR #64358 Phoenix callbacks can be async by @flupke

All callback arguments can now return T | Promise<T>, to fix annoying eslint errors like:

    Promise returned in function argument where a void return was expected. (eslint @typescript-eslint/no-misused-promises)

* 🤖 Merge PR #63921 [d3-sankey] remove unused import from tests by @simPod

---------

Co-authored-by: Henato <57230682+Henato@users.noreply.github.com>
Co-authored-by: Renato <renato@innovaro.com.br>
Co-authored-by: Tomasz Pluskiewicz <tpluscode@users.noreply.github.com>
Co-authored-by: Dimitri B <BendingBender@users.noreply.github.com>
Co-authored-by: Guillermo Julián <gjulianm@users.noreply.github.com>
Co-authored-by: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Co-authored-by: Maxim Mazurok <maxim@mazurok.com>
Co-authored-by: Ilia Borovitinov <icehaunter@gmail.com>
Co-authored-by: Tom MacWright <tmcw@users.noreply.github.com>
Co-authored-by: Doooooring <106396244+Doooooring@users.noreply.github.com>
Co-authored-by: Sebastian Silbermann <sebastian.silbermann@klarna.com>
Co-authored-by: Marcelo Shima <marceloshima@gmail.com>
Co-authored-by: Serge Hänni <phylor@users.noreply.github.com>
Co-authored-by: Evan Broder <evan@ebroder.net>
Co-authored-by: Risto Keravuori <kerarist@twitch.tv>
Co-authored-by: Brendan Hayward <brendanhayward85@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Simon Podlipsky <simon@podlipsky.net>
Co-authored-by: Benn Bollay <bb.github@magitech.org>
Co-authored-by: Kyℓe Hensel <k-yle@users.noreply.github.com>
Co-authored-by: Pig Fang <g-plane@hotmail.com>
Co-authored-by: Jon Dufresne <jon.dufresne@gmail.com>
Co-authored-by: Nathan Walters <nwalters512@gmail.com>
Co-authored-by: Wang Zhi <yfwz100@yeah.net>
Co-authored-by: Philip Su <39933441+fivecar@users.noreply.github.com>
Co-authored-by: Stuart Harrison <pezholio@gmail.com>
Co-authored-by: S. Jansen <sampie777@users.noreply.github.com>
Co-authored-by: S. Jansen <sa.jansen1@gmail.com>
Co-authored-by: Luper Rouch <luper.rouch@gmail.com>
@typescript-bot typescript-bot removed this from Recently Merged in New Pull Request Status Board Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintainer Approved Popular package This PR affects a popular package (as counted by NPM download counts). 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.

None yet

4 participants