@tsparticles/cli 1.3.0 → 1.3.2

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.
@@ -19,7 +19,7 @@ async function getFolderStats(folderPath) {
19
19
  const dir = await fs_extra_1.default.promises.opendir(folderPath);
20
20
  for await (const dirent of dir) {
21
21
  if (dirent.isDirectory()) {
22
- const subDirStats = await getDistStats(path_1.default.join(folderPath, dirent.name));
22
+ const subDirStats = await getFolderStats(path_1.default.join(folderPath, dirent.name));
23
23
  stats.totalFolders += subDirStats.totalFolders + 1;
24
24
  stats.totalFiles += subDirStats.totalFiles;
25
25
  stats.totalSize += subDirStats.totalSize;
@@ -29,7 +29,7 @@ buildCommand.argument("[path]", `Path to the project root folder, default is "sr
29
29
  buildCommand.action(async (argPath) => {
30
30
  const opts = buildCommand.opts(), ci = !!opts.ci, all = !!opts.all, doBundle = all || !!opts.bundle, clean = all || !!opts.clean, distfiles = all || !!opts.dist, doLint = all || !!opts.lint, prettier = all || !!opts.prettify, tsc = all || !!opts.tsc;
31
31
  const basePath = process.cwd();
32
- const oldStats = await (0, build_diststats_1.getDistStats)(path_1.default.join(basePath, "dist"));
32
+ const oldStats = await (0, build_diststats_1.getDistStats)(basePath);
33
33
  if (clean) {
34
34
  await (0, build_clear_1.clearDist)(basePath);
35
35
  }
@@ -59,7 +59,7 @@ buildCommand.action(async (argPath) => {
59
59
  if (!canContinue) {
60
60
  throw new Error("Build failed");
61
61
  }
62
- const newStats = await (0, build_diststats_1.getDistStats)(path_1.default.join(basePath, "dist")), diffSize = newStats.totalSize - oldStats.totalSize, texts = [
62
+ const newStats = await (0, build_diststats_1.getDistStats)(basePath), diffSize = newStats.totalSize - oldStats.totalSize, texts = [
63
63
  `Size changed from ${oldStats.totalSize} to ${newStats.totalSize} (${diffSize}B)`,
64
64
  `Files count changed from ${oldStats.totalFiles} to ${newStats.totalFiles} (${newStats.totalFiles - oldStats.totalFiles})`,
65
65
  `Folders count changed from ${oldStats.totalFolders} to ${newStats.totalFolders} (${newStats.totalFolders - oldStats.totalFolders})`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "tsparticles-cli": "dist/cli.js"
@@ -22,7 +22,7 @@ async function getFolderStats(folderPath: string): Promise<IDistStats> {
22
22
 
23
23
  for await (const dirent of dir) {
24
24
  if (dirent.isDirectory()) {
25
- const subDirStats = await getDistStats(path.join(folderPath, dirent.name));
25
+ const subDirStats = await getFolderStats(path.join(folderPath, dirent.name));
26
26
 
27
27
  stats.totalFolders += subDirStats.totalFolders + 1;
28
28
  stats.totalFiles += subDirStats.totalFiles;
@@ -43,7 +43,7 @@ buildCommand.action(async (argPath: string) => {
43
43
 
44
44
  const basePath = process.cwd();
45
45
 
46
- const oldStats = await getDistStats(path.join(basePath, "dist"));
46
+ const oldStats = await getDistStats(basePath);
47
47
 
48
48
  if (clean) {
49
49
  await clearDist(basePath);
@@ -85,7 +85,7 @@ buildCommand.action(async (argPath: string) => {
85
85
  throw new Error("Build failed");
86
86
  }
87
87
 
88
- const newStats = await getDistStats(path.join(basePath, "dist")),
88
+ const newStats = await getDistStats(basePath),
89
89
  diffSize = newStats.totalSize - oldStats.totalSize,
90
90
  texts = [
91
91
  `Size changed from ${oldStats.totalSize} to ${newStats.totalSize} (${diffSize}B)`,