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

A build-block npm script #1

Open
SofiaSousa opened this issue Nov 13, 2018 · 2 comments
Open

A build-block npm script #1

SofiaSousa opened this issue Nov 13, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@SofiaSousa
Copy link
Member

SofiaSousa commented Nov 13, 2018

Last Cloud Blocks release (1.0.7) allows the upload of custom blocks via zip files.

Would be nice that generated blocks have a build-block script to create the zip file (which should include the build folder and package.json file at least).

My suggestion:

"build-block": "zip -r [block-name].zip build package.json"

"scripts": { 
  "build-block": "cd .. && zip -r [block-name]/[block-name].zip [block-name]/build [block-name]/package.json"
}
@SofiaSousa SofiaSousa added the enhancement New feature or request label Nov 13, 2018
@perandre
Copy link
Member

Nice, but I'm also thinking: If you are familiar with the command line, you wouldn't upload a zip. You would edit .gitignore and add the block to your repo. Right?

@SofiaSousa
Copy link
Member Author

If you want to keep the blocks inside the wp project, editing the .gitignore is the right way.

But if you want to keep them in different repositories and upload the blocks through the UI, a build-block script could be useful.

To upload just a block, you don't have to update the whole site, just have to generate the block zip file and upload it.

For the block developer, it's just another npm command:

npm run build-block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants