@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.
- package/LICENSE +2 -2
- package/README.md +1 -1
- package/{src/index.cjs → cjs/index.js} +6 -8
- package/{src/managePrint.cjs → cjs/managePrint.js} +9 -9
- package/{src/notSupport.cjs → cjs/notSupport.js} +1 -1
- package/{src/printError.cjs → cjs/printError.js} +1 -1
- package/{src/printInfo.cjs → cjs/printInfo.js} +1 -1
- package/{src/printWarn.cjs → cjs/printWarn.js} +1 -1
- package/{src/index.mjs → es/index.js} +6 -8
- package/{src/managePrint.mjs → es/managePrint.js} +9 -9
- package/{src/notSupport.mjs → es/notSupport.js} +1 -1
- package/{src/printError.mjs → es/printError.js} +1 -1
- package/{src/printInfo.mjs → es/printInfo.js} +1 -1
- package/{src/printWarn.mjs → es/printWarn.js} +1 -1
- package/{src → es/src}/index.d.ts +1 -0
- package/package.json +32 -42
- package/index.cjs +0 -7
- package/index.d.ts +0 -2
- package/index.mjs +0 -1
- /package/{src/blankCall.cjs → cjs/blankCall.js} +0 -0
- /package/{src/parseError.cjs → cjs/parseError.js} +0 -0
- /package/{src/platform.cjs → cjs/platform.js} +0 -0
- /package/{src/setType.cjs → cjs/setType.js} +0 -0
- /package/{src/blankCall.mjs → es/blankCall.js} +0 -0
- /package/{src/parseError.mjs → es/parseError.js} +0 -0
- /package/{src/platform.mjs → es/platform.js} +0 -0
- /package/{src/setType.mjs → es/setType.js} +0 -0
- /package/{src → es/src}/blankCall.d.ts +0 -0
- /package/{src → es/src}/managePrint.d.ts +0 -0
- /package/{src → es/src}/notSupport.d.ts +0 -0
- /package/{src → es/src}/parseError.d.ts +0 -0
- /package/{src → es/src}/platform.d.ts +0 -0
- /package/{src → es/src}/printError.d.ts +0 -0
- /package/{src → es/src}/printInfo.d.ts +0 -0
- /package/{src → es/src}/printWarn.d.ts +0 -0
- /package/{src → es/src}/setType.d.ts +0 -0
- /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
|
-
[&label=版本号&labelColor=rgb(73,73,228)&color=rgb(0,0,0)>)](https://www.npmjs.com/package/@qqi/log) [?logo=github>)](https://github.com/
|
|
3
|
+
[&label=版本号&labelColor=rgb(73,73,228)&color=rgb(0,0,0)>)](https://www.npmjs.com/package/@qqi/log) [?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.
|
|
5
|
-
var blankCall = require('./blankCall.
|
|
6
|
-
var managePrint = require('./managePrint.
|
|
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.
|
|
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.
|
|
5
|
-
var platform = require('./platform.
|
|
6
|
-
var blankCall = require('./blankCall.
|
|
7
|
-
var printError = require('./printError.
|
|
8
|
-
var printWarn = require('./printWarn.
|
|
9
|
-
var printInfo = require('./printInfo.
|
|
10
|
-
var setType = require('./setType.
|
|
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,9 +1,9 @@
|
|
|
1
1
|
import { createConstructor, getRandomString } from 'a-js-tools';
|
|
2
|
-
import { setType } from './setType.
|
|
3
|
-
import { blankCall } from './blankCall.
|
|
4
|
-
import { managePrint } from './managePrint.
|
|
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.
|
|
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.
|
|
3
|
-
import { platform } from './platform.
|
|
4
|
-
import { blankCall } from './blankCall.
|
|
5
|
-
import { printError } from './printError.
|
|
6
|
-
import { printWarn } from './printWarn.
|
|
7
|
-
import { printInfo } from './printInfo.
|
|
8
|
-
import { typeList } from './setType.
|
|
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
|
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.
|
|
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
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
12
|
+
"cjs",
|
|
13
|
+
"es",
|
|
14
|
+
"LICENSE",
|
|
15
|
+
"README.md"
|
|
25
16
|
],
|
|
26
17
|
"exports": {
|
|
27
18
|
".": {
|
|
28
|
-
"import":
|
|
29
|
-
|
|
30
|
-
|
|
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/
|
|
41
|
+
"url": "git+https://github.com/MrMudBean/qqi.git"
|
|
41
42
|
},
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"url": "https://earthnut.dev"
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public",
|
|
45
|
+
"registry": "https://registry.npmjs.org/"
|
|
46
46
|
},
|
|
47
47
|
"browserslist": [
|
|
48
|
-
"
|
|
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
package/index.d.ts
DELETED
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
|