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

Compile instructions are out of date? #1070

Open
Greatness7 opened this issue Mar 19, 2024 · 2 comments
Open

Compile instructions are out of date? #1070

Greatness7 opened this issue Mar 19, 2024 · 2 comments
Labels
documentation Documentation needs to be updated pull-request Pull request available support-request Help/support requested

Comments

@Greatness7
Copy link

Greatness7 commented Mar 19, 2024

Hello, I'm wanting to compile the icon font but the instructions seem to be out of date.

The readme says to run npm run build-iconfont, but this script is not defined. Maybe it wants npm run build:webfont? I am however wanting to get a ttf out of it and not a woff, it is not clear what command should be ran to do so.

Another issue I had is that the includeIcons paremeter specified in compile-options.json seems to be ignored. Or perhaps it is only being respected by some parts of the build process and not others. Despite only specifying a small handful of icons in my json, running the build:webfont script seems to be executing fix-outline.py on every possible icon which takes several hours to complete.

The aforementioned script also had some errors which I had to fix locally, I've submitted a PR for that part.

@BG-Software-BG BG-Software-BG added documentation Documentation needs to be updated pull-request Pull request available support-request Help/support requested labels Mar 19, 2024
@Greatness7
Copy link
Author

Greatness7 commented Mar 19, 2024

I was ultimately able to get this to compile by working around some of the bugs in the code:

  1. Don't be on a Windows system, the build scripts are not compatible despite this not being mentioned anywhere in the readme.
  2. Fix the python script as above.
  3. Fix icons-webfont/.build/build-outline.mjs by wrapping the glob function in a promisify.
  4. Move compile-options.json to one folder above the working directory that your script will be ran from. I had to put it in the /packages/ folder to be recognized, contrary to what the readme suggests. The code responsible for this is here.
  5. Run npm run build:webfont (again contradictory to the readme).
  6. If you're including many icons, expect to wait a long time, likely hours. The build script sequentially spins up a new python instance for every single icon. Doing these in parallel would be a welcome improvement.
  7. You will still get some errors and the script will ultimately fail, but this failure happens late enough that the .ttf already exists, so I did not care to investigate further.

@EdgarsJoja
Copy link

EdgarsJoja commented Jul 9, 2024

Seems this is still not fixed - got the same problems while compiling fonts.
In addition, after fixing already mentioned issues by @Greatness7 (import sys, compile-options.json placement), I see another problem:

Error: Undefined variable.
   ╷
46 │ .#{$ti-prefix}-123:before { content: $ti-icon-number-123; }
   │                                      ^^^^^^^^^^^^^^^^^^^
   ╵
  dist/tabler-icons-outline.scss 46:38  root stylesheet
 ELIFECYCLE  Command failed with exit code 65.
 ELIFECYCLE  Command failed with exit code 65.
/usr/src/app/tabler-icons/packages/icons-webfont:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @tabler/[email protected] build: `pnpm run copy && pnpm run build:prepare && pnpm run build:outline && pnpm run build:webfont && pnpm run build:css`
Exit status 65

It looks like aliases.json conflict with compile-options.json "includeIcons" array. For outlined & filled types it seems to correctly only attempt to generate only specified "includeIcons" values. However, for "all" type it tries to generate merged "includeIcons" and values from aliases.json file, even though I don't need those.
Quick semi-fix here is to just add all aliases.json values to "includeIcons" array OR remove aliases from aliases.json file, i.e.:

{
  "outline": {
  },
  "filled": {
  }
}

then build command finished succesfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation needs to be updated pull-request Pull request available support-request Help/support requested
Projects
None yet
Development

No branches or pull requests

3 participants