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

Modify to read RootConfig file of js ext #9

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

uyu423
Copy link

@uyu423 uyu423 commented Oct 28, 2020

There are people who want to manage config files such as tsconfig, pm2, webpack, eslint, etc. as *.js rather than *.json files. And most packages support reading configuration files with the *.js extension.

I want to manage the pinpoint-config file with js extension rather than json extension.

This is a PR on the above.

@feelform
Copy link
Collaborator

microsoft/TypeScript#30400 (comment)

It allows to support configure with statements, we have to approach it carefully. tsconfig also doesn't allow js config.

@uyu423
Copy link
Author

uyu423 commented Oct 28, 2020

@feelform One of the limitations of json is that it doesn't support comments. This causes inconvenience. and I think there should be a variety of pinpoint-agent setting methods that suit the user's likes. Even if the js configuration file has state, it is the user's responsibility.

Are there any other problems expected when the configure has a state?
tsconfig is my mistake. sorry.

- `import 'pinpoint-node-agent'` 방식은 한줄로 노드 에이전트를 띄울 수 있지만, 환경 변수나 외부의 config.json 파일 외에 에이전트 객체의 설정 값을 바꿀 수 있는 방법이 없다.
- 그래서 wrapper function 으로 한번 감싸주고 외부로 부터 인자를 주입 받아 필요시 동적으로 pinpointNodeAgent 를 생성할 수 있도록 변경했다.
- 하위 호환 때문에 PR은 올리지 못할 덧...
- TypeScript 환경에서 쓸거라 d.ts 파일을 추가함
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants