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

Improved getting started #3128

Merged
merged 15 commits into from
Oct 14, 2024
Merged

Improved getting started #3128

merged 15 commits into from
Oct 14, 2024

Conversation

michaelbromley
Copy link
Member

Relates to #3117

  • Needs testing on macos & linux

Sql.js is not needed when we have SQLite,
and oracle/mssql have never been supported by Vendure
Since v2.2, Vendure no longer supports Yarn v1.x which is long
unmaintained, and breaks with some of the depdendencies we
use.

At the same time, modern Yarn (berry) does not get installed
globally - rather it uses corepack which is specific to a
particular package dir. Therefore all the logic around
detecting a global Yarn binary (which was all inherited from
the Create React App code) is no longer relevant.
Prevents the progress bar from interfering with the vendure create
clack prompt spinner
Copy link

vercel bot commented Oct 10, 2024

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

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Oct 14, 2024 11:36am

packages/create/src/helpers.ts Fixed Show fixed Hide fixed
packages/create/src/helpers.ts Fixed Show fixed Hide fixed
Copy link
Collaborator

@dlhck dlhck left a comment

Choose a reason for hiding this comment

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

Ship it 🚀

Comment on lines +349 to +356
function isDaemonRunning(): boolean {
try {
execFileSync('docker', ['stats', '--no-stream'], { stdio: 'ignore' });
return true;
} catch (e: any) {
return false;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Some setups will require root privileges for the docker stats command so this might fail even if technically the daemon is running.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's true, but we won't be able to cover 100% of all setups.

Comment on lines 381 to 383
} else {
execSync('systemctl start docker');
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth to enable instead of start to make docker auto-start on next reboot. Sidenote: Both starting and enabling require root privileges which might trip up some OS'

Copy link
Collaborator

Choose a reason for hiding this comment

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

This command is running only on Linux based OS. In most cases the primary user has administrator rights. So again, covering 100% of setups (especially Linux-based) is virtually impossible. I think we can iterate here based on user feedback

Recommended by the code scan as a better way that is not
as vulnerable to injection
@michaelbromley
Copy link
Member Author

Thanks for your input @DanielBiegler!

As David mentioned, there will certainly be cases where the automated Docker control will fail - in this case we have the flow "we couldn't start Docker" and then offer the user the chance to start it manually, or opt to setup with SQLite instead.

@michaelbromley michaelbromley merged commit adb4384 into master Oct 14, 2024
31 checks passed
@michaelbromley michaelbromley deleted the improved-getting-started branch October 14, 2024 11:56
@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants