@developer_tribe/react-builder 0.1.11 → 0.1.12
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 +1 -1
- package/scripts/public/scripts/build/index.js +6 -10
- package/scripts/public/scripts/build/info.json +6 -0
- package/scripts/public/scripts/build/utils/checkFolderAndFilesValid.js +1 -6
- package/scripts/public/scripts/build/utils/createComponentsIndex.js +1 -7
- package/scripts/public/scripts/build/utils/createMissingFoldersAndFiles.js +4 -6
- package/scripts/public/scripts/build/utils/createRenderNodeGenerated.js +1 -6
package/package.json
CHANGED
|
@@ -14,15 +14,11 @@ import { createComponentsIndex } from './utils/createComponentsIndex.js';
|
|
|
14
14
|
const argv = yargs(hideBin(process.argv)).argv;
|
|
15
15
|
export const args = argv;
|
|
16
16
|
const builderPath = args.path || 'node_modules/@developer_tribe/react-builder';
|
|
17
|
-
const targetPath = process.cwd();
|
|
18
17
|
const selectedComponents = args.components || [];
|
|
18
|
+
const name = args.name || 'build-components';
|
|
19
19
|
|
|
20
20
|
function run() {
|
|
21
|
-
const builderComponentsPath = Path.join(
|
|
22
|
-
builderPath,
|
|
23
|
-
'src',
|
|
24
|
-
'build-components'
|
|
25
|
-
);
|
|
21
|
+
const builderComponentsPath = Path.join(builderPath, 'src', name);
|
|
26
22
|
checkPathExists(builderComponentsPath);
|
|
27
23
|
const components = getAllComponents(builderComponentsPath);
|
|
28
24
|
for (const component of selectedComponents) {
|
|
@@ -31,14 +27,14 @@ function run() {
|
|
|
31
27
|
process.exit(1);
|
|
32
28
|
}
|
|
33
29
|
}
|
|
34
|
-
checkFolderAndFilesValid(
|
|
35
|
-
createMissingFoldersAndFiles(
|
|
30
|
+
checkFolderAndFilesValid(builderComponentsPath, selectedComponents);
|
|
31
|
+
createMissingFoldersAndFiles(builderComponentsPath, selectedComponents);
|
|
36
32
|
createRenderNodeGenerated(
|
|
37
33
|
builderComponentsPath,
|
|
38
|
-
|
|
34
|
+
builderComponentsPath,
|
|
39
35
|
selectedComponents
|
|
40
36
|
);
|
|
41
|
-
createComponentsIndex(
|
|
37
|
+
createComponentsIndex(builderComponentsPath, selectedComponents);
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
run();
|
|
@@ -2,12 +2,7 @@ import fs from 'fs';
|
|
|
2
2
|
import Path from 'path';
|
|
3
3
|
|
|
4
4
|
// Ensure target build-components folder contains only folders from components list; create missing ones
|
|
5
|
-
export function checkFolderAndFilesValid(
|
|
6
|
-
const buildComponentsTarget = Path.join(
|
|
7
|
-
targetRootPath,
|
|
8
|
-
'src',
|
|
9
|
-
'build-components'
|
|
10
|
-
);
|
|
5
|
+
export function checkFolderAndFilesValid(buildComponentsTarget, components) {
|
|
11
6
|
if (!fs.existsSync(buildComponentsTarget)) {
|
|
12
7
|
fs.mkdirSync(buildComponentsTarget, { recursive: true });
|
|
13
8
|
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import Path from 'path';
|
|
3
3
|
|
|
4
|
-
export function createComponentsIndex(
|
|
5
|
-
const buildComponentsTarget = Path.join(
|
|
6
|
-
targetRootPath,
|
|
7
|
-
'src',
|
|
8
|
-
'build-components'
|
|
9
|
-
);
|
|
10
|
-
|
|
4
|
+
export function createComponentsIndex(buildComponentsTarget, components) {
|
|
11
5
|
if (!fs.existsSync(buildComponentsTarget)) {
|
|
12
6
|
fs.mkdirSync(buildComponentsTarget, { recursive: true });
|
|
13
7
|
}
|
|
@@ -6,12 +6,10 @@ function toPropsName(name) {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
// Create folders and base component files if missing
|
|
9
|
-
export function createMissingFoldersAndFiles(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
'build-components'
|
|
14
|
-
);
|
|
9
|
+
export function createMissingFoldersAndFiles(
|
|
10
|
+
buildComponentsTarget,
|
|
11
|
+
components
|
|
12
|
+
) {
|
|
15
13
|
if (!fs.existsSync(buildComponentsTarget)) {
|
|
16
14
|
fs.mkdirSync(buildComponentsTarget, { recursive: true });
|
|
17
15
|
}
|
|
@@ -14,14 +14,9 @@ function readPatternType(builderComponentsPath, componentName) {
|
|
|
14
14
|
|
|
15
15
|
export function createRenderNodeGenerated(
|
|
16
16
|
builderComponentsPath,
|
|
17
|
-
|
|
17
|
+
buildComponentsTarget,
|
|
18
18
|
components
|
|
19
19
|
) {
|
|
20
|
-
const buildComponentsTarget = Path.join(
|
|
21
|
-
targetRootPath,
|
|
22
|
-
'src',
|
|
23
|
-
'build-components'
|
|
24
|
-
);
|
|
25
20
|
if (!fs.existsSync(buildComponentsTarget)) {
|
|
26
21
|
fs.mkdirSync(buildComponentsTarget, { recursive: true });
|
|
27
22
|
}
|