@cloud-ru/ft-gulp-icon-builder 1.0.1-preview-fab5fcb.0 → 1.0.1-preview-a291701.0

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.
@@ -35,7 +35,9 @@ function gulpCreateSvgSprite({ filePath, idPrefix }) {
35
35
  },
36
36
  onEnd: () => __awaiter(this, void 0, void 0, function* () {
37
37
  const { result } = yield sprite.compileAsync();
38
- node_fs_1.default.writeFileSync(node_path_1.default.resolve(process.cwd(), filePath), result.symbol.sprite.contents.toString());
38
+ const fullFilePath = node_path_1.default.resolve(process.cwd(), filePath);
39
+ node_fs_1.default.mkdirSync(node_path_1.default.dirname(fullFilePath), { recursive: true });
40
+ node_fs_1.default.writeFileSync(fullFilePath, result.symbol.sprite.contents.toString());
39
41
  }),
40
42
  });
41
43
  }
@@ -53,7 +53,7 @@ function gulpSvgIndexFile({ src, dest, getComponentName = capitalizeFirstLetter
53
53
  // index file for all
54
54
  const folderName = node_path_1.default.basename(folder);
55
55
  const componentName = getComponentName(folderName);
56
- imports.push(`export { default as ${componentName}SVG } from './${folderName}';`);
56
+ imports.push(`export { default as ${componentName} } from './${folderName}';`);
57
57
  if (!indexFile) {
58
58
  indexFile = node_path_1.default.resolve(dest, getTail(node_path_1.default.dirname(folder)), 'index.tsx');
59
59
  }
@@ -29,7 +29,9 @@ export function gulpCreateSvgSprite({ filePath, idPrefix }) {
29
29
  },
30
30
  onEnd: () => __awaiter(this, void 0, void 0, function* () {
31
31
  const { result } = yield sprite.compileAsync();
32
- fs.writeFileSync(path.resolve(process.cwd(), filePath), result.symbol.sprite.contents.toString());
32
+ const fullFilePath = path.resolve(process.cwd(), filePath);
33
+ fs.mkdirSync(path.dirname(fullFilePath), { recursive: true });
34
+ fs.writeFileSync(fullFilePath, result.symbol.sprite.contents.toString());
33
35
  }),
34
36
  });
35
37
  }
@@ -47,7 +47,7 @@ export function gulpSvgIndexFile({ src, dest, getComponentName = capitalizeFirst
47
47
  // index file for all
48
48
  const folderName = path.basename(folder);
49
49
  const componentName = getComponentName(folderName);
50
- imports.push(`export { default as ${componentName}SVG } from './${folderName}';`);
50
+ imports.push(`export { default as ${componentName} } from './${folderName}';`);
51
51
  if (!indexFile) {
52
52
  indexFile = path.resolve(dest, getTail(path.dirname(folder)), 'index.tsx');
53
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-ru/ft-gulp-icon-builder",
3
- "version": "1.0.1-preview-fab5fcb.0",
3
+ "version": "1.0.1-preview-a291701.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  ""
@@ -46,5 +46,5 @@
46
46
  "@types/vinyl": "2.0.12",
47
47
  "gulp-cli": "3.1.0"
48
48
  },
49
- "gitHead": "0964d3164274b577cfef81b1c81b83a0bd206204"
49
+ "gitHead": "dd75754836764fb4377b7d5b71746736a5cf16bc"
50
50
  }
@@ -27,7 +27,9 @@ export function gulpCreateSvgSprite({ filePath, idPrefix }: { idPrefix: string;
27
27
 
28
28
  onEnd: async () => {
29
29
  const { result } = await sprite.compileAsync();
30
- fs.writeFileSync(path.resolve(process.cwd(), filePath), result.symbol.sprite.contents.toString());
30
+ const fullFilePath = path.resolve(process.cwd(), filePath);
31
+ fs.mkdirSync(path.dirname(fullFilePath), { recursive: true });
32
+ fs.writeFileSync(fullFilePath, result.symbol.sprite.contents.toString());
31
33
  },
32
34
  });
33
35
  }
@@ -55,7 +55,7 @@ export function gulpSvgIndexFile({ src, dest, getComponentName = capitalizeFirst
55
55
  // index file for all
56
56
  const folderName = path.basename(folder);
57
57
  const componentName = getComponentName(folderName);
58
- imports.push(`export { default as ${componentName}SVG } from './${folderName}';`);
58
+ imports.push(`export { default as ${componentName} } from './${folderName}';`);
59
59
  if (!indexFile) {
60
60
  indexFile = path.resolve(dest, getTail(path.dirname(folder)), 'index.tsx');
61
61
  }