init sequence rewrite #41

Merged
kevintl1998 merged 52 commits from init_sequence_rewrite into main 2026-09-07 12:24:28 -04:00
Owner
No description provided.
@ -0,0 +1,218 @@
---@class core_config.addon_data.flag_data
---@field default_value string
---@field handler? fun(keypath: string, flag_key: string, flag_value: string)
Author
Owner

No references to the handler. This needs to be implemented or removed

No references to the handler. This needs to be implemented or removed
kevintl1998 marked this conversation as resolved
@ -0,0 +4,4 @@
---@class core_config.addon_data.entry_data
---@field required boolean
---@field validator? fun(keypath: string, value: any): boolean
Author
Owner

Need to test the effects of function pointers on caching.
Edit: they can't be cached, so the method of getting data from addons needs to be reworked.

Need to test the effects of function pointers on caching. Edit: they can't be cached, so the method of getting data from addons needs to be reworked.
Author
Owner

Leaving this to the addons for now. Added a register function for addons to register themselves and their versions which will be tracked for caching.

Leaving this to the addons for now. Added a register function for addons to register themselves and their versions which will be tracked for caching.
kevintl1998 marked this conversation as resolved
lua/yapp/api.lua Outdated
@ -111,0 +59,4 @@
--- Configure settings for a keypath
---@param keypath string Path to the value formatted as "key1.key2.key3"
---@param opts core_config.addon_data.entry_data
M.register_keypath = function(keypath, opts)
Author
Owner

Data registration should be split out into a separate module and explicitly state that api functions cannot be called until after the output config has been loaded.

Data registration should be split out into a separate module and explicitly state that api functions cannot be called until after the output config has been loaded.
kevintl1998 marked this conversation as resolved
lua/yapp/api.lua Outdated
@ -111,0 +52,4 @@
--- Gets the data directory for the current working directory
---@return string
M.get_project_data_dir = function()
Author
Owner

Move to CoreConfig.get_project_data_dir and document that it cannot be called before this plugin is initialized.

Move to CoreConfig.get_project_data_dir and document that it cannot be called before this plugin is initialized.
kevintl1998 marked this conversation as resolved
@ -0,0 +17,4 @@
---@param obj any
---@return string
M.hash_fn = function(obj)
local obj_serialized = table_utils.serialize(obj)
Author
Owner

See if vim.inspect can be used here instead.

See if vim.inspect can be used here instead.
kevintl1998 marked this conversation as resolved
@ -50,0 +25,4 @@
--- Registers a handler for the given event.
---@param event core_config.event.type
---@param handler core_config.event.handler
M.register_event_handler = function(event, handler)
Author
Owner

Passed in event needs to be validated

Passed in event needs to be validated
kevintl1998 marked this conversation as resolved
lua/yapp/api.lua Outdated
@ -111,0 +52,4 @@
--- Gets the data directory for the current working directory
---@return string
M.get_project_data_dir = function()
Author
Owner

move to init.lua

move to init.lua
kevintl1998 marked this conversation as resolved
@ -0,0 +10,4 @@
---@param configs table
---@param addon_data core_config.addon_data
---@return table
local create_cache_input_data = function(configs, addon_data)
Author
Owner

Have a cache utils function for creating input data and use that to fill the input data

Have a cache utils function for creating input data and use that to fill the input data
kevintl1998 marked this conversation as resolved
@ -125,3 +132,3 @@
else
-- If M.set_value is behaving correctly, we should not be able to reach this branch
error("Fatal error occured. key_path passed to handle_globs did not start with '*'")
error("Fatal error occured. keypath "..keypath.." passed to handle_globs did not start with '*'")
Author
Owner

Error handling should be done with the custom error handler

Error handling should be done with the custom error handler
kevintl1998 marked this conversation as resolved
@ -265,0 +274,4 @@
--- Converts a keypath to a 1-indexed list of keys
---@param keypath string
---@return table 1-indexed list of keys
M.as_list = function(keypath)
Author
Owner

Is this the same as keypath_to_list?
Edit: yes. keypath_to_list has been removed and references to it replaced with M.as_list

Is this the same as keypath_to_list? Edit: yes. keypath_to_list has been removed and references to it replaced with M.as_list
kevintl1998 marked this conversation as resolved
@ -0,0 +5,4 @@
---@class core_config.utils.flags
---@field illegal_chars string
---@field is_flag_entry_format_correct fun(flag_key: string, flag_value: string): boolean
---@field verify_flag fun(flag_key: string, flag_value: string, keypath: string, error_handler: core_config.error_handler, addon_data: core_config.addon_data?)
Author
Owner

remove error handler parameter and return an error message.

remove error handler parameter and return an error message.
kevintl1998 marked this conversation as resolved
kevintl1998 deleted branch init_sequence_rewrite 2026-09-07 12:24:28 -04:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kevintl1998/yapp.nvim!41
No description provided.