Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Extract config logic from import and export code #39

Merged
merged 6 commits into from
Jan 29, 2017
Merged

Extract config logic from import and export code #39

merged 6 commits into from
Jan 29, 2017

Conversation

mattpalermo
Copy link
Collaborator

The primary goal of this change is to extract the configuration logic from the import and export code. This adds a layer of abstraction and makes things simpler. Using this new power, some minor behaviour was improved. Issue #30 is partially (or fully?) solved.

I also took this opportunity to do some other clean up tasks. I added and fixed some comments. And I put some general utility code in a utility module.

I left detailed notes of exactly everything that changed in the commit logs.

The primary goal of this commit is to extract the configuration
logic from the importing and exporting logic. The configuration
logic is now in a class clsConfiguration. This class provides
an easy to use and safe API for working with the configuration.
The user of the API should be safe from causing corruption.
Additionally the user of the API should be shielded from low
level aspects of a corrupted configuration file. What I'm trying
to say is that it adds a layer of abstraction.

While porting the import and export logic to use the new API, I
improved some behaviour of the MakeConfigFile routine and the
Export routine.

In the MakeConfigFile, the routine now takes
advantage of the non-destructive nature of the configuration API.
The MakeConfigFile now updates the config file instead of creating
a new one. It will silently add modules and references but will
prompt the user to ask if missing modules and references should
be deleted.

In the Export, the routine now silently ignores modules listed
in the configuration file that isn't currently in the project.
This partially solves issue #30. The only thing left to do is
to remove and clear the modules after everything else has
successfully exported.

Some minor refactoring was done. The modUtil module was created
to house functionality that serves a very general purpose.

Comments were added to each function and module subsection to
help with documentation. Comment at the top of modImportExport
and modMenu describing the references nessesary for the code to
run was removed since an authoritive list of references required
is kept in the CodeExport.config.json.

.editorconfig was created to aid in editing the VB code and other
code in modern text editors.

Note: I am yet to test this code. It compiles without error but
may have runtime errors. I just want to get it committed to
make sure I don't loose work.
Only remaining issue is that stdole and Office references are
weird and shouldn't be added to the configuration file.
These references are practically built in but are not flagged as
built in.

Also fixed some issues where the JSON output from the MakeConfigFile
was slightly different to as if it was edited in a text editor.
This should avoid the files changing without the content actually
changing.
The Make Config file action will no longer destroy the old configuration.
@mattpalermo
Copy link
Collaborator Author

Going to integrate this into dev and then integrate dev into master without waiting for review. I am a bit impatient tonight and want to cut a release based on this, before the week starts. I feel that while this is a big change in the code base (it's quite a big diff), it is not a controversial change and it doesn't change too much from the user's perspective.

@mattpalermo mattpalermo merged commit ae3085c into spences10:dev Jan 29, 2017
@mattpalermo mattpalermo deleted the refactor branch January 29, 2017 17:54
@mattpalermo mattpalermo mentioned this pull request Jan 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants