8000 chore: make development environment work on Windows by xC0dex · Pull Request #5344 · scalar/scalar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: make development environment work on Windows #5344

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

Merged
merged 56 commits into from
May 21, 2025
Merged

Conversation

xC0dex
Copy link
Collaborator
@xC0dex xC0dex commented Apr 7, 2025

Problem

Currently, it's not possible to build the project on Windows machines.

Solution

This PR makes the repository compatible with Windows by migrating all shell scripts to typescript. All shell commands are now prefixed with shx. This PR focuses on building the repository on Windows machines. I'll cover the test setup in a separate PR.

Tested with pnpm turbo build

New dev dependencies

Checklist

I’ve gone through the following:

  • I’ve added an explanation why this change is needed.
  • I’ve added a changeset (pnpm changeset).
  • I’ve added tests for the regression or new feature.
  • I’ve updated the documentation.

Closes #5328

Copy link
changeset-bot bot commented Apr 7, 2025

⚠️ No Changeset found

Latest commit: 316961c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@xC0dex xC0dex force-pushed the feat/windows-support branch from c860666 to 56126a5 Compare April 7, 2025 14:00
@hanspagel hanspagel changed the title feat: Make Repository Windows Compatible chore: make development environment work on Windows Apr 7, 2025
@hanspagel
Copy link
Member

I tried to run it but got this, what am I doing wrong?

image

@hanspagel
Copy link
Member

Okay, I tried to upgrade to Windows Vista and it seems to work now

image

@hanspagel
Copy link
Member
hanspagel commented Apr 7, 2025

Wait it asked me to switch to Windows XP and … now I got this, what does that mean?

image

@amritk
Copy link
Member
amritk commented Apr 7, 2025

How can I make it work on linux? Couldn't get .net working for some reason

@xC0dex xC0dex marked this pull request as ready for review May 8, 2025 17:56
@xC0dex xC0dex requested review from amritk and geoffgscott as code owners May 8, 2025 17:56
@xC0dex xC0dex marked this pull request as draft May 8, 2025 18:04
Copy link
relativeci bot commented May 18, 2025

#9901 Bundle Size — 2.42MiB (0%).

316961c(current) vs dada855 main#9900(baseline)

Warning

Bundle contains 3 duplicate packages – View duplicate packages

Bundle metrics  no changes
                 Current
#9901
     Baseline
#9900
No change  Initial JS 2.42MiB 2.42MiB
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 1 1
No change  Assets 1 1
No change  Modules 1487 1487
No change  Duplicate Modules 0 0
No change  Duplicate Code 0% 0%
No change  Packages 168 168
No change  Duplicate Packages 3 3
Bundle size by type  no changes
                 Current
#9901
     Baseline
#9900
No change  JS 2.42MiB 2.42MiB

Bundle analysis reportBranch feat/windows-supportProject dashboard


Generated by RelativeCIDocumentationReport issue

Copy link
Contributor
github-actions bot commented May 18, 2025

@xC0dex
Copy link
Collaborator Author
xC0dex commented May 18, 2025

Easy

"clean:nuxt": "find . -name .nuxt -type d -exec rm -rf {} \\;",
"clean:dist": "find . -name dist -type d -exec rm -rf {} \\;",
"clean:turbo": "find . -name .turbo -type d -exec rm -rf {} \\;",
"clean": "pnpm clean:dist && pnpm clean:turbo && pnpm clean:nuxt && pnpm clean:next && pnpm clean:nodeModules",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Node Modules must be the last folder because we use shx which is in the node_modules directory

#!/usr/bin/env vite-node
import { executeCommands } from './utils/utils'

executeCommands(['npx vite-node esbuild.ts', 'pnpm types:build'], 'esbuild')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This has to be npx.

*/
export const executeCommand = (command: string, errorMessage?: string): void => {
try {
execSync(command, { stdio: 'inherit', env: { ...process.env, NODE_ENV: 'production' } })
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

NODE_ENV: 'production' must be provided. Otherwise, there are some weird "jsxdev is not a function" in the Next.js example project.

@xC0dex
Copy link
Collaborator Author
xC0dex commented May 18, 2025

Please make a clean install on your machines and let me know if it behaves like before on Linux/macOS.
Fingers crossed 🤞

@xC0dex xC0dex marked this pull request as ready for review May 18, 2025 17:51
@marclave marclave requested a review from hanspagel May 19, 2025 06:36
@hanspagel
Copy link
Member
hanspagel commented May 19, 2025

OMG, it’s finally green.

We need @geoffgscott’s review here.

@xC0dex Can you rebase once more? It says that there are conflicts.

Screenshot 2025-05-19 at 11 00 44

@xC0dex
Copy link
Collaborator Author
xC0dex commented May 19, 2025

@hanspagel unfortunately VS Code created merge commits instead of rebasing. So it's no longer possible for me to rebase. Only merging main into the branch works.

Anyway: Branch should be up-to-date now (but with some merge commits)

Copy link
Member
@geoffgscott geoffgscott left a comment

Choose a reason for hiding this comment

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

Would like to see most of this move to the repo CLI but this is a great intermediate step.

@amritk
Copy link
Member
amritk commented May 21, 2025

Shall we send it?

@amritk
Copy link
Member
amritk commented May 21, 2025

So I ran it and had these changes to the ts files, looks like just permissions changes. I believe it makes them executable in unix which is what we want so I'll commit it.
image

@amritk amritk merged commit c658a29 into main May 21, 2025
33 checks passed
@amritk amritk deleted the feat/windows-support branch May 21, 2025 17:14
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.

Make Repository Windows compatible
5 participants
0