callawaycloud / force-source-clean Goto Github PK
View Code? Open in Web Editor NEWSFDX plugin which performs the 'force:source:retrieve --manifest' command but removes stale files
SFDX plugin which performs the 'force:source:retrieve --manifest' command but removes stale files
โ project git:(XXX.1/master) sfdx force:source:clean -x manifest/package.xml
(node:22917) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit
WARNING: This command can be dangerous! It is intended to be used along side source control. IT WILL REMOVE ALL FILES FROM 'packageDirectories' WHICH ARE NOT FOUND IN THE TARGET ORG. They will not be recoverable unless tracked in source control!
Do you wish to continue? (y): y
WARNING: Failed to retrieve! All files are "marked" and will need to be manually reset!
ERROR running force:source:retrieve: Unexpected file found in package directory: /Users/ralphcallaway/Development/project/src/classes/SomeClass.cls.orig
In this case, a git merge conflict artifact broke down the process and left everything deleted (will post some thoughts on that in another ticket)
Not totally sure this is really an issue with this command, more an issue with the sfdx command not being smart enough to tell the difference between sfdx and non-sfdx files in package directories.
more consistent with -f as a "force" action for CLIs when you want to ignore warnings
my $.02, obviously a subjective opinion
Email templates included in package folder are deleted even if they are included in the project manifest file.
Ran to sync up a production org which had 3 static resources
Running a retrieve brings them right back. Long shot, but maybe simple text static resources have a slightly different structure gumming things up.
did i a decent amount of autocomplete for our ant scripts, happy to take this on
Currently if we add a field on a managed package object it's not retrieved.
After clicking yes, you're waiting for a pretty good while.
Would be a nice place for a super styling spinner or other pacifier
https://github.com/clj-commons/spinner has a lot of options, these two options in the demo seemed perfect
tmp module is listed in devDependencies
Seems inevitable that there be a fair amount of stuff like #4 where it doesn't complete and all the files are "DELETED"
Recoverying with source control is a snap, but it's easy to mess something up and forget some of your stuff wasn't committed.
A small protective measure would be to save a backup of the folder being cleaned, say .cleanbk that could make clean up a quick move folder. Or even better just magically bring it back. If it worked well the warning prompt might not be as critical
Sub case of #17
if i have a file manifest/package.xml
and i type sfdx force:source:clean -x m
i'd expect to be able to tab and it would auto complete the file name (default zsh behavior)
not sure if there is something in the sfdx command that supports this
i'm currently using https://github.com/wadewegner/salesforce-cli-zsh-completion which might be the source of the behavior, so may end up being something to add over there
Now that it's starting to feel like it's close to a v1 seems like a good time to add a basic test suite
Noticed when I run clean I'll often see files listed as modified even though there is no content changes. Dug a bit deeper and ran a patch and can see lines like this
mode change 100755 => 100644 src/main/default/classes/SomeClass.cls-meta.xml
Would be nice if we could avoid this, although this could just be an issue on the first sync after which everything ends up with the default file permissions sfdx retrieve gives them.
this is pretty much alway manifest so just default it
if someone wanted to store something else in a force.com package folder (i.e. selenium tests) that isn't subject to the compile on save, pull/push commands, seems like it would be expected this command would respect .forceIgnore
Got the following error after run the sfdx force:source:clean -n
command:
ERROR running force:source:retrieve: XXX.cls-meta.xml: Expected source files for type 'ApexClass'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.