@edirect/trace 10.0.0 → 11.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +222 -206
  2. package/dist/README.md +381 -0
  3. package/dist/package.json +44 -0
  4. package/package.json +56 -31
  5. package/.editorconfig +0 -14
  6. package/.eslintignore +0 -1
  7. package/.eslintrc.js +0 -44
  8. package/.eslintrc.json +0 -159
  9. package/.prettierrc +0 -5
  10. package/dist/constants/headers.d.ts +0 -4
  11. package/dist/constants/headers.js +0 -6
  12. package/dist/constants/headers.js.map +0 -1
  13. package/dist/constants/index.d.ts +0 -1
  14. package/dist/constants/index.js +0 -9
  15. package/dist/constants/index.js.map +0 -1
  16. package/dist/index.d.ts +0 -3
  17. package/dist/index.js +0 -32
  18. package/dist/index.js.map +0 -1
  19. package/dist/middlewares/CLS.d.ts +0 -5
  20. package/dist/middlewares/CLS.js +0 -34
  21. package/dist/middlewares/CLS.js.map +0 -1
  22. package/dist/middlewares/body.d.ts +0 -5
  23. package/dist/middlewares/body.js +0 -104
  24. package/dist/middlewares/body.js.map +0 -1
  25. package/dist/middlewares/index.d.ts +0 -4
  26. package/dist/middlewares/index.js +0 -15
  27. package/dist/middlewares/index.js.map +0 -1
  28. package/dist/middlewares/nextjs.d.ts +0 -5
  29. package/dist/middlewares/nextjs.js +0 -35
  30. package/dist/middlewares/nextjs.js.map +0 -1
  31. package/dist/middlewares/trace.d.ts +0 -5
  32. package/dist/middlewares/trace.js +0 -27
  33. package/dist/middlewares/trace.js.map +0 -1
  34. package/dist/otel.d.ts +0 -1
  35. package/dist/otel.js +0 -194
  36. package/dist/otel.js.map +0 -1
  37. package/dist/tsconfig.build.tsbuildinfo +0 -1
  38. package/dist/utils/CLS.d.ts +0 -5
  39. package/dist/utils/CLS.js +0 -42
  40. package/dist/utils/CLS.js.map +0 -1
  41. package/dist/utils/body-prop-tools.d.ts +0 -15
  42. package/dist/utils/body-prop-tools.js +0 -87
  43. package/dist/utils/body-prop-tools.js.map +0 -1
  44. package/dist/utils/index.d.ts +0 -3
  45. package/dist/utils/index.js +0 -13
  46. package/dist/utils/index.js.map +0 -1
  47. package/dist/utils/json-path.d.ts +0 -9
  48. package/dist/utils/json-path.js +0 -33
  49. package/dist/utils/json-path.js.map +0 -1
  50. package/dist/utils/trace.d.ts +0 -5
  51. package/dist/utils/trace.js +0 -13
  52. package/dist/utils/trace.js.map +0 -1
  53. package/dist/version.d.ts +0 -1
  54. package/dist/version.js +0 -5
  55. package/dist/version.js.map +0 -1
  56. package/docs/architecture.png +0 -0
  57. package/tsconfig.build.json +0 -9
package/dist/README.md ADDED
@@ -0,0 +1,381 @@
1
+ # Open Telemetry Trace
2
+
3
+ ## Background
4
+
5
+ Based on application logs and a sales checker service that triggers alerts on a slack channel, the current solution offers some insight into the application but falls short when it comes to deep understanding of exceptions and the general business flow.
6
+
7
+ Due to the sheer amount of logs and complex integrations between the application microservices, it is not uncommon to find scenarios where the development team can spend hours tracing the problem back to its origin.
8
+
9
+ - Non-standard logs
10
+ - The log format and content depends on implementation and log uniformity is a challenge by itself.
11
+ - Logs might be outdated or absent
12
+ - As services shift, evolve and so should logs. This can be a source for inconsistencies as logs may not be updated or can be wrongly removed during the feature implementation.
13
+ - Logs are difficult to query and trace
14
+ - Even with the help of tools such Elasticsearch, querying and tracing logs can be a difficult task due to complex interactions among different services in the application.
15
+ - As an example, an error response from quote-engine but we only dispose of the policy number to find the root cause. The data provided is not enough for a complete investigation, which may lead to long research.
16
+ - Not able to trace all exception occurrences
17
+ - In the case shown by the previous item the error was not logged or at least not easily accessible.
18
+ - Sales triggers are not flexible
19
+ - Triggers are configured as code in the sales checker service. Any change to the logic must be implemented, tested and deployed.
20
+ - Sales alert do not provide insight into root causes
21
+ - The alert contains only the basic information necessary for an investigation to start. It contains the lead, partner, vertical and a brief description of the problem.
22
+ - Limited business process visibility
23
+ - As the alerts are based on sale statuses, we have limited insight into the process. With such a limited view we cannot verify which steps represent bottlenecks or are more prone to errors. Useful information for maintaining and improving the system.
24
+ - No concise view of the business flow
25
+ - Currently there are no dashboards or easily accessible views that can provide correlated information about the many steps that compose the Bolttech business flow.
26
+
27
+ ## Detailed Design
28
+
29
+ To fill the gaps that the current approach, the proposed solution must fulfill some requirements:
30
+
31
+ - Requires minimal code and service changes
32
+ - Must be flexible and configurable
33
+ - Must capable of querying multiple data sources
34
+ - Must be an evolutive tool that can help multiple types of users
35
+ - Must have a dashboard that shows useful information about business flow
36
+
37
+ Taking the requirements in consideration, the proposed solutions employs an application monitoring tool named Open Telemetry, a microservice responsible for correlating the data captured by the tool and a comprehensive dashboard for the final user.
38
+
39
+ ![image](./docs/architecture.png)
40
+
41
+ ## Usage
42
+
43
+ - Tracing Apps
44
+ - Datadog
45
+ - Services and Observability
46
+ - [Service Visibility Frontend](https://bitbucket.org/gofrank/service-visibility-frontend/src/main/)
47
+ - [Service Visibility Backend](https://bitbucket.org/gofrank/service-visibility-backend/src/main/)
48
+
49
+ ## Sample application
50
+
51
+ - [Service Visibility Samples](https://bitbucket.org/gofrank/service-visibility-samples/src/master/)
52
+ 1. Expressjs Sample
53
+
54
+ https://bitbucket.org/gofrank/service-visibility-samples/src/master/samples/api/
55
+
56
+ 2. Nest-app Sample
57
+
58
+ https://bitbucket.org/gofrank/service-visibility-samples/src/master/samples/quote-nestapp/
59
+
60
+ ## NestJS Applications
61
+
62
+ NestJs applications **should be upgraded to version 9.**
63
+
64
+ - Just the fact of upgrade the nest-app to version 9 will able the service to ship all logs to the service visibility
65
+
66
+ As we applied the `@edirect/trace` to the nest-app, we dont need to have the trace part of code on nest-app applications with nest-app version 9
67
+
68
+ In case of impossibility to upgrade, use the "Other" instructions using `@edirect/trace` directly
69
+
70
+ Integration Service was not able to upgrade because it uses a react-ssr that does not have compatibility with nestjs 9, so, even as a nestjs application, we implemented the "Other" way
71
+
72
+ - [@edirect/nest-app:9](https://bitbucket.org/gofrank/nest-app/src/master/)
73
+ 1. Upgrade nest-app, all edirect dependencies and all nestjs dependencies
74
+
75
+ 2. We should initialize our application with `otel` as a requirement for node startup command:
76
+
77
+ ```bash
78
+ node --require ./node_modules/@edirect/trace/dist/otel.js dist/main
79
+ ```
80
+
81
+ (dist/main or your application entrypoint)
82
+
83
+ 3. Remove the old client initialization as we moved it to the node require
84
+
85
+ If the service was using old trace version
86
+
87
+ ```js
88
+ const config = require('config');
89
+ const {
90
+ services: { APM },
91
+ middlewares: traceMiddlewares,
92
+ } = require('@edirect/trace');
93
+ const apmConfig = config.get('apm');
94
+
95
+ if (apmConfig.enabled) {
96
+ const apm = new APM(
97
+ apmConfig.service,
98
+ apmConfig.url,
99
+ apmConfig.traceServer,
100
+ );
101
+ apm.startTrace();
102
+ }
103
+ ```
104
+
105
+ 4. Remove the middleware usage
106
+
107
+ If the service was using old trace version
108
+
109
+ Remove it completely as we moved it to inside of `@edirect/trace`:
110
+
111
+ ```js
112
+ if (apmConfig.enabled) {
113
+ app.use(new traceMiddlewares.Body().body);
114
+ }
115
+ ```
116
+
117
+ ## NextJS Applications
118
+
119
+ NextJS applications **should be upgraded to version 12 or above**.
120
+
121
+ 1. Install the trace package:
122
+
123
+ ```bash
124
+ npm install --save @edirect/trace
125
+ ```
126
+
127
+ 2. Create a middleware
128
+ - When you upgrade the NextJS application to the version 12(or above) you will be able
129
+ to use [Middlewares](https://nextjs.org/docs/advanced-features/middleware).
130
+
131
+ Create a file called as `middleware.ts(or .js)` inside of the `src` folder.
132
+
133
+ ```ts
134
+ import { NextResponse } from 'next/server';
135
+ import type { NextRequest } from 'next/server';
136
+ import NextJsTracer from '@edirect/trace/dist/middlewares/nextjs';
137
+
138
+ // This function can be marked `async` if using `await` inside
139
+ export function middleware(request: NextRequest) {
140
+ // @edirect/trace
141
+ new NextJsTracer().body(req as unknown as Request & Record<string, unknown>);
142
+ NextResponse.next();
143
+ }
144
+ ```
145
+
146
+ 3. Install dotenv and create a dotenv.config
147
+
148
+ ```bash
149
+ npm install --save dotenv
150
+ ```
151
+
152
+ `dotenv.config.js`
153
+
154
+ ```js
155
+ const dotenv = require('dotenv');
156
+ const nodeEnv = process.env.NODE_ENV || 'development';
157
+
158
+ dotenv.config({ path: `.${nodeEnv}.env` });
159
+ ```
160
+
161
+ 4. Add the environment variables to your NextJS app:
162
+ **Example:**`.development.env`
163
+
164
+ ```yml
165
+ ## OPEN TELEMETRY
166
+ TRACE_TAG_OWNER=OWNER
167
+ TRACE_TAG_SCOPE=ie
168
+ TRACE_TAG_SERVICENAME=frontend-v2
169
+ TRACE_TAG_TENANT={STAGE}-{INSTANCE}
170
+ TRACE_SERVER_URL={URL}
171
+ TRACE_TAG_SERVICE=frontend-v2-{STAGE}-{INSTANCE}
172
+ TRACE_TAG_VERSION=1.0.0
173
+ TRACE_TAG_CLUSTER=stag-ie
174
+ TRACE_TAG_ENV=ie-stag-broker
175
+ ```
176
+
177
+ 5. Serve your production build on the standalone mode. Add this line to your `next.config.js` file
178
+
179
+ ```js
180
+ module.exports = {
181
+ // ...myOtherSettings
182
+ output: 'standalone',
183
+ };
184
+ ```
185
+
186
+ 6. Change the **start** and **dev** command:
187
+ ```json
188
+ {
189
+ "scripts": {
190
+ "dev": "cross-env NODE_ENV=development node --require ./dotenv.config.js --require ./node_modules/@edirect/trace/dist/otel.js ./node_modules/next/dist/bin/next -p 3100",
191
+ "start": "cross-env NODE_ENV=production node --require ./dotenv.config.js --require ./node_modules/@edirect/trace/dist/otel.js ./build/client/standalone/server.js -p 3100"
192
+ }
193
+ }
194
+ ```
195
+
196
+ ## Other (Not nest-app:9)
197
+
198
+ ### If you are unable to update to nest 9 or is not nest (express)
199
+
200
+ - [@edirect/trace](https://bitbucket.org/gofrank/trace/src/master/)
201
+
202
+ The usage of `@edirect/trace` will need your care to inject our middleware to log all requests from the app
203
+ 1. Install the trace package
204
+
205
+ ```bash
206
+ npm install --save @edirect/trace
207
+ ```
208
+
209
+ 2. Import the trace package
210
+
211
+ ```js
212
+ import { middlewares as traceMiddlewares } from '@edirect/trace';
213
+ ```
214
+
215
+ 3. Add the trace middleware to your application routes
216
+
217
+ Express:
218
+
219
+ ```js
220
+ app.use(new traceMiddlewares.Body().body);
221
+ ```
222
+
223
+ NestJs with nest-app:
224
+
225
+ ```js
226
+ consumer
227
+ .apply(new traceMiddlewares.Body().body)
228
+ .forRoutes({ path: '/**', method: RequestMethod.ALL });
229
+ ```
230
+
231
+ 4. We should initialize our application with `otel` as a requirement for node startup command:
232
+
233
+ ```bash
234
+ node --require ./node_modules/@edirect/trace/dist/otel.js dist/main
235
+ ```
236
+
237
+ (dist/main or your application entrypoint)
238
+
239
+ 5. Remove the old client initialization as we moved it to the node require
240
+
241
+ If the service was using old trace version
242
+
243
+ ```js
244
+ const config = require('config');
245
+ const {
246
+ services: { APM },
247
+ middlewares: traceMiddlewares,
248
+ } = require('@edirect/trace');
249
+ const apmConfig = config.get('apm');
250
+
251
+ if (apmConfig.enabled) {
252
+ const apm = new APM(
253
+ apmConfig.service,
254
+ apmConfig.url,
255
+ apmConfig.traceServer,
256
+ );
257
+ apm.startTrace();
258
+ }
259
+ ```
260
+
261
+ 6. Clean the middleware usage
262
+
263
+ If the service was using old trace version
264
+
265
+ Replace:
266
+
267
+ ```js
268
+ if (apmConfig.enabled) {
269
+ app.use(new traceMiddlewares.Body().body);
270
+ }
271
+ ```
272
+
273
+ with:
274
+
275
+ ```js
276
+ app.use(new traceMiddlewares.Body().body);
277
+ ```
278
+
279
+ ## Applying k8s configurations (Required)
280
+
281
+ We created a standard way to deploy our application configurations and simplify its configurations:
282
+
283
+ - Sometimes it could be already done by another team and you don't need to manage the configuration, just generate the configurations and apply it
284
+ - `bolttech-broker-asia\staging\config-map.yaml` (or your environment config-map)
285
+
286
+ ```yaml
287
+ auth: #or your service
288
+ trace:
289
+ tags:
290
+ scope: ie #your tech center
291
+ env: ie-stag-broker #current k8s cluster environment
292
+ cluster: stag-ie #current k8s cluster
293
+ tenant: ${namespace}
294
+ service: ${name}-${namespace}
295
+ servicename: ${name}
296
+ version: '1.0.0'
297
+ owner: OWNER
298
+ server: opentelemetry-collector.stag.bolttechbroker.net #cluster opentelemetry server
299
+ ```
300
+
301
+ Then you should generate and apply your brand new configurations:
302
+
303
+ 1. Generate
304
+
305
+ This command will generate the new configuration files for the services.
306
+
307
+ ```bash
308
+ # Staging Clusters
309
+ edi infra bolttech-broker-asia k8s generate <ENVIRONMENT> <SERVICE>
310
+ edi infra bolttech-broker-asia k8s generate stage1-vnbroker rules-engine # VN Example
311
+
312
+ # Production Clusters
313
+ edi infra <PRODUCTION_BROKER> k8s generate <ENVIRONMENT> <SERVICE>
314
+ edi infra bolttech-broker-asia-hk k8s generate live-hkbroker-a policy-issuing-service --prod # HK Example
315
+ ```
316
+
317
+ 2. Apply
318
+
319
+ This command will apply the new configurations and **redeploy** the service on the cluster.
320
+
321
+ ```bash
322
+ # Staging Clusters
323
+ edi infra bolttech-broker-asia k8s apply staging <STAGE/RC> <SERVICE> --redeploy
324
+ edi infra bolttech-broker-asia k8s apply staging rc-vnbroker frontend-service --redeploy # VN Example
325
+
326
+ # Production Clusters
327
+ edi infra <PRODUCTION_BROKER> k8s apply <CLUSTER> <ENVIRONMENT> <SERVICE>
328
+ edi infra bolttech-broker-asia-hk k8s apply cluster-a live-hkbroker-a plan-service --prod --redeploy # HK Example
329
+ ```
330
+
331
+ - Key notes when using the infrastructure repositories:
332
+ - Before running any command make sure you have completed the setup of the `edi-cli` tool and that you have all the related projects (`infrastructure` and `k8s-templates`) inside the same root folder.
333
+ - Make sure to have the most recent version of the `master` branch before running any commands.
334
+ - Remember to **ALWAYS COMMIT AND PUSH YOUR CHANGES TO THE REPOSITORIES, OTHERWISE THE NEW CONFIGURATIONS WILL NOT BE APPLIED TO SERVICES WHEN THEY ARE DEPLOYED USING THE JENKINS PIPELINES**.
335
+ - To make things easier, make sure to check the helper script on `edi-cli` project. Located at the `edi-cli-cli` folder.
336
+ - Consider hiding the folders of the brokers you will not need to work with. This will greatly improve your navigation inside the project.
337
+
338
+ ## Debugging
339
+
340
+ - How to debug it on vscode:
341
+
342
+ As we don't debug using node command directly, we suggest you to use this in your `.vscode/launch.json`
343
+
344
+ ```json
345
+ {
346
+ "version": "0.2.0",
347
+ "configurations": [
348
+ {
349
+ "type": "node",
350
+ "request": "launch",
351
+ "name": "Debug with OTEL",
352
+ "args": ["${workspaceFolder}/src/main.ts"],
353
+ "runtimeArgs": [
354
+ "--inspect",
355
+ "-r",
356
+ "./node_modules/@edirect/trace/dist/otel.js",
357
+ "-r",
358
+ "tsconfig-paths/register",
359
+ "-r",
360
+ "ts-node/register"
361
+ ],
362
+ "console": "integratedTerminal",
363
+ "envFile": "${workspaceFolder}/.development.env"
364
+ }
365
+ ]
366
+ }
367
+ ```
368
+
369
+ and append the OTEL environment variables to your local environments file:
370
+
371
+ ```conf
372
+ TRACE_TAG_OWNER=OWNER
373
+ TRACE_TAG_SCOPE=pgw
374
+ TRACE_TAG_SERVICENAME=payment-gateway
375
+ TRACE_TAG_TENANT=local-paythbroker
376
+ TRACE_SERVER_URL=opentelemetry-collector.stag.bolttechpay.net
377
+ TRACE_TAG_SERVICE=payment-gateway-local-paythbroker
378
+ TRACE_TAG_VERSION=1.0.0
379
+ TRACE_TAG_CLUSTER=localhost
380
+ TRACE_TAG_ENV=development
381
+ ```
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@edirect/trace",
3
+ "version": "11.0.25",
4
+ "description": "Edirect trace",
5
+ "main": "./dist/src/index.js",
6
+ "types": "./dist/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "development": "./src/index.ts",
10
+ "default": "./dist/src/index.js",
11
+ "require": "./dist/src/index.js",
12
+ "types": "./dist/src/index.d.ts"
13
+ },
14
+ "./package.json": "./package.json"
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "author": "EDirectInsure",
20
+ "license": "ISC",
21
+ "dependencies": {
22
+ "@opentelemetry/api": "^1.9.0",
23
+ "@opentelemetry/auto-instrumentations-node": "^0.62.2",
24
+ "@opentelemetry/exporter-trace-otlp-http": "^0.203.0",
25
+ "@opentelemetry/instrumentation": "^0.203.0",
26
+ "@opentelemetry/instrumentation-express": "^0.52.0",
27
+ "@opentelemetry/instrumentation-http": "^0.203.0",
28
+ "@opentelemetry/resources": "^2.0.1",
29
+ "@opentelemetry/sdk-node": "^0.203.0",
30
+ "@opentelemetry/sdk-trace-base": "^2.0.1",
31
+ "@opentelemetry/sdk-trace-node": "^2.0.1",
32
+ "@opentelemetry/semantic-conventions": "^1.37.0",
33
+ "cls-hooked": "^4.2.2",
34
+ "express-mung": "^0.5.1",
35
+ "reflect-metadata": "^0.2.2",
36
+ "uuid": "^11.1.0"
37
+ },
38
+ "devDependencies": {
39
+ "@types/express": "^5.0.3",
40
+ "@types/node": "^24.3.0",
41
+ "typescript": "^5.9.2"
42
+ },
43
+ "type": "commonjs"
44
+ }
package/package.json CHANGED
@@ -1,43 +1,68 @@
1
1
  {
2
2
  "name": "@edirect/trace",
3
- "version": "10.0.0",
3
+ "version": "11.0.25",
4
4
  "description": "Edirect trace",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "scripts": {
8
- "prebuild": "node -p \"'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
9
- "build": "tsc --build ./tsconfig.build.json"
5
+ "packageScope": "@edirect",
6
+ "main": "./dist/src/index.js",
7
+ "types": "./dist/src/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "development": "./src/index.ts",
11
+ "default": "./dist/src/index.js",
12
+ "require": "./dist/src/index.js",
13
+ "types": "./dist/src/index.d.ts"
14
+ },
15
+ "./package.json": "./package.json"
10
16
  },
17
+ "files": [
18
+ "dist"
19
+ ],
11
20
  "author": "EDirectInsure",
12
21
  "license": "ISC",
13
- "devDependencies": {
14
- "@types/express": "^4.17.14",
15
- "@types/node": "^16.3.2",
16
- "@typescript-eslint/eslint-plugin": "^4.19.0",
17
- "@typescript-eslint/parser": "^4.19.0",
18
- "eslint": "^7.22.0",
19
- "eslint-config-prettier": "^8.1.0",
20
- "eslint-plugin-prettier": "^3.3.1",
21
- "husky": "^3.1.0",
22
- "prettier": "^2.2.1",
23
- "typescript": "^4.9.5"
24
- },
25
22
  "dependencies": {
26
23
  "@opentelemetry/api": "^1.9.0",
27
- "@opentelemetry/auto-instrumentations-node": "^0.53.0",
28
- "@opentelemetry/exporter-trace-otlp-http": "^0.55.0",
29
- "@opentelemetry/instrumentation": "^0.55.0",
30
- "@opentelemetry/instrumentation-express": "^0.45.0",
31
- "@opentelemetry/instrumentation-http": "^0.55.0",
32
- "@opentelemetry/resources": "^1.28.0",
33
- "@opentelemetry/sdk-node": "^0.55.0",
34
- "@opentelemetry/sdk-trace-base": "^1.28.0",
35
- "@opentelemetry/sdk-trace-node": "^1.28.0",
36
- "@opentelemetry/semantic-conventions": "^1.28.0",
24
+ "@opentelemetry/auto-instrumentations-node": "^0.62.2",
25
+ "@opentelemetry/exporter-trace-otlp-http": "^0.203.0",
26
+ "@opentelemetry/instrumentation": "^0.203.0",
27
+ "@opentelemetry/instrumentation-express": "^0.52.0",
28
+ "@opentelemetry/instrumentation-http": "^0.203.0",
29
+ "@opentelemetry/resources": "^2.0.1",
30
+ "@opentelemetry/sdk-node": "^0.203.0",
31
+ "@opentelemetry/sdk-trace-base": "^2.0.1",
32
+ "@opentelemetry/sdk-trace-node": "^2.0.1",
33
+ "@opentelemetry/semantic-conventions": "^1.37.0",
37
34
  "cls-hooked": "^4.2.2",
38
35
  "express-mung": "^0.5.1",
39
- "querystring": "^0.2.1",
40
36
  "reflect-metadata": "^0.2.2",
41
- "uuid": "^10.0.0"
37
+ "uuid": "^11.1.0"
38
+ },
39
+ "devDependencies": {
40
+ "@types/express": "^5.0.3",
41
+ "@types/node": "^24.3.0",
42
+ "@typescript-eslint/eslint-plugin": "^8.42.0",
43
+ "@typescript-eslint/parser": "^8.42.0",
44
+ "eslint": "^9.34.0",
45
+ "eslint-config-prettier": "^10.1.8",
46
+ "eslint-plugin-prettier": "^5.5.4",
47
+ "husky": "^9.1.7",
48
+ "prettier": "^3.6.2",
49
+ "typescript": "^5.9.2"
50
+ },
51
+ "nx": {
52
+ "name": "@edirect/trace",
53
+ "targets": {
54
+ "build": {
55
+ "executor": "@nx/js:tsc",
56
+ "options": {
57
+ "main": "{workspaceRoot}/packages/edirect-trace/src/index.ts",
58
+ "tsConfig": "{workspaceRoot}/packages/edirect-trace/tsconfig.lib.json",
59
+ "outputPath": "{workspaceRoot}/packages/edirect-trace/dist",
60
+ "assets": [
61
+ "{workspaceRoot}/packages/edirect-trace/package.json",
62
+ "{workspaceRoot}/packages/edirect-trace/README.md"
63
+ ]
64
+ }
65
+ }
66
+ }
42
67
  }
43
- }
68
+ }
package/.editorconfig DELETED
@@ -1,14 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- end_of_line = lf
5
- insert_final_newline = true
6
- charset = utf-8
7
-
8
- [*.js]
9
- indent_style = space
10
- indent_size = 2
11
- trim_trailing_whitespace = true
12
-
13
- [*.md]
14
- trim_trailing_whitespace = false
package/.eslintignore DELETED
@@ -1 +0,0 @@
1
- /node_modules
package/.eslintrc.js DELETED
@@ -1,44 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es6: true,
5
- node: true,
6
- },
7
- extends: [
8
- 'plugin:@typescript-eslint/recommended',
9
- 'prettier'
10
- ],
11
- globals: {
12
- Atomics: 'readonly',
13
- SharedArrayBuffer: 'readonly',
14
- },
15
- parser: '@typescript-eslint/parser',
16
- parserOptions: {
17
- ecmaFeatures: {
18
- jsx: true,
19
- },
20
- ecmaVersion: 2018,
21
- sourceType: 'module',
22
- project: './tsconfig.json',
23
- tsconfigRootDir: __dirname,
24
- },
25
- plugins: ['@typescript-eslint', 'prettier'],
26
- rules: {
27
- 'no-unused-vars': 0,
28
- '@typescript-eslint/no-unused-vars': [
29
- 'error',
30
- { argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
31
- ],
32
- '@typescript-eslint/no-explicit-any': 0,
33
- '@typescript-eslint/ban-ts-ignore': 0,
34
- '@typescript-eslint/explicit-function-return-type': [
35
- 'warn',
36
- {
37
- allowExpressions: true,
38
- allowTypedFunctionExpressions: true,
39
- allowHigherOrderFunctions: true,
40
- },
41
- ],
42
- '@typescript-eslint/no-floating-promises': 1,
43
- },
44
- };