@domain.js/main 0.1.13 → 0.1.14

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.
@@ -1,18 +1,18 @@
1
- import _ from "lodash";
2
- import * as uuid from "uuid";
3
1
  import * as ajv from "ajv";
4
2
  import * as ajvFormats from "ajv-formats";
5
3
  import * as async from "async";
6
4
  import * as axios from "axios";
7
5
  import * as cronParser from "cron-parser";
8
6
  import humanInterval from "human-interval";
9
- import * as IORedis from "ioredis";
7
+ import IORedis from "ioredis";
8
+ import _ from "lodash";
10
9
  import LRU from "lru-cache";
10
+ import moment from "moment";
11
11
  import * as mysql from "mysql2";
12
12
  import * as Sequelize from "sequelize";
13
- import moment from "moment";
14
- import * as utils from "./utils";
13
+ import * as uuid from "uuid";
15
14
  import { errors } from "./basic-errors";
15
+ import * as utils from "./utils";
16
16
  /** npm packages injection */
17
17
  export interface Defaults {
18
18
  /**
package/dist/defaults.js CHANGED
@@ -23,21 +23,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.defaults = void 0;
26
- const lodash_1 = __importDefault(require("lodash"));
27
- const uuid = __importStar(require("uuid"));
28
26
  const ajv = __importStar(require("ajv"));
29
27
  const ajvFormats = __importStar(require("ajv-formats"));
30
28
  const async = __importStar(require("async"));
31
29
  const axios = __importStar(require("axios"));
32
30
  const cronParser = __importStar(require("cron-parser"));
33
31
  const human_interval_1 = __importDefault(require("human-interval"));
34
- const IORedis = __importStar(require("ioredis"));
32
+ const ioredis_1 = __importDefault(require("ioredis"));
33
+ const lodash_1 = __importDefault(require("lodash"));
35
34
  const lru_cache_1 = __importDefault(require("lru-cache"));
35
+ const moment_1 = __importDefault(require("moment"));
36
36
  const mysql = __importStar(require("mysql2"));
37
37
  const Sequelize = __importStar(require("sequelize"));
38
- const moment_1 = __importDefault(require("moment"));
39
- const utils = __importStar(require("./utils"));
38
+ const uuid = __importStar(require("uuid"));
40
39
  const basic_errors_1 = require("./basic-errors");
40
+ const utils = __importStar(require("./utils"));
41
41
  exports.defaults = {
42
42
  _: lodash_1.default,
43
43
  uuid,
@@ -47,7 +47,7 @@ exports.defaults = {
47
47
  axios,
48
48
  cronParser,
49
49
  humanInterval: human_interval_1.default,
50
- IORedis,
50
+ IORedis: ioredis_1.default,
51
51
  LRU: lru_cache_1.default,
52
52
  mysql,
53
53
  Sequelize,
@@ -1,30 +1,15 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
20
4
  };
21
5
  Object.defineProperty(exports, "__esModule", { value: true });
22
6
  exports.Deps = exports.Main = void 0;
23
- const process = __importStar(require("process"));
7
+ const process_1 = __importDefault(require("process"));
24
8
  function Graceful(info) {
25
9
  let exiting = false; // 是否正在退出
26
10
  const callbacks = [];
27
- const counter = ((count = 0) => {
11
+ const counter = ((init = 0) => {
12
+ let count = init;
28
13
  const decr = () => {
29
14
  count -= 1;
30
15
  };
@@ -72,11 +57,11 @@ function Graceful(info) {
72
57
  return;
73
58
  info("process exit check success, process exited");
74
59
  clearInterval(timer);
75
- process.exit(0);
60
+ process_1.default.exit(0);
76
61
  }, 1000);
77
62
  };
78
- process.on("SIGTERM", exitHandle);
79
- process.on("SIGINT", exitHandle);
63
+ process_1.default.on("SIGTERM", exitHandle);
64
+ process_1.default.on("SIGINT", exitHandle);
80
65
  /**
81
66
  * addListen function be called when process exit
82
67
  * @param listenner
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domain.js/main",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "DDD framework",
5
5
  "main": "dist/index.js",
6
6
  "bin": {