edgeone 1.0.14-beta.2 → 1.0.14

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.
@@ -102539,7 +102539,7 @@ var yargs_default = Yargs;
102539
102539
  // package.json
102540
102540
  var package_default = {
102541
102541
  name: "edgeone",
102542
- version: "1.0.14-beta.1",
102542
+ version: "1.0.14",
102543
102543
  description: "Command-line interface for TencentCloud Pages Functions",
102544
102544
  bin: {
102545
102545
  edgeone: "./edgeone-bin/edgeone.js"
@@ -114256,7 +114256,6 @@ async function PagesDevServer(devConfig) {
114256
114256
  });
114257
114257
  handleLog(WsLogUrl);
114258
114258
  const corsPath = devConfig.fePort ? `http://localhost:${devConfig.fePort}` : "*";
114259
- console.log("front end port", devConfig.fePort, corsPath);
114260
114259
  const proxy = import_http_proxy.default.createProxyServer();
114261
114260
  server.on("request", (req, res) => {
114262
114261
  if (!favicon && req.url.startsWith("/favicon")) {
@@ -114387,7 +114386,9 @@ var path7 = require("path");
114387
114386
  function createFunctionsFolder() {
114388
114387
  const folderPath = path7.join(process.cwd(), "functions");
114389
114388
  if (fs7.existsSync(folderPath)) {
114389
+ console.log("Pages function folder already exists.");
114390
114390
  } else {
114391
+ console.log("in createFunctionsFolder 2");
114391
114392
  const filePath = path7.join(process.cwd(), "functions", "helloworld", "index.js");
114392
114393
  const fileContent = `const json = JSON.stringify({
114393
114394
  "code": 0,
@@ -114406,17 +114407,16 @@ export function onRequest(context) {
114406
114407
 
114407
114408
  `;
114408
114409
  fs7.mkdirSync(path7.dirname(filePath), { recursive: true });
114409
- fs7.writeFile(filePath, fileContent, (err2) => {
114410
- if (err2) {
114411
- console.error(err2);
114412
- }
114413
- });
114410
+ try {
114411
+ fs7.writeFileSync(filePath, fileContent);
114412
+ } catch (e2) {
114413
+ console.error("Create function failed:", e2);
114414
+ }
114414
114415
  }
114415
114416
  }
114416
114417
  async function PagesInit(yargs) {
114417
114418
  await loginIfNot();
114418
114419
  createFunctionsFolder();
114419
- createFunctionsFolder();
114420
114420
  okLog("Function example created!");
114421
114421
  okLog("Project init success!");
114422
114422
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edgeone",
3
- "version": "1.0.14-beta.2",
3
+ "version": "1.0.14",
4
4
  "description": "Command-line interface for TencentCloud Pages Functions",
5
5
  "bin": {
6
6
  "edgeone": "./edgeone-bin/edgeone.js"