Automattic / Automattic/dot-handy

Inconsistent-looking `require` module paths.

Open
#5 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

Currently all the module paths are written in relative paths, which looks inconsistent across the codebase, and is one extra mental burden to keep track of. e.g. in [main.js](https://github.com/Automattic/dot-handy/blob/trunk/main.js#L9):

```
const {
setLocalStorage,
initialize,
} = require( './lib/init.js' );
const { readConfigFiles, mergeConfig } = require( './lib/config.js' );
const { readActionFiles } = require( './lib/action.js' );
const { getRootUrlFromEnv, parseNonSpaceSeparatedList } = require( './lib/misc.js' );
```

in any of the action files, e.g. [close-action.js](https://github.com/Automattic/dot-handy/blob/trunk/actions/close-account.js#L1):
```
const { createAction, readActionFile } = require( '../lib/action.js' );
```

It'd be better if the module searching path can be set like Calypso does.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the require examples in main.js and actions/close-account.js, then inspect how Calypso sets its module search path. Determine the project-wide approach for replacing the inconsistent relative paths, and verify that module loading still works throughout the codebase.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
developer-experience
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.