edgeone 1.0.11 → 1.0.12
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/edgeone-dist/cli.js +58 -131
- package/package.json +1 -1
package/edgeone-dist/cli.js
CHANGED
|
@@ -85016,96 +85016,6 @@ var require_async2 = __commonJS({
|
|
|
85016
85016
|
}
|
|
85017
85017
|
});
|
|
85018
85018
|
|
|
85019
|
-
// node_modules/mkdirp/index.js
|
|
85020
|
-
var require_mkdirp = __commonJS({
|
|
85021
|
-
"node_modules/mkdirp/index.js"(exports2, module2) {
|
|
85022
|
-
var path9 = require("path");
|
|
85023
|
-
var fs9 = require("fs");
|
|
85024
|
-
var _0777 = parseInt("0777", 8);
|
|
85025
|
-
module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
|
|
85026
|
-
function mkdirP(p, opts, f3, made) {
|
|
85027
|
-
if (typeof opts === "function") {
|
|
85028
|
-
f3 = opts;
|
|
85029
|
-
opts = {};
|
|
85030
|
-
} else if (!opts || typeof opts !== "object") {
|
|
85031
|
-
opts = { mode: opts };
|
|
85032
|
-
}
|
|
85033
|
-
var mode = opts.mode;
|
|
85034
|
-
var xfs = opts.fs || fs9;
|
|
85035
|
-
if (mode === void 0) {
|
|
85036
|
-
mode = _0777;
|
|
85037
|
-
}
|
|
85038
|
-
if (!made)
|
|
85039
|
-
made = null;
|
|
85040
|
-
var cb2 = f3 || /* istanbul ignore next */
|
|
85041
|
-
function() {
|
|
85042
|
-
};
|
|
85043
|
-
p = path9.resolve(p);
|
|
85044
|
-
xfs.mkdir(p, mode, function(er) {
|
|
85045
|
-
if (!er) {
|
|
85046
|
-
made = made || p;
|
|
85047
|
-
return cb2(null, made);
|
|
85048
|
-
}
|
|
85049
|
-
switch (er.code) {
|
|
85050
|
-
case "ENOENT":
|
|
85051
|
-
if (path9.dirname(p) === p)
|
|
85052
|
-
return cb2(er);
|
|
85053
|
-
mkdirP(path9.dirname(p), opts, function(er2, made2) {
|
|
85054
|
-
if (er2)
|
|
85055
|
-
cb2(er2, made2);
|
|
85056
|
-
else
|
|
85057
|
-
mkdirP(p, opts, cb2, made2);
|
|
85058
|
-
});
|
|
85059
|
-
break;
|
|
85060
|
-
default:
|
|
85061
|
-
xfs.stat(p, function(er2, stat2) {
|
|
85062
|
-
if (er2 || !stat2.isDirectory())
|
|
85063
|
-
cb2(er, made);
|
|
85064
|
-
else
|
|
85065
|
-
cb2(null, made);
|
|
85066
|
-
});
|
|
85067
|
-
break;
|
|
85068
|
-
}
|
|
85069
|
-
});
|
|
85070
|
-
}
|
|
85071
|
-
mkdirP.sync = function sync(p, opts, made) {
|
|
85072
|
-
if (!opts || typeof opts !== "object") {
|
|
85073
|
-
opts = { mode: opts };
|
|
85074
|
-
}
|
|
85075
|
-
var mode = opts.mode;
|
|
85076
|
-
var xfs = opts.fs || fs9;
|
|
85077
|
-
if (mode === void 0) {
|
|
85078
|
-
mode = _0777;
|
|
85079
|
-
}
|
|
85080
|
-
if (!made)
|
|
85081
|
-
made = null;
|
|
85082
|
-
p = path9.resolve(p);
|
|
85083
|
-
try {
|
|
85084
|
-
xfs.mkdirSync(p, mode);
|
|
85085
|
-
made = made || p;
|
|
85086
|
-
} catch (err0) {
|
|
85087
|
-
switch (err0.code) {
|
|
85088
|
-
case "ENOENT":
|
|
85089
|
-
made = sync(path9.dirname(p), opts, made);
|
|
85090
|
-
sync(p, opts, made);
|
|
85091
|
-
break;
|
|
85092
|
-
default:
|
|
85093
|
-
var stat2;
|
|
85094
|
-
try {
|
|
85095
|
-
stat2 = xfs.statSync(p);
|
|
85096
|
-
} catch (err1) {
|
|
85097
|
-
throw err0;
|
|
85098
|
-
}
|
|
85099
|
-
if (!stat2.isDirectory())
|
|
85100
|
-
throw err0;
|
|
85101
|
-
break;
|
|
85102
|
-
}
|
|
85103
|
-
}
|
|
85104
|
-
return made;
|
|
85105
|
-
};
|
|
85106
|
-
}
|
|
85107
|
-
});
|
|
85108
|
-
|
|
85109
85019
|
// node_modules/portfinder/lib/portfinder.js
|
|
85110
85020
|
var require_portfinder = __commonJS({
|
|
85111
85021
|
"node_modules/portfinder/lib/portfinder.js"(exports2) {
|
|
@@ -85116,7 +85026,6 @@ var require_portfinder = __commonJS({
|
|
|
85116
85026
|
var path9 = require("path");
|
|
85117
85027
|
var _async = require_async2();
|
|
85118
85028
|
var debug = require_src();
|
|
85119
|
-
var mkdirp = require_mkdirp().mkdirp;
|
|
85120
85029
|
var debugTestPort = debug("portfinder:testPort");
|
|
85121
85030
|
var debugGetPort = debug("portfinder:getPort");
|
|
85122
85031
|
var debugDefaultHosts = debug("portfinder:defaultHosts");
|
|
@@ -85173,11 +85082,7 @@ var require_portfinder = __commonJS({
|
|
|
85173
85082
|
exports2.setBasePath = function(path10) {
|
|
85174
85083
|
exports2.basePath = path10;
|
|
85175
85084
|
};
|
|
85176
|
-
|
|
85177
|
-
if (!callback) {
|
|
85178
|
-
callback = options;
|
|
85179
|
-
options = {};
|
|
85180
|
-
}
|
|
85085
|
+
internals.getPort = function(options, callback) {
|
|
85181
85086
|
options.port = Number(options.port) || Number(exports2.basePort);
|
|
85182
85087
|
options.host = options.host || null;
|
|
85183
85088
|
options.stopPort = Number(options.stopPort) || Number(exports2.highestPort);
|
|
@@ -85187,7 +85092,7 @@ var require_portfinder = __commonJS({
|
|
|
85187
85092
|
throw Error("Provided options.startPort(" + options.startPort + ") is less than 0, which are cannot be bound.");
|
|
85188
85093
|
}
|
|
85189
85094
|
if (options.stopPort < options.startPort) {
|
|
85190
|
-
throw Error("Provided options.stopPort(" + options.stopPort + "is less than options.startPort (" + options.startPort + ")");
|
|
85095
|
+
throw Error("Provided options.stopPort(" + options.stopPort + ") is less than options.startPort (" + options.startPort + ")");
|
|
85191
85096
|
}
|
|
85192
85097
|
}
|
|
85193
85098
|
if (options.host && exports2._defaultHosts.indexOf(options.host) === -1) {
|
|
@@ -85222,7 +85127,7 @@ var require_portfinder = __commonJS({
|
|
|
85222
85127
|
} else {
|
|
85223
85128
|
const idx = exports2._defaultHosts.indexOf(currentHost);
|
|
85224
85129
|
exports2._defaultHosts.splice(idx, 1);
|
|
85225
|
-
return
|
|
85130
|
+
return internals.getPort(options, callback);
|
|
85226
85131
|
}
|
|
85227
85132
|
} else {
|
|
85228
85133
|
return callback(err2);
|
|
@@ -85240,34 +85145,37 @@ var require_portfinder = __commonJS({
|
|
|
85240
85145
|
return callback(Error(msg));
|
|
85241
85146
|
}
|
|
85242
85147
|
} else {
|
|
85243
|
-
return
|
|
85148
|
+
return internals.getPort({ port: openPorts.pop(), host: options.host, startPort: options.startPort, stopPort: options.stopPort }, callback);
|
|
85244
85149
|
}
|
|
85245
85150
|
});
|
|
85246
85151
|
};
|
|
85247
|
-
exports2.
|
|
85248
|
-
if (
|
|
85152
|
+
exports2.getPort = function(options, callback) {
|
|
85153
|
+
if (typeof options === "function") {
|
|
85154
|
+
callback = options;
|
|
85249
85155
|
options = {};
|
|
85250
85156
|
}
|
|
85251
|
-
|
|
85252
|
-
exports2.getPort(options, function(err2, port) {
|
|
85253
|
-
if (err2) {
|
|
85254
|
-
return reject(err2);
|
|
85255
|
-
}
|
|
85256
|
-
resolve5(port);
|
|
85257
|
-
});
|
|
85258
|
-
});
|
|
85259
|
-
};
|
|
85260
|
-
exports2.getPorts = function(count, options, callback) {
|
|
85157
|
+
options = options || {};
|
|
85261
85158
|
if (!callback) {
|
|
85262
|
-
|
|
85263
|
-
|
|
85159
|
+
return new Promise(function(resolve5, reject) {
|
|
85160
|
+
internals.getPort(options, function(err2, port) {
|
|
85161
|
+
if (err2) {
|
|
85162
|
+
return reject(err2);
|
|
85163
|
+
}
|
|
85164
|
+
resolve5(port);
|
|
85165
|
+
});
|
|
85166
|
+
});
|
|
85167
|
+
} else {
|
|
85168
|
+
return internals.getPort(options, callback);
|
|
85264
85169
|
}
|
|
85170
|
+
};
|
|
85171
|
+
exports2.getPortPromise = exports2.getPort;
|
|
85172
|
+
internals.getPorts = function(count, options, callback) {
|
|
85265
85173
|
let lastPort = null;
|
|
85266
85174
|
_async.timesSeries(count, function(index, asyncCallback) {
|
|
85267
85175
|
if (lastPort) {
|
|
85268
85176
|
options.port = exports2.nextPort(lastPort);
|
|
85269
85177
|
}
|
|
85270
|
-
|
|
85178
|
+
internals.getPort(options, function(err2, port) {
|
|
85271
85179
|
if (err2) {
|
|
85272
85180
|
asyncCallback(err2);
|
|
85273
85181
|
} else {
|
|
@@ -85277,19 +85185,26 @@ var require_portfinder = __commonJS({
|
|
|
85277
85185
|
});
|
|
85278
85186
|
}, callback);
|
|
85279
85187
|
};
|
|
85280
|
-
exports2.
|
|
85281
|
-
if (
|
|
85188
|
+
exports2.getPorts = function(count, options, callback) {
|
|
85189
|
+
if (typeof options === "function") {
|
|
85190
|
+
callback = options;
|
|
85282
85191
|
options = {};
|
|
85283
85192
|
}
|
|
85284
|
-
|
|
85285
|
-
|
|
85286
|
-
|
|
85287
|
-
|
|
85288
|
-
|
|
85289
|
-
|
|
85193
|
+
options = options || {};
|
|
85194
|
+
if (!callback) {
|
|
85195
|
+
return new Promise(function(resolve5, reject) {
|
|
85196
|
+
internals.getPorts(count, options, function(err2, ports) {
|
|
85197
|
+
if (err2) {
|
|
85198
|
+
return reject(err2);
|
|
85199
|
+
}
|
|
85200
|
+
resolve5(ports);
|
|
85201
|
+
});
|
|
85290
85202
|
});
|
|
85291
|
-
}
|
|
85203
|
+
} else {
|
|
85204
|
+
return internals.getPorts(count, options, callback);
|
|
85205
|
+
}
|
|
85292
85206
|
};
|
|
85207
|
+
exports2.getPortsPromise = exports2.getPorts;
|
|
85293
85208
|
exports2.getSocket = function(options, callback) {
|
|
85294
85209
|
if (!callback) {
|
|
85295
85210
|
callback = options;
|
|
@@ -85312,7 +85227,7 @@ var require_portfinder = __commonJS({
|
|
|
85312
85227
|
});
|
|
85313
85228
|
}
|
|
85314
85229
|
function createAndTestSocket(dir) {
|
|
85315
|
-
|
|
85230
|
+
fs9.mkdir(dir, { mode: options.mod, recursive: true }, function(err2) {
|
|
85316
85231
|
if (err2) {
|
|
85317
85232
|
return callback(err2);
|
|
85318
85233
|
}
|
|
@@ -102624,7 +102539,7 @@ var yargs_default = Yargs;
|
|
|
102624
102539
|
// package.json
|
|
102625
102540
|
var package_default = {
|
|
102626
102541
|
name: "edgeone",
|
|
102627
|
-
version: "1.0.
|
|
102542
|
+
version: "1.0.12",
|
|
102628
102543
|
description: "Command-line interface for TencentCloud Pages Functions",
|
|
102629
102544
|
bin: {
|
|
102630
102545
|
edgeone: "./edgeone-bin/edgeone.js"
|
|
@@ -104142,7 +104057,7 @@ function combineURLs(baseURL, relativeURL) {
|
|
|
104142
104057
|
// node_modules/axios/lib/core/buildFullPath.js
|
|
104143
104058
|
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
104144
104059
|
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
104145
|
-
if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
|
|
104060
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
|
104146
104061
|
return combineURLs(baseURL, requestedURL);
|
|
104147
104062
|
}
|
|
104148
104063
|
return requestedURL;
|
|
@@ -104157,7 +104072,7 @@ var import_follow_redirects = __toESM(require_follow_redirects(), 1);
|
|
|
104157
104072
|
var import_zlib = __toESM(require("zlib"), 1);
|
|
104158
104073
|
|
|
104159
104074
|
// node_modules/axios/lib/env/data.js
|
|
104160
|
-
var VERSION = "1.8.
|
|
104075
|
+
var VERSION = "1.8.4";
|
|
104161
104076
|
|
|
104162
104077
|
// node_modules/axios/lib/helpers/parseProtocol.js
|
|
104163
104078
|
function parseProtocol(url2) {
|
|
@@ -106240,7 +106155,6 @@ async function capi(action, params, options, callback) {
|
|
|
106240
106155
|
}
|
|
106241
106156
|
}
|
|
106242
106157
|
);
|
|
106243
|
-
console.log("res1", JSON.stringify(res1.data, null, 2));
|
|
106244
106158
|
if ((_b2 = (_a6 = res1.data) == null ? void 0 : _a6.data) == null ? void 0 : _b2.Response) {
|
|
106245
106159
|
if ((_e = (_d2 = (_c2 = res1.data) == null ? void 0 : _c2.data) == null ? void 0 : _d2.Response) == null ? void 0 : _e.Error) {
|
|
106246
106160
|
throw res1.data.data.Response.Error;
|
|
@@ -113578,6 +113492,16 @@ async function PagesCI(_) {
|
|
|
113578
113492
|
// src/pages/common/env.tsx
|
|
113579
113493
|
var pullEnvVars = async (projectId) => {
|
|
113580
113494
|
const envDestination = getCwdFullPath("./.env");
|
|
113495
|
+
const localEnv = readEnvFileSync(envDestination);
|
|
113496
|
+
const localEnvVars = [];
|
|
113497
|
+
Object.keys(localEnv).forEach((key2) => {
|
|
113498
|
+
if (key2.endsWith("DEV")) {
|
|
113499
|
+
localEnvVars.push({
|
|
113500
|
+
Key: key2,
|
|
113501
|
+
Value: localEnv[key2]
|
|
113502
|
+
});
|
|
113503
|
+
}
|
|
113504
|
+
});
|
|
113581
113505
|
normalLog("Pulling environment variables...");
|
|
113582
113506
|
const res = await pagesCapi("DescribePagesProjectEnvs", {
|
|
113583
113507
|
ProjectId: projectId
|
|
@@ -113586,8 +113510,9 @@ var pullEnvVars = async (projectId) => {
|
|
|
113586
113510
|
});
|
|
113587
113511
|
const envvars = JSON.parse(res.Result || []);
|
|
113588
113512
|
const { EnvVars } = envvars;
|
|
113513
|
+
const vars = EnvVars.concat(localEnvVars);
|
|
113589
113514
|
let envFileContent = "";
|
|
113590
|
-
|
|
113515
|
+
vars.forEach((item) => {
|
|
113591
113516
|
envFileContent += `${item.Key}=${item.Value}
|
|
113592
113517
|
`;
|
|
113593
113518
|
});
|
|
@@ -113870,10 +113795,10 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
113870
113795
|
return 1;
|
|
113871
113796
|
}
|
|
113872
113797
|
if ("CI" in env2) {
|
|
113873
|
-
if ("GITHUB_ACTIONS"
|
|
113798
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key2) => key2 in env2)) {
|
|
113874
113799
|
return 3;
|
|
113875
113800
|
}
|
|
113876
|
-
if (["TRAVIS", "
|
|
113801
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
|
|
113877
113802
|
return 1;
|
|
113878
113803
|
}
|
|
113879
113804
|
return min;
|
|
@@ -114326,6 +114251,7 @@ async function PagesDevServer(devConfig) {
|
|
|
114326
114251
|
return res.end();
|
|
114327
114252
|
}
|
|
114328
114253
|
if (localStaticPath) {
|
|
114254
|
+
console.log("this is localStaticPath");
|
|
114329
114255
|
const localPath = path6.join(localStaticPath, req.url);
|
|
114330
114256
|
if (localStaticPath && sirver && fs6.existsSync(localPath)) {
|
|
114331
114257
|
if (req.url !== "/") {
|
|
@@ -114334,6 +114260,7 @@ async function PagesDevServer(devConfig) {
|
|
|
114334
114260
|
}
|
|
114335
114261
|
}
|
|
114336
114262
|
}
|
|
114263
|
+
console.log("proxy");
|
|
114337
114264
|
proxy.web(req, res, {
|
|
114338
114265
|
target: `${DebugUrl}`,
|
|
114339
114266
|
changeOrigin: true
|