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

feat(web): add custom scripts plugin #17

Merged
merged 5 commits into from
Oct 16, 2024
Merged

Conversation

eahefnawy
Copy link
Collaborator

This gives us control over the child process running the script, so that we can suppress its output.

"license": "MIT",
"dependencies": {
"express": "^4.19.2",
"serverless-http": "^3.2.0"
},
"devDependencies": {
"serverless-domain-manager": "^7.4.0",
"serverless-plugin-scripts": "^1.0.2"
"serverless-domain-manager": "^7.4.0"
Copy link
Member

Choose a reason for hiding this comment

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

This project uses npm workspaces, so don't forget to run npm i in the root to update the lock files.

@@ -0,0 +1,69 @@
import { execSync } from "child_process";

class Scripts {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add inline comments to provide more context for users who might not be familiar with plugins. A few things to cover...

  • Why it exists - to run custom scripts, which we need to run the build script at deploy time, with support for variable resolution from framework, as well as proper stdio handling.
  • How this works - it runs because it's included as a plugin in serverless.yml, and how hooks work.

@eahefnawy eahefnawy merged commit 0619201 into main Oct 16, 2024
1 check passed
@eahefnawy eahefnawy deleted the add-custom-scripts-plugin branch October 16, 2024 09:55
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.

2 participants