Automattic / Automattic/dot-handy

Refactor: the path resolving logic of actions and configs is similar. Can they be unified?

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
3
Forks
2
PR merge metrics
No merged PRs in 30d

Description

The path resolving of config files and of action files, although look different from code, the logic is exactly the same:

1. Look into the local file directory, i.e. local-actions and local-configs. These files are considered case specific that are not appropriate to commit to the public repo, so they are higher priority; sort of like various `conf.d` things on a Linux-like system.
2. If nothing, look into the shared file directory, i.e. actions and configs.

They look very different now because an action file is read by `require()`, while a config file is read as a plain `json` file. How could we unify them so we don't have maintain two path resolving code?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the separate path-resolution entry points for action files and config files, then compare how each searches local-actions/local-configs before actions/configs. Check the existing require() and JSON-loading paths; done means one shared resolver preserves that priority while supporting both file-reading approaches.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.