-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat(agora): create the project agora-app-tailwind
(ARCH-298)
#2865
feat(agora): create the project agora-app-tailwind
(ARCH-298)
#2865
Conversation
Errors when importing all the app routes defined in
|
echo "There are no processes listening to the port $port." | ||
else | ||
echo "Killing the processes listening to the port $port." | ||
kill $pids | ||
kill -9 $pids |
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.
As a suggestion, we could try killing normally and then force killing if the port is still in use.
function workspace-kill-port {
local port="$1"
# Check if the port exists
if ! lsof -i :$port > /dev/null; then
echo "Port $port is not open."
return
fi
# Get PIDs of processes listening on the port
local pids=$(lsof -t -i:$port)
if [ -z "$pids" ]; then
echo "No processes found listening on port $port."
return
fi
echo "Attempting to kill processes listening on port $port..."
# First, try a regular kill
kill $pids
# If the above fails, use kill -9
if ! kill -0 $pids > /dev/null 2>&1; then
echo "Failed to kill processes. Using SIGKILL"
kill -9 $pids
fi
# Verify if the processes were killed successfully
if ! ps -p $pids > /dev/null; then
echo "Processes listening on port $port have been successfully terminated."
else
echo "Warning: Processes listening on port $port were not terminated successfully."
fi
}
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.
Added a suggestion but LGTM!
Contributes to https://sagebionetworks.jira.com/browse/ARCH-298
Changelog
agora-app-tailwind
with esbuild and Tailwind enabledworkspace-kill-port <port>
to effectively kill the Angular app started withserve
Important
I wanted this PR to supporting the linting with files with Tailwind ESLint plugin. Ideally, the configuration would be applied in the root ESLint config file. However, we may want to only lint specific files and projects that we know use Tailwind because there are many JS, TS and HTML files that do not include any Tailwind class name, which triggers this error:
tailwindcss/no-custom-classname
. Configuring ESLint to enforce Tailwind rules will be handled in a separate PR.Initially included but then removed:
Notes
Stylelint
It looks like the VS Code extension for Stylelint does not automatically take into account changes made to the Stylelint config file (
stylelint.config.mjs
). One solution that works is to restart VS Code. Another option may be to disable and re-enable the extension (not tested).Angular apps built with esbuild and started with
nx serve
may still be running after Ctrl + CThis behavior was previously observed with
sandbox-angular-app
. This issue does not affect apps built with Webpack.There is an issue with the command
nx serve agora-app-tailwind
where stopping the command with Ctrl + C won't stop the process. Yet the app will no longer be available onlocalhost:4200
. The process that is still running can be seen in the list of ports forwarded in VS Code or with the command:As result, trying to serve the app again will lead to the issue shown below:
Observations:
kill -9 <pid>
but not withkill <pid>
as done byworkspace-kill-port <port>
. Hence, this PR update the command to runkill -9 <pid>
.Warning
Changes made to
dev-env.sh
, where the commandworkspace-kill-port
is defined, require to source this Bash file again. This can be achieved with the command. ./dev-env.sh
or simply opening a new terminal that automatically source this file.Preview
Create the app
Serve the app