apertium / apertium-html-tools

Web application providing a fully localised interface for text/website/document translation, analysis and generation powered by Apertium.
http://wiki.apertium.org/wiki/Apertium-html-tools
GNU General Public License v3.0
41 stars 89 forks source link

issue#462 about section #467

Closed hazemk537 closed 1 year ago

hazemk537 commented 1 year ago

Because , I found an error while building when I used the SVG version , so I convert it to PNG

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 4459651220


Totals Coverage Status
Change from base Build 4398888430: 0.003%
Covered Lines: 1379
Relevant Lines: 1394

💛 - Coveralls
sushain97 commented 1 year ago

If you run into an unexpected issue, please ask for help with it rather than reverting to a sub-optimal choice. In this case, you'll need to modify Jest config, ESBuild config and TS declarations to allow for SVG files.

hazemk537 commented 1 year ago

okay , I can do that

hazemk537 commented 1 year ago
  1. I modified jest config after adding "^.+\.svg$": "jest-svg-transformer" to transformer
  2. I added svg.d.ts for the svg module 3.should i install esbuild-plugin-svg and use it ? it is deprecated
sushain97 commented 1 year ago

Please do not add any new config files or new dependencies. The existing support for gif/png files should extend to svg files immediately.

hazemk537 commented 1 year ago

the svg is still not work,any help?

hazemk537 commented 1 year ago

After many tries

References

If you want to load PNG, JPEG or GIF files as data URLs in your JavaScript code, you can use esbuild’s built-in loader option

If you want to load SVG files as strings or custom elements in your JavaScript code, you can use esbuild-plugin-svg

TinoDidriksen commented 1 year ago

We do NOT want any of the images as data URLs. But surely it can't be true that we need something special to copy an asset from the source to the build folder and insert the relative path to it.

hazemk537 commented 1 year ago

okay , should I repo the repo to PNG version ? to accept the pull request ?

TinoDidriksen commented 1 year ago

No, the SVG version is correct. It should simply be handled same as the other images are - which is, copied to the build folder and linked from there.

hazemk537 commented 1 year ago

No need to copy to dist , its working now using the SVG !! image

hazemk537 commented 1 year ago

Done

sushain97 commented 1 year ago

Please fix the build failures.

hazemk537 commented 1 year ago

done

sushain97 commented 1 year ago

I don't think we should be increasing the test timeout. It's probably just flaky? Another run will fix it.

hazemk537 commented 1 year ago

I tried runnibg it using jest and without increasing the timeout ,one file sometimes fails but after the increasing , no fails . I think we shoud increase it for future non fake issues during build . do you agrre with me ?

sushain97 commented 1 year ago

No, we should fix the test to not flake instead.

hazemk537 commented 1 year ago

so the problem is inside the test file itself ! I got it