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

javascripts outside json file. #52

Closed
jeffreyvangorkum opened this issue Sep 26, 2022 · 3 comments · Fixed by #189
Closed

javascripts outside json file. #52

jeffreyvangorkum opened this issue Sep 26, 2022 · 3 comments · Fixed by #189
Labels
enhancement New feature or request

Comments

@jeffreyvangorkum
Copy link

When Frodo exports the scripts, they get put in either separate json files or one big json file. From a CI/CD perspective this isn't the ideal situation. As it's not a javascript file, you cannot run automatic jobs on the code from a git perspective. Think about code quality control or cve scans or also editing java scripts from your IDE directly from a cloned git environment.

Is it an option to, next to exporting the script json, to create a file for the javascript alone as well? And when using the import option, a function that puts the javascript in the json file again?

@jeffreyvangorkum jeffreyvangorkum added the enhancement New feature or request label Sep 26, 2022
@vscheuber
Copy link
Contributor

vscheuber commented Sep 26, 2022

I love the suggestion! This has come up several times in the past. We are debating possible options:

Introduce a new parameter to the frodo script export and frodo script import commands: --external-source (or something like that).

When supplying the paramater on export, frodo creates something like this:

<script name1>.script.json
<script name2>.js
<script name2>.script.json
<script name2>.groovy

where the .json file would look exactly the way it looks today (including the script source embedded in the json) and then there would be another file with the same filename prefix but a suffix according to the script language (.js or .groovy) containing only the script code.

When supplying the parameter on import, frodo will try to read the external source file and fallback on what's in the json file and print a warning.

On import the behavior is debatable: Should frodo error out if it cannot find an external script? Or should it silently fallback on what's in the json file.

@adam-cyclones
Copy link

I also need something like this (and export dumps files instead of base64), I would add that a watch mode would be amazing, where a persistent connection is established and I change a file and it gets imported on change, using something like Chokidar.

frodo script import <script name1>.script.json --watch
frodo script import <script name2>.js --watch
frodo script import <script name2>.script.json --watch
frodo script import <script name2>.groovy --watch

With no flag for the source, instead, we work that out from extension?

@vscheuber
Copy link
Contributor

@meesvandongen it looks like you are working on something along these lines in #205

@vscheuber vscheuber linked a pull request Jan 20, 2023 that will close this issue
vscheuber added a commit to rockcarver/frodo-lib that referenced this issue Jan 24, 2023
frodo extract functionality for lib side
progresses rockcarver/frodo-cli#52
vscheuber added a commit to vscheuber/frodo-lib that referenced this issue Aug 28, 2023
vscheuber added a commit to vscheuber/frodo-lib that referenced this issue Aug 28, 2023
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
3 participants