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

fix(theme): fix serving and exporting local themes #537

Merged
merged 4 commits into from
Jun 19, 2021

Conversation

XuluWarrior
Copy link
Contributor

@XuluWarrior XuluWarrior commented Mar 15, 2021

Fixes #492, fixes #538.

@@ -5,9 +5,6 @@ describe('renderHTML', () => {
const originalRequireResolve = require.resolve;
const mockThemePath = 'mock/path/to/jsonresume-theme-even';
require.resolve = (...args) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

While writing the new tests, I found that this mock of resolve is not called.
So tests are running against the actual file system.
Possibly the mock can be removed. Or maybe it needs to be fixed.

Copy link

Choose a reason for hiding this comment

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

I propose to write that as a TODO comment instead of leaving as an PR comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The PR comment is an implicit question about what the correct action is.
Any TODO would come from the answer to the question.
And I'm not sure that in code TODOs is the way this project manages future code changes. They may prefer creating a GitHub issue.

@@ -3,7 +3,7 @@ const themeServer =
const fs = require('fs');
const request = require('superagent');
const chalk = require('chalk');
const renderHtml = require('./render-html');
const renderHtml = require('./render-html').default;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This project uses a mix of CommonJS and ES6 modules. This should probably be made consistent to prevent bugs like this.
I won't address it in this PR.

@XuluWarrior XuluWarrior changed the title Fix using local theme from path fix: Fix using local theme from path Mar 15, 2021
@wxsms
Copy link

wxsms commented Mar 16, 2021

This solution works. thank you.

@@ -43,5 +40,20 @@ describe('renderHTML', () => {
'<!doctype html>',
);
});

it('should reject theme with invalid path', async () => {
Copy link

@paskal paskal Mar 17, 2021

Choose a reason for hiding this comment

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

According to what we see, currently, we don't test the theme with valid path, I wonder if that can be tested as well: some test which would be red without your alterations and green after them.

Copy link
Contributor Author

@XuluWarrior XuluWarrior Mar 17, 2021

Choose a reason for hiding this comment

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

The test below ('with local theme path') is a valid path.
It would fail pre my changes.

Copy link

Choose a reason for hiding this comment

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

My bad, I've missed that one. Looks good!

@neviaumi
Copy link

Can i kwon will it merge soon ?

@michaltalaga
Copy link

bump

@XuluWarrior
Copy link
Contributor Author

Are there any project maintainers about to review/comment on this PR? I see that there haven't been any merges for a few months.

@VCNinc
Copy link

VCNinc commented Apr 6, 2021

Is this project abandoned?

@VCNinc
Copy link

VCNinc commented Apr 6, 2021

@thomasdavis

@alexkreidler
Copy link

I'm getting TypeError: renderHtml is not a function, it seems like this PR would fix that.

It would be great to get this merged. I'll ping the top commiters, so those who have commit rights and some free time can take a look: @rolandnsharp @thomasdavis @PeterDaveHello @rbardini @erming @antialias

Also if someone has time to run upgrade-interactive to bump the dependencies then you can close all the dependabot PRs.

Thanks all for this project!

@paskal
Copy link

paskal commented Jun 9, 2021

@nhymxu
Copy link

nhymxu commented Jun 16, 2021

I don't have problem with local theme.
Just problem with const renderHtml = require('./render-html').default;

So, for clear and small PR. Should we split to two PR?

@XuluWarrior
Copy link
Contributor Author

So now @paskal has approved this PR what is the next step?
Does it require further approval?
Or somebody with merge rights to do the merge?

@paskal
Copy link

paskal commented Jun 17, 2021

I am no one here. Someone from the list above needs to approve and merge it.

@rbardini rbardini changed the title fix: Fix using local theme from path fix(theme): fix serving and exporting local themes Jun 19, 2021
@rbardini rbardini merged commit 16eae28 into jsonresume:master Jun 19, 2021
@github-actions
Copy link

🎉 This PR is included in version 3.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rbardini
Copy link
Contributor

Thanks @XuluWarrior for fixing this, and sorry everyone for the delay! As a side note, I've been writing an alternative JSON Resume builder from scratch that I hope might shape the future of resume-cli, in case anyone wants to give it a try 🙂

XuluWarrior added a commit to XuluWarrior/jsonresume-theme-orbit that referenced this pull request Sep 1, 2023
Issue with not loading local themes is now fixed
jsonresume/resume-cli#537
XuluWarrior added a commit to XuluWarrior/jsonresume-theme-orbit that referenced this pull request Sep 23, 2023
XuluWarrior added a commit to XuluWarrior/jsonresume-theme-orbit-original that referenced this pull request Sep 23, 2023
Issue with not loading local themes is now fixed jsonresume/resume-cli#537
XuluWarrior added a commit to XuluWarrior/jsonresume-theme-orbit that referenced this pull request Sep 23, 2023
Issue with not loading local themes is now fixed
jsonresume/resume-cli#537
XuluWarrior added a commit to XuluWarrior/jsonresume-theme-kards that referenced this pull request Sep 23, 2023
Issue with not loading local themes is now fixed
jsonresume/resume-cli#537
thomasdavis added a commit that referenced this pull request Apr 3, 2024
thomasdavis added a commit that referenced this pull request Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Local themes broken again v3.0.3+: Can't serve resume from local theme
9 participants