@plasmicapp/cli 0.1.231 → 0.1.233

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const file_utils_1 = require("../utils/file-utils");
4
+ describe("defaultPagePath", () => {
5
+ it("does nothing for react", () => {
6
+ expect(file_utils_1.defaultPagePath({ config: { platform: "react" } }, "/index.tsx")).toBe("/index.tsx");
7
+ expect(file_utils_1.defaultPagePath({ config: { platform: "react" } }, "/nested/index.tsx")).toBe("/nested/index.tsx");
8
+ });
9
+ it("handles gatsby pagesDir", () => {
10
+ expect(file_utils_1.defaultPagePath({
11
+ config: {
12
+ platform: "gatsby",
13
+ gatsbyConfig: { pagesDir: "../pages" },
14
+ },
15
+ }, "/index.tsx")).toBe("../pages/index.tsx");
16
+ expect(file_utils_1.defaultPagePath({
17
+ config: {
18
+ platform: "gatsby",
19
+ gatsbyConfig: { pagesDir: "../pages" },
20
+ },
21
+ }, "/nested/index.tsx")).toBe("../pages/nested/index.tsx");
22
+ });
23
+ it("handles nextjs pagesDir", () => {
24
+ expect(file_utils_1.defaultPagePath({
25
+ config: {
26
+ platform: "nextjs",
27
+ nextjsConfig: { pagesDir: "../pages" },
28
+ },
29
+ }, "/index.jsx")).toBe("../pages/index.jsx");
30
+ expect(file_utils_1.defaultPagePath({
31
+ config: {
32
+ platform: "nextjs",
33
+ nextjsConfig: { pagesDir: "../pages" },
34
+ },
35
+ }, "/index.tsx")).toBe("../pages/index.tsx");
36
+ expect(file_utils_1.defaultPagePath({
37
+ config: {
38
+ platform: "nextjs",
39
+ nextjsConfig: { pagesDir: "../pages" },
40
+ },
41
+ }, "/nested/index.tsx")).toBe("../pages/nested/index.tsx");
42
+ });
43
+ it("handles nextjs pagesDir using app/ directory ", () => {
44
+ expect(file_utils_1.defaultPagePath({
45
+ config: { platform: "nextjs", nextjsConfig: { pagesDir: "../app" } },
46
+ }, "/index.jsx")).toBe("../app/page.jsx");
47
+ expect(file_utils_1.defaultPagePath({
48
+ config: { platform: "nextjs", nextjsConfig: { pagesDir: "../app" } },
49
+ }, "/index.tsx")).toBe("../app/page.tsx");
50
+ expect(file_utils_1.defaultPagePath({
51
+ config: { platform: "nextjs", nextjsConfig: { pagesDir: "../app" } },
52
+ }, "/nested/index.tsx")).toBe("../app/nested/page.tsx");
53
+ expect(file_utils_1.defaultPagePath({
54
+ config: { platform: "nextjs", nextjsConfig: { pagesDir: "../app" } },
55
+ }, "/not-index.tsx")).toBe("../app/not-index/page.tsx");
56
+ });
57
+ });
@@ -81,14 +81,22 @@ function deriveInitAnswers(opts) {
81
81
  ? "nextjs"
82
82
  : envdetect_1.detectGatsby()
83
83
  ? "gatsby"
84
- : "react";
85
- const isCra = envdetect_1.detectCreateReactApp();
84
+ : envdetect_1.detectCreateReactApp()
85
+ ? "react"
86
+ : "";
87
+ const isCra = platform === "react";
86
88
  const isNext = platform === "nextjs";
89
+ const isNextAppDir = isNext && envdetect_1.detectNextJsAppDir();
87
90
  const isGatsby = platform === "gatsby";
88
91
  const isGeneric = !isCra && !isNext && !isGatsby;
89
92
  const isTypescript = envdetect_1.detectTypescript();
90
93
  if (isNext) {
91
- deps_1.logger.info("Detected Next.js...");
94
+ if (isNextAppDir) {
95
+ deps_1.logger.info("Detected Next.js with app/ directory (experimental)...");
96
+ }
97
+ else {
98
+ deps_1.logger.info("Detected Next.js...");
99
+ }
92
100
  }
93
101
  else if (isGatsby) {
94
102
  deps_1.logger.info("Detected Gatsby...");
@@ -98,7 +106,7 @@ function deriveInitAnswers(opts) {
98
106
  }
99
107
  // Platform-specific defaults that take precedent
100
108
  const deriver = isNext
101
- ? getNextDefaults(plasmicRootDir)
109
+ ? getNextDefaults(plasmicRootDir, isNextAppDir)
102
110
  : isGatsby
103
111
  ? getGatsbyDefaults(plasmicRootDir)
104
112
  : isCra
@@ -276,12 +284,12 @@ function deriveInitAnswers(opts) {
276
284
  return answers;
277
285
  });
278
286
  }
279
- function getNextDefaults(plasmicRootDir) {
287
+ function getNextDefaults(plasmicRootDir, appDir) {
280
288
  var _a;
281
289
  const projectRootDir = (_a = npm_utils_1.findPackageJsonDir(plasmicRootDir)) !== null && _a !== void 0 ? _a : plasmicRootDir;
282
290
  return {
283
291
  srcDir: upath_1.default.relative(plasmicRootDir, upath_1.default.join(projectRootDir, "components")),
284
- pagesDir: (srcDir) => upath_1.default.relative(upath_1.default.join(plasmicRootDir, srcDir), upath_1.default.join(projectRootDir, "pages")),
292
+ pagesDir: (srcDir) => upath_1.default.relative(upath_1.default.join(plasmicRootDir, srcDir), upath_1.default.join(projectRootDir, appDir ? "app" : "pages")),
285
293
  styleScheme: "css-modules",
286
294
  imagesScheme: "public-files",
287
295
  imagesPublicDir: (srcDir) => upath_1.default.relative(upath_1.default.join(plasmicRootDir, srcDir), upath_1.default.join(projectRootDir, "public")),
@@ -330,7 +330,7 @@ function fixFileExtension(context) {
330
330
  });
331
331
  }
332
332
  function syncProject(context, opts, projectIdsAndTokens, projectId, branchName, componentIds, projectVersion, dependencies, summary, indirect, externalNpmPackages, externalCssImports, metadataDefaults) {
333
- var _a;
333
+ var _a, _b, _c;
334
334
  return __awaiter(this, void 0, void 0, function* () {
335
335
  const existingProject = context.config.projects.find((p) => p.projectId === projectId);
336
336
  const existingCompScheme = ((existingProject === null || existingProject === void 0 ? void 0 : existingProject.components) || []).map((c) => [c.id, c.scheme]);
@@ -339,6 +339,14 @@ function syncProject(context, opts, projectIdsAndTokens, projectId, branchName,
339
339
  // Server-side code-gen
340
340
  const projectBundle = yield context.api.projectComponents(projectId, branchName, {
341
341
  platform: context.config.platform,
342
+ platformOptions: context.config.platform === "nextjs"
343
+ ? {
344
+ nextjs: {
345
+ appDir: ((_c = (_b = context.config.nextjsConfig) === null || _b === void 0 ? void 0 : _b.pagesDir) === null || _c === void 0 ? void 0 : _c.endsWith("app")) ||
346
+ false,
347
+ },
348
+ }
349
+ : {},
342
350
  componentIdOrNames: componentIds,
343
351
  version: projectVersion,
344
352
  imageOpts: context.config.images,
package/dist/api.d.ts CHANGED
@@ -178,6 +178,11 @@ export declare class PlasmicApi {
178
178
  */
179
179
  projectComponents(projectId: string, branchName: string, opts: {
180
180
  platform: string;
181
+ platformOptions: {
182
+ nextjs?: {
183
+ appDir: boolean;
184
+ };
185
+ };
181
186
  componentIdOrNames: readonly string[] | undefined;
182
187
  version: string;
183
188
  imageOpts: ImagesConfig;
@@ -1,4 +1,5 @@
1
1
  export declare function detectTypescript(): string | null;
2
2
  export declare function detectNextJs(): boolean;
3
+ export declare function detectNextJsAppDir(): any;
3
4
  export declare function detectGatsby(): string | null;
4
5
  export declare function detectCreateReactApp(): boolean;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.detectCreateReactApp = exports.detectGatsby = exports.detectNextJs = exports.detectTypescript = void 0;
6
+ exports.detectCreateReactApp = exports.detectGatsby = exports.detectNextJsAppDir = exports.detectNextJs = exports.detectTypescript = void 0;
7
7
  const findup_sync_1 = __importDefault(require("findup-sync"));
8
8
  const npm_utils_1 = require("./npm-utils");
9
9
  function detectTypescript() {
@@ -26,6 +26,15 @@ function detectNextJs() {
26
26
  }
27
27
  }
28
28
  exports.detectNextJs = detectNextJs;
29
+ function detectNextJsAppDir() {
30
+ var _a, _b;
31
+ const nextConfigPath = findup_sync_1.default("next.config.js");
32
+ if (!nextConfigPath) {
33
+ return false;
34
+ }
35
+ return ((_b = (_a = require(nextConfigPath)) === null || _a === void 0 ? void 0 : _a.experimental) === null || _b === void 0 ? void 0 : _b.appDir) || false;
36
+ }
37
+ exports.detectNextJsAppDir = detectNextJsAppDir;
29
38
  function detectGatsby() {
30
39
  return findup_sync_1.default("gatsby-config.js") || findup_sync_1.default("gatsby-config.ts");
31
40
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { ProjectMetaBundle } from "../api";
3
- import { PlasmicContext, ProjectConfig } from "./config-utils";
3
+ import { PlasmicConfig, PlasmicContext, ProjectConfig } from "./config-utils";
4
4
  export declare function stripExtension(filename: string, removeComposedPath?: boolean): string;
5
5
  export declare function writeFileContentRaw(filePath: string, content: string | Buffer, opts?: {
6
6
  force?: boolean;
@@ -8,7 +8,9 @@ export declare function writeFileContentRaw(filePath: string, content: string |
8
8
  }): Promise<void>;
9
9
  export declare function defaultResourcePath(context: PlasmicContext, project: ProjectConfig | ProjectMetaBundle | string, ...subpaths: string[]): string;
10
10
  export declare function defaultPublicResourcePath(context: PlasmicContext, project: ProjectConfig, ...subpaths: string[]): string;
11
- export declare function defaultPagePath(context: PlasmicContext, fileName: string): string;
11
+ export declare function defaultPagePath(context: {
12
+ config: Pick<PlasmicConfig, "platform" | "gatsbyConfig" | "nextjsConfig">;
13
+ }, fileName: string): string;
12
14
  /**
13
15
  * Returns true iff paths `a` and `b` resolve to the same page URI. For
14
16
  * example:
@@ -57,15 +57,32 @@ function defaultPublicResourcePath(context, project, ...subpaths) {
57
57
  return upath_1.default.join(context.config.images.publicDir, "plasmic", lodash_1.default.snakeCase(project.projectName), ...subpaths);
58
58
  }
59
59
  exports.defaultPublicResourcePath = defaultPublicResourcePath;
60
+ const INDEX_EXT_REGEXP = /\/index\.(jsx|tsx)$/;
61
+ const EXT_REGEXP = /\.(jsx|tsx)$/;
60
62
  function defaultPagePath(context, fileName) {
61
- var _a, _b;
63
+ var _a, _b, _c, _d;
62
64
  if (context.config.platform === "nextjs") {
63
- return upath_1.default.join(((_a = context.config.nextjsConfig) === null || _a === void 0 ? void 0 : _a.pagesDir) || "", fileName);
65
+ if ((_b = (_a = context.config.nextjsConfig) === null || _a === void 0 ? void 0 : _a.pagesDir) === null || _b === void 0 ? void 0 : _b.endsWith("app")) {
66
+ const matchesIndex = fileName.match(INDEX_EXT_REGEXP);
67
+ if (matchesIndex) {
68
+ // convert "/foo/index.tsx" to "/foo/page.tsx"
69
+ return upath_1.default.join(context.config.nextjsConfig.pagesDir, fileName.replace(INDEX_EXT_REGEXP, "/page.$1"));
70
+ }
71
+ else {
72
+ // convert "/foo/bar.tsx" to "/foo/bar/page.tsx"
73
+ return upath_1.default.join(context.config.nextjsConfig.pagesDir, fileName.replace(EXT_REGEXP, "/page.$1"));
74
+ }
75
+ }
76
+ else {
77
+ return upath_1.default.join(((_c = context.config.nextjsConfig) === null || _c === void 0 ? void 0 : _c.pagesDir) || "", fileName);
78
+ }
79
+ }
80
+ else if (context.config.platform === "gatsby") {
81
+ return upath_1.default.join(((_d = context.config.gatsbyConfig) === null || _d === void 0 ? void 0 : _d.pagesDir) || "", fileName);
64
82
  }
65
- if (context.config.platform === "gatsby") {
66
- return upath_1.default.join(((_b = context.config.gatsbyConfig) === null || _b === void 0 ? void 0 : _b.pagesDir) || "", fileName);
83
+ else {
84
+ return fileName;
67
85
  }
68
- return fileName;
69
86
  }
70
87
  exports.defaultPagePath = defaultPagePath;
71
88
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicapp/cli",
3
- "version": "0.1.231",
3
+ "version": "0.1.233",
4
4
  "description": "plasmic cli for syncing local code with Plasmic designs",
5
5
  "engines": {
6
6
  "node": ">=12"
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@babel/preset-typescript": "^7.12.1",
23
- "@plasmicapp/react-web": "0.2.174",
23
+ "@plasmicapp/react-web": "0.2.175",
24
24
  "@types/findup-sync": "^2.0.2",
25
25
  "@types/glob": "^7.1.3",
26
26
  "@types/inquirer": "^6.5.0",
@@ -77,5 +77,5 @@
77
77
  "wrap-ansi": "^7.0.0",
78
78
  "yargs": "^15.4.1"
79
79
  },
80
- "gitHead": "b9fab3909c26303a416efc88ed6b869220d3e287"
80
+ "gitHead": "411aa3e27a221f2a3a88578bc108905e424b4a8c"
81
81
  }
@@ -0,0 +1,105 @@
1
+ import { defaultPagePath } from "../utils/file-utils";
2
+
3
+ describe("defaultPagePath", () => {
4
+ it("does nothing for react", () => {
5
+ expect(
6
+ defaultPagePath({ config: { platform: "react" } }, "/index.tsx")
7
+ ).toBe("/index.tsx");
8
+ expect(
9
+ defaultPagePath({ config: { platform: "react" } }, "/nested/index.tsx")
10
+ ).toBe("/nested/index.tsx");
11
+ });
12
+ it("handles gatsby pagesDir", () => {
13
+ expect(
14
+ defaultPagePath(
15
+ {
16
+ config: {
17
+ platform: "gatsby",
18
+ gatsbyConfig: { pagesDir: "../pages" },
19
+ },
20
+ },
21
+ "/index.tsx"
22
+ )
23
+ ).toBe("../pages/index.tsx");
24
+ expect(
25
+ defaultPagePath(
26
+ {
27
+ config: {
28
+ platform: "gatsby",
29
+ gatsbyConfig: { pagesDir: "../pages" },
30
+ },
31
+ },
32
+ "/nested/index.tsx"
33
+ )
34
+ ).toBe("../pages/nested/index.tsx");
35
+ });
36
+ it("handles nextjs pagesDir", () => {
37
+ expect(
38
+ defaultPagePath(
39
+ {
40
+ config: {
41
+ platform: "nextjs",
42
+ nextjsConfig: { pagesDir: "../pages" },
43
+ },
44
+ },
45
+ "/index.jsx"
46
+ )
47
+ ).toBe("../pages/index.jsx");
48
+ expect(
49
+ defaultPagePath(
50
+ {
51
+ config: {
52
+ platform: "nextjs",
53
+ nextjsConfig: { pagesDir: "../pages" },
54
+ },
55
+ },
56
+ "/index.tsx"
57
+ )
58
+ ).toBe("../pages/index.tsx");
59
+ expect(
60
+ defaultPagePath(
61
+ {
62
+ config: {
63
+ platform: "nextjs",
64
+ nextjsConfig: { pagesDir: "../pages" },
65
+ },
66
+ },
67
+ "/nested/index.tsx"
68
+ )
69
+ ).toBe("../pages/nested/index.tsx");
70
+ });
71
+ it("handles nextjs pagesDir using app/ directory ", () => {
72
+ expect(
73
+ defaultPagePath(
74
+ {
75
+ config: { platform: "nextjs", nextjsConfig: { pagesDir: "../app" } },
76
+ },
77
+ "/index.jsx"
78
+ )
79
+ ).toBe("../app/page.jsx");
80
+ expect(
81
+ defaultPagePath(
82
+ {
83
+ config: { platform: "nextjs", nextjsConfig: { pagesDir: "../app" } },
84
+ },
85
+ "/index.tsx"
86
+ )
87
+ ).toBe("../app/page.tsx");
88
+ expect(
89
+ defaultPagePath(
90
+ {
91
+ config: { platform: "nextjs", nextjsConfig: { pagesDir: "../app" } },
92
+ },
93
+ "/nested/index.tsx"
94
+ )
95
+ ).toBe("../app/nested/page.tsx");
96
+ expect(
97
+ defaultPagePath(
98
+ {
99
+ config: { platform: "nextjs", nextjsConfig: { pagesDir: "../app" } },
100
+ },
101
+ "/not-index.tsx"
102
+ )
103
+ ).toBe("../app/not-index/page.tsx");
104
+ });
105
+ });
@@ -19,6 +19,7 @@ import {
19
19
  detectCreateReactApp,
20
20
  detectGatsby,
21
21
  detectNextJs,
22
+ detectNextJsAppDir,
22
23
  detectTypescript,
23
24
  } from "../utils/envdetect";
24
25
  import { existsBuffered } from "../utils/file-utils";
@@ -163,15 +164,22 @@ async function deriveInitAnswers(
163
164
  ? "nextjs"
164
165
  : detectGatsby()
165
166
  ? "gatsby"
166
- : "react";
167
- const isCra = detectCreateReactApp();
167
+ : detectCreateReactApp()
168
+ ? "react"
169
+ : "";
170
+ const isCra = platform === "react";
168
171
  const isNext = platform === "nextjs";
172
+ const isNextAppDir = isNext && detectNextJsAppDir();
169
173
  const isGatsby = platform === "gatsby";
170
174
  const isGeneric = !isCra && !isNext && !isGatsby;
171
175
  const isTypescript = detectTypescript();
172
176
 
173
177
  if (isNext) {
174
- logger.info("Detected Next.js...");
178
+ if (isNextAppDir) {
179
+ logger.info("Detected Next.js with app/ directory (experimental)...");
180
+ } else {
181
+ logger.info("Detected Next.js...");
182
+ }
175
183
  } else if (isGatsby) {
176
184
  logger.info("Detected Gatsby...");
177
185
  } else if (isCra) {
@@ -180,7 +188,7 @@ async function deriveInitAnswers(
180
188
 
181
189
  // Platform-specific defaults that take precedent
182
190
  const deriver = isNext
183
- ? getNextDefaults(plasmicRootDir)
191
+ ? getNextDefaults(plasmicRootDir, isNextAppDir)
184
192
  : isGatsby
185
193
  ? getGatsbyDefaults(plasmicRootDir)
186
194
  : isCra
@@ -407,7 +415,10 @@ async function deriveInitAnswers(
407
415
  return answers as InitArgs;
408
416
  }
409
417
 
410
- function getNextDefaults(plasmicRootDir: string): DefaultDeriver {
418
+ function getNextDefaults(
419
+ plasmicRootDir: string,
420
+ appDir: boolean
421
+ ): DefaultDeriver {
411
422
  const projectRootDir = findPackageJsonDir(plasmicRootDir) ?? plasmicRootDir;
412
423
  return {
413
424
  srcDir: path.relative(
@@ -417,7 +428,7 @@ function getNextDefaults(plasmicRootDir: string): DefaultDeriver {
417
428
  pagesDir: (srcDir: string) =>
418
429
  path.relative(
419
430
  path.join(plasmicRootDir, srcDir),
420
- path.join(projectRootDir, "pages")
431
+ path.join(projectRootDir, appDir ? "app" : "pages")
421
432
  ),
422
433
  styleScheme: "css-modules",
423
434
  imagesScheme: "public-files",
@@ -555,6 +555,16 @@ async function syncProject(
555
555
  branchName,
556
556
  {
557
557
  platform: context.config.platform,
558
+ platformOptions:
559
+ context.config.platform === "nextjs"
560
+ ? {
561
+ nextjs: {
562
+ appDir:
563
+ context.config.nextjsConfig?.pagesDir?.endsWith("app") ||
564
+ false,
565
+ },
566
+ }
567
+ : {},
558
568
  componentIdOrNames: componentIds,
559
569
  version: projectVersion,
560
570
  imageOpts: context.config.images,
package/src/api.ts CHANGED
@@ -261,6 +261,11 @@ export class PlasmicApi {
261
261
  branchName: string,
262
262
  opts: {
263
263
  platform: string;
264
+ platformOptions: {
265
+ nextjs?: {
266
+ appDir: boolean;
267
+ };
268
+ };
264
269
  componentIdOrNames: readonly string[] | undefined;
265
270
  version: string;
266
271
  imageOpts: ImagesConfig;
@@ -25,6 +25,15 @@ export function detectNextJs() {
25
25
  }
26
26
  }
27
27
 
28
+ export function detectNextJsAppDir() {
29
+ const nextConfigPath = findupSync("next.config.js");
30
+ if (!nextConfigPath) {
31
+ return false;
32
+ }
33
+
34
+ return require(nextConfigPath)?.experimental?.appDir || false;
35
+ }
36
+
28
37
  export function detectGatsby() {
29
38
  return findupSync("gatsby-config.js") || findupSync("gatsby-config.ts");
30
39
  }
@@ -9,6 +9,7 @@ import { isLocalModulePath } from "./code-utils";
9
9
  import {
10
10
  ComponentConfig,
11
11
  CONFIG_FILE_NAME,
12
+ PlasmicConfig,
12
13
  PlasmicContext,
13
14
  ProjectConfig,
14
15
  } from "./config-utils";
@@ -77,14 +78,39 @@ export function defaultPublicResourcePath(
77
78
  );
78
79
  }
79
80
 
80
- export function defaultPagePath(context: PlasmicContext, fileName: string) {
81
+ const INDEX_EXT_REGEXP = /\/index\.(jsx|tsx)$/;
82
+ const EXT_REGEXP = /\.(jsx|tsx)$/;
83
+
84
+ export function defaultPagePath(
85
+ context: {
86
+ config: Pick<PlasmicConfig, "platform" | "gatsbyConfig" | "nextjsConfig">;
87
+ },
88
+ fileName: string
89
+ ) {
81
90
  if (context.config.platform === "nextjs") {
82
- return path.join(context.config.nextjsConfig?.pagesDir || "", fileName);
83
- }
84
- if (context.config.platform === "gatsby") {
91
+ if (context.config.nextjsConfig?.pagesDir?.endsWith("app")) {
92
+ const matchesIndex = fileName.match(INDEX_EXT_REGEXP);
93
+ if (matchesIndex) {
94
+ // convert "/foo/index.tsx" to "/foo/page.tsx"
95
+ return path.join(
96
+ context.config.nextjsConfig.pagesDir,
97
+ fileName.replace(INDEX_EXT_REGEXP, "/page.$1")
98
+ );
99
+ } else {
100
+ // convert "/foo/bar.tsx" to "/foo/bar/page.tsx"
101
+ return path.join(
102
+ context.config.nextjsConfig.pagesDir,
103
+ fileName.replace(EXT_REGEXP, "/page.$1")
104
+ );
105
+ }
106
+ } else {
107
+ return path.join(context.config.nextjsConfig?.pagesDir || "", fileName);
108
+ }
109
+ } else if (context.config.platform === "gatsby") {
85
110
  return path.join(context.config.gatsbyConfig?.pagesDir || "", fileName);
111
+ } else {
112
+ return fileName;
86
113
  }
87
- return fileName;
88
114
  }
89
115
 
90
116
  /**