@secret-momo/utils 1.0.1 → 1.0.3
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/lib/env.d.ts.map +1 -1
- package/lib/env.js +6 -1
- package/package.json +4 -3
package/lib/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAmDA,wBAAgB,WAAW,IAAI,MAAM,CAIpC"}
|
package/lib/env.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { execSync } from 'child_process';
|
|
2
|
+
import { info } from './log.js';
|
|
2
3
|
|
|
3
4
|
let macHardwareInfo = null;
|
|
4
5
|
function getMacHardwareInfo() {
|
|
@@ -7,7 +8,8 @@ function getMacHardwareInfo() {
|
|
|
7
8
|
}
|
|
8
9
|
try {
|
|
9
10
|
const output = execSync("system_profiler SPHardwareDataType", {
|
|
10
|
-
encoding: "utf-8"
|
|
11
|
+
encoding: "utf-8",
|
|
12
|
+
stdio: ["pipe", "pipe", "ignore"]
|
|
11
13
|
});
|
|
12
14
|
const getValue = (key) => {
|
|
13
15
|
const regex = new RegExp(`${key}:\\s+(.+)`);
|
|
@@ -35,5 +37,8 @@ function getNodeName() {
|
|
|
35
37
|
const { modelName, chip } = getMacHardwareInfo();
|
|
36
38
|
return `${modelName}(${chip})`;
|
|
37
39
|
}
|
|
40
|
+
if (import.meta.main) {
|
|
41
|
+
info(`getNodeName: ${getNodeName()}`);
|
|
42
|
+
}
|
|
38
43
|
|
|
39
44
|
export { getNodeName };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@secret-momo/utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"module": "src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
]
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
|
+
"postinstall": "bun outdated",
|
|
30
31
|
"prepublishOnly": "bun run build",
|
|
31
32
|
"build": "rm -rf lib && rollup -c && tsc -p tsconfig.json"
|
|
32
33
|
},
|
|
@@ -35,13 +36,13 @@
|
|
|
35
36
|
"@eslint/js": "10.0.1",
|
|
36
37
|
"@types/bun": "1.3.14",
|
|
37
38
|
"eslint": "10.4.1",
|
|
38
|
-
"eslint-plugin-import": "
|
|
39
|
+
"eslint-plugin-import-x": "4.16.2",
|
|
39
40
|
"eslint-plugin-react": "7.37.5",
|
|
40
41
|
"eslint-plugin-react-hooks": "7.1.1",
|
|
41
42
|
"eslint-plugin-unused-imports": "4.4.1",
|
|
42
43
|
"husky": "9.1.7",
|
|
43
44
|
"jiti": "2.7.0",
|
|
44
|
-
"lint-staged": "
|
|
45
|
+
"lint-staged": "17.0.7",
|
|
45
46
|
"prettier": "3.8.3",
|
|
46
47
|
"rollup": "4.61.1",
|
|
47
48
|
"rollup-plugin-esbuild": "6.2.1",
|