@developer_tribe/react-builder 0.1.12 → 0.1.13

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.12",
3
+ "version": "0.1.13",
4
4
  "type": "module",
5
5
  "restricted": true,
6
6
  "main": "dist/index.cjs.js",
@@ -20,7 +20,7 @@ async function getAllEntriesInComponentsRoot(paths) {
20
20
  return dirents.filter(
21
21
  d =>
22
22
  d.name !== 'RenderNode.generated.tsx' &&
23
- d.name !== 'other.ts' &&
23
+ d.name !== 'other.tsx' &&
24
24
  d.name !== 'index.ts'
25
25
  );
26
26
  });
@@ -37,10 +37,10 @@ function ensureAllEntriesAreFolders(dirents, paths) {
37
37
  }
38
38
  }
39
39
 
40
- // single-use: ensure fallback other.ts exists
40
+ // single-use: ensure fallback other.tsx exists
41
41
  async function ensureOtherTsExists(paths) {
42
42
  const { COMPONENTS_ROOT } = paths;
43
- const otherPath = path.join(COMPONENTS_ROOT, 'other.ts');
43
+ const otherPath = path.join(COMPONENTS_ROOT, 'other.tsx');
44
44
  const exists = await fs
45
45
  .stat(otherPath)
46
46
  .then(() => true)
@@ -3,7 +3,6 @@
3
3
  import yargs from 'yargs/yargs';
4
4
  import { hideBin } from 'yargs/helpers';
5
5
  import Path from 'path';
6
- import { fileURLToPath } from 'url';
7
6
  import { checkPathExists } from './utils/checkPathExists.js';
8
7
  import { getAllComponents } from './utils/getAllComponents.js';
9
8
  import { checkFolderAndFilesValid } from './utils/checkFolderAndFilesValid.js';
@@ -16,9 +15,15 @@ export const args = argv;
16
15
  const builderPath = args.path || 'node_modules/@developer_tribe/react-builder';
17
16
  const selectedComponents = args.components || [];
18
17
  const name = args.name || 'build-components';
18
+ const targetPath = process.cwd();
19
19
 
20
20
  function run() {
21
- const builderComponentsPath = Path.join(builderPath, 'src', name);
21
+ const builderComponentsPath = Path.join(
22
+ builderPath,
23
+ 'src',
24
+ 'build-components'
25
+ );
26
+ const targetComponentsPath = Path.join(targetPath, 'src', name);
22
27
  checkPathExists(builderComponentsPath);
23
28
  const components = getAllComponents(builderComponentsPath);
24
29
  for (const component of selectedComponents) {
@@ -27,11 +32,11 @@ function run() {
27
32
  process.exit(1);
28
33
  }
29
34
  }
30
- checkFolderAndFilesValid(builderComponentsPath, selectedComponents);
31
- createMissingFoldersAndFiles(builderComponentsPath, selectedComponents);
35
+ checkFolderAndFilesValid(targetComponentsPath, selectedComponents);
36
+ createMissingFoldersAndFiles(targetComponentsPath, selectedComponents);
32
37
  createRenderNodeGenerated(
33
38
  builderComponentsPath,
34
- builderComponentsPath,
39
+ targetComponentsPath,
35
40
  selectedComponents
36
41
  );
37
42
  createComponentsIndex(builderComponentsPath, selectedComponents);
@@ -19,7 +19,7 @@ export function checkFolderAndFilesValid(buildComponentsTarget, components) {
19
19
  if (
20
20
  !components.includes(name) &&
21
21
  name !== 'RenderNode.generated.tsx' &&
22
- name !== 'other.ts'
22
+ name !== 'other.tsx'
23
23
  ) {
24
24
  const full = Path.join(buildComponentsTarget, name);
25
25
  fs.rmSync(full, { recursive: true, force: true });
@@ -15,7 +15,7 @@ export function createMissingFoldersAndFiles(
15
15
  }
16
16
 
17
17
  // Ensure fallback helper exists
18
- const otherPath = Path.join(buildComponentsTarget, 'other.ts');
18
+ const otherPath = Path.join(buildComponentsTarget, 'other.tsx');
19
19
  if (!fs.existsSync(otherPath)) {
20
20
  const otherContent = `import React from 'react';
21
21
  import type { Node } from '@developer_tribe/react-builder';
File without changes