torch-glare 2.1.0 → 2.1.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.
- package/apps/lib/components/Badge.tsx +34 -137
- package/apps/lib/components/BadgeField.tsx +4 -4
- package/apps/lib/components/DataViews/ARCHITECTURE.md +439 -0
- package/apps/lib/components/DataViews/DataViewsConfigPanel.tsx +416 -0
- package/apps/lib/components/DataViews/DataViewsHeader.tsx +126 -0
- package/apps/lib/components/DataViews/DataViewsLayout.tsx +300 -0
- package/apps/lib/components/DataViews/FilterPanel.tsx +324 -0
- package/apps/lib/components/DataViews/InboxView.tsx +514 -0
- package/apps/lib/components/DataViews/KanbanView.tsx +242 -0
- package/apps/lib/components/DataViews/PanelControls.tsx +80 -0
- package/apps/lib/components/DataViews/SettingsPanel.tsx +285 -0
- package/apps/lib/components/DataViews/TableView.tsx +232 -0
- package/apps/lib/components/DataViews/TreeView.tsx +363 -0
- package/apps/lib/components/DataViews/badgeAdapter.ts +45 -0
- package/apps/lib/components/DataViews/fieldRenderers.tsx +334 -0
- package/apps/lib/components/DataViews/filters/DateRangePopover.tsx +113 -0
- package/apps/lib/components/DataViews/filters/PresetChips.tsx +45 -0
- package/apps/lib/components/DataViews/filters/RangeSliderWithInputs.tsx +154 -0
- package/apps/lib/components/DataViews/index.ts +30 -0
- package/apps/lib/components/DataViews/tree/TreeDrawer.tsx +54 -0
- package/apps/lib/components/DataViews/tree/TreeSidebar.tsx +77 -0
- package/apps/lib/components/DataViews/types.ts +177 -0
- package/apps/lib/components/TreeFolder/TreeFolder.tsx +387 -0
- package/apps/lib/components/TreeFolder/TreeFolderBreadcrumb.tsx +80 -0
- package/apps/lib/components/TreeFolder/TreeFolderRow.tsx +235 -0
- package/apps/lib/components/TreeFolder/TreeFolderStyles.tsx +60 -0
- package/apps/lib/components/TreeFolder/icons.tsx +63 -0
- package/apps/lib/components/TreeFolder/index.ts +17 -0
- package/apps/lib/components/TreeFolder/treeFolderUtils.ts +114 -0
- package/apps/lib/components/TreeFolder/types.ts +68 -0
- package/apps/lib/components/TreeFolder/useTreeFolderDnD.ts +261 -0
- package/apps/lib/hooks/useDataViewsState.ts +169 -0
- package/apps/lib/hooks/useIsMobile.ts +21 -0
- package/apps/lib/utils/dataViews/columnUtils.ts +130 -0
- package/apps/lib/utils/dataViews/fieldUtils.ts +198 -0
- package/apps/lib/utils/dataViews/nestedDataUtils.tsx +364 -0
- package/apps/lib/utils/dataViews/pathUtils.ts +132 -0
- package/apps/lib/utils/dataViews/rangeUtils.ts +225 -0
- package/apps/lib/utils/dataViews/treeUtils.ts +403 -0
- package/dist/bin/index.js +3 -3
- package/dist/bin/index.js.map +1 -1
- package/dist/src/commands/add.d.ts.map +1 -1
- package/dist/src/commands/add.js +29 -6
- package/dist/src/commands/add.js.map +1 -1
- package/dist/src/commands/utils.d.ts.map +1 -1
- package/dist/src/commands/utils.js +22 -2
- package/dist/src/commands/utils.js.map +1 -1
- package/dist/src/shared/copyComponentsRecursively.d.ts.map +1 -1
- package/dist/src/shared/copyComponentsRecursively.js +8 -1
- package/dist/src/shared/copyComponentsRecursively.js.map +1 -1
- package/dist/src/shared/getDependenciesAndInstallNestedComponents.d.ts +18 -4
- package/dist/src/shared/getDependenciesAndInstallNestedComponents.d.ts.map +1 -1
- package/dist/src/shared/getDependenciesAndInstallNestedComponents.js +110 -40
- package/dist/src/shared/getDependenciesAndInstallNestedComponents.js.map +1 -1
- package/docs/components/badge-field.md +21 -21
- package/docs/components/badge.md +156 -483
- package/docs/components/form-stepper.md +244 -0
- package/docs/components/stepper.md +215 -0
- package/docs/components/timeline.md +248 -0
- package/docs/reference/components.md +8 -7
- package/docs/reference/types.md +34 -26
- package/docs/tutorials/theming-basics.md +30 -27
- package/package.json +1 -1
- /package/docs/components/{labeled-checkbox.md → labeled-check-box.md} +0 -0
- /package/docs/components/{tree-dropdown.md → tree-drop-down.md} +0 -0
package/dist/src/commands/add.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
+
import fs from "fs";
|
|
2
3
|
import inquirer from "inquirer";
|
|
3
4
|
import { fileURLToPath } from "url";
|
|
4
5
|
import { ensureDirectoryExists } from "../shared/ensureDirectoryExists.js";
|
|
@@ -25,15 +26,16 @@ export async function add(component, replace = false) {
|
|
|
25
26
|
if (!component) {
|
|
26
27
|
component = await promptComponentSelection(availableComponents);
|
|
27
28
|
}
|
|
28
|
-
//
|
|
29
|
-
|
|
29
|
+
// Resolve user input to an actual entry — accepts "Button", "Button.tsx", or "DataViews" (folder).
|
|
30
|
+
const resolved = resolveComponentEntry(component, availableComponents, templatesDir);
|
|
31
|
+
if (!resolved) {
|
|
30
32
|
console.error(`❌ Component "${component}" not found.`);
|
|
31
33
|
return;
|
|
32
34
|
}
|
|
33
|
-
const { source, targetDir } = getInstallPaths(
|
|
35
|
+
const { source, targetDir } = getInstallPaths(resolved, targetFile, templatesDir, "components");
|
|
34
36
|
// Check if component already exists
|
|
35
|
-
if (isFileExists(targetDir,
|
|
36
|
-
console.log(`⚠️ Component "${
|
|
37
|
+
if (isFileExists(targetDir, resolved) && !replace) {
|
|
38
|
+
console.log(`⚠️ Component "${resolved}" already exists.`);
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
41
|
// Ensure the target directory exists
|
|
@@ -41,7 +43,28 @@ export async function add(component, replace = false) {
|
|
|
41
43
|
ensureDirectoryExists(targetDir);
|
|
42
44
|
// Copy the component (directory or file) and install dependencies
|
|
43
45
|
copyComponentsRecursively(source, targetDir);
|
|
44
|
-
console.log(`✅ ${
|
|
46
|
+
console.log(`✅ ${resolved} has been added to ${targetFile.path}!`);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Resolve a user-provided component name to an actual entry in the templates
|
|
50
|
+
* directory. Tries (in order):
|
|
51
|
+
* 1. exact match (e.g. "Button.tsx" or "DataViews")
|
|
52
|
+
* 2. with `.tsx` suffix (e.g. user typed "Button")
|
|
53
|
+
* 3. with `.ts` suffix (for non-JSX modules)
|
|
54
|
+
* Returns the matching entry name, or null if nothing matches.
|
|
55
|
+
*/
|
|
56
|
+
function resolveComponentEntry(input, available, dir) {
|
|
57
|
+
if (available.includes(input))
|
|
58
|
+
return input;
|
|
59
|
+
const candidates = [`${input}.tsx`, `${input}.ts`];
|
|
60
|
+
for (const c of candidates) {
|
|
61
|
+
if (available.includes(c))
|
|
62
|
+
return c;
|
|
63
|
+
}
|
|
64
|
+
// Last-ditch: see if it exists on disk even if `getAvailableFiles` missed it.
|
|
65
|
+
if (fs.existsSync(path.join(dir, input)))
|
|
66
|
+
return input;
|
|
67
|
+
return null;
|
|
45
68
|
}
|
|
46
69
|
/**
|
|
47
70
|
* Prompt the user to select a component from a list.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../cli/src/commands/add.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAElD,2CAA2C;AAC3C,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,6CAA6C;AAC7C,MA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KAAK,CAAC;IAC5C,MAAM,UAAU,GAAG,CAAC,GAAG,KAAK,MAAM,EAAE,GAAG,KAAK,KAAK,CAAC,CAAC;IACnD,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QACzB,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IACD,8EAA8E;IAC9E,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACvD,OAAO,IAAI,CAAC;AAChB,CAAC;AAGD;;;;GAIG;AACH,KAAK,UAAU,wBAAwB,CAAC,mBAA6B;IACjE,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QAChD;YACI,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,wCAAwC;YACjD,OAAO,EAAE,mBAAmB;SAC/B;KACJ,CAAC,CAAC;IACH,OAAO,iBAAiB,CAAC;AAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../cli/src/commands/utils.ts"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../cli/src/commands/utils.ts"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCpF"}
|
|
@@ -24,11 +24,13 @@ export async function addUtil(util, replace = false) {
|
|
|
24
24
|
if (!util) {
|
|
25
25
|
util = await promptUtilSelection(availableUtils);
|
|
26
26
|
}
|
|
27
|
-
//
|
|
28
|
-
|
|
27
|
+
// Resolve user input — accepts "cn", "cn.ts", or a folder name like "dataViews".
|
|
28
|
+
const resolved = resolveUtilEntry(util, availableUtils, utilsTemplatesDir);
|
|
29
|
+
if (!resolved) {
|
|
29
30
|
console.error(`❌ Utility file "${util}" not found.`);
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
33
|
+
util = resolved;
|
|
32
34
|
// get the path and create the create the target directory
|
|
33
35
|
const { source, targetDir } = getInstallPaths(util, targetFile, utilsTemplatesDir, "utils");
|
|
34
36
|
const target = path.join(targetDir, util);
|
|
@@ -52,6 +54,24 @@ export async function addUtil(util, replace = false) {
|
|
|
52
54
|
function getAvailableUtils(utilsTemplatesDir) {
|
|
53
55
|
return fs.readdirSync(utilsTemplatesDir).map((file) => path.basename(file));
|
|
54
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Resolve a user-provided util name to an actual entry. Tries:
|
|
59
|
+
* 1. exact match (e.g. "cn.ts" or "dataViews")
|
|
60
|
+
* 2. with `.ts` suffix
|
|
61
|
+
* 3. with `.tsx` suffix
|
|
62
|
+
*/
|
|
63
|
+
function resolveUtilEntry(input, available, dir) {
|
|
64
|
+
if (available.includes(input))
|
|
65
|
+
return input;
|
|
66
|
+
const candidates = [`${input}.ts`, `${input}.tsx`];
|
|
67
|
+
for (const c of candidates) {
|
|
68
|
+
if (available.includes(c))
|
|
69
|
+
return c;
|
|
70
|
+
}
|
|
71
|
+
if (fs.existsSync(path.join(dir, input)))
|
|
72
|
+
return input;
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
55
75
|
/**
|
|
56
76
|
* Prompt the user to select a utility file from a list.
|
|
57
77
|
* @param {string[]} availableUtils - Array of available utility files.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../cli/src/commands/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC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AAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACvD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,KAAK,UAAU,mBAAmB,CAAC,cAAwB;IACvD,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QAC3C;YACI,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,2CAA2C;YACpD,OAAO,EAAE,cAAc;SAC1B;KACJ,CAAC,CAAC;IACH,OAAO,YAAY,CAAC;AACxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyComponentsRecursively.d.ts","sourceRoot":"","sources":["../../../cli/src/shared/copyComponentsRecursively.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"copyComponentsRecursively.d.ts","sourceRoot":"","sources":["../../../cli/src/shared/copyComponentsRecursively.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAqB9E;AACD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC7B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACf,IAAI,CAiBN"}
|
|
@@ -8,7 +8,14 @@ import path from "path";
|
|
|
8
8
|
*/
|
|
9
9
|
export function copyComponentsRecursively(source, target) {
|
|
10
10
|
if (fs.lstatSync(source).isDirectory()) {
|
|
11
|
-
|
|
11
|
+
// If target already exists as a directory, nest the source folder
|
|
12
|
+
// inside it (so `add DataViews` ends up at ./components/DataViews/,
|
|
13
|
+
// not flattened into ./components/). Otherwise the target IS the
|
|
14
|
+
// destination directory (legacy behavior).
|
|
15
|
+
const finalTarget = fs.existsSync(target) && fs.lstatSync(target).isDirectory()
|
|
16
|
+
? path.join(target, path.basename(source))
|
|
17
|
+
: target;
|
|
18
|
+
copyDirectorySync(source, finalTarget);
|
|
12
19
|
}
|
|
13
20
|
else {
|
|
14
21
|
let finalTarget = target;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyComponentsRecursively.js","sourceRoot":"","sources":["../../../cli/src/shared/copyComponentsRecursively.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAc,EAAE,MAAc;IACpE,IAAI,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;QACrC,
|
|
1
|
+
{"version":3,"file":"copyComponentsRecursively.js","sourceRoot":"","sources":["../../../cli/src/shared/copyComponentsRecursively.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAc,EAAE,MAAc;IACpE,IAAI,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;QACrC,kEAAkE;QAClE,oEAAoE;QACpE,iEAAiE;QACjE,2CAA2C;QAC3C,MAAM,WAAW,GACb,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE;YACvD,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC1C,CAAC,CAAC,MAAM,CA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,CAAC,UAAU,CAAC,CAAC;QACpC,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Walk a copied component file's imports and (a) collect 3rd-party deps to
|
|
3
|
+
* install, (b) recursively pull in any referenced glare components, hooks, or
|
|
4
|
+
* utils so the user gets a self-contained drop-in.
|
|
5
|
+
*
|
|
6
|
+
* Import-path forms understood:
|
|
7
|
+
* "lucide-react" → 3rd-party
|
|
8
|
+
* "./TableView" → sibling (already copied by folder copy)
|
|
9
|
+
* "../Button" → ../components/Button.tsx
|
|
10
|
+
* "../../components/Button" → same
|
|
11
|
+
* "../utils/cn" → util "cn"
|
|
12
|
+
* "../../utils/cn" → util "cn"
|
|
13
|
+
* "../../utils/dataViews/pathUtils" → util folder "dataViews" (whole folder)
|
|
14
|
+
* "../hooks/useIsMobile" → hook "useIsMobile.ts"
|
|
15
|
+
* "../../hooks/useIsMobile" → same
|
|
16
|
+
*
|
|
17
|
+
* @param componentPath - File whose imports we're walking.
|
|
18
|
+
* @param installedDependencies - Already-present 3rd-party packages.
|
|
19
|
+
* @returns Set of 3rd-party deps still to install.
|
|
6
20
|
*/
|
|
7
21
|
export declare function getDependenciesAndInstallNestedComponents(componentPath: string, installedDependencies: Set<string>): Set<string>;
|
|
8
22
|
//# sourceMappingURL=getDependenciesAndInstallNestedComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDependenciesAndInstallNestedComponents.d.ts","sourceRoot":"","sources":["../../../cli/src/shared/getDependenciesAndInstallNestedComponents.ts"],"names":[],"mappings":"AAMA
|
|
1
|
+
{"version":3,"file":"getDependenciesAndInstallNestedComponents.d.ts","sourceRoot":"","sources":["../../../cli/src/shared/getDependenciesAndInstallNestedComponents.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,yCAAyC,CACrD,aAAa,EAAE,MAAM,EACrB,qBAAqB,EAAE,GAAG,CAAC,MAAM,CAAC,GACnC,GAAG,CAAC,MAAM,CAAC,CAgEb"}
|
|
@@ -4,63 +4,133 @@ import { addUtil } from "../commands/utils.js";
|
|
|
4
4
|
import { addHook } from "../commands/hook.js";
|
|
5
5
|
import { add } from "../commands/add.js";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Walk a copied component file's imports and (a) collect 3rd-party deps to
|
|
8
|
+
* install, (b) recursively pull in any referenced glare components, hooks, or
|
|
9
|
+
* utils so the user gets a self-contained drop-in.
|
|
10
|
+
*
|
|
11
|
+
* Import-path forms understood:
|
|
12
|
+
* "lucide-react" → 3rd-party
|
|
13
|
+
* "./TableView" → sibling (already copied by folder copy)
|
|
14
|
+
* "../Button" → ../components/Button.tsx
|
|
15
|
+
* "../../components/Button" → same
|
|
16
|
+
* "../utils/cn" → util "cn"
|
|
17
|
+
* "../../utils/cn" → util "cn"
|
|
18
|
+
* "../../utils/dataViews/pathUtils" → util folder "dataViews" (whole folder)
|
|
19
|
+
* "../hooks/useIsMobile" → hook "useIsMobile.ts"
|
|
20
|
+
* "../../hooks/useIsMobile" → same
|
|
21
|
+
*
|
|
22
|
+
* @param componentPath - File whose imports we're walking.
|
|
23
|
+
* @param installedDependencies - Already-present 3rd-party packages.
|
|
24
|
+
* @returns Set of 3rd-party deps still to install.
|
|
11
25
|
*/
|
|
12
26
|
export function getDependenciesAndInstallNestedComponents(componentPath, installedDependencies) {
|
|
13
27
|
const componentContent = fs.readFileSync(componentPath, "utf-8");
|
|
14
|
-
const importRegex = /import\s
|
|
28
|
+
const importRegex = /import\s+(?:[\s\S]*?from\s+)?['"]([^'"]+)['"]/g;
|
|
15
29
|
const dependenciesToInstall = new Set();
|
|
30
|
+
const dir = path.dirname(componentPath);
|
|
16
31
|
let match;
|
|
17
32
|
while ((match = importRegex.exec(componentContent)) !== null) {
|
|
18
33
|
const moduleName = match[1];
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
addUtil(moduleName.slice(9) + ".ts");
|
|
34
|
+
if (!moduleName)
|
|
35
|
+
continue;
|
|
36
|
+
// ----- 3rd-party packages (no relative prefix) -----
|
|
37
|
+
if (!moduleName.startsWith(".")) {
|
|
38
|
+
if (!installedDependencies.has(moduleName)) {
|
|
39
|
+
dependenciesToInstall.add(moduleName);
|
|
40
|
+
}
|
|
41
|
+
continue;
|
|
28
42
|
}
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
// ----- Relative imports -----
|
|
44
|
+
const segments = moduleName.split("/").filter(s => s && s !== ".");
|
|
45
|
+
const dotDots = segments.filter(s => s === "..").length;
|
|
46
|
+
const rest = segments.slice(dotDots);
|
|
47
|
+
// Sibling import (no ..): handled by directory copy, skip.
|
|
48
|
+
if (dotDots === 0)
|
|
49
|
+
continue;
|
|
50
|
+
const head = rest[0];
|
|
51
|
+
// Implicit-or-explicit segment header — handle both:
|
|
52
|
+
// "../utils/cn" (head = "utils")
|
|
53
|
+
// "../../utils/cn" (head = "utils")
|
|
54
|
+
// "../Button" (head = "Button") → component sibling
|
|
55
|
+
if (head === "utils") {
|
|
56
|
+
// utils/cn or utils/dataViews/pathUtils
|
|
57
|
+
const utilEntry = rest[1];
|
|
58
|
+
if (utilEntry) {
|
|
59
|
+
addUtil(utilEntry);
|
|
60
|
+
}
|
|
34
61
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
(
|
|
38
|
-
|
|
39
|
-
!installedDependencies.has(moduleName)) {
|
|
40
|
-
const baseName = moduleName.slice(2);
|
|
41
|
-
const dir = path.dirname(componentPath);
|
|
42
|
-
// Try .tsx first, fall back to .ts for non-JSX files
|
|
43
|
-
if (fs.existsSync(path.join(dir, baseName + ".tsx"))) {
|
|
44
|
-
add(baseName + ".tsx");
|
|
62
|
+
else if (head === "hooks") {
|
|
63
|
+
const hookEntry = rest[1];
|
|
64
|
+
if (hookEntry) {
|
|
65
|
+
addHook(`${hookEntry}.ts`);
|
|
45
66
|
}
|
|
46
|
-
|
|
47
|
-
|
|
67
|
+
}
|
|
68
|
+
else if (head === "components") {
|
|
69
|
+
const compEntry = rest[1];
|
|
70
|
+
if (compEntry) {
|
|
71
|
+
// Use bare name; the add() resolver figures out folder-vs-file.
|
|
72
|
+
add(compEntry);
|
|
48
73
|
}
|
|
49
74
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (fs.existsSync(path.join(componentsDir, baseName + ".tsx"))) {
|
|
57
|
-
add(baseName + ".tsx");
|
|
75
|
+
else {
|
|
76
|
+
// Bare relative — assume sibling component (e.g. "../Button" from a layout).
|
|
77
|
+
// Resolve against the file system to decide whether to call addUtil/addHook/add.
|
|
78
|
+
const resolved = resolveRelative(dir, moduleName);
|
|
79
|
+
if (resolved) {
|
|
80
|
+
routeByLocation(resolved);
|
|
58
81
|
}
|
|
59
82
|
else {
|
|
60
|
-
|
|
83
|
+
// Fallback: try as a sibling component.
|
|
84
|
+
add(head);
|
|
61
85
|
}
|
|
62
86
|
}
|
|
63
87
|
}
|
|
64
88
|
return dependenciesToInstall;
|
|
65
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Resolve a relative import to an absolute file or folder path inside
|
|
92
|
+
* apps/lib (skipping extension guesses — caller knows what they want).
|
|
93
|
+
* Returns null when nothing exists.
|
|
94
|
+
*/
|
|
95
|
+
function resolveRelative(fromDir, moduleName) {
|
|
96
|
+
const base = path.resolve(fromDir, moduleName);
|
|
97
|
+
const candidates = [base, `${base}.tsx`, `${base}.ts`, path.join(base, "index.ts"), path.join(base, "index.tsx")];
|
|
98
|
+
for (const c of candidates) {
|
|
99
|
+
if (fs.existsSync(c))
|
|
100
|
+
return c;
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Given an absolute path inside apps/lib, route it to the right add* command
|
|
106
|
+
* by inspecting which top-level folder it lives in.
|
|
107
|
+
*/
|
|
108
|
+
function routeByLocation(absPath) {
|
|
109
|
+
const marker = `${path.sep}apps${path.sep}lib${path.sep}`;
|
|
110
|
+
const idx = absPath.indexOf(marker);
|
|
111
|
+
if (idx === -1)
|
|
112
|
+
return;
|
|
113
|
+
const after = absPath.slice(idx + marker.length);
|
|
114
|
+
const [folder, ...rest] = after.split(path.sep);
|
|
115
|
+
const entry = rest[0];
|
|
116
|
+
if (!entry)
|
|
117
|
+
return;
|
|
118
|
+
switch (folder) {
|
|
119
|
+
case "components":
|
|
120
|
+
add(stripExt(entry));
|
|
121
|
+
break;
|
|
122
|
+
case "hooks":
|
|
123
|
+
addHook(entry);
|
|
124
|
+
break;
|
|
125
|
+
case "utils":
|
|
126
|
+
addUtil(entry);
|
|
127
|
+
break;
|
|
128
|
+
case "layouts":
|
|
129
|
+
add(stripExt(entry));
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function stripExt(name) {
|
|
134
|
+
return name.replace(/\.(tsx?|jsx?)$/, "");
|
|
135
|
+
}
|
|
66
136
|
//# sourceMappingURL=getDependenciesAndInstallNestedComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDependenciesAndInstallNestedComponents.js","sourceRoot":"","sources":["../../../cli/src/shared/getDependenciesAndInstallNestedComponents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC
|
|
1
|
+
{"version":3,"file":"getDependenciesAndInstallNestedComponents.js","sourceRoot":"","sources":["../../../cli/src/shared/getDependenciesAndInstallNestedComponents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,yCAAyC,CACrD,aAAqB,EACrB,qBAAkC;IAElC,MAAM,gBAAgB,GAAG,EAAE,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,gDAAgD,CAAC;IACrE,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAU,CAAC;IAChD,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAExC,IAAI,KAAK,CAAC;IACV,OAAO,CAAC,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC3D,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC,UAAU;YAAE,SAAS;QAE1B,sDAAsD;QACtD,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;gBACzC,qBAAqB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAC1C,CAAC;YACD,SAAS;QACb,CAAC;QAED,+BAA+B;QAC/B,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK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,MAAM,EAAE,CAAC;QACb,KAAK,YAAY;YAAE,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YAAC,MAAK;QAC9C,KAAK,OAAO;YAAO,OAAO,CAAC,KAAK,CAAC,CAAC;YAAC,MAAK;QACxC,KAAK,OAAO;YAAO,OAAO,CAAC,KAAK,CAAC,CAAC;YAAC,MAAK;QACxC,KAAK,SAAS;YAAK,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YAAC,MAAK;IAClD,CAAC;AACL,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAA;AAC7C,CAAC"}
|
|
@@ -34,8 +34,8 @@ import { useState } from 'react'
|
|
|
34
34
|
export function BasicBadgeField() {
|
|
35
35
|
const [tags] = useState([
|
|
36
36
|
{ id: '1', name: 'React', variant: 'blue' },
|
|
37
|
-
{ id: '2', name: 'TypeScript', variant: '
|
|
38
|
-
{ id: '3', name: 'Next.js', variant: '
|
|
37
|
+
{ id: '2', name: 'TypeScript', variant: 'purple' },
|
|
38
|
+
{ id: '3', name: 'Next.js', variant: 'slate' },
|
|
39
39
|
])
|
|
40
40
|
|
|
41
41
|
return (
|
|
@@ -60,12 +60,12 @@ export function TechnologySelector() {
|
|
|
60
60
|
|
|
61
61
|
const allTags: Tag[] = [
|
|
62
62
|
{ id: '1', name: 'React', variant: 'blue' },
|
|
63
|
-
{ id: '2', name: 'TypeScript', variant: '
|
|
64
|
-
{ id: '3', name: 'Next.js', variant: '
|
|
65
|
-
{ id: '4', name: 'Tailwind CSS', variant: '
|
|
63
|
+
{ id: '2', name: 'TypeScript', variant: 'purple' },
|
|
64
|
+
{ id: '3', name: 'Next.js', variant: 'slate' },
|
|
65
|
+
{ id: '4', name: 'Tailwind CSS', variant: 'green' },
|
|
66
66
|
{ id: '5', name: 'Node.js', variant: 'green' },
|
|
67
67
|
{ id: '6', name: 'PostgreSQL', variant: 'blue' },
|
|
68
|
-
{ id: '7', name: 'MongoDB', variant: '
|
|
68
|
+
{ id: '7', name: 'MongoDB', variant: 'green' },
|
|
69
69
|
{ id: '8', name: 'GraphQL', variant: 'purple' },
|
|
70
70
|
{ id: '9', name: 'REST API', variant: 'gray' },
|
|
71
71
|
{ id: '10', name: 'Docker', variant: 'blue' },
|
|
@@ -105,9 +105,9 @@ export function CategoryFilter() {
|
|
|
105
105
|
{ id: 'development', name: 'Development', variant: 'blue' },
|
|
106
106
|
{ id: 'marketing', name: 'Marketing', variant: 'yellow' },
|
|
107
107
|
{ id: 'sales', name: 'Sales', variant: 'green' },
|
|
108
|
-
{ id: 'support', name: 'Support', variant: '
|
|
108
|
+
{ id: 'support', name: 'Support', variant: 'orange' },
|
|
109
109
|
{ id: 'hr', name: 'Human Resources', variant: 'rose' },
|
|
110
|
-
{ id: 'finance', name: 'Finance', variant: '
|
|
110
|
+
{ id: 'finance', name: 'Finance', variant: 'slate' },
|
|
111
111
|
]
|
|
112
112
|
|
|
113
113
|
const [selectedCategories, setSelectedCategories] = useState<Tag[]>([])
|
|
@@ -152,13 +152,13 @@ export function SkillsSelector() {
|
|
|
152
152
|
{ id: 'ts', name: 'TypeScript', variant: 'blue' },
|
|
153
153
|
{ id: 'react', name: 'React', variant: 'blue' },
|
|
154
154
|
{ id: 'vue', name: 'Vue.js', variant: 'green' },
|
|
155
|
-
{ id: 'angular', name: 'Angular', variant: '
|
|
156
|
-
{ id: 'node', name: 'Node.js', variant: '
|
|
155
|
+
{ id: 'angular', name: 'Angular', variant: 'red' },
|
|
156
|
+
{ id: 'node', name: 'Node.js', variant: 'green' },
|
|
157
157
|
{ id: 'python', name: 'Python', variant: 'blue' },
|
|
158
|
-
{ id: 'java', name: 'Java', variant: '
|
|
159
|
-
{ id: 'go', name: 'Go', variant: '
|
|
160
|
-
{ id: 'rust', name: 'Rust', variant: '
|
|
161
|
-
{ id: 'sql', name: 'SQL', variant: '
|
|
158
|
+
{ id: 'java', name: 'Java', variant: 'orange' },
|
|
159
|
+
{ id: 'go', name: 'Go', variant: 'green' },
|
|
160
|
+
{ id: 'rust', name: 'Rust', variant: 'orange' },
|
|
161
|
+
{ id: 'sql', name: 'SQL', variant: 'slate' },
|
|
162
162
|
{ id: 'nosql', name: 'NoSQL', variant: 'green' },
|
|
163
163
|
{ id: 'aws', name: 'AWS', variant: 'yellow' },
|
|
164
164
|
{ id: 'azure', name: 'Azure', variant: 'blue' },
|
|
@@ -213,16 +213,16 @@ Tag management for projects with custom variants.
|
|
|
213
213
|
```tsx
|
|
214
214
|
export function ProjectTags() {
|
|
215
215
|
const projectTags: Tag[] = [
|
|
216
|
-
{ id: '1', name: 'High Priority', variant: '
|
|
216
|
+
{ id: '1', name: 'High Priority', variant: 'red' },
|
|
217
217
|
{ id: '2', name: 'In Progress', variant: 'blue' },
|
|
218
218
|
{ id: '3', name: 'Completed', variant: 'green' },
|
|
219
219
|
{ id: '4', name: 'On Hold', variant: 'yellow' },
|
|
220
220
|
{ id: '5', name: 'Needs Review', variant: 'purple' },
|
|
221
|
-
{ id: '6', name: 'Client Approval', variant: '
|
|
221
|
+
{ id: '6', name: 'Client Approval', variant: 'purple' },
|
|
222
222
|
{ id: '7', name: 'Internal', variant: 'gray' },
|
|
223
|
-
{ id: '8', name: 'External', variant: '
|
|
224
|
-
{ id: '9', name: 'Urgent', variant: '
|
|
225
|
-
{ id: '10', name: 'Can Wait', variant: '
|
|
223
|
+
{ id: '8', name: 'External', variant: 'slate' },
|
|
224
|
+
{ id: '9', name: 'Urgent', variant: 'orange' },
|
|
225
|
+
{ id: '10', name: 'Can Wait', variant: 'green' },
|
|
226
226
|
]
|
|
227
227
|
|
|
228
228
|
const [projectData, setProjectData] = useState({
|
|
@@ -310,7 +310,7 @@ export function BadgeFieldWithIcon() {
|
|
|
310
310
|
const tags: Tag[] = [
|
|
311
311
|
{ id: '1', name: 'JavaScript', variant: 'yellow' },
|
|
312
312
|
{ id: '2', name: 'Python', variant: 'blue' },
|
|
313
|
-
{ id: '3', name: 'Ruby', variant: '
|
|
313
|
+
{ id: '3', name: 'Ruby', variant: 'red' },
|
|
314
314
|
]
|
|
315
315
|
|
|
316
316
|
return (
|
|
@@ -385,7 +385,7 @@ export function EmailRecipients() {
|
|
|
385
385
|
{ id: '1', name: 'john@example.com', variant: 'blue' },
|
|
386
386
|
{ id: '2', name: 'jane@example.com', variant: 'green' },
|
|
387
387
|
{ id: '3', name: 'team@example.com', variant: 'purple' },
|
|
388
|
-
{ id: '4', name: 'support@example.com', variant: '
|
|
388
|
+
{ id: '4', name: 'support@example.com', variant: 'slate' },
|
|
389
389
|
]
|
|
390
390
|
|
|
391
391
|
const [recipients, setRecipients] = useState<Tag[]>([])
|