@youcan/cli 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.
@@ -3,6 +3,7 @@ import stdout from '../../../utils/system/stdout.js';
3
3
  import { getCurrentThemeId, getCurrentDate, LoadingSpinner } from '../../../utils/common.js';
4
4
  import messages from '../../../config/messages.js';
5
5
  import { zipDirectory } from '../../../utils/system/zipFolder.js';
6
+ import config from '../../../config/index.js';
6
7
 
7
8
  function command(cli) {
8
9
  return {
@@ -18,7 +19,7 @@ function command(cli) {
18
19
  const loading = new LoadingSpinner('📦 Packaging your theme');
19
20
  loading.start();
20
21
  const exportFolder = `theme_${getCurrentDate()}`;
21
- await zipDirectory(cwd(), exportFolder);
22
+ await zipDirectory(cwd(), exportFolder, config.THEME_FILE_TYPES);
22
23
  loading.stop();
23
24
  return stdout.info(`your theme was successfully packaged to ${exportFolder}`);
24
25
  },
@@ -2,4 +2,4 @@
2
2
  * Zip folder and save it to a given path and return zip folder path
3
3
  */
4
4
  export declare function zipFolder(folderPath: string, folderName: string): Promise<string>;
5
- export declare function zipDirectory(dirPath: string, folderName: string): Promise<unknown>;
5
+ export declare function zipDirectory(dirPath: string, folderName: string, only?: string[]): Promise<unknown>;
@@ -29,8 +29,8 @@ async function zipFolder(folderPath, folderName) {
29
29
  }
30
30
  });
31
31
  }
32
- async function zipDirectory(dirPath, folderName) {
33
- const ls = lsDir(dirPath);
32
+ async function zipDirectory(dirPath, folderName, only) {
33
+ const ls = lsDir(dirPath).filter(folder => only === null || only === void 0 ? void 0 : only.includes(folder));
34
34
  return new Promise((resolve, reject) => {
35
35
  try {
36
36
  const zip = path.resolve(dirPath, `${folderName}.zip`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@youcan/cli",
3
3
  "type": "module",
4
- "version": "1.0.4",
4
+ "version": "1.0.5",
5
5
  "description": "YouCan CLI for developers.",
6
6
  "author": "YouCan <contact@youcan.shop> (https://youcan.shop)",
7
7
  "keywords": [],