Skip to content

feat: add morgan types to work with typescript #119

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

Closed
wants to merge 1 commit into from

Conversation

floross
Copy link

@floross floross commented May 3, 2022

This pull request add types information to the morgan elastic package (@elastic/ecs-morgan-format)

@cla-checker-service
Copy link

❌ Author of the following commits did not sign a Contributor Agreement:
3716ad9

Please, read and sign the above mentioned agreement if you want to contribute to this project

@github-actions github-actions bot added agent-nodejs Make available for APM Agents project planning. community triage labels May 3, 2022
@apmmachine
Copy link
Contributor

❕ Build Aborted

The PR is not allowed to run in the CI yet

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Start Time: 2022-05-03T13:37:50.455+0000

  • Duration: 3 min 59 sec

Steps errors 1

Expand to view the steps failures

Error signal
  • Took 0 min 0 sec . View more details here
  • Description: githubApiCall: The REST API call https://api.github.com/orgs/elastic/members/floross return the message : java.lang.Exception: httpRequest: Failure connecting to the service https://api.github.com/orgs/elastic/members/floross : httpRequest: Failure connecting to the service https://api.github.com/orgs/elastic/members/floross : Code: 404Error: {"message":"User does not exist or is not a member of the organization","documentation_url":"https://docs.github.com/rest/reference/orgs#check-organization-membership-for-a-user"}

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@trentm
Copy link
Member

trentm commented Oct 18, 2023

Hi @floross. Thanks very much for your PR! I'm sorry that I didn't get back to you way back when you submitted this. Are you able to sign our CLA (at https://www.elastic.co/contributor-agreement)? Then I'll be able to get this in this week.

trentm added a commit that referenced this pull request Oct 27, 2023
This updates the three @elastic/ecs-*-format packages to support the following
import styles from JS and TS code:
1. `const { ecsFormat } = require('@elastic/ecs-pino-format);` in JS and TS.
   The preferred import style for JS code using CommonJS.
2. `import { ecsFormat } from '@elastic/ecs-pino-format';` in JS and TS.
   ES module (ESM) import style. This is the preferred style for TypeScript
   code and for JS developers using ESM.
3. `const ecsFormat = require('@elastic/ecs-pino-format');` in JS.
   The old, deprecated import method. Still supported for backward compat.
4. `import ecsFormat from '@elastic/ecs-pino-format';` in JS and TS.
   This works, but is deprecated. Prefer #2 style.
5. `import * as EcsPinoFormat from '@elastic/ecs-pino-format';` in TS.
   One must then use `EcsPinoFormat.ecsFormat()`.

Note that this *excludes* support for this TS-only style:
`import escFormat = require('@elastic/ecs-pino-format');`

This also adds types for ecs-morgan-format, based on #119 and #90.
I'd had an earlier start on this in #96.

Replaces: #96
Closes: #90
Closes: #119
@trentm trentm closed this in #165 Oct 30, 2023
trentm added a commit that referenced this pull request Oct 30, 2023
…#165)

This updates the three @elastic/ecs-*-format packages to support the following
import styles from JS and TS code:
1. `const { ecsFormat } = require('@elastic/ecs-pino-format);` in JS and TS.
   The preferred import style for JS code using CommonJS.
2. `import { ecsFormat } from '@elastic/ecs-pino-format';` in JS and TS.
   ES module (ESM) import style. This is the preferred style for TypeScript
   code and for JS developers using ESM.
3. `const ecsFormat = require('@elastic/ecs-pino-format');` in JS.
   The old, deprecated import method. Still supported for backward compat.
4. `import ecsFormat from '@elastic/ecs-pino-format';` in JS and TS.
   This works, but is deprecated. Prefer #2 style.
5. `import * as EcsPinoFormat from '@elastic/ecs-pino-format';` in TS.
   One must then use `EcsPinoFormat.ecsFormat()`.

Note that this *excludes* support for this TS-only style:
`import escFormat = require('@elastic/ecs-pino-format');`

This also adds types for ecs-morgan-format, based on #119 and #90.
I'd had an earlier start on this in #96.

Replaces: #96
Closes: #90
Closes: #119
@trentm trentm removed the triage label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning. community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants