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

enable mac compatibility #27

Merged
merged 2 commits into from
Nov 27, 2023
Merged

enable mac compatibility #27

merged 2 commits into from
Nov 27, 2023

Conversation

levino
Copy link
Collaborator

@levino levino commented Nov 26, 2023

Based on #25. The apage theme requires an environment variable LANG to be present, which is not the case on MacOS, but probably only on linux. I think that makes the theme essentially broken and we should remove it, until this issue has been fixed.

Summary by CodeRabbit

  • New Features

    • Introduced automated Playwright tests in the CI/CD pipeline for enhanced quality assurance.
  • Chores

    • Removed an unused theme from the application's theme registry.

Copy link

vercel bot commented Nov 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
jsonresume-org-homepage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2023 2:20pm
jsonresume-org-registry ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2023 2:20pm

Copy link
Contributor

coderabbitai bot commented Nov 26, 2023

Walkthrough

The changes involve setting up a GitHub Actions workflow for Playwright tests and modifying the API by removing a theme export. The workflow is configured to run tests on an Ubuntu environment, with steps for setup, dependency installation, and test execution. The API change suggests a cleanup or deprecation of a theme.

Changes

File Path Change Summary
.github/workflows/playwright.yml Added a GitHub Actions workflow for Playwright tests.
apps/.../api/formatters/template.js Removed the export of the apage theme.

🐇✨
In the realm of code, where tests play and dart,
A workflow's born, a CI art.
Themes retreat, as apage departs,
In the commit's wake, a new start. 🚀🌟


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@thomasdavis
Copy link
Member

Yeah happy to just remove apage

the apage theme access process.env in an unsafe way which leads to crashes. removed.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c8b0672 and 21e45c3.
Files ignored due to filter (2)
  • apps/registry/package.json
  • pnpm-lock.yaml
Files selected for processing (2)
  • .github/workflows/playwright.yml (1 hunks)
  • apps/registry/pages/api/formatters/template.js (1 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/playwright.yml
Additional comments: 1
apps/registry/pages/api/formatters/template.js (1)
  • 1-6: The removal of the apage theme from the THEMES object is consistent with the PR's intent to address MacOS compatibility issues.

Comment on lines 1 to 6
export const THEMES = {
ace: require('jsonresume-theme-ace'),
actual: require('jsonresume-theme-actual'),
apage: require('jsonresume-theme-apage'),
autumn: require('jsonresume-theme-autumn'),
caffeine: require('jsonresume-theme-caffeine'),
class: require('jsonresume-theme-class'),
Copy link
Contributor

Choose a reason for hiding this comment

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

The getTheme function should handle the case where a theme is not found in the THEMES object to prevent runtime errors.

const getTheme = (theme) => {
  if (!THEMES[theme]) {
    return {
      error: 'Theme is not supported.',
    };
  }
  try {
    return THEMES[theme];
  } catch (e) {
    return {
      e: e.toString(),
      error: 'Theme is not supported.',
    };
  }
};

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
export const THEMES = {
ace: require('jsonresume-theme-ace'),
actual: require('jsonresume-theme-actual'),
apage: require('jsonresume-theme-apage'),
autumn: require('jsonresume-theme-autumn'),
caffeine: require('jsonresume-theme-caffeine'),
class: require('jsonresume-theme-class'),
export const THEMES = {
ace: require('jsonresume-theme-ace'),
actual: require('jsonresume-theme-actual'),
autumn: require('jsonresume-theme-autumn'),
caffeine: require('jsonresume-theme-caffeine'),
class: require('jsonresume-theme-class'),
}
const getTheme = (theme) => {
if (!THEMES[theme]) {
return {
error: 'Theme is not supported.',
};
}
try {
return THEMES[theme];
} catch (e) {
return {
e: e.toString(),
error: 'Theme is not supported.',
};
}
};

@levino levino added this pull request to the merge queue Nov 27, 2023
Merged via the queue into master with commit 5334e46 Nov 27, 2023
6 checks passed
@levino levino deleted the feature/enable-mac-compatibility branch November 27, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants