@pisell/common 0.0.17 → 0.0.18-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/es/config/index.d.ts +30 -0
- package/es/script/utils/index.js +1 -1
- package/lib/config/index.d.ts +30 -0
- package/lib/script/utils/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare type PisellConfigType = {
|
|
2
|
+
ENV: {
|
|
3
|
+
host: string;
|
|
4
|
+
socket: string;
|
|
5
|
+
helpHost: string;
|
|
6
|
+
boxlocal_h5: string;
|
|
7
|
+
accounts: string;
|
|
8
|
+
domain: string;
|
|
9
|
+
googleMap: string;
|
|
10
|
+
appCenter: string;
|
|
11
|
+
static: string;
|
|
12
|
+
};
|
|
13
|
+
/** 当前主项目类型 */
|
|
14
|
+
platform: 'shop' | string;
|
|
15
|
+
/** 包内请求 由主项目注入 */
|
|
16
|
+
request: {
|
|
17
|
+
get: RequestMethod;
|
|
18
|
+
post: RequestMethod;
|
|
19
|
+
put: RequestMethod;
|
|
20
|
+
remove: RequestMethod;
|
|
21
|
+
request: RequestMethod;
|
|
22
|
+
};
|
|
23
|
+
/** 消息通知url */
|
|
24
|
+
webhookUrl?: string;
|
|
25
|
+
};
|
|
26
|
+
export interface RequestMethod {
|
|
27
|
+
<T = any>(url: string, data?: Record<string, any>, config?: any): Promise<T>;
|
|
28
|
+
}
|
|
29
|
+
export declare const initConfig: (options: PisellConfigType) => void;
|
|
30
|
+
export declare const getConfig: () => PisellConfigType;
|
package/es/script/utils/index.js
CHANGED
|
@@ -237,7 +237,7 @@ var versionSort = function versionSort(versionList) {
|
|
|
237
237
|
* @returns {*}
|
|
238
238
|
*/
|
|
239
239
|
var getCurrentProjectName = function getCurrentProjectName() {
|
|
240
|
-
return loadJSON("".concat(process.
|
|
240
|
+
return loadJSON("".concat(process.cwd(), "/package.json")).name;
|
|
241
241
|
};
|
|
242
242
|
var loadJSON = function loadJSON(path) {
|
|
243
243
|
return JSON.parse(fs.readFileSync(new URL(path, import.meta.url)));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare type PisellConfigType = {
|
|
2
|
+
ENV: {
|
|
3
|
+
host: string;
|
|
4
|
+
socket: string;
|
|
5
|
+
helpHost: string;
|
|
6
|
+
boxlocal_h5: string;
|
|
7
|
+
accounts: string;
|
|
8
|
+
domain: string;
|
|
9
|
+
googleMap: string;
|
|
10
|
+
appCenter: string;
|
|
11
|
+
static: string;
|
|
12
|
+
};
|
|
13
|
+
/** 当前主项目类型 */
|
|
14
|
+
platform: 'shop' | string;
|
|
15
|
+
/** 包内请求 由主项目注入 */
|
|
16
|
+
request: {
|
|
17
|
+
get: RequestMethod;
|
|
18
|
+
post: RequestMethod;
|
|
19
|
+
put: RequestMethod;
|
|
20
|
+
remove: RequestMethod;
|
|
21
|
+
request: RequestMethod;
|
|
22
|
+
};
|
|
23
|
+
/** 消息通知url */
|
|
24
|
+
webhookUrl?: string;
|
|
25
|
+
};
|
|
26
|
+
export interface RequestMethod {
|
|
27
|
+
<T = any>(url: string, data?: Record<string, any>, config?: any): Promise<T>;
|
|
28
|
+
}
|
|
29
|
+
export declare const initConfig: (options: PisellConfigType) => void;
|
|
30
|
+
export declare const getConfig: () => PisellConfigType;
|
|
@@ -197,7 +197,7 @@ var versionSort = (versionList) => {
|
|
|
197
197
|
});
|
|
198
198
|
};
|
|
199
199
|
var getCurrentProjectName = () => {
|
|
200
|
-
return loadJSON(`${process.
|
|
200
|
+
return loadJSON(`${process.cwd()}/package.json`).name;
|
|
201
201
|
};
|
|
202
202
|
var loadJSON = (path) => JSON.parse(fs.readFileSync(new URL(path, import_meta.url)));
|
|
203
203
|
var getCurrentUserName = async () => {
|