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

feat: tailwind -> unocss #866

Merged
merged 68 commits into from
Sep 3, 2024
Merged

feat: tailwind -> unocss #866

merged 68 commits into from
Sep 3, 2024

Conversation

ryoppippi
Copy link
Owner

@ryoppippi ryoppippi commented Aug 8, 2024

switch from tailwindcss to unocss

Summary by CodeRabbit

  • New Features

    • Introduced a new ProgressBar component for rendering progress bars.
    • Updated Skills.svelte to use string identifiers for icons, enhancing maintainability.
  • Improvements

    • Streamlined CI workflow and pre-push checks for more efficient linting.
    • Enhanced styling approach with the adoption of UnoCSS and attribute-based styling.
  • Bug Fixes

    • Improved error handling in blog loading logic to ensure proper file existence checks.
  • Refactor

    • Transitioned multiple components to TypeScript for better type safety.
    • Simplified icon handling across various components by replacing component imports with string identifiers.
    • Restructured navigation and layout components for improved clarity and maintainability.
    • Updated the rendering logic in components to utilize a more semantic and attribute-based approach.
  • Chores

    • Updated dependencies to the latest versions for improved performance and security.
    • Removed unnecessary files and imports to declutter the codebase.

Copy link

cloudflare-workers-and-pages bot commented Aug 8, 2024

Deploying ryoppippi-com with  Cloudflare Pages  Cloudflare Pages

Latest commit: 328bfed
Status:⚡️  Build in progress...

View logs

@ryoppippi ryoppippi force-pushed the feature/remove-tailwind branch 4 times, most recently from 56d6648 to 6f1105f Compare August 9, 2024 10:13
@ryoppippi ryoppippi force-pushed the feature/remove-tailwind branch 4 times, most recently from ff49e10 to 55908cc Compare August 9, 2024 10:34
Copy link

coderabbitai bot commented Aug 27, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The changes encompass updates to the pre-push hook, CI workflow, ESLint configuration, package dependencies, and various Svelte components. Key modifications include conditional linting in the pre-push hook, consolidation of CI jobs, simplification of icon usage, transition to TypeScript in several components, and refinement of component structures. Additionally, new configuration files for UnoCSS and updates to the Vite configuration reflect a shift towards utility-first CSS styling. These adjustments aim to streamline development and improve maintainability.

Changes

Files Change Summary
.githooks/pre-push, .github/workflows/ci.yaml, .tool-versions Introduced conditional linting in pre-push, consolidated CI jobs, and updated tool versions for bun and nodejs.
eslint.config.js Modified ESLint configuration to disable Tailwind CSS rules.
package.json Updated dependencies, removed some, and modified scripts for linting and formatting.
src/app.d.ts Removed import statement for unplugin-icons/types/svelte.
src/lib/Chip.svelte, src/lib/ChipList.svelte, src/lib/Nav.svelte, src/lib/TimelineItem.svelte, src/lib/Social.svelte Changed icon handling from component imports to string identifiers, simplifying component structures.
src/lib/Profile.svelte Transitioned to TypeScript and simplified component structure by removing unused styles.
src/routes/+error.svelte, src/routes/+layout.svelte, src/routes/+page.svelte, src/routes/blog/+page.svelte Simplified markup and updated styling approaches across various components.
src/routes/blog/[slug]/+page.server.ts Modified file handling logic in the load function for improved error management.
src/routes/me/Education.svelte, src/routes/me/Experience.svelte, src/routes/me/Skills.svelte Updated icon references to string literals and transitioned to TypeScript for better type safety.
src/shims.d.ts Introduced TypeScript declarations for Attributify attributes.
svelte.config.js Refined development environment handling and asset path configuration.
uno.config.ts New configuration for UnoCSS with theme extensions and presets.
vite.config.ts Updated Vite configuration to remove Icons plugin and add UnoCSS plugin for utility-first styling.
src/routes/me/+page.server.ts, src/routes/works/+page.server.ts Implemented server-side load functions to return 301 redirect responses for specified routes.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant PrePushHook
    participant CIWorkflow
    participant Git
    participant ToolVersions

    Developer->>PrePushHook: Push changes
    PrePushHook->>PrePushHook: Check staged files
    PrePushHook->>CIWorkflow: Run linting if files present
    CIWorkflow->>Git: Push to remote repository
    ToolVersions->>CIWorkflow: Use updated tool versions
Loading

🐇 In the meadow so bright,
Changes hop with delight,
Linting checks now more wise,
Icons dance in new guise!
TypeScript brings a fresh cheer,
Utility styles, oh dear!
Let's celebrate, with a hop and a twirl! 🌼

Tip

We have updated our review workflow to use the Anthropic's Claude family of models. Please share any feedback in the discussion post on our Discord.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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.

Actionable comments posted: 4

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 48ff284 and 5804acc.

Files ignored due to path filters (2)
  • bun.lockb is excluded by !**/bun.lockb
  • devbox.lock is excluded by !**/*.lock
Files selected for processing (28)
  • .githooks/pre-push (1 hunks)
  • .github/workflows/ci.yaml (1 hunks)
  • .tool-versions (1 hunks)
  • eslint.config.js (1 hunks)
  • package.json (1 hunks)
  • src/app.d.ts (1 hunks)
  • src/lib/Chip.svelte (2 hunks)
  • src/lib/ChipList.svelte (1 hunks)
  • src/lib/Nav.svelte (1 hunks)
  • src/lib/Profile.svelte (1 hunks)
  • src/lib/Social.svelte (1 hunks)
  • src/lib/Timeline.svelte (1 hunks)
  • src/lib/TimelineItem.svelte (2 hunks)
  • src/lib/markdown.server.ts (4 hunks)
  • src/routes/+error.svelte (1 hunks)
  • src/routes/+layout.svelte (2 hunks)
  • src/routes/+page.svelte (1 hunks)
  • src/routes/blog/+page.svelte (2 hunks)
  • src/routes/blog/[slug]/+page.server.ts (1 hunks)
  • src/routes/blog/[slug]/+page.svelte (1 hunks)
  • src/routes/me/Education.svelte (1 hunks)
  • src/routes/me/Experience.svelte (2 hunks)
  • src/routes/me/ProgressBar.svelte (1 hunks)
  • src/routes/me/Skills.svelte (2 hunks)
  • src/shims.d.ts (1 hunks)
  • svelte.config.js (2 hunks)
  • uno.config.ts (1 hunks)
  • vite.config.ts (2 hunks)
Files skipped from review due to trivial changes (5)
  • .tool-versions
  • src/app.d.ts
  • src/lib/ChipList.svelte
  • src/lib/Timeline.svelte
  • src/shims.d.ts
Additional context used
actionlint
.github/workflows/ci.yaml

25-25: shellcheck reported issue in this script: SC2035:info:1:16: Use ./glob or -- glob so names with dashes won't become options

(shellcheck)

Additional comments not posted (73)
src/routes/me/ProgressBar.svelte (4)

1-1: LGTM!

The <script> tag is correctly opened.

The code changes are approved.


2-2: Verify the usage of props.

The destructuring of $props() is correct, but ensure that all necessary props are being passed down.

Please verify that all necessary props are being passed down correctly.


3-3: LGTM!

The <script> tag is correctly closed.

The code changes are approved.


4-4: LGTM!

The usage of the spread operator for props in the <progress> tag is correct.

The code changes are approved.

eslint.config.js (4)

1-1: LGTM!

The import statement is correct.

The code changes are approved.


2-2: LGTM!

The export statement is correct.

The code changes are approved.


4-4: LGTM!

The tailwind option has been correctly changed from true to false to reflect the transition from Tailwind CSS to Unocss.

The code changes are approved.


5-7: LGTM!

The TypeScript configuration remains unchanged and is correct.

The code changes are approved.

src/routes/+error.svelte (6)

1-1: LGTM!

The import statement is correct.

The code changes are approved.


4-4: LGTM!

The opening <div> tag with classes for styling is correct.

The code changes are approved.


6-6: LGTM!

The display of $page.url is correct.

The code changes are approved.


7-7: LGTM!

The display of $page.status is correct.

The code changes are approved.


8-8: LGTM!

The <hr> tag with classes for styling is correct.

The code changes are approved.


9-9: LGTM!

The <a> tag with classes for styling and link to home is correct.

The code changes are approved.

src/lib/Profile.svelte (3)

1-1: LGTM!

The script tag has been correctly updated to use TypeScript.

The code changes are approved.


2-2: LGTM!

The constant name is correctly defined using template literals.

The code changes are approved.


10-10: LGTM!

The class attribute has been correctly updated to use a more concise syntax for responsive design.

The code changes are approved.

.githooks/pre-push (4)

3-4: LGTM!

The script correctly retrieves a list of staged files.

The code changes are approved.


6-8: LGTM!

The script correctly runs secretlint only if there are relevant files.

The code changes are approved.


9-9: LGTM!

The script correctly runs bun lint on the relevant files.

The code changes are approved.


10-10: LGTM!

The script correctly runs bun check as part of the pre-push process.

The code changes are approved.

src/lib/Chip.svelte (3)

11-11: LGTM!

The icon property type has been correctly changed from ConstructorOfATypedSvelteComponent to string.

The code changes are approved.


20-20: LGTM!

The comment to ignore the potential linting warning is appropriate.

The code changes are approved.


22-22: LGTM!

The rendering logic has been correctly updated to use a standard HTML <div> element with a class name derived from the icon string.

The code changes are approved.

src/routes/+page.svelte (2)

14-32: Validate the new attributes.

Ensure that the new attributes are correctly applied and recognized by the framework.

Run the following script to validate the new attributes:


6-12: Ensure consistency of the attribute-based approach.

Verify that the new attribute-based approach is consistently applied throughout the codebase.

Run the following script to verify consistency:

src/routes/blog/+page.svelte (3)

12-17: LGTM!

The new class attributes use a more concise syntax, enhancing readability and potentially performance.

The code changes are approved.


19-26: LGTM!

The new shorthand format simplifies the styling while maintaining the same functionality.

The code changes are approved.


29-35: LGTM!

The change in rendering the external link icon to a self-closing <div> with specific attributes suggests a shift in how the icon is displayed or styled, potentially improving performance.

The code changes are approved.

src/lib/markdown.server.ts (2)

21-21: LGTM!

The new function signature consolidates overloads and simplifies the interface, allowing it to accept an optional options parameter without specific handling for the parseContent flag.

The code changes are approved.


Line range hint 31-44: LGTM! But verify the function usage in the codebase.

The function now consistently returns an object that includes the parsed content, regardless of the options passed. Ensure that all function calls to parseMarkdown are updated to handle this change.

The code changes are approved.

Run the following script to verify the function usage:

src/lib/TimelineItem.svelte (2)

13-13: LGTM!

The new type enhances the flexibility of the icon property, allowing for a broader range of icon representations.

The code changes are approved.


26-26: LGTM!

The change simplifies the rendering logic and improves performance by reducing the overhead associated with component instantiation.

The code changes are approved.

uno.config.ts (4)

1-10: LGTM!

The imports are correctly implemented.

The code changes are approved.


12-21: LGTM!

The configuration object is correctly defined and includes necessary presets and transformers.

The code changes are approved.


22-50: LGTM!

The theme extension is correctly implemented and includes custom colors and breakpoints.

The code changes are approved.


51-54: LGTM!

The rules and shortcuts arrays are correctly defined but currently empty.

The code changes are approved.

src/routes/me/Education.svelte (5)

9-9: LGTM!

The icon reference is correctly changed to a string literal 'i-mdi:academic-cap'.

The code changes are approved.


12-12: LGTM!

The icon reference is correctly changed to a string literal 'i-mdi:academic-cap'.

The code changes are approved.


17-17: LGTM!

The icon reference is correctly changed to a string literal 'i-mdi:academic-cap'.

The code changes are approved.


24-24: LGTM!

The icon reference is correctly changed to a string literal 'i-mdi:academic-cap'.

The code changes are approved.


30-30: LGTM!

The icon reference is correctly changed to a string literal 'i-mdi:academic-cap'.

The code changes are approved.

vite.config.ts (3)

8-8: LGTM!

The import is correctly implemented.

The code changes are approved.


9-9: LGTM!

The import is correctly implemented.

The code changes are approved.


40-44: LGTM!

The UnoCSS plugin is correctly added and configured with the necessary extractors.

The code changes are approved.

src/lib/Nav.svelte (4)

6-9: LGTM!

The changes to the LINKS array improve semantic clarity and are correctly implemented.

The code changes are approved.


13-32: LGTM!

The changes to the <header> element and its children enhance readability and maintainability by using a more declarative approach to styling.

The code changes are approved.


32-53: LGTM!

The changes to the <nav> element and its children enhance readability and maintainability by using a more declarative approach to styling and destructuring.

The code changes are approved.


54-67: LGTM!

The changes to the CV download button enhance readability and maintainability by using a more declarative approach to styling and simplifying the icon representation.

The code changes are approved.

src/routes/+layout.svelte (3)

2-3: LGTM!

The changes to the import statements indicate a shift towards a utility-first CSS approach, which can enhance styling flexibility and maintainability.

The code changes are approved.


63-67: LGTM!

The changes to the <main> element enhance the clarity of the component's markup and facilitate future modifications.

The code changes are approved.


76-82: LGTM!

The addition of global styles can improve the user experience by ensuring consistent styling across the application.

The code changes are approved.

src/lib/Social.svelte (2)

8-14: LGTM!

The changes to the ICONS array simplify the component by removing the need for multiple imports and enhance flexibility in icon styling through CSS classes.

The code changes are approved.


18-32: LGTM!

The changes to the <article> element enhance flexibility in icon styling and potentially improve performance by reducing the overhead associated with component instantiation.

The code changes are approved.

svelte.config.js (4)

1-5: LGTM!

The import statements are correctly importing the required modules.

The code changes are approved.


Line range hint 15-22: LGTM!

The vitePlugin configuration is correctly set up to use the inspector in development and force runes for user scripts.

The code changes are approved.


31-34: LGTM!

The TypeScript configuration correctly includes uno.config.ts.

The code changes are approved.


40-48: LGTM!

The asset paths configuration correctly handles different environments and deployment branches.

The code changes are approved.

.github/workflows/ci.yaml (4)

7-9: LGTM!

The environment variables BUN_VERSION and NODE_VERSION are correctly defined to enhance configurability.

The code changes are approved.


18-20: LGTM!

The setup-node action is correctly configured to use the NODE_VERSION environment variable.

The code changes are approved.


23-24: LGTM!

The Bun setup step is correctly configured to use the BUN_VERSION environment variable and the --frozen-lockfile option ensures adherence to the lockfile.

The code changes are approved.


26-26: LGTM!

The bun sync step is correctly added to enhance dependency management.

The code changes are approved.

package.json (4)

18-18: LGTM!

The modification to use nr instead of npm run in the format script is correct and aligns with the project's command-line tool usage.

The code changes are approved.


19-21: LGTM!

The prepare script is correctly configured to include necessary preparation steps.

The code changes are approved.


24-77: LGTM!

The updates to the devDependencies section are correct and ensure compatibility with the latest tools and libraries.

The code changes are approved.


Line range hint 79-83: LGTM!

The trustedDependencies section is correctly configured to include necessary trusted packages.

The code changes are approved.

src/routes/me/Skills.svelte (4)

1-1: LGTM!

The update to use TypeScript enhances type safety and tooling support.

The code changes are approved.


2-2: LGTM!

The modification of the import path for the ProgressBar component to a relative path suggests a restructuring of the project or a move towards more localized component management.

The code changes are approved.


4-45: LGTM!

The redefinition of the contents object with updated icon references and the use of the satisfies operator enhances maintainability and type safety.

The code changes are approved.


61-62: LGTM!

The update to the rendering logic to accommodate the new icon references simplifies the rendering process and may improve performance by avoiding the overhead associated with component instantiation for icons.

The code changes are approved.

src/routes/me/Experience.svelte (3)

1-1: LGTM!

The update to use TypeScript enhances type safety and tooling support.

The code changes are approved.


10-10: LGTM!

The modification of the items object declaration to use TypeScript's satisfies operator ensures that it conforms to the specified type, enhancing type safety.

The code changes are approved.


21-72: LGTM!

The change to use string identifiers for icons simplifies the icon integration process, potentially improving maintainability and readability of the code.

The code changes are approved.

}

const mdRaw = await fs.readFile(filePath, 'utf-8');
Copy link

Choose a reason for hiding this comment

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

Add error handling for fs.readFile.

The fs.readFile call should handle errors to ensure robustness.

Apply this diff to add error handling:

-const mdRaw = await fs.readFile(filePath, 'utf-8');
+let mdRaw;
+try {
+  mdRaw = await fs.readFile(filePath, 'utf-8');
+} catch (err) {
+  return error(500, 'Error reading file');
+}
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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const mdRaw = await fs.readFile(filePath, 'utf-8');
let mdRaw;
try {
mdRaw = await fs.readFile(filePath, 'utf-8');
} catch (err) {
return error(500, 'Error reading file');
}

if (!meta.isPublished) {
throw new Error('Post not found');
}
const filePath = path.resolve(import.meta.dirname, `../../../posts/${slug}.md`);
Copy link

Choose a reason for hiding this comment

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

Fix incorrect use of import.meta.dirname.

Replace import.meta.dirname with path.dirname(import.meta.url) to correctly resolve the directory name.

Apply this diff to fix the issue:

-const filePath = path.resolve(import.meta.dirname, `../../../posts/${slug}.md`);
+const filePath = path.resolve(path.dirname(import.meta.url), `../../../posts/${slug}.md`);
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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const filePath = path.resolve(import.meta.dirname, `../../../posts/${slug}.md`);
const filePath = path.resolve(path.dirname(import.meta.url), `../../../posts/${slug}.md`);

<div class='prose'>
{@html data.content}
<div text-text-100>
<Markdown md={data.content} />
Copy link

Choose a reason for hiding this comment

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

Add error handling for the Markdown component.

Ensure that the Markdown component can handle potential errors in the Markdown content.

Apply this diff to add error handling:

<div text-text-100>
-  <Markdown md={data.content} />
+  <Markdown md={data.content} on:error={(e) => console.error(e.detail)} />
</div>

Committable suggestion was skipped due to low confidence.

@@ -1,23 +1,29 @@
<script>
import Markdown from 'svelte-exmarkdown';
Copy link

Choose a reason for hiding this comment

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

Validate data.title and data.pubDate.

Ensure that data.title and data.pubDate are valid before using them.

Apply this diff to add validation:

<script>
  import Markdown from 'svelte-exmarkdown';
  import { formatDate } from '$lib/util.js';

  const { data } = $props();

+  if (!data.title || !data.pubDate) {
+    throw new Error('Invalid data');
+  }
</script>

Committable suggestion was skipped due to low confidence.

Copy link

@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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5804acc and dd01ffa.

Files ignored due to path filters (1)
  • bun.lockb is excluded by !**/bun.lockb
Files selected for processing (4)
  • package.json (1 hunks)
  • src/lib/Nav.svelte (1 hunks)
  • src/routes/+layout.svelte (2 hunks)
  • vite.config.ts (2 hunks)
Files skipped from review as they are similar to previous changes (3)
  • src/lib/Nav.svelte
  • src/routes/+layout.svelte
  • vite.config.ts
Additional comments not posted (16)
package.json (16)

18-18: Verify the correctness of the nr command.

The format script has been modified to use the nr command instead of npm run. Ensure that the nr command is a valid alias or a custom tool intended for this purpose. If it's a typo, please correct it.


25-25: Looks good!

The @iconify-json/akar-icons dependency has been updated to the latest minor version. This should bring in the latest features and bug fixes without introducing any breaking changes.


26-26: Looks good!

The @iconify-json/devicon-plain dependency has been updated to the latest minor version. This should bring in the latest features and bug fixes without introducing any breaking changes.


27-27: Looks good!

The @iconify-json/fa-solid dependency has been updated to the latest minor version. This should bring in the latest features and bug fixes without introducing any breaking changes.


40-40: Looks good!

The @sveltejs/adapter-auto dependency has been updated to the latest patch version. This should bring in bug fixes and minor improvements without introducing any breaking changes.


41-41: Looks good!

The @sveltejs/adapter-static dependency has been updated to the latest patch version. This should bring in bug fixes and minor improvements without introducing any breaking changes.


42-42: Looks good!

The @sveltejs/enhanced-img dependency has been updated to the latest patch version. This should bring in bug fixes and minor improvements without introducing any breaking changes.


53-53: Verify compatibility with the project's ESLint configuration.

The eslint dependency has been updated to the latest minor version. This should bring in new features, improvements, and bug fixes. However, please ensure that the new version is compatible with the project's existing ESLint configuration and rules. Run the linter and check for any new warnings or errors.


55-55: Verify compatibility with the project's ESLint configuration.

The eslint-plugin-svelte dependency has been updated to the latest minor version. This should bring in new features, improvements, and bug fixes. However, please ensure that the new version is compatible with the project's existing ESLint configuration and rules. Run the linter and check for any new warnings or errors related to Svelte code.


63-63: Thoroughly test the application with the updated Svelte version.

The svelte dependency has been updated to a newer pre-release version of Svelte 5. This update may introduce new features, improvements, and bug fixes. However, as it is a pre-release version, there is a higher risk of breaking changes or compatibility issues with other dependencies.

Please thoroughly test the application to ensure that all features work as expected and there are no regressions or compatibility problems with the updated Svelte version. Pay special attention to any Svelte-specific code, such as components, bindings, and transitions.


64-64: Looks good!

The svelte-check dependency has been updated to the latest patch version. This should bring in bug fixes and minor improvements without introducing any breaking changes.


71-71: Looks good!

The typescript dependency has been updated to the latest patch version. This should bring in bug fixes and minor improvements without introducing any breaking changes.


73-73: Verify compatibility with the project's TypeScript setup.

The typia dependency has been updated to the latest minor version. This should bring in new features, improvements, and bug fixes. However, please ensure that the new version is compatible with the project's existing TypeScript setup and type definitions. Run the type checker and check for any new type errors or warnings.


74-74: Looks good!

The ufo dependency has been updated to the latest patch version. This should bring in bug fixes and minor improvements without introducing any breaking changes.


76-76: Test the build process and development workflow with the updated Vite version.

The vite dependency has been updated to the latest minor version. This update may introduce new features, improvements, and bug fixes. As Vite is the build tool and development server for the project, it's important to ensure that the update doesn't introduce any breaking changes or compatibility issues.

Please test the following with the updated Vite version:

  1. Run the development server and verify that the application works as expected, including hot module replacement and live reloading.
  2. Build the application for production and ensure that the generated output is correct and optimized.
  3. Check for any new warnings or errors during the build process or in the browser console.

If you encounter any issues, please investigate and consider rolling back the update if necessary.


39-39: Provide more information about the dependency replacement.

The @skeletonlabs/skeleton dependency has been replaced with @std/collections. This change suggests a shift in the project's design or functionality requirements. Replacing a dependency with another one may introduce breaking changes and require modifications to the codebase.

Please provide more information about the following:

  1. What is the reason for replacing @skeletonlabs/skeleton with @std/collections? What benefits does @std/collections offer over @skeletonlabs/skeleton?
  2. What is the impact of this replacement on the codebase? Are there any breaking changes or required modifications to the code that uses `@skeletonl

This commit adds @antfu/ni to devDependencies in package.json and
updates the "format" and "prepare" scripts. The bun.lockb file is also
updated to reflect these changes.
The prepare script in package.json has been refactored for better
readability and maintainability. The tasks are now split into separate
scripts: prepare:typia and prepare:githooks. This change should make it
easier to understand what each part of the prepare script is doing.
The script tag in Profile.svelte has been refactored to use TypeScript.
The constant 'name' is now defined using backticks instead of single quotes.
The styles previously present in the file have been removed entirely.
This commit represents a significant simplification of the file.
The Vite configuration has been updated. The `UnpluginTypia` and
`UnoCSS`
plugins have been reordered, and the `cache` option has been removed
from
`UnpluginTypia`. The `Icons` plugin configuration has been reformatted
for
better readability.
This commit updates the `svelte.config.js` file. The `dev` constant was
removed and `isDevelopment` is used directly instead. The `assets` path
now checks if the environment is development or production and sets the
path accordingly. If it's the main branch in production, it sets the path
to `https:///vim-jp-radio.com`. Otherwise, it uses `CF_PAGES_URL`.
This commit replaces the icon components in Social.svelte with
corresponding class names. This change simplifies the code and
improves maintainability. The icon components were replaced with
their corresponding class names in the ICONS array.
The `icon` prop in `TimelineItem.svelte` has been changed from a Svelte
component to a string. This change simplifies the usage of `TimelineItem`
by allowing the use of icon classes instead of importing and passing
Svelte components. The `Experience.svelte` file has been updated to
reflect this change.
The IconAcademicCap import has been removed and replaced with a string
icon 'i-mdi:academic-cap'. This change simplifies the icon usage in the
TimelineItem components within the Education.svelte file.
In both Chip.svelte and ChipList.svelte, the `icon` prop has been
changed from a Svelte component to a string. This change simplifies
the usage of the `icon` prop and allows for more flexibility in
icon usage. The icon string is now used as a class name in a div
element.
Copy link

@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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between dd01ffa and a036525.

Files selected for processing (3)
  • src/lib/Nav.svelte (1 hunks)
  • src/routes/me/+page.server.ts (1 hunks)
  • src/routes/works/+page.server.ts (1 hunks)
Files skipped from review due to trivial changes (2)
  • src/routes/me/+page.server.ts
  • src/routes/works/+page.server.ts
Files skipped from review as they are similar to previous changes (1)
  • src/lib/Nav.svelte

@ryoppippi ryoppippi force-pushed the feature/remove-tailwind branch from a036525 to 27946be Compare September 3, 2024 12:38
Copy link

socket-security bot commented Sep 3, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@antfu/ni@0.22.4 environment, filesystem, shell 0 440 kB antfu
npm/@types/fs-extra@11.0.4 None +1 42.5 kB types
npm/@types/node@20.16.3 None +1 2.26 MB types
npm/@unocss/extractor-svelte@0.62.3 None 0 3.09 kB antfu
npm/@unocss/reset@0.62.3 None 0 43.9 kB antfu
npm/fs-extra@11.2.0 Transitive: environment, filesystem +3 112 kB ryanzim
npm/reading-time@1.5.0 None 0 10.2 kB ngryman
npm/svelte-exmarkdown@3.0.5 Transitive: environment +74 2.97 MB ssssota
npm/unocss@0.62.3 Transitive: environment, filesystem, network, shell, unsafe +188 309 MB antfu
npm/vite-plugin-favicons@0.1.4 Transitive: environment +2 269 kB ryoppippi

🚮 Removed packages: npm/@types/node@22.5.2), npm/ts-node@10.9.2)

View full report↗︎

@ryoppippi ryoppippi force-pushed the feature/remove-tailwind branch from 318fa6b to db5653b Compare September 3, 2024 12:48
@ryoppippi ryoppippi force-pushed the feature/remove-tailwind branch from 097ccf5 to 4babc2f Compare September 3, 2024 13:06
Copy link

@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.

Actionable comments posted: 1

Outside diff range, codebase verification and nitpick comments (2)
src/lib/markdown.server.ts (1)

44-44: Consider conditionally including the content property in the return value.

Always including the content property in the return value may not be necessary if options?.parseContent is set to false.

Apply this diff to conditionally include the content property:

-return { ...item, content };
+return options?.parseContent ? { ...item, content } : item;
.github/workflows/ci.yaml (1)

7-9: Consider using specific versions for BUN_VERSION and NODE_VERSION.

Using latest and lts/* may lead to unexpected behavior if new versions introduce breaking changes. For better reproducibility, consider using specific versions.

env:
-  BUN_VERSION: latest
+  BUN_VERSION: 0.6.7
-  NODE_VERSION: lts/*  
+  NODE_VERSION: 18.16.0
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a036525 and 4babc2f.

Files ignored due to path filters (1)
  • bun.lockb is excluded by !**/bun.lockb
Files selected for processing (28)
  • .github/workflows/ci.yaml (1 hunks)
  • eslint.config.js (1 hunks)
  • package.json (1 hunks)
  • src/app.d.ts (1 hunks)
  • src/lib/Chip.svelte (2 hunks)
  • src/lib/ChipList.svelte (1 hunks)
  • src/lib/Nav.svelte (1 hunks)
  • src/lib/Profile.svelte (1 hunks)
  • src/lib/Social.svelte (1 hunks)
  • src/lib/Timeline.svelte (1 hunks)
  • src/lib/TimelineItem.svelte (2 hunks)
  • src/lib/markdown.server.ts (4 hunks)
  • src/routes/+error.svelte (1 hunks)
  • src/routes/+layout.svelte (3 hunks)
  • src/routes/+page.svelte (1 hunks)
  • src/routes/blog/+page.svelte (2 hunks)
  • src/routes/blog/[slug]/+page.server.ts (1 hunks)
  • src/routes/blog/[slug]/+page.svelte (1 hunks)
  • src/routes/me/+page.server.ts (1 hunks)
  • src/routes/me/Education.svelte (1 hunks)
  • src/routes/me/Experience.svelte (2 hunks)
  • src/routes/me/ProgressBar.svelte (1 hunks)
  • src/routes/me/Skills.svelte (2 hunks)
  • src/routes/works/+page.server.ts (1 hunks)
  • src/shims.d.ts (1 hunks)
  • svelte.config.js (2 hunks)
  • uno.config.ts (1 hunks)
  • vite.config.ts (2 hunks)
Files skipped from review due to trivial changes (6)
  • src/app.d.ts
  • src/lib/ChipList.svelte
  • src/lib/Timeline.svelte
  • src/routes/me/+page.server.ts
  • src/routes/me/Education.svelte
  • src/shims.d.ts
Files skipped from review as they are similar to previous changes (15)
  • src/lib/Chip.svelte
  • src/lib/Nav.svelte
  • src/lib/Profile.svelte
  • src/lib/Social.svelte
  • src/lib/TimelineItem.svelte
  • src/routes/+layout.svelte
  • src/routes/+page.svelte
  • src/routes/blog/+page.svelte
  • src/routes/blog/[slug]/+page.server.ts
  • src/routes/blog/[slug]/+page.svelte
  • src/routes/me/Experience.svelte
  • src/routes/me/ProgressBar.svelte
  • src/routes/works/+page.server.ts
  • svelte.config.js
  • uno.config.ts
Additional context used
actionlint
.github/workflows/ci.yaml

25-25: shellcheck reported issue in this script: SC2035:info:1:16: Use ./glob or -- glob so names with dashes won't become options

(shellcheck)

Additional comments not posted (24)
eslint.config.js (2)

4-4: LGTM!

Setting tailwind to false aligns with the PR objective of transitioning from Tailwind CSS to Unocss.


5-5: LGTM!

Setting svelte to true ensures that Svelte-specific linting rules are applied, which is necessary for a project using Svelte.

src/routes/+error.svelte (1)

5-15: LGTM!

The code changes are approved. The updated component structure and styling are consistent with the transition to Unocss. The plain text display of error information simplifies the user interface compared to the previous version that used a CodeBlock component. The horizontal rule and link to return to the home page are appropriate for an error page.

src/lib/markdown.server.ts (2)

1-1: LGTM!

The code change is approved.


21-21: Verify the impact of the function signature changes.

Ensure that all calls to parseMarkdown are updated to match the new signature.

Run the following script to verify the function usage:

Additionally, consider updating the return type to conditionally include the content property based on the value of parseContent:

-export function parseMarkdown<T extends boolean>(filepath: string, contentRaw: string, options?: { parseContent?: T; }): (Item & { content: string }) {
+export function parseMarkdown<T extends boolean>(filepath: string, contentRaw: string, options?: { parseContent?: T; }): (Item & (T extends true ? { content: string } : {})) {
Verification successful

Function signature changes are compatible with existing calls.

The existing calls to parseMarkdown are compatible with the updated function signature. Consider updating the return type to conditionally include the content property based on the parseContent option:

-export function parseMarkdown<T extends boolean>(filepath: string, contentRaw: string, options?: { parseContent?: T; }): (Item & { content: string }) {
+export function parseMarkdown<T extends boolean>(filepath: string, contentRaw: string, options?: { parseContent?: T; }): (Item & (T extends true ? { content: string } : {})) {

This change would enhance type safety by reflecting the actual structure of the returned object based on the options provided.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `parseMarkdown` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type typescript -A 5 $'parseMarkdown'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify all function calls to `parseMarkdown` match the new signature.

# Test: Search for the function usage without specifying the file type.
rg -A 5 'parseMarkdown'

Length of output: 1650

vite.config.ts (4)

9-11: LGTM!

The code changes are approved.


20-27: LGTM!

The code changes are approved.


7-8: Verify the removal of cloudflareRedirect plugin usage.

The import statement for cloudflareRedirect has been commented out.

Run the following script to verify that the plugin is no longer being used in the configuration:

Verification successful

The cloudflareRedirect plugin is no longer in use.

Both the import statement and the usage of the cloudflareRedirect plugin are commented out in the vite.config.ts file, indicating that the plugin is not active in the current configuration.

  • vite.config.ts: Lines where cloudflareRedirect is commented out.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that `cloudflareRedirect` plugin is no longer being used.

# Test: Search for the plugin usage. Expect: No occurrences.
rg --type typescript $'cloudflareRedirect'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify that `cloudflareRedirect` plugin is no longer being used.

# Test: Search for the plugin usage. Expect: No occurrences.
rg 'cloudflareRedirect'

Length of output: 163


34-41: Verify the impact of removing the cache option from the UnpluginTypia plugin configuration.

The cache option has been removed from the UnpluginTypia plugin configuration. This may impact how caching is managed during builds.

Run the following script to verify the impact of removing the cache option:

LGTM for the addition of the UnoCSS plugin and its associated extractor for Svelte!

The code changes are approved.

Verification successful

No issues found with the removal of the cache option from the UnpluginTypia plugin configuration.

The UnpluginTypia plugin is only configured in vite.config.ts with the log: 'verbose' option, and there are no other occurrences in the codebase. The removal of the cache option appears to be intentional and does not seem to impact the build process adversely.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing the `cache` option from the `UnpluginTypia` plugin configuration.

# Test: Search for the `UnpluginTypia` plugin usage in the codebase. Expect: Only occurrences with the new configuration.
rg --type typescript $'UnpluginTypia'

Length of output: 71


Script:

#!/bin/bash
# Description: Verify the impact of removing the `cache` option from the `UnpluginTypia` plugin configuration.

# Test: Search for the `UnpluginTypia` plugin usage in TypeScript files in the codebase.
rg --type ts 'UnpluginTypia'

Length of output: 155

.github/workflows/ci.yaml (5)

12-12: LGTM!

The job name change from lint to ci is approved. The new name is more appropriate for a job that performs multiple tasks.


18-20: LGTM!

The addition of the Node.js setup step using the actions/setup-node action is approved. It is necessary for running Node.js-based tools and scripts, and using the NODE_VERSION environment variable promotes maintainability.


23-23: LGTM!

The change to use the BUN_VERSION environment variable for the Bun version is approved. It promotes maintainability and consistency.


24-24: LGTM!

The addition of the --frozen-lockfile option to the bun i command is approved. It ensures that the installation strictly adheres to the lockfile, preventing unintended changes to dependencies and improving the robustness of the CI workflow.


26-26: Please provide more information about the purpose and implications of the bun sync command.

The bun sync command is added as a new step, but its purpose and implications are unclear without additional context. Please provide more details about what this command does and how it affects the CI workflow.

package.json (6)

18-18: Verify the purpose and functionality of the nr command.

The format script has been modified to use the nr command instead of npm run. Ensure that the nr command is properly defined and functions as expected for linting and fixing code.


24-33: LGTM!

The version updates for the @iconify-json dependencies are approved. Keeping the dependencies up to date is a good practice.


40-43: LGTM!

The version updates for the @sveltejs dependencies are approved. Keeping the dependencies up to date is a good practice.


39-39: Verify the purpose and compatibility of the @std/collections package.

The @skeletonlabs/skeleton dependency has been replaced with @std/collections. Ensure that the @std/collections package serves the same purpose and is compatible with the project's requirements.


48-49: LGTM!

The addition of the @unocss dependencies is approved. These packages will support the transition to using Unocss for styling in the project.


53-55: LGTM!

The version updates for the eslint, eslint-plugin-svelte, fs-extra, svelte, svelte-check, typia, and vite dependencies are approved. Keeping the dependencies up to date is a good practice.

The addition of the sort-on and typescript-svelte-plugin dependencies is also approved. These packages will enhance the project's development workflow and TypeScript support for Svelte.

Also applies to: 57-57, 61-61, 63-66, 73-73, 75-78

src/routes/me/Skills.svelte (4)

1-1: LGTM!

The change to use TypeScript in the script tag is approved. It will enable stricter type checking and improve type safety.


4-45: LGTM!

The changes to the contents object are approved. They enhance the maintainability of the code by reducing the number of direct imports and potentially optimizing the bundle size. The use of satisfies in the type declaration enhances type safety and clarity.


61-62: LGTM!

The change to the icon rendering logic is approved. It simplifies the rendering process and may improve performance by avoiding the overhead associated with component instantiation for icons.


2-2: Also applies to: 6-16, 19-21, 24-28, 32-32, 35-38, 41-43

bun-version: latest
- run: bun i
bun-version: ${{ env.BUN_VERSION }}
- run: bun i --frozen-lockfile
- run: bun secretlint **/*
Copy link

Choose a reason for hiding this comment

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

Fix the shellcheck issue by using -- **/* instead of **/*.

Shellcheck suggests using ./*glob* or -- *glob* to prevent names with dashes from becoming options.

- - run: bun secretlint **/*
+ - run: bun secretlint -- **/*
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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- run: bun secretlint **/*
- run: bun secretlint -- **/*
Tools
actionlint

25-25: shellcheck reported issue in this script: SC2035:info:1:16: Use ./glob or -- glob so names with dashes won't become options

(shellcheck)

Copy link

@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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4babc2f and b36541f.

Files selected for processing (2)
  • src/routes/me/+page.server.ts (1 hunks)
  • src/routes/works/+page.server.ts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • src/routes/me/+page.server.ts
  • src/routes/works/+page.server.ts

@ryoppippi ryoppippi merged commit f2e3766 into main Sep 3, 2024
4 of 5 checks passed
@ryoppippi ryoppippi deleted the feature/remove-tailwind branch September 3, 2024 17:31
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.

1 participant