-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Fix/remove hardcoded npm package #9410
Fix/remove hardcoded npm package #9410
Conversation
$cssFilePath, | ||
$tailwindConfigFilePath, | ||
])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the formatting change here
$this->info("Using NPM v{$npmVersion[0]}"); | ||
$this->info("Using {$pm} v{$pmVersion[0]}"); | ||
|
||
$installCommand = $pm === 'yarn' ? 'yarn add' : "{$pm} install"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refactor this to use a match() statement
|
||
if ($npmVersionExistCode !== 0) { | ||
exec($pm . ' -v', $pmVersion, $pmVersionExistCode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please convert the concatenation to using "{$}"
syntax
packages/panels/docs/11-themes.md
Outdated
@@ -121,6 +121,12 @@ If you have multiple panels, you can specify the panel you want to create a them | |||
php artisan make:filament-theme admin | |||
``` | |||
|
|||
By default, command will use node package manager with npm. If you want to use different package manager use `--pm` option: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, command will use node package manager with npm. If you want to use different package manager use `--pm` option: | |
By default, this command will use NPM to install dependencies. If you want to use a different package manager, you can use the `--pm` option: |
Thanks |
@@ -108,7 +115,7 @@ public function handle(): int | |||
$this->components->bulletList([ | |||
"First, add a new item to the `input` array of `vite.config.js`: `resources/css/filament/{$panelId}/theme.css`.", | |||
"Next, register the theme in the {$panelId} panel provider using `->viteTheme('resources/css/filament/{$panelId}/theme.css')`", | |||
'Finally, run `npm run build` to compile the theme.', | |||
"Finally, run `{$pm} run build` to compile the theme.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never tried with bun
but bun build
is the command right, not bun run build
? https://bun.sh/docs/bundler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tried both build and run build both works, same with yarn works yarn run build and yarn build
Current make:filament-theme command had hardcoded npm package giving no possibility to use other package managers such as yarn or bun. This PR adds a new --pm option to the command which will let user to enter what package manager command should use.
Example usage:
php artisan make:filament-theme admin --pm=bun
php artisan make:filament-theme admin --pm=yarn