@developer_tribe/react-builder 0.1.4 → 0.1.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@developer_tribe/react-builder",
3
- "version": "0.1.4",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "restricted": true,
6
6
  "main": "dist/index.cjs.js",
@@ -14,6 +14,7 @@ const argv = yargs(hideBin(process.argv)).argv;
14
14
  export const args = argv;
15
15
  const builderPath = args.path || '/node_modules/@developer_tribe/react-builder';
16
16
  const targetPath = process.cwd();
17
+ const selectedComponents = args.components || [];
17
18
 
18
19
  function run() {
19
20
  const builderComponentsPath = Path.join(
@@ -23,9 +24,19 @@ function run() {
23
24
  );
24
25
  checkPathExists(builderComponentsPath);
25
26
  const components = getAllComponents(builderComponentsPath);
26
- checkFolderAndFilesValid(targetPath, components);
27
- createMissingFoldersAndFiles(targetPath, components);
28
- createRenderNodeGenerated(builderComponentsPath, targetPath, components);
27
+ for (const component of components) {
28
+ if (!selectedComponents.includes(component)) {
29
+ console.error(`Component ${component} not found`);
30
+ process.exit(1);
31
+ }
32
+ }
33
+ checkFolderAndFilesValid(targetPath, selectedComponents);
34
+ createMissingFoldersAndFiles(targetPath, selectedComponents);
35
+ createRenderNodeGenerated(
36
+ builderComponentsPath,
37
+ targetPath,
38
+ selectedComponents
39
+ );
29
40
  }
30
41
 
31
42
  run();
@@ -6,6 +6,12 @@
6
6
  "type": "string",
7
7
  "describe": "path of project",
8
8
  "demandOption": false
9
+ },
10
+ "components": {
11
+ "alias": "c",
12
+ "type": "array",
13
+ "describe": "component names",
14
+ "demandOption": false
9
15
  }
10
16
  }
11
17
  }