Client script in the site

Hello community
I just asking about the client script
I have a custom app I did a view client scripts in the site when I installed the app I another site I didn’t find any code generated in my app. So I came back to check the app code I didn’t find any code which I wrote in the old site. And still there
So if I have a custom app should I write all server script and client script in the app it self or the code I write in the site should be copied to the app…

If you want to maintain the code and do reviews, I recommend writing your scripts in a custom app.

or

If you want to write your script on Client Script and Server Script Doctypes, you can export those scripts through fixtures in your custom app so that you will not lose your changes.

thank you @ejaaz
I already moved my script to the app, but I may use the fixture to export workspaces and dashboards, could you provide me with how to do that any guide line docs would be appreciated

In your custom app’s hooks.py file, you can specify what to export and apply filters to them.

The client script is exported without filters, and the workspace is exported with filters, as you can see in the image above.

then run command
bench export-fixtures

Edit

if you want to export just custom app fixtures the you can use bench export-fixtures --app custom_app