create-plasmic-app 0.0.37 → 0.0.38

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.
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const promises_1 = __importDefault(require("fs/promises"));
15
+ const fs_1 = require("fs");
16
16
  const path_1 = __importDefault(require("path"));
17
17
  const nextjs_1 = require("../templates/nextjs");
18
18
  const cmd_utils_1 = require("../utils/cmd-utils");
@@ -43,7 +43,7 @@ const nextjsStrategy = {
43
43
  const { projectPath, scheme } = args;
44
44
  if (scheme === "codegen") {
45
45
  const nextjsConfigFile = path_1.default.join(projectPath, "next.config.js");
46
- yield promises_1.default.writeFile(nextjsConfigFile, `
46
+ yield fs_1.promises.writeFile(nextjsConfigFile, `
47
47
  module.exports = {
48
48
  eslint: {
49
49
  ignoreDuringBuilds: true,
@@ -62,13 +62,13 @@ module.exports = {
62
62
  const pagesPath = path_1.default.join(projectPath, "pages");
63
63
  file_utils_1.deleteGlob(path_1.default.join(pagesPath, `*.*`));
64
64
  const hostPage = path_1.default.join(pagesPath, `plasmic-host.${useTypescript ? "tsx" : "jsx"}`);
65
- yield promises_1.default.writeFile(hostPage, nextjs_1.makeNextjsHostPage(scheme));
65
+ yield fs_1.promises.writeFile(hostPage, nextjs_1.makeNextjsHostPage(scheme));
66
66
  if (scheme === "loader") {
67
67
  const initFile = path_1.default.join(projectPath, `plasmic-init.${useTypescript ? "ts" : "js"}`);
68
- yield promises_1.default.writeFile(initFile, nextjs_1.makeNextjsInitPage(projectId, lang_utils_1.ensure(projectApiToken)));
68
+ yield fs_1.promises.writeFile(initFile, nextjs_1.makeNextjsInitPage(projectId, lang_utils_1.ensure(projectApiToken)));
69
69
  // Write catch-all page for loader
70
70
  const loaderPage = path_1.default.join(pagesPath, `[[...catchall]].${useTypescript ? "tsx" : "jsx"}`);
71
- yield promises_1.default.writeFile(loaderPage, nextjs_1.makeNextjsCatchallPage(useTypescript ? "ts" : "js"));
71
+ yield fs_1.promises.writeFile(loaderPage, nextjs_1.makeNextjsCatchallPage(useTypescript ? "ts" : "js"));
72
72
  }
73
73
  else {
74
74
  yield common_1.runCodegenSync({
@@ -80,7 +80,7 @@ module.exports = {
80
80
  yield file_utils_1.overwriteIndex(projectPath, "nextjs", scheme);
81
81
  // Overwrite the wrapper files to wrap PlasmicRootProvider
82
82
  const appFilePath = path_1.default.join(projectPath, "pages", `_app.js`);
83
- yield promises_1.default.writeFile(appFilePath, nextjs_1.wrapAppRootForCodegen());
83
+ yield fs_1.promises.writeFile(appFilePath, nextjs_1.wrapAppRootForCodegen());
84
84
  }
85
85
  }),
86
86
  build: (args) => __awaiter(void 0, void 0, void 0, function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-plasmic-app",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "description": "Create Plasmic-powered React apps",
5
5
  "main": "./dist/lib.js",
6
6
  "types": "./dist/lib.d.ts",
@@ -1,4 +1,4 @@
1
- import fs from "fs/promises";
1
+ import { promises as fs } from "fs";
2
2
  import path from "path";
3
3
  import {
4
4
  makeNextjsCatchallPage,