Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve managing global configuration #8

Open
aniketnk opened this issue Jul 20, 2020 · 4 comments · May be fixed by #24
Open

Improve managing global configuration #8

aniketnk opened this issue Jul 20, 2020 · 4 comments · May be fixed by #24
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@aniketnk
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Let's have a better way to manage configuration. See [Best-Practices Config Guide].(https://github.com/goldbergyoni/nodebestpractices/blob/master/sections/projectstructre/configguide.md)

Issue:
Error not informative

error TS2307: Cannot find module './config' or its corresponding type declarations.

Describe the solution you'd like
Use some library like rc, nconf, config

Describe alternatives you've considered
Mentioned above

Additional context
None

@aniketnk
Copy link
Collaborator Author

I added the config.ts file, but now I'm getting another error

posterior/node_modules/ts-node/src/index.ts:434
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/app.ts:6:20 - error TS2306: File '/Users/ani/work/posterior/src/config.ts' is not a module.

6 import config from './config';
                     ~~~~~~~~~~

    at createTSError (/Users/ani/work/posterior/node_modules/ts-node/src/index.ts:434:12)
    at reportTSError (/Users/ani/work/posterior/node_modules/ts-node/src/index.ts:438:19)
    at getOutput (/Users/ani/work/posterior/node_modules/ts-node/src/index.ts:578:36)
    at Object.compile (/Users/ani/work/posterior/node_modules/ts-node/src/index.ts:775:32)
    at Module.m._compile (/Users/ani/work/posterior/node_modules/ts-node/src/index.ts:858:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/ani/work/posterior/node_modules/ts-node/src/index.ts:861:12)
    at Module.load (internal/modules/cjs/loader.js:1050:32)
    at Function.Module._load (internal/modules/cjs/loader.js:938:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)

This error is different from the one described in the issue.

How to reproduce:

  • Checkout Sparsh's fork, master branch at commit 5a5d640
  • Environment: MacOS, node v14.5.0

@temanisparsh need an urgent fix for this

@temanisparsh
Copy link
Contributor

I added the config.ts file, but now I'm getting another error

posterior/node_modules/ts-node/src/index.ts:434
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/app.ts:6:20 - error TS2306: File '/Users/ani/work/posterior/src/config.ts' is not a module.

6 import config from './config';
                     ~~~~~~~~~~

    at createTSError (/Users/ani/work/posterior/node_modules/ts-node/src/index.ts:434:12)
    at reportTSError (/Users/ani/work/posterior/node_modules/ts-node/src/index.ts:438:19)
    at getOutput (/Users/ani/work/posterior/node_modules/ts-node/src/index.ts:578:36)
    at Object.compile (/Users/ani/work/posterior/node_modules/ts-node/src/index.ts:775:32)
    at Module.m._compile (/Users/ani/work/posterior/node_modules/ts-node/src/index.ts:858:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/ani/work/posterior/node_modules/ts-node/src/index.ts:861:12)
    at Module.load (internal/modules/cjs/loader.js:1050:32)
    at Function.Module._load (internal/modules/cjs/loader.js:938:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)

This error is different from the one described in the issue.

How to reproduce:

  • Checkout Sparsh's fork, master branch at commit 5a5d640
  • Environment: MacOS, node v14.5.0

@temanisparsh need an urgent fix for this

Have updated the config file to fix this

@temanisparsh
Copy link
Contributor

We can use config for this.
nconf seems a bit too much.

@aniketnk
Copy link
Collaborator Author

Alright. Let's get that in another PR. Link it here.

@aniketnk aniketnk added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jul 22, 2020
@temanisparsh temanisparsh linked a pull request Jul 22, 2020 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants