@gopowerteam/request-generate 0.3.2 → 0.3.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/dist/index.mjs +2 -7
- package/package.json +6 -9
- package/dist/chunk-C0xms8kb.cjs +0 -34
- package/dist/index.cjs +0 -1109
- package/dist/index.d.cts +0 -739
- package/dist/vite-plugin/index.cjs +0 -238
- package/dist/vite-plugin/index.d.cts +0 -13
package/dist/index.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import path from "node:path";
|
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import chalk from "chalk";
|
|
7
7
|
import ora from "ora";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
8
9
|
import Handlebars from "handlebars";
|
|
9
10
|
import swaggerParse from "@apidevtools/swagger-parser";
|
|
10
11
|
import crypto from "node:crypto";
|
|
@@ -814,6 +815,7 @@ const toUpperHelper = {
|
|
|
814
815
|
|
|
815
816
|
//#endregion
|
|
816
817
|
//#region src/template.ts
|
|
818
|
+
const __dirname = path$1.dirname(fileURLToPath(import.meta.url));
|
|
817
819
|
function registerHandlebarTemplates() {
|
|
818
820
|
registerHandlebarPartials();
|
|
819
821
|
registerHandlebarHelpers();
|
|
@@ -845,17 +847,10 @@ function registerHandlebarHelpers() {
|
|
|
845
847
|
function registerHandlebarHelper(helper) {
|
|
846
848
|
Handlebars.registerHelper(helper.name, helper.fn);
|
|
847
849
|
}
|
|
848
|
-
/**
|
|
849
|
-
* 注册Handlebar模板
|
|
850
|
-
*/
|
|
851
850
|
function registerHandlebarPartial(input) {
|
|
852
851
|
const template = loadHandlebarTemplate(`partials/${input}`);
|
|
853
852
|
Handlebars.registerPartial(input, template);
|
|
854
853
|
}
|
|
855
|
-
/**
|
|
856
|
-
* 加载模板
|
|
857
|
-
* @returns 模板内容
|
|
858
|
-
*/
|
|
859
854
|
function loadHandlebarTemplate(input) {
|
|
860
855
|
const templatePath = path$1.resolve(__dirname, "templates", `${input}.hbs`);
|
|
861
856
|
return fs$1.readFileSync(templatePath, "utf-8");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gopowerteam/request-generate",
|
|
3
|
-
"type": "
|
|
4
|
-
"version": "0.3.
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.3.3",
|
|
5
5
|
"private": false,
|
|
6
6
|
"keywords": [
|
|
7
7
|
"gopowerteam",
|
|
@@ -10,17 +10,14 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./dist/index.d.mts",
|
|
13
|
-
"import": "./dist/index.mjs"
|
|
14
|
-
"require": "./dist/index.cjs"
|
|
13
|
+
"import": "./dist/index.mjs"
|
|
15
14
|
},
|
|
16
15
|
"./vite-plugin": {
|
|
17
16
|
"types": "./dist/vite-plugin/index.d.mts",
|
|
18
|
-
"import": "./dist/vite-plugin/index.mjs"
|
|
19
|
-
"require": "./dist/vite-plugin/index.cjs"
|
|
17
|
+
"import": "./dist/vite-plugin/index.mjs"
|
|
20
18
|
}
|
|
21
19
|
},
|
|
22
|
-
"main": "./dist/index.
|
|
23
|
-
"module": "./dist/index.mjs",
|
|
20
|
+
"main": "./dist/index.mjs",
|
|
24
21
|
"types": "./dist/index.d.mts",
|
|
25
22
|
"bin": {
|
|
26
23
|
"request-download": "bin/download.mts",
|
|
@@ -54,7 +51,7 @@
|
|
|
54
51
|
"typescript": "^5.9.3",
|
|
55
52
|
"vite": "^7.3.1",
|
|
56
53
|
"vitest": "^3.0.0",
|
|
57
|
-
"@gopowerteam/request": "0.2.
|
|
54
|
+
"@gopowerteam/request": "0.2.1"
|
|
58
55
|
},
|
|
59
56
|
"scripts": {
|
|
60
57
|
"dev": "tsdown --watch",
|
package/dist/chunk-C0xms8kb.cjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
-
value: mod,
|
|
24
|
-
enumerable: true
|
|
25
|
-
}) : target, mod));
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
|
|
29
|
-
Object.defineProperty(exports, '__toESM', {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function () {
|
|
32
|
-
return __toESM;
|
|
33
|
-
}
|
|
34
|
-
});
|