gajus / gajus/roarr

Add a utility to identify Roarr location

Open
#27 0 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
1.1k
Forks
41
PR merge metrics
No merged PRs in 30d

Description

I start pretty much every file with a variation of:

```js
import Logger from '../Logger';

const log = Logger.child({
namespace: 'createUpstreamHttpClientConfiguration',
});

```

`namespace` is most of the time the name of the file.

I am wondering if we could provide a utility to automate this, e.g.

```js
import log from 'roarr.macro';

```

that would transpile to a version above.

`Logger` file is usually simply used to add the package name to the context. That could be pulled from `package.json` or we could resolve location of the `Logger.js` file to always use as a base.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the Logger file and the package.json context mentioned in the issue, then examine how Logger.js is resolved and how the proposed roarr.macro import could be transpiled. Done means a documented utility can derive the package context and file-based namespace for the shown logger pattern.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.