Recent searches


No recent searches

How to prevent settings.yml from being packaged into the app?

Answered


Posted Jul 21, 2021

I've got an app that works great. In the app is a manifest.json file specifying that a token field is required via parameters. For local dev work I have a settings.yml file in my root directory:

/app_name
-- .zat
-- README.md
-- assets/
-- manifest.json
-- readme/
-- settings.yml
-- tmp/
-- translations/

One of my colleagues downloaded the .zip of this app and peeked inside and noticed the settings.yml file was there. Since this file contains a secret token I would really prefer it not get packaged up when running `zat package`. 

Is there any sort of ".zatignore" where I can tell zat to not include that file in the app package? I couldn't find anything in the KB around preventing the settings file from being packaged up.

Thanks!


1

5

5 comments

image avatar

Tipene Hughes

Zendesk Developer Advocacy

Hey RC,

Sorry for the delay in getting back to you!

I think the best way to approach this would be to make your settings.yml a hidden file (“.settings.yml”). This will ensure that the file is skipped over when the app is packaged using zat package.

I hope this helps. Feel free to reach out if you have any questions!

Tipene

0


Tipene Hughes

Related: How could we prevent node_modules from being included in the package? I have a react app and have had to create a temporary workaround using pre and post package scripts that essentially remove and reinstall (respectively) all dependencies. Is there a better solution?

0


image avatar

Tipene Hughes

Zendesk Developer Advocacy

Hey Eric,

ZCLI and ZAT will attempt to package any files contained within the directory you specify, or the root directory if none is specified. So, before using ZCLI or ZAT to package your app, you’ll need to make sure that your bundler (e.g. webpack) is not adding the node_modules folder to the build/dist directory that’s created at build time. Then, you can specify the directory to run the packaging process, i.e zcli:apps create ./dist.

Here’s an example Zendesk react app to take a look at that you might find helpful:
https://github.com/zendesk/sell-zaf-app-scaffold

I hope this helps! Let me know if you have any questions.

Tipene

0


Thanks Tipene Hughes!

Is this possible with ZAT as well? I don't see it listed anywhere in the docs.

0


image avatar

Tipene Hughes

Zendesk Developer Advocacy

Sure is! You'd just use the --path flag on your package command e.g zat package --path=./dist

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post