@pushwoosh/frontend-builder-engine 1.0.4 → 1.0.5

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.
@@ -1,11 +1,12 @@
1
1
  const childProcess = require('child_process');
2
2
  const fs = require('fs').promises;
3
3
  const { program, Command } = require('commander');
4
+ const path = require('path');
4
5
 
5
6
  const { buildTs } = require('./build-ts');
6
7
  const { buildStyledComponents } = require('./build-babel');
7
8
  const { loadTsConfig } = require('./lib-build-tsconfig');
8
- const { loadPushwooshConfig } = require('./helpers');
9
+ const { loadPushwooshConfig, listFilesInDirectoryRecursively } = require('./helpers');
9
10
 
10
11
  program
11
12
  .version('1.0.0')
@@ -22,6 +23,13 @@ program
22
23
  });
23
24
  await buildTs(curDir, tsConfig);
24
25
  await buildStyledComponents(targetDir, targetDir);
26
+ const files = await listFilesInDirectoryRecursively(curDir).then((files) => files.filter((file) => file.endsWith('.svg')));
27
+ await Promise.all(files.map(async (file) => {
28
+ const sourcePath = `${curDir}/${file}`;
29
+ const targetPath = `${targetDir}/${file}`;
30
+ await fs.mkdir(path.dirname(targetPath), { recursive: true });
31
+ await fs.copyFile(sourcePath, targetPath);
32
+ }));
25
33
  await fs.copyFile(`${curDir}/package.json`, `${targetDir}/package.json`);
26
34
  await fs.copyFile(`${curDir}/.npmrc`, `${targetDir}/.npmrc`);
27
35
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/frontend-builder-engine",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Pushwoosh frontend builder engine",
5
5
  "main": "./lib/pushwoosh-frontend-builder-engine.js",
6
6
  "scripts": {