edgeone 1.0.14-beta.3 → 1.0.15

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.2",
102542
+ version: "1.0.15",
102543
102543
  description: "Command-line interface for TencentCloud Pages Functions",
102544
102544
  bin: {
102545
102545
  edgeone: "./edgeone-bin/edgeone.js"
@@ -114281,7 +114281,6 @@ async function PagesDevServer(devConfig) {
114281
114281
  }
114282
114282
  }
114283
114283
  }
114284
- console.log("proxy");
114285
114284
  proxy.web(req, res, {
114286
114285
  target: `${DebugUrl}`,
114287
114286
  changeOrigin: true
@@ -114386,6 +114385,7 @@ var path7 = require("path");
114386
114385
  function createFunctionsFolder() {
114387
114386
  const folderPath = path7.join(process.cwd(), "functions");
114388
114387
  if (fs7.existsSync(folderPath)) {
114388
+ console.log("Pages function folder already exists.");
114389
114389
  } else {
114390
114390
  const filePath = path7.join(process.cwd(), "functions", "helloworld", "index.js");
114391
114391
  const fileContent = `const json = JSON.stringify({
@@ -114405,17 +114405,16 @@ export function onRequest(context) {
114405
114405
 
114406
114406
  `;
114407
114407
  fs7.mkdirSync(path7.dirname(filePath), { recursive: true });
114408
- fs7.writeFile(filePath, fileContent, (err2) => {
114409
- if (err2) {
114410
- console.error(err2);
114411
- }
114412
- });
114408
+ try {
114409
+ fs7.writeFileSync(filePath, fileContent);
114410
+ } catch (e2) {
114411
+ console.error("Create function failed:", e2);
114412
+ }
114413
114413
  }
114414
114414
  }
114415
114415
  async function PagesInit(yargs) {
114416
114416
  await loginIfNot();
114417
114417
  createFunctionsFolder();
114418
- createFunctionsFolder();
114419
114418
  okLog("Function example created!");
114420
114419
  okLog("Project init success!");
114421
114420
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edgeone",
3
- "version": "1.0.14-beta.3",
3
+ "version": "1.0.15",
4
4
  "description": "Command-line interface for TencentCloud Pages Functions",
5
5
  "bin": {
6
6
  "edgeone": "./edgeone-bin/edgeone.js"