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

(Ready for review) Improve start command on windows #316

Conversation

wonderwhy-er
Copy link
Collaborator

@wonderwhy-er wonderwhy-er commented Nov 18, 2024

PR Description

Summary

This pull request introduces two changes to improve the project setup and usability:

  1. Update .gitignore:

    • Added /.history to .gitignore to prevent tracking IDE/editor-specific history files.
  2. Improve start Command for Cross-Platform Compatibility:

    • Added platform-specific start commands:
      • start:windows: Simplified command for running the project on Windows without requiring bindings.
      • start:unix: Existing start command for Unix-based systems with bindings.
    • Updated the start script to detect the operating system dynamically and execute the appropriate command.

Motivation

On my channel I often get people complain of it not working on windows due to that
One example here: https://www.youtube.com/watch?v=-VkGI-cUaWw&lc=Ugy8rg_sGmOLSp7JoaN4AaABAg


Problem Addressed

The previous start command failed on Windows systems due to incompatible syntax for handling bindings. This issue required either manual adjustments or using a Linux subsystem, creating friction for Windows users.


Solution

The updated start script dynamically detects the operating system:

  • On Windows: Skips bindings, as they are usually not required for local development.
  • On Unix-based systems: Executes the original command with bindings.

Changes

  1. .gitignore:

    • Added /.history to avoid unnecessary clutter from history files.
  2. package.json:

    • Added start:windows and start:unix commands.
    • Refactored the start command to dynamically detect the operating system and run the appropriate script.

Testing

  • Verified the start command runs successfully on both Windows and Unix-based systems.
  • Confirmed that bindings are correctly skipped on Windows.

Impact

  • Simplifies the development experience for Windows users.
  • Maintains compatibility for Unix-based environments.

@kustomzone
Copy link

"typecheck": "tsc" is appended to the end of the start command, also listed later in the scripts.
Duplicate warning on startup.

@wonderwhy-er
Copy link
Collaborator Author

"typecheck": "tsc" is appended to the end of the start command, also listed later in the scripts. Duplicate warning on startup.

Woah ups, something went off with cherry pick... Fixed now.

@wonderwhy-er wonderwhy-er changed the title Improve start command on windows (Ready for review) Improve start command on windows Nov 20, 2024
@dustinwloring1988
Copy link
Collaborator

This has been added in a merged commit, thanks wonderwhy-er

@wonderwhy-er
Copy link
Collaborator Author

@dustinwloring1988 hm, something is off about how you do it, this way you are seen as author of all the work in git history.
That's undesirable, you will end up demotivating people.

Why not just merge here? Conflicts?

I think there should be way to merge without loosing authorship of code.

@dustinwloring1988 dustinwloring1988 merged commit f7a1236 into stackblitz-labs:main Dec 3, 2024
1 check passed
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.

3 participants