Skip to content

Commit

Permalink
feat: support cjs and esm both by tshy
Browse files Browse the repository at this point in the history
BREAKING CHANGE: drop Node.js < 18.19.0 support

part of eggjs/egg#3644

eggjs/egg#5257
  • Loading branch information
fengmk2 committed Feb 4, 2025
1 parent d0fa496 commit 202bb16
Show file tree
Hide file tree
Showing 43 changed files with 420 additions and 352 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
test/fixtures
coverage
node_modules
__snapshots__
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "eslint-config-egg"
"extends": [
"eslint-config-egg/typescript",
"eslint-config-egg/lib/rules/enforce-node-prefix"
]
}
21 changes: 0 additions & 21 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

24 changes: 0 additions & 24 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/ci.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
Job:
name: Node.js
uses: node-modules/github-actions/.github/workflows/node-test.yml@master
with:
os: 'ubuntu-latest, windows-latest, macos-latest'
version: '18, 20, 22'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
7 changes: 1 addition & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
name: Release

on:
push:
branches: [ master ]

workflow_dispatch: {}

jobs:
release:
name: Node.js
uses: artusjs/github-actions/.github/workflows/node-release.yml@v1
uses: eggjs/github-actions/.github/workflows/node-release.yml@master
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
with:
checkTest: false
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ coverage/
run/
.DS_Store
*.swp

test/fixtures/**/run
.tshy*
.eslintcache
dist
package-lock.json
.package-lock.json
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,20 @@
### Features

* upgrade all deps to latest versions ([#6](https://github.com/eggjs/egg-tracer/issues/6)) ([516ae2b](https://github.com/eggjs/egg-tracer/commit/516ae2b570e3fceb523d7ca37443310da10ac5ed))

---


1.1.0 / 2017-09-07
==================

**features**
* [[`02501c6`](http://github.com/eggjs/egg-tracer/commit/02501c6623da0acfaca660b71d12e66afa5d7810)] - feat: support app or agent get tracer (#2) (hui <<[email protected]>>)

**others**
* [[`840724e`](http://github.com/eggjs/egg-tracer/commit/840724e8c5dc31908397004ede4a6e5a52555e0e)] - chore: upgrade deps and fix test (#1) (Haoliang Gao <<[email protected]>>)

1.0.0 / 2016-08-16
==================

* first version
14 changes: 0 additions & 14 deletions History.md

This file was deleted.

35 changes: 22 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# egg-tracer
# @eggjs/tracer

[![NPM version][npm-image]][npm-url]
[![Test coverage][codecov-image]][codecov-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/egg-tracer.svg?style=flat-square
[npm-url]: https://npmjs.org/package/egg-tracer
[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/egg-tracer.svg?style=flat-square
[codecov-url]: https://codecov.io/github/eggjs/egg-tracer?branch=master
[snyk-image]: https://snyk.io/test/npm/egg-tracer/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/egg-tracer
[download-image]: https://img.shields.io/npm/dm/egg-tracelog.svg?style=flat-square
[download-url]: https://npmjs.org/package/egg-tracer
[![Node.js Version](https://img.shields.io/node/v/@eggjs/tracer.svg?style=flat)](https://nodejs.org/en/download/)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)
![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/eggjs/security)

[npm-image]: https://img.shields.io/npm/v/@eggjs/tracer.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@eggjs/tracer
[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/tracer.svg?style=flat-square
[codecov-url]: https://codecov.io/github/eggjs/tracer?branch=master
[snyk-image]: https://snyk.io/test/npm/@eggjs/tracer/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/@eggjs/tracer
[download-image]: https://img.shields.io/npm/dm/@eggjs/tracer.svg?style=flat-square
[download-url]: https://npmjs.org/package/@eggjs/tracer

tracer plugin for egg.

## Install

```bash
npm i egg-tracer
npm i @eggjs/tracer
```

## Usage
Expand All @@ -30,15 +33,15 @@ Enable tracer plugin:
// config/plugin.js
exports.tracer = {
enable: true,
package: 'egg-tracer',
package: '@eggjs/tracer',
};
```

### Build my own tracer

```js
// my_tracer.js
const Tracer = require('egg-tracer');
const { Tracer } = require('@eggjs/tracer');

const counter = 0;

Expand Down Expand Up @@ -66,3 +69,9 @@ Please open an issue [here](https://github.com/eggjs/egg/issues).
## License

[MIT](LICENSE)

## Contributors

[![Contributors](https://contrib.rocks/image?repo=eggjs/tracer)](https://github.com/eggjs/tracer/graphs/contributors)

Made with [contributors-img](https://contrib.rocks).
1 change: 0 additions & 1 deletion agent.js

This file was deleted.

1 change: 0 additions & 1 deletion app.js

This file was deleted.

1 change: 0 additions & 1 deletion app/extend/agent.js

This file was deleted.

1 change: 0 additions & 1 deletion app/extend/application.js

This file was deleted.

14 changes: 0 additions & 14 deletions app/extend/context.js

This file was deleted.

8 changes: 0 additions & 8 deletions config/config.default.js

This file was deleted.

10 changes: 0 additions & 10 deletions index.d.ts

This file was deleted.

8 changes: 0 additions & 8 deletions index.js

This file was deleted.

8 changes: 0 additions & 8 deletions index.test-d.ts

This file was deleted.

20 changes: 0 additions & 20 deletions lib/index.js

This file was deleted.

19 changes: 0 additions & 19 deletions lib/tracer.js

This file was deleted.

Loading

0 comments on commit 202bb16

Please sign in to comment.