Skip to content

Comments

Bug fix include modules cross module references#13

Merged
rulasg merged 2 commits intomainfrom
bug-fix-include-modules-cross-module-references
Mar 6, 2025
Merged

Bug fix include modules cross module references#13
rulasg merged 2 commits intomainfrom
bug-fix-include-modules-cross-module-references

Conversation

@rulasg
Copy link
Owner

@rulasg rulasg commented Mar 6, 2025

Standardization of root path invocation:

Refactoring configuration and database scripts:

  • include/config.ps1: Added detailed comments explaining the design and usage of root path invocation. Renamed Invoke-GetConfigRootPath to GetConfigRootPath and updated GetConfigFile to use $CONFIG_INVOKE_GET_ROOT_PATH_ALIAS. [1] [2]
  • include/databaseV2.ps1: Renamed from private/dependencies/databaseV2.ps1, added detailed comments, and refactored functions to use $DB_INVOKE_GET_ROOT_PATH_ALIAS. Removed redundant functions. [1] [2] [3]

New public scripts for configuration and database handling:

  • public/sfDatabase.ps1: Introduced $DB_INVOKE_GET_ROOT_PATH_ALIAS and $DB_INVOKE_GET_ROOT_PATH_CMD, and added functions Invoke-SfGetDbRootPath and Reset-DatabaseStore.
  • public/sfconfig.ps1: Introduced $CONFIG_INVOKE_GET_ROOT_PATH_ALIAS and $CONFIG_INVOKE_GET_ROOT_PATH_CMD, and added functions Invoke-SfGetConfigRootPath, Get-SfConfig, Save-SfConfig, Open-SfConfig, and Add-SfConfigAttribute.

@rulasg rulasg self-assigned this Mar 6, 2025
# to use the store path, mocked or not, to create the final store file name.
# All functions of this ps1 will depend on `GetConfigFile` for functionality.
#
# TODO : Create a related public ps1

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
#
# TODO : Create a related public ps1

# Create a related public ps1

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
# Sample code (replace "MyModule" with a unique module prefix):
# $CONFIG_INVOKE_GET_ROOT_PATH_ALIAS = "MyModuleGetConfigRootPath"
# $CONFIG_INVOKE_GET_ROOT_PATH_CMD = "Invoke-MyModuleGetConfigRootPath"
#

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
# $CONFIG_INVOKE_GET_ROOT_PATH_CMD = "Invoke-MyModuleGetConfigRootPath"
#
# Set-MyInvokeCommandAlias -Alias $CONFIG_INVOKE_GET_ROOT_PATH_ALIAS -Command $CONFIG_INVOKE_GET_ROOT_PATH_CMD
#

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
# $DB_INVOKE_GET_ROOT_PATH_CMD = "Invoke-SfGetDbRootPath"
#
# Set-MyInvokeCommandAlias -Alias $DB_INVOKE_GET_ROOT_PATH_ALIAS -Command $DB_INVOKE_GET_ROOT_PATH_CMD
#

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
return Save-Configuration -Config $Config
} Export-ModuleMember -Function Save-SfConfig

function Open-SfConfig{

Check notice

Code scanning / PSScriptAnalyzer

The cmdlet 'Open-SfConfig' does not have a help comment. Note

The cmdlet 'Open-SfConfig' does not have a help comment.

} Export-ModuleMember -Function Open-SfConfig

function Add-SfConfigAttribute{

Check notice

Code scanning / PSScriptAnalyzer

The cmdlet 'Add-SfConfigAttribute' does not have a help comment. Note

The cmdlet 'Add-SfConfigAttribute' does not have a help comment.
if(-Not $config){
$config = @{}
}

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
process{
$config.attributes += $Attribute
}

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace

$config = Get-SfConfig
Write-Output $config.attributes

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
@rulasg rulasg merged commit 4949693 into main Mar 6, 2025
3 checks passed
@rulasg rulasg deleted the bug-fix-include-modules-cross-module-references branch March 6, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant