Conversation
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
| @@ -1,4 +1,5 @@ | |||
| declare module "*.css"; | |||
|
|
|||
There was a problem hiding this comment.
Prettier should have had an opinion here! :-)
| (window as unknown as TurnstileWindow).turnstile.render(container, { | ||
| sitekey: this.challenge.siteKey, | ||
| size: "invisible", | ||
| size: "invisible" as TurnstileOptions["size"], |
There was a problem hiding this comment.
@BeryJu Could you please affirm this? The as TurnstilesOptions["size"] clause was necessary here because "invisible" is not a valid setting according to the options in the provided type file. If invisible is valid because you've made it so, let me know and I'll add a comment to that effect.
There was a problem hiding this comment.
I don't think thats valid (at least not anymore), so we can probably remove it
✅ Deploy Preview for authentik ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7854 +/- ##
===========================================
+ Coverage 49.01% 92.63% +43.61%
===========================================
Files 588 588
Lines 29200 29200
===========================================
+ Hits 14313 27049 +12736
+ Misses 14887 2151 -12736
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This commit follows the [patch for Turnstile](#7854) and performs a similar operation for the Storybook build, which failed after the latest `npm audit` and `npm update` passes. [This patch to Vite](vitejs/vite#10762) fixes a problem with the Vite build in that Vite could not resolve if a CSS import was strictly at the module level or if it was necessary to include the imported CSS at the document level. The fix is to hack a query, `?inline`, to the end of the import string, to indicate that it's a module-only import. The Storybook for Web Components build recommended by the Open Webcomponent Consortium is a Storybook-Vite implementation. The latest update fully deprecated undecorated CSS imports, and Storybook broke, unable to reconcile the CSS imports. This patch inlines the inlining of the CSS automatically for Storybook by using the Rollup `modify()` plug-in which performs string substitutions on the source code before it's presented to the compiler and bundler; it recognizes the strings that require inlining, those that match the regex: ``` JavaScript /^(import \w+ from .*\.css)";/ ``` ... and replaces them with a version ending in `.css?inline`. Because the actual recognizer inside `modify()` recognizes strings and not regular expressions, a script to build the strings has been added to the `scripts` folder. Just like locales, you will have to re-run and re-build `build-storybook-import-maps` script if you add a new CSS file to the source tree.
After running 'npm update' on the dev tree, the build started to fail with these options and types no longer being set correctly in the source tree. I have explicitly included the Turnstile object as a sub-component of Window, and modified the CaptchaStage to understand the TurnstileObject and TurnstileOptions, and the build now completes.
…etting; that's purely an HCaptcha thing.
After reading [this guide](https://medium.com/@anjusha.khandavalli/decoding-commonly-used-symbols-in-package-json-file-e08f3939c9e4), I've locked down the version of pyright to a specific and immovable version until we can get a better read on how the Pyright upgrade breaks things.
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
c7f6e43 to
de1abfd
Compare
This commit follows the [patch for Turnstile](#7854) and performs a similar operation for the Storybook build, which failed after the latest `npm audit` and `npm update` passes. [This patch to Vite](vitejs/vite#10762) fixes a problem with the Vite build in that Vite could not resolve if a CSS import was strictly at the module level or if it was necessary to include the imported CSS at the document level. The fix is to hack a query, `?inline`, to the end of the import string, to indicate that it's a module-only import. The Storybook for Web Components build recommended by the Open Webcomponent Consortium is a Storybook-Vite implementation. The latest update fully deprecated undecorated CSS imports, and Storybook broke, unable to reconcile the CSS imports. This patch inlines the inlining of the CSS automatically for Storybook by using the Rollup `modify()` plug-in which performs string substitutions on the source code before it's presented to the compiler and bundler; it recognizes the strings that require inlining, those that match the regex: ``` JavaScript /^(import \w+ from .*\.css)";/ ``` ... and replaces them with a version ending in `.css?inline`. Because the actual recognizer inside `modify()` recognizes strings and not regular expressions, a script to build the strings has been added to the `scripts` folder. Just like locales, you will have to re-run and re-build `build-storybook-import-maps` script if you add a new CSS file to the source tree.
* web: fix storybookbuild build after npm update This commit follows the [patch for Turnstile](#7854) and performs a similar operation for the Storybook build, which failed after the latest `npm audit` and `npm update` passes. [This patch to Vite](vitejs/vite#10762) fixes a problem with the Vite build in that Vite could not resolve if a CSS import was strictly at the module level or if it was necessary to include the imported CSS at the document level. The fix is to hack a query, `?inline`, to the end of the import string, to indicate that it's a module-only import. The Storybook for Web Components build recommended by the Open Webcomponent Consortium is a Storybook-Vite implementation. The latest update fully deprecated undecorated CSS imports, and Storybook broke, unable to reconcile the CSS imports. This patch inlines the inlining of the CSS automatically for Storybook by using the Rollup `modify()` plug-in which performs string substitutions on the source code before it's presented to the compiler and bundler; it recognizes the strings that require inlining, those that match the regex: ``` JavaScript /^(import \w+ from .*\.css)";/ ``` ... and replaces them with a version ending in `.css?inline`. Because the actual recognizer inside `modify()` recognizes strings and not regular expressions, a script to build the strings has been added to the `scripts` folder. Just like locales, you will have to re-run and re-build `build-storybook-import-maps` script if you add a new CSS file to the source tree. * web: prettier had opinions * web: apply eslint + sonarjs check to the scripts folder. * Google recaptcha (aka Turnstile) doesn't understand the "invisible" setting; that's purely an HCaptcha thing. * web: removing the typecast means I no longer need the type. * web: prettier is still having opinions, dammit.
* main: web: dark/light theme fixes (#7872) web: replace 'description-list' with list of descriptions (#7392) web: expressing success (#7830) web: fix turnstile types after update (#7854) core: bump github.com/google/uuid from 1.4.0 to 1.5.0 (#7866) website: bump @types/react from 18.2.43 to 18.2.45 in /website (#7865) web: bump wdio-wait-for from 3.0.9 to 3.0.10 in /tests/wdio (#7867) website/blog: okta part two blog (#7863) web: bump lit-analyzer from 2.0.1 to 2.0.2 in /web (#7858) web: bump the babel group in /web with 4 updates (#7856) web: bump the eslint group in /web with 2 updates (#7857) web: bump rollup from 4.7.0 to 4.8.0 in /web (#7859) web: bump the eslint group in /tests/wdio with 2 updates (#7860) web: refactor the table renderer for legibility (#7433) documentation: Improve explanation of `kubernetes_json_patches` (#7832) root: update security policy to include link to cure53 report (#7853)

Details
After running 'npm update' on the dev tree, the build started to fail with these options and types no longer being set correctly in the source tree.
I have explicitly included the Turnstile object as a sub-component of Window, and modified the CaptchaStage to understand the TurnstileObject and TurnstileOptions, and the build now completes. As these are purely type-level changes, the functionality of the system is unchanged, and testing (by hand, sigh) indicates that the visible behavior is consistent with previous iterations.
Checklist
ak test authentik/)make lint-fix)If an API change has been made
make gen-build)If changes to the frontend have been made
make web)make i18n-extract)If applicable
make website)