@qqi/log 0.1.1 → 1.0.0

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 (37) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +1 -1
  3. package/{src/index.cjs → cjs/index.js} +6 -8
  4. package/{src/managePrint.cjs → cjs/managePrint.js} +9 -9
  5. package/{src/notSupport.cjs → cjs/notSupport.js} +1 -1
  6. package/{src/printError.cjs → cjs/printError.js} +1 -1
  7. package/{src/printInfo.cjs → cjs/printInfo.js} +1 -1
  8. package/{src/printWarn.cjs → cjs/printWarn.js} +1 -1
  9. package/{src/index.mjs → es/index.js} +6 -8
  10. package/{src/managePrint.mjs → es/managePrint.js} +9 -9
  11. package/{src/notSupport.mjs → es/notSupport.js} +1 -1
  12. package/{src/printError.mjs → es/printError.js} +1 -1
  13. package/{src/printInfo.mjs → es/printInfo.js} +1 -1
  14. package/{src/printWarn.mjs → es/printWarn.js} +1 -1
  15. package/{src → es/src}/index.d.ts +1 -0
  16. package/package.json +32 -42
  17. package/index.cjs +0 -7
  18. package/index.d.ts +0 -2
  19. package/index.mjs +0 -1
  20. /package/{src/blankCall.cjs → cjs/blankCall.js} +0 -0
  21. /package/{src/parseError.cjs → cjs/parseError.js} +0 -0
  22. /package/{src/platform.cjs → cjs/platform.js} +0 -0
  23. /package/{src/setType.cjs → cjs/setType.js} +0 -0
  24. /package/{src/blankCall.mjs → es/blankCall.js} +0 -0
  25. /package/{src/parseError.mjs → es/parseError.js} +0 -0
  26. /package/{src/platform.mjs → es/platform.js} +0 -0
  27. /package/{src/setType.mjs → es/setType.js} +0 -0
  28. /package/{src → es/src}/blankCall.d.ts +0 -0
  29. /package/{src → es/src}/managePrint.d.ts +0 -0
  30. /package/{src → es/src}/notSupport.d.ts +0 -0
  31. /package/{src → es/src}/parseError.d.ts +0 -0
  32. /package/{src → es/src}/platform.d.ts +0 -0
  33. /package/{src → es/src}/printError.d.ts +0 -0
  34. /package/{src → es/src}/printInfo.d.ts +0 -0
  35. /package/{src → es/src}/printWarn.d.ts +0 -0
  36. /package/{src → es/src}/setType.d.ts +0 -0
  37. /package/{src → es/src}/type.d.ts +0 -0
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright (c) <2025> <🥜>
3
+ Copyright (c) <2025> <Mr.MudBean>
4
4
 
5
5
  Permission to use, copy, modify, and/or distribute this software for any
6
6
  purpose with or without fee is hereby granted, provided that the above
@@ -16,7 +16,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
16
 
17
17
  # MIT 许可证
18
18
 
19
- 版权所有 (c) [2025] [🥜]
19
+ 版权所有 (c) [2025] [泥豆君]
20
20
 
21
21
  特此免费授予任何获得本软件及相关文档文件(以下简称“软件”)副本的人不受限制地处置该软件的权利,包括不受限制地使用、复制、修改、合并、发布、分发、再许可和/或出售该软件副本的权利,并允许向其提供该软件的人这样做,但须遵守以下条件:
22
22
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @qqi/log
2
2
 
3
- [![version](<https://img.shields.io/npm/v/@qqi/log.svg?logo=npm&logoColor=rgb(0,0,0)&label=版本号&labelColor=rgb(73,73,228)&color=rgb(0,0,0)>)](https://www.npmjs.com/package/@qqi/log) [![issues 提交](<https://img.shields.io/badge/issues-提交-rgb(255,0,63)?logo=github>)](https://github.com/earthnutDev/qqi/issues)
3
+ [![version](<https://img.shields.io/npm/v/@qqi/log.svg?logo=npm&logoColor=rgb(0,0,0)&label=版本号&labelColor=rgb(73,73,228)&color=rgb(0,0,0)>)](https://www.npmjs.com/package/@qqi/log) [![issues 提交](<https://img.shields.io/badge/issues-提交-rgb(255,0,63)?logo=github>)](https://github.com/MeMudBean/qqi/issues)
4
4
 
5
5
  ## 安装
6
6
 
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var aJsTools = require('a-js-tools');
4
- var setType = require('./setType.cjs');
5
- var blankCall = require('./blankCall.cjs');
6
- var managePrint = require('./managePrint.cjs');
4
+ var setType = require('./setType.js');
5
+ var blankCall = require('./blankCall.js');
6
+ var managePrint = require('./managePrint.js');
7
7
  var aTypeOfJs = require('a-type-of-js');
8
- var platform = require('./platform.cjs');
8
+ var platform = require('./platform.js');
9
9
  var _static = require('@color-pen/static');
10
10
 
11
11
  /**
@@ -14,8 +14,6 @@ var _static = require('@color-pen/static');
14
14
  *
15
15
  * @param options - 配置项
16
16
  * @returns - dev log 工厂函数
17
- *
18
- *
19
17
  */
20
18
  function Dog(options) {
21
19
  if (aTypeOfJs.isUndefined(options))
@@ -38,8 +36,8 @@ function Dog(options) {
38
36
  name = name.trim().replace(/\s+/g, '_');
39
37
  /** 当前获取环境值 */
40
38
  const _env = (platform.platform === 'node' &&
41
- (process.env[name.toUpperCase().concat('_DEV')] ??
42
- process.env[name.toLowerCase().concat('_dev')])) ||
39
+ (globalThis?.process.env[name.toUpperCase().concat('_DEV')] ??
40
+ globalThis?.process.env[name.toLowerCase().concat('_dev')])) ||
43
41
  false;
44
42
  const env = _env === 'false' ? false : _env === 'true' ? true : _env;
45
43
  /** 默认 node 环境以获取到的环境值为准,而非 node 环境默认开启,并通过自定义的 @qqi/babel-plugin-remove-dog-calls 来进行过滤正式环境(环境值需要自定义) */
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
3
  var aTypeOfJs = require('a-type-of-js');
4
- var notSupport = require('./notSupport.cjs');
5
- var platform = require('./platform.cjs');
6
- var blankCall = require('./blankCall.cjs');
7
- var printError = require('./printError.cjs');
8
- var printWarn = require('./printWarn.cjs');
9
- var printInfo = require('./printInfo.cjs');
10
- var setType = require('./setType.cjs');
4
+ var notSupport = require('./notSupport.js');
5
+ var platform = require('./platform.js');
6
+ var blankCall = require('./blankCall.js');
7
+ var printError = require('./printError.js');
8
+ var printWarn = require('./printWarn.js');
9
+ var printInfo = require('./printInfo.js');
10
+ var setType = require('./setType.js');
11
11
 
12
12
  /** 管理是否打印 */
13
13
  function managePrint(type, privateFunc, name) {
14
14
  if (platform.platform === 'node') {
15
- const dev = process.env[name.toUpperCase().concat('_DEV')] ||
16
- process.env[name.toLowerCase().concat('_dev')];
15
+ const dev = globalThis?.process.env[name.toUpperCase().concat('_DEV')] ||
16
+ globalThis?.process.env[name.toLowerCase().concat('_dev')];
17
17
  /// 当前禁止使用打印
18
18
  /// node 环境未配置 NAME_DEV 环境变量
19
19
  /// 显式配置 NAME_DEV 环境变量为 false
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var blankCall = require('./blankCall.cjs');
3
+ var blankCall = require('./blankCall.js');
4
4
 
5
5
  /**
6
6
  * 当前环境不支持
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var parseError = require('./parseError.cjs');
3
+ var parseError = require('./parseError.js');
4
4
 
5
5
  /**
6
6
  *
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var parseError = require('./parseError.cjs');
3
+ var parseError = require('./parseError.js');
4
4
 
5
5
  /**
6
6
  *
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var parseError = require('./parseError.cjs');
3
+ var parseError = require('./parseError.js');
4
4
 
5
5
  /**
6
6
  *
@@ -1,9 +1,9 @@
1
1
  import { createConstructor, getRandomString } from 'a-js-tools';
2
- import { setType } from './setType.mjs';
3
- import { blankCall } from './blankCall.mjs';
4
- import { managePrint } from './managePrint.mjs';
2
+ import { setType } from './setType.js';
3
+ import { blankCall } from './blankCall.js';
4
+ import { managePrint } from './managePrint.js';
5
5
  import { isUndefined, isBoolean, isString } from 'a-type-of-js';
6
- import { platform } from './platform.mjs';
6
+ import { platform } from './platform.js';
7
7
  import { esc } from '@color-pen/static';
8
8
 
9
9
  /**
@@ -12,8 +12,6 @@ import { esc } from '@color-pen/static';
12
12
  *
13
13
  * @param options - 配置项
14
14
  * @returns - dev log 工厂函数
15
- *
16
- *
17
15
  */
18
16
  function Dog(options) {
19
17
  if (isUndefined(options))
@@ -36,8 +34,8 @@ function Dog(options) {
36
34
  name = name.trim().replace(/\s+/g, '_');
37
35
  /** 当前获取环境值 */
38
36
  const _env = (platform === 'node' &&
39
- (process.env[name.toUpperCase().concat('_DEV')] ??
40
- process.env[name.toLowerCase().concat('_dev')])) ||
37
+ (globalThis?.process.env[name.toUpperCase().concat('_DEV')] ??
38
+ globalThis?.process.env[name.toLowerCase().concat('_dev')])) ||
41
39
  false;
42
40
  const env = _env === 'false' ? false : _env === 'true' ? true : _env;
43
41
  /** 默认 node 环境以获取到的环境值为准,而非 node 环境默认开启,并通过自定义的 @qqi/babel-plugin-remove-dog-calls 来进行过滤正式环境(环境值需要自定义) */
@@ -1,17 +1,17 @@
1
1
  import { isUndefined } from 'a-type-of-js';
2
- import { notSupport } from './notSupport.mjs';
3
- import { platform } from './platform.mjs';
4
- import { blankCall } from './blankCall.mjs';
5
- import { printError } from './printError.mjs';
6
- import { printWarn } from './printWarn.mjs';
7
- import { printInfo } from './printInfo.mjs';
8
- import { typeList } from './setType.mjs';
2
+ import { notSupport } from './notSupport.js';
3
+ import { platform } from './platform.js';
4
+ import { blankCall } from './blankCall.js';
5
+ import { printError } from './printError.js';
6
+ import { printWarn } from './printWarn.js';
7
+ import { printInfo } from './printInfo.js';
8
+ import { typeList } from './setType.js';
9
9
 
10
10
  /** 管理是否打印 */
11
11
  function managePrint(type, privateFunc, name) {
12
12
  if (platform === 'node') {
13
- const dev = process.env[name.toUpperCase().concat('_DEV')] ||
14
- process.env[name.toLowerCase().concat('_dev')];
13
+ const dev = globalThis?.process.env[name.toUpperCase().concat('_DEV')] ||
14
+ globalThis?.process.env[name.toLowerCase().concat('_dev')];
15
15
  /// 当前禁止使用打印
16
16
  /// node 环境未配置 NAME_DEV 环境变量
17
17
  /// 显式配置 NAME_DEV 环境变量为 false
@@ -1,4 +1,4 @@
1
- import { blankCall } from './blankCall.mjs';
1
+ import { blankCall } from './blankCall.js';
2
2
 
3
3
  /**
4
4
  * 当前环境不支持
@@ -1,4 +1,4 @@
1
- import { parseError } from './parseError.mjs';
1
+ import { parseError } from './parseError.js';
2
2
 
3
3
  /**
4
4
  *
@@ -1,4 +1,4 @@
1
- import { parseError } from './parseError.mjs';
1
+ import { parseError } from './parseError.js';
2
2
 
3
3
  /**
4
4
  *
@@ -1,4 +1,4 @@
1
- import { parseError } from './parseError.mjs';
1
+ import { parseError } from './parseError.js';
2
2
 
3
3
  /**
4
4
  *
@@ -7,3 +7,4 @@ import { DevLog, DogOptions } from './type';
7
7
  */
8
8
  declare const DogConstructor: import("a-js-tools").CreateConstructor<DevLog, [options?: DogOptions | undefined]>;
9
9
  export { DogConstructor as Dog };
10
+ export type { DevLogType, DevLog } from './type';
package/package.json CHANGED
@@ -1,63 +1,53 @@
1
1
  {
2
- "main": "index.cjs",
3
- "module": "index.mjs",
4
- "types": "index.d.ts",
5
2
  "type": "module",
6
- "version": "0.1.1",
3
+ "version": "1.0.0",
7
4
  "name": "@qqi/log",
5
+ "main": "cjs/index.js",
6
+ "module": "es/index.js",
7
+ "types": "es/src/index.d.ts",
8
8
  "description": "原 @qqi/dev-log 中的 log 部分",
9
+ "sideEffects": false,
9
10
  "license": "MIT",
10
- "dependencies": {
11
- "@color-pen/static": "^1.0.1",
12
- "a-js-tools": "^1.0.10",
13
- "a-type-of-js": "^1.0.7",
14
- "color-pen": "^2.0.13"
15
- },
16
- "publishConfig": {
17
- "access": "public",
18
- "registry": "https://registry.npmjs.org/"
19
- },
20
11
  "files": [
21
- "index.d.ts",
22
- "index.mjs",
23
- "index.cjs",
24
- "src"
12
+ "cjs",
13
+ "es",
14
+ "LICENSE",
15
+ "README.md"
25
16
  ],
26
17
  "exports": {
27
18
  ".": {
28
- "import": {
29
- "default": "./index.mjs",
30
- "types": "./index.d.ts"
31
- },
32
- "require": {
33
- "default": "./index.cjs",
34
- "types": "./index.d.ts"
35
- }
19
+ "import": "./es/index.js",
20
+ "default": "./es/index.js",
21
+ "require": "./cjs/index.js",
22
+ "types": "./es/src/index.d.ts"
36
23
  }
37
24
  },
25
+ "keywords": [
26
+ "log"
27
+ ],
28
+ "homepage": "https://earthnut.dev/npm/qqi/log",
29
+ "dependencies": {
30
+ "@color-pen/static": "^1.1.1",
31
+ "a-js-tools": "^2.0.1",
32
+ "a-type-of-js": "^2.0.0",
33
+ "color-pen": "^3.0.0"
34
+ },
35
+ "bugs": {
36
+ "url": "https://github.com/MrMudBean/qqi/issues",
37
+ "email": "Mr.MudBean@outlook.com"
38
+ },
38
39
  "repository": {
39
40
  "type": "git",
40
- "url": "git+https://github.com/earthnutDev/qqi.git"
41
+ "url": "git+https://github.com/MrMudBean/qqi.git"
41
42
  },
42
- "author": {
43
- "name": "🥜",
44
- "email": "earthnut.dev@outlook.com",
45
- "url": "https://earthnut.dev"
43
+ "publishConfig": {
44
+ "access": "public",
45
+ "registry": "https://registry.npmjs.org/"
46
46
  },
47
47
  "browserslist": [
48
- "node>=18.0.0"
48
+ "last 2"
49
49
  ],
50
50
  "engines": {
51
51
  "node": ">=18.0.0"
52
- },
53
- "keywords": [
54
- "log",
55
- "qqi",
56
- "earthnut"
57
- ],
58
- "homepage": "https://earthnut.dev/npm/qqi/log",
59
- "bugs": {
60
- "url": "https://github.com/earthnutDev/qqi/issues",
61
- "email": "earthnut.dev@outlook.com"
62
52
  }
63
53
  }
package/index.cjs DELETED
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./src/index.cjs');
4
-
5
-
6
-
7
- exports.Dog = index.Dog;
package/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { Dog } from './src';
2
- export type { DevLogType, DevLog } from './src/type';
package/index.mjs DELETED
@@ -1 +0,0 @@
1
- export { Dog } from './src/index.mjs';
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes