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

Add build scripts #22

Open
otakupahp opened this issue Apr 26, 2024 · 3 comments
Open

Add build scripts #22

otakupahp opened this issue Apr 26, 2024 · 3 comments

Comments

@otakupahp
Copy link

Description

The composer.json file is great for dev, but needs extra scripts to make an easy build deployment.

Additional context

Usually I update the file to include additional scripts needed to deploy to production:

after "internationalize" scripts

    "localize": [
      "@makemo:theme",
      "@makemo:blocks",
      "@makemo:features"
    ],

And this before "packages-install"

    "install-build": [
      "@composer run-script internationalize",
      "@composer run-script localize",
      "@composer install --no-dev -o"
    ],

This way, when I need to push this, then I just run the install-build script

@otakupahp
Copy link
Author

Improved a bit, moved the install-build before packages-install to the end of scripts

    "install-build": [
      "@composer run-script packages-install",
      "@format:php",
      "@lint:php",
      "@internationalize",
      "@localize",
      "@composer install --no-dev -o"
    ]

@otakupahp
Copy link
Author

Final improvement adding scripts:

Added this to package.json

"build-production": "npm-run-all --sequential format:scripts format:styles lint:scripts lint:styles build",

And added this to composer.json

"npm run build-production"

so, when I run install-build I have everything in on command

The full script:

    "install-build": [
      "@composer run-script packages-install",
      "@format:php",
      "@lint:php",
      "@internationalize",
      "@localize",
      "@composer install --no-dev -o",
      "npm run build-production"
    ]

@ahegyes
Copy link
Contributor

ahegyes commented Aug 21, 2024

This is pretty cool! I'll look into it again after my AFK 😄

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

No branches or pull requests

2 participants