@eggjs/development 4.0.0 → 4.0.1-beta.2

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 (56) hide show
  1. package/README.md +9 -13
  2. package/dist/agent.d.ts +11 -0
  3. package/dist/agent.js +80 -0
  4. package/dist/app/middleware/egg_loader_trace.d.ts +6 -0
  5. package/dist/app/middleware/egg_loader_trace.js +37 -0
  6. package/dist/app.d.ts +10 -0
  7. package/dist/app.js +14 -0
  8. package/dist/{commonjs/config → config}/config.default.d.ts +7 -3
  9. package/dist/config/config.default.js +23 -0
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.js +1 -0
  12. package/{src/types.ts → dist/types.d.ts} +5 -4
  13. package/dist/types.js +1 -0
  14. package/dist/utils.d.ts +4 -0
  15. package/dist/utils.js +7 -0
  16. package/package.json +44 -65
  17. package/dist/commonjs/agent.d.ts +0 -7
  18. package/dist/commonjs/agent.js +0 -98
  19. package/dist/commonjs/app/middleware/egg_loader_trace.d.ts +0 -3
  20. package/dist/commonjs/app/middleware/egg_loader_trace.js +0 -44
  21. package/dist/commonjs/app.d.ts +0 -6
  22. package/dist/commonjs/app.js +0 -17
  23. package/dist/commonjs/config/config.default.js +0 -24
  24. package/dist/commonjs/config/loader_trace.html +0 -49
  25. package/dist/commonjs/index.d.ts +0 -1
  26. package/dist/commonjs/index.js +0 -4
  27. package/dist/commonjs/package.json +0 -3
  28. package/dist/commonjs/types.d.ts +0 -35
  29. package/dist/commonjs/types.js +0 -3
  30. package/dist/commonjs/utils.d.ts +0 -3
  31. package/dist/commonjs/utils.js +0 -25
  32. package/dist/esm/agent.d.ts +0 -7
  33. package/dist/esm/agent.js +0 -92
  34. package/dist/esm/app/middleware/egg_loader_trace.d.ts +0 -3
  35. package/dist/esm/app/middleware/egg_loader_trace.js +0 -39
  36. package/dist/esm/app.d.ts +0 -6
  37. package/dist/esm/app.js +0 -14
  38. package/dist/esm/config/config.default.d.ts +0 -15
  39. package/dist/esm/config/config.default.js +0 -22
  40. package/dist/esm/config/loader_trace.html +0 -49
  41. package/dist/esm/index.d.ts +0 -1
  42. package/dist/esm/index.js +0 -2
  43. package/dist/esm/package.json +0 -3
  44. package/dist/esm/types.d.ts +0 -35
  45. package/dist/esm/types.js +0 -2
  46. package/dist/esm/utils.d.ts +0 -3
  47. package/dist/esm/utils.js +0 -17
  48. package/dist/package.json +0 -4
  49. package/src/agent.ts +0 -106
  50. package/src/app/middleware/egg_loader_trace.ts +0 -39
  51. package/src/app.ts +0 -17
  52. package/src/config/config.default.ts +0 -23
  53. package/src/config/loader_trace.html +0 -49
  54. package/src/index.ts +0 -1
  55. package/src/typings/index.d.ts +0 -4
  56. package/src/utils.ts +0 -19
package/src/app.ts DELETED
@@ -1,17 +0,0 @@
1
- import type { ILifecycleBoot, EggCore } from '@eggjs/core';
2
-
3
- export default class AppBoot implements ILifecycleBoot {
4
- #app: EggCore;
5
-
6
- constructor(app: EggCore) {
7
- this.#app = app;
8
- // if true, then don't need to wait at local development mode
9
- if (app.config.development.fastReady) {
10
- process.nextTick(() => this.#app.ready(true));
11
- }
12
- }
13
-
14
- async configWillLoad() {
15
- this.#app.config.coreMiddleware.push('eggLoaderTrace');
16
- }
17
- }
@@ -1,23 +0,0 @@
1
- import type { DevelopmentConfig } from '../types.js';
2
-
3
- /**
4
- * @member Config#development
5
- * @property {Array} watchDirs - dirs needed watch, when files under these change, application will reload, use relative path
6
- * @property {Array} ignoreDirs - dirs don't need watch, including subdirectories, use relative path
7
- * @property {Boolean} fastReady - don't wait all plugins ready, default is false.
8
- * @property {Boolean} reloadOnDebug - whether reload on debug, default is true.
9
- * @property {Boolean} overrideDefault - whether override default watchDirs, default is false.
10
- * @property {Boolean} overrideIgnore - whether override default ignoreDirs, default is false.
11
- * @property {Array|String} reloadPattern - whether to reload, use https://github.com/sindresorhus/multimatch
12
- */
13
- export default {
14
- development: {
15
- watchDirs: [],
16
- ignoreDirs: [],
17
- fastReady: false,
18
- reloadOnDebug: true,
19
- overrideDefault: false,
20
- overrideIgnore: false,
21
- reloadPattern: undefined,
22
- } as DevelopmentConfig,
23
- };
@@ -1,49 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <title></title>
5
- </head>
6
- <body>
7
- <div id="mountNode"></div>
8
- <script src="https://gw.alipayobjects.com/os/antv/assets/g2/3.0.9/g2.min.js"></script>
9
- <script>
10
- var data = {{placeholder}};
11
-
12
- const chart = new G2.Chart({
13
- container: 'mountNode', // 指定图表容器 ID
14
- height: data.length * 22, // 指定图表高度
15
- forceFit: true,
16
- padding: 'auto',
17
- });
18
-
19
- // Step 2: 载入数据源
20
- chart.source(data, {
21
- range: {
22
- type: 'time',
23
- mask: 'HH:mm:ss',
24
- nice: true,
25
- },
26
- });
27
- chart
28
- .coord()
29
- .transpose()
30
- .scale(1, -1);
31
-
32
- chart.legend({ position: 'top' });
33
-
34
- chart.tooltip({
35
- showTitle: false,
36
- itemTpl: '<li>{duration}ms: {name} </li>'
37
- });
38
-
39
- chart
40
- .interval()
41
- .position('title*range')
42
- .color('type')
43
- .tooltip('name*duration', (name, duration) => ({ name, duration }))
44
- .size(5);
45
-
46
- chart.render();
47
- </script>
48
- </body>
49
- </html>
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- import './types.js';
@@ -1,4 +0,0 @@
1
- // make sure to import egg typings and let typescript know about it
2
- // @see https://github.com/whxaxes/blog/issues/11
3
- // and https://www.typescriptlang.org/docs/handbook/declaration-merging.html
4
- import 'egg';
package/src/utils.ts DELETED
@@ -1,19 +0,0 @@
1
- import path from 'node:path';
2
- import { fileURLToPath } from 'node:url';
3
-
4
- export function getSourceDirname() {
5
- if (typeof __dirname !== 'undefined') {
6
- return path.dirname(__dirname);
7
- }
8
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
9
- // @ts-ignore
10
- return path.dirname(fileURLToPath(import.meta.url));
11
- }
12
-
13
- export function getSourceFile(filename: string) {
14
- return path.join(getSourceDirname(), filename);
15
- }
16
-
17
- export function isTimingFile(file: string) {
18
- return /^(agent|application)_timing/.test(file);
19
- }