Open torenware opened 2 years ago
You should be able to compare $DDEV_PROJECT_TYPE
to laravel
. That gets the Laravel users that use the project type. But there are others that use project type 'php'
You should be able to compare
$DDEV_PROJECT_TYPE
tolaravel
. That gets the Laravel users that use the project type. But there are others that use project type 'php'
OK, easier than munging config.yaml myself. I'll try this to see if it works where I'm doing that.
For folks like @tyler36 to try to make sure this does what it needs to do:
Here's what the UI looks like when you do not set a package manager and do not do npm install
or its yarn/pnpm equivalent:
ddev get https://github.com/torenware/ddev-viteserve/tarball/laravel-aware-5
ddev restart
ddev vite-serve
on a completely fresh project, without modifying the generated .ddev/.env
file, you'll see something like this:
$ ddev vite-serve
1) npm
2) yarn
3) pnpm
Choose the package manager to use:
npm install
for you, and start vite for you.
Choose the package manager to use: 1
'npm'
Using package manager npm
added 26 packages, and audited 27 packages in 18s
6 packages are looking for funding
run npm fund
for details
found 0 vulnerabilities npm notice npm notice New minor version of npm available! 8.11.0 -> 8.19.2 npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.19.2 npm notice Run npm install -g npm@8.19.2 to update! npm notice Vite now serving .
5. To see the "already installed state", run `ddev vite-serve stop`, and then run `ddev vite-serve` again:
$ ddev vite-serve stop stopping vite $ ddev vite-serve 'npm' Using package manager npm
up to date, audited 27 packages in 1s
6 packages are looking for funding
run npm fund
for details
found 0 vulnerabilities Vite now serving .
6. Note that vite-serve auto-detected the previous npm install, but reran `npm install` to make sure things haven't changed in your package.json and lock file.
7. Delete node_modules/ and the lock file, and you'll be able to see the selection menu come up again when you restart vite-serve.
8. Try this with yarn or pnpm to see this also works.
9. Then, on a clean install of the stock Laravel project, use the procedure in the current CMS Quickstart Guide, to confirm that I haven't broken that path either.
You should be able to compare
$DDEV_PROJECT_TYPE
tolaravel
. That gets the Laravel users that use the project type. But there are others that use project type 'php'
This works fine, and the code is refactored accordingly. For the php
type, it probably does not make sense to do this; in my own use of it, I still tend to put the vite project in a sub-directory, and there's no reason to suppose that people would mix the php and js code as has become Laravel's preference. For everybody else, laissez les bons temps rouler, non?
I'm experimenting with making the add-on change its behavior when used in projects of
type: laravel
. Changes would include at least:.ddev/.env
This issue is the tracking issue for the PRs relevant to this issue.