@auto-engineer/generate-react-client 1.12.1
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/CHANGELOG.md +12 -0
- package/LICENSE +10 -0
- package/dist/src/commands/generate-react-client.d.ts +21 -0
- package/dist/src/commands/generate-react-client.d.ts.map +1 -0
- package/dist/src/commands/generate-react-client.js +62 -0
- package/dist/src/commands/generate-react-client.js.map +1 -0
- package/dist/src/copy-starter.d.ts +2 -0
- package/dist/src/copy-starter.d.ts.map +1 -0
- package/dist/src/copy-starter.js +34 -0
- package/dist/src/copy-starter.js.map +1 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -0
- package/dist/starter/.storybook/main.ts +33 -0
- package/dist/starter/.storybook/preview.tsx +35 -0
- package/dist/starter/components.json +29 -0
- package/dist/starter/index.html +12 -0
- package/dist/starter/package.json +60 -0
- package/dist/starter/pnpm-lock.yaml +5236 -0
- package/dist/starter/public/mockServiceWorker.js +336 -0
- package/dist/starter/src/App.tsx +15 -0
- package/dist/starter/src/components/.gitkeep +0 -0
- package/dist/starter/src/components/ui/Accordion.stories.tsx +47 -0
- package/dist/starter/src/components/ui/Accordion.tsx +51 -0
- package/dist/starter/src/components/ui/Alert.stories.tsx +27 -0
- package/dist/starter/src/components/ui/Alert.tsx +49 -0
- package/dist/starter/src/components/ui/AlertDialog.stories.tsx +65 -0
- package/dist/starter/src/components/ui/AlertDialog.tsx +163 -0
- package/dist/starter/src/components/ui/AspectRatio.stories.tsx +33 -0
- package/dist/starter/src/components/ui/AspectRatio.tsx +9 -0
- package/dist/starter/src/components/ui/Avatar.stories.tsx +42 -0
- package/dist/starter/src/components/ui/Avatar.tsx +87 -0
- package/dist/starter/src/components/ui/Badge.stories.tsx +36 -0
- package/dist/starter/src/components/ui/Badge.tsx +40 -0
- package/dist/starter/src/components/ui/Breadcrumb.stories.tsx +52 -0
- package/dist/starter/src/components/ui/Breadcrumb.tsx +92 -0
- package/dist/starter/src/components/ui/Button.stories.tsx +92 -0
- package/dist/starter/src/components/ui/Button.tsx +62 -0
- package/dist/starter/src/components/ui/ButtonGroup.stories.tsx +30 -0
- package/dist/starter/src/components/ui/ButtonGroup.tsx +75 -0
- package/dist/starter/src/components/ui/Calendar.stories.tsx +38 -0
- package/dist/starter/src/components/ui/Calendar.tsx +159 -0
- package/dist/starter/src/components/ui/Card.stories.tsx +42 -0
- package/dist/starter/src/components/ui/Card.tsx +56 -0
- package/dist/starter/src/components/ui/Carousel.stories.tsx +54 -0
- package/dist/starter/src/components/ui/Carousel.tsx +216 -0
- package/dist/starter/src/components/ui/Chart.stories.tsx +38 -0
- package/dist/starter/src/components/ui/Chart.tsx +296 -0
- package/dist/starter/src/components/ui/Checkbox.stories.tsx +31 -0
- package/dist/starter/src/components/ui/Checkbox.tsx +29 -0
- package/dist/starter/src/components/ui/Collapsible.stories.tsx +56 -0
- package/dist/starter/src/components/ui/Collapsible.tsx +15 -0
- package/dist/starter/src/components/ui/Combobox.stories.tsx +73 -0
- package/dist/starter/src/components/ui/Combobox.tsx +267 -0
- package/dist/starter/src/components/ui/Command.stories.tsx +69 -0
- package/dist/starter/src/components/ui/Command.tsx +137 -0
- package/dist/starter/src/components/ui/ContextMenu.stories.tsx +66 -0
- package/dist/starter/src/components/ui/ContextMenu.tsx +211 -0
- package/dist/starter/src/components/ui/DesignSystem-Colors.mdx +68 -0
- package/dist/starter/src/components/ui/DesignSystem-Colors.stories.tsx +116 -0
- package/dist/starter/src/components/ui/DesignSystem-Layout.mdx +64 -0
- package/dist/starter/src/components/ui/DesignSystem-Layout.stories.tsx +166 -0
- package/dist/starter/src/components/ui/DesignSystem-Typography.mdx +31 -0
- package/dist/starter/src/components/ui/DesignSystem-Typography.stories.tsx +79 -0
- package/dist/starter/src/components/ui/Dialog.stories.tsx +72 -0
- package/dist/starter/src/components/ui/Dialog.tsx +136 -0
- package/dist/starter/src/components/ui/Direction.stories.tsx +36 -0
- package/dist/starter/src/components/ui/Direction.tsx +18 -0
- package/dist/starter/src/components/ui/Drawer.stories.tsx +68 -0
- package/dist/starter/src/components/ui/Drawer.tsx +106 -0
- package/dist/starter/src/components/ui/DropdownMenu.stories.tsx +72 -0
- package/dist/starter/src/components/ui/DropdownMenu.tsx +219 -0
- package/dist/starter/src/components/ui/Empty.stories.tsx +35 -0
- package/dist/starter/src/components/ui/Empty.tsx +85 -0
- package/dist/starter/src/components/ui/Field.stories.tsx +47 -0
- package/dist/starter/src/components/ui/Field.tsx +226 -0
- package/dist/starter/src/components/ui/Form.stories.tsx +44 -0
- package/dist/starter/src/components/ui/Form.tsx +136 -0
- package/dist/starter/src/components/ui/HoverCard.stories.tsx +47 -0
- package/dist/starter/src/components/ui/HoverCard.tsx +36 -0
- package/dist/starter/src/components/ui/Input.stories.tsx +38 -0
- package/dist/starter/src/components/ui/Input.tsx +21 -0
- package/dist/starter/src/components/ui/InputGroup.stories.tsx +50 -0
- package/dist/starter/src/components/ui/InputGroup.tsx +147 -0
- package/dist/starter/src/components/ui/InputOTP.stories.tsx +40 -0
- package/dist/starter/src/components/ui/InputOTP.tsx +68 -0
- package/dist/starter/src/components/ui/Item.stories.tsx +61 -0
- package/dist/starter/src/components/ui/Item.tsx +158 -0
- package/dist/starter/src/components/ui/Kbd.stories.tsx +54 -0
- package/dist/starter/src/components/ui/Kbd.tsx +18 -0
- package/dist/starter/src/components/ui/Label.stories.tsx +85 -0
- package/dist/starter/src/components/ui/Label.tsx +40 -0
- package/dist/starter/src/components/ui/Menubar.stories.tsx +76 -0
- package/dist/starter/src/components/ui/Menubar.tsx +236 -0
- package/dist/starter/src/components/ui/NativeSelect.stories.tsx +42 -0
- package/dist/starter/src/components/ui/NativeSelect.tsx +44 -0
- package/dist/starter/src/components/ui/NavigationMenu.stories.tsx +78 -0
- package/dist/starter/src/components/ui/NavigationMenu.tsx +142 -0
- package/dist/starter/src/components/ui/Pagination.stories.tsx +75 -0
- package/dist/starter/src/components/ui/Pagination.tsx +100 -0
- package/dist/starter/src/components/ui/Popover.stories.tsx +51 -0
- package/dist/starter/src/components/ui/Popover.tsx +52 -0
- package/dist/starter/src/components/ui/Progress.stories.tsx +28 -0
- package/dist/starter/src/components/ui/Progress.tsx +24 -0
- package/dist/starter/src/components/ui/RadioGroup.stories.tsx +48 -0
- package/dist/starter/src/components/ui/RadioGroup.tsx +31 -0
- package/dist/starter/src/components/ui/Resizable.stories.tsx +69 -0
- package/dist/starter/src/components/ui/Resizable.tsx +47 -0
- package/dist/starter/src/components/ui/ScrollArea.stories.tsx +43 -0
- package/dist/starter/src/components/ui/ScrollArea.tsx +46 -0
- package/dist/starter/src/components/ui/Select.stories.tsx +57 -0
- package/dist/starter/src/components/ui/Select.tsx +162 -0
- package/dist/starter/src/components/ui/Separator.stories.tsx +40 -0
- package/dist/starter/src/components/ui/Separator.tsx +26 -0
- package/dist/starter/src/components/ui/Sheet.stories.tsx +66 -0
- package/dist/starter/src/components/ui/Sheet.tsx +107 -0
- package/dist/starter/src/components/ui/Sidebar.stories.tsx +94 -0
- package/dist/starter/src/components/ui/Sidebar.tsx +675 -0
- package/dist/starter/src/components/ui/Skeleton.stories.tsx +38 -0
- package/dist/starter/src/components/ui/Skeleton.tsx +7 -0
- package/dist/starter/src/components/ui/Slider.stories.tsx +21 -0
- package/dist/starter/src/components/ui/Slider.tsx +54 -0
- package/dist/starter/src/components/ui/Sonner.stories.tsx +44 -0
- package/dist/starter/src/components/ui/Sonner.tsx +34 -0
- package/dist/starter/src/components/ui/Spinner.stories.tsx +23 -0
- package/dist/starter/src/components/ui/Spinner.tsx +9 -0
- package/dist/starter/src/components/ui/Switch.stories.tsx +35 -0
- package/dist/starter/src/components/ui/Switch.tsx +33 -0
- package/dist/starter/src/components/ui/Table.stories.tsx +65 -0
- package/dist/starter/src/components/ui/Table.tsx +75 -0
- package/dist/starter/src/components/ui/Tabs.stories.tsx +51 -0
- package/dist/starter/src/components/ui/Tabs.tsx +69 -0
- package/dist/starter/src/components/ui/Textarea.stories.tsx +24 -0
- package/dist/starter/src/components/ui/Textarea.tsx +18 -0
- package/dist/starter/src/components/ui/Toast.stories.tsx +112 -0
- package/dist/starter/src/components/ui/Toast.tsx +114 -0
- package/dist/starter/src/components/ui/Toaster.tsx +28 -0
- package/dist/starter/src/components/ui/Toggle.stories.tsx +40 -0
- package/dist/starter/src/components/ui/Toggle.tsx +41 -0
- package/dist/starter/src/components/ui/ToggleGroup.stories.tsx +58 -0
- package/dist/starter/src/components/ui/ToggleGroup.tsx +80 -0
- package/dist/starter/src/components/ui/Tooltip.stories.tsx +40 -0
- package/dist/starter/src/components/ui/Tooltip.tsx +42 -0
- package/dist/starter/src/hooks/use-mobile.ts +19 -0
- package/dist/starter/src/hooks/use-toast.ts +186 -0
- package/dist/starter/src/index.css +123 -0
- package/dist/starter/src/lib/utils.ts +6 -0
- package/dist/starter/src/main.tsx +5 -0
- package/dist/starter/tsconfig.app.json +25 -0
- package/dist/starter/tsconfig.json +4 -0
- package/dist/starter/vite.config.ts +16 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +37 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# @auto-engineer/generate-react-client
|
|
2
|
+
|
|
3
|
+
## 1.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`6557224`](https://github.com/BeOnAuto/auto-engineer/commit/6557224ec6f51c704855e5058931e81ab1de1544) Thanks [@osamanar](https://github.com/osamanar)! - - Updated project dependency lock file to ensure consistent package installations
|
|
8
|
+
|
|
9
|
+
- [`cd5f56b`](https://github.com/BeOnAuto/auto-engineer/commit/cd5f56b01951cd27392c51a384706a8c2a7401c5) Thanks [@osamanar](https://github.com/osamanar)! - - Removed unused packages to keep the project lean and reduce maintenance overhead
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`6557224`](https://github.com/BeOnAuto/auto-engineer/commit/6557224ec6f51c704855e5058931e81ab1de1544), [`cd5f56b`](https://github.com/BeOnAuto/auto-engineer/commit/cd5f56b01951cd27392c51a384706a8c2a7401c5)]:
|
|
12
|
+
- @auto-engineer/message-bus@1.12.1
|
package/LICENSE
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Elastic License 2.0
|
|
2
|
+
|
|
3
|
+
Copyright 2024 Sam Hatoum
|
|
4
|
+
|
|
5
|
+
This software and associated documentation files (the "Software") are licensed under the Elastic License 2.0 (the "License"). You may not use this file except in compliance with the License.
|
|
6
|
+
|
|
7
|
+
You may obtain a copy of the License at:
|
|
8
|
+
https://www.elastic.co/licensing/elastic-license
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Command, type Event } from '@auto-engineer/message-bus';
|
|
2
|
+
export type GenerateReactClientCommand = Command<'GenerateReactClient', {
|
|
3
|
+
targetDir: string;
|
|
4
|
+
}>;
|
|
5
|
+
export type ReactClientGeneratedEvent = Event<'ReactClientGenerated', {
|
|
6
|
+
targetDir: string;
|
|
7
|
+
}>;
|
|
8
|
+
export type ReactClientGenerationFailedEvent = Event<'ReactClientGenerationFailed', {
|
|
9
|
+
error: string;
|
|
10
|
+
targetDir: string;
|
|
11
|
+
}>;
|
|
12
|
+
export type GenerateReactClientEvents = ReactClientGeneratedEvent | ReactClientGenerationFailedEvent;
|
|
13
|
+
export declare const commandHandler: import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
|
|
14
|
+
type: string;
|
|
15
|
+
data: Readonly<Record<string, unknown>>;
|
|
16
|
+
timestamp?: Date;
|
|
17
|
+
requestId?: string;
|
|
18
|
+
correlationId?: string;
|
|
19
|
+
}>>;
|
|
20
|
+
export default commandHandler;
|
|
21
|
+
//# sourceMappingURL=generate-react-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-react-client.d.ts","sourceRoot":"","sources":["../../../src/commands/generate-react-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAwB,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAW5F,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAC9C,qBAAqB,EACrB;IACE,SAAS,EAAE,MAAM,CAAC;CACnB,CACF,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAC3C,sBAAsB,EACtB;IACE,SAAS,EAAE,MAAM,CAAC;CACnB,CACF,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,KAAK,CAClD,6BAA6B,EAC7B;IACE,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CACF,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,yBAAyB,GAAG,gCAAgC,CAAC;AAErG,eAAO,MAAM,cAAc;;;;;;GAqDzB,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { defineCommandHandler } from '@auto-engineer/message-bus';
|
|
4
|
+
import createDebug from 'debug';
|
|
5
|
+
import { copyStarter } from '../copy-starter.js';
|
|
6
|
+
const debug = createDebug('auto:generate-react-client:command');
|
|
7
|
+
const resolveStarterPath = () => {
|
|
8
|
+
const currentDir = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
return path.resolve(currentDir, '../../starter');
|
|
10
|
+
};
|
|
11
|
+
export const commandHandler = defineCommandHandler({
|
|
12
|
+
name: 'GenerateReactClient',
|
|
13
|
+
displayName: 'Generate React Client',
|
|
14
|
+
alias: 'generate:react-client',
|
|
15
|
+
description: 'Scaffold a React + Vite + Tailwind CSS v4 + shadcn client app',
|
|
16
|
+
category: 'generate',
|
|
17
|
+
icon: 'monitor',
|
|
18
|
+
fields: {
|
|
19
|
+
targetDir: {
|
|
20
|
+
description: 'Output directory for the generated client',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
examples: ['$ auto generate:react-client --target-dir=./client'],
|
|
25
|
+
events: [
|
|
26
|
+
{ name: 'ReactClientGenerated', displayName: 'React Client Generated' },
|
|
27
|
+
{
|
|
28
|
+
name: 'ReactClientGenerationFailed',
|
|
29
|
+
displayName: 'React Client Generation Failed',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
handle: async (command) => {
|
|
33
|
+
const { targetDir } = command.data;
|
|
34
|
+
debug('Generating React client to: %s', targetDir);
|
|
35
|
+
try {
|
|
36
|
+
const starterPath = resolveStarterPath();
|
|
37
|
+
debug('Starter path: %s', starterPath);
|
|
38
|
+
const fileCount = await copyStarter(starterPath, targetDir);
|
|
39
|
+
debug('React client generated at %s (%d files)', targetDir, fileCount);
|
|
40
|
+
return {
|
|
41
|
+
type: 'ReactClientGenerated',
|
|
42
|
+
data: { targetDir },
|
|
43
|
+
timestamp: new Date(),
|
|
44
|
+
requestId: command.requestId,
|
|
45
|
+
correlationId: command.correlationId,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
50
|
+
debug('Generation failed: %s', errorMessage);
|
|
51
|
+
return {
|
|
52
|
+
type: 'ReactClientGenerationFailed',
|
|
53
|
+
data: { error: errorMessage, targetDir },
|
|
54
|
+
timestamp: new Date(),
|
|
55
|
+
requestId: command.requestId,
|
|
56
|
+
correlationId: command.correlationId,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
export default commandHandler;
|
|
62
|
+
//# sourceMappingURL=generate-react-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gener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'node:fs/promises';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import createDebug from 'debug';
|
|
4
|
+
const debug = createDebug('auto:generate-react-client:copy-starter');
|
|
5
|
+
const SKIP = new Set(['node_modules', 'pnpm-lock.yaml', '.DS_Store']);
|
|
6
|
+
async function copyDir(src, dest) {
|
|
7
|
+
await fs.mkdir(dest, { recursive: true });
|
|
8
|
+
const entries = await fs.readdir(src, { withFileTypes: true });
|
|
9
|
+
let count = 0;
|
|
10
|
+
for (const entry of entries) {
|
|
11
|
+
if (SKIP.has(entry.name))
|
|
12
|
+
continue;
|
|
13
|
+
const srcPath = path.join(src, entry.name);
|
|
14
|
+
const destPath = path.join(dest, entry.name);
|
|
15
|
+
if (entry.isDirectory()) {
|
|
16
|
+
count += await copyDir(srcPath, destPath);
|
|
17
|
+
}
|
|
18
|
+
else if (entry.isFile()) {
|
|
19
|
+
await fs.copyFile(srcPath, destPath);
|
|
20
|
+
count++;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return count;
|
|
24
|
+
}
|
|
25
|
+
export async function copyStarter(starterDir, targetDir) {
|
|
26
|
+
const src = path.isAbsolute(starterDir) ? starterDir : path.resolve(process.cwd(), starterDir);
|
|
27
|
+
const dest = path.isAbsolute(targetDir) ? targetDir : path.resolve(process.cwd(), targetDir);
|
|
28
|
+
debug('Copying starter from %s to %s', src, dest);
|
|
29
|
+
await fs.rm(dest, { recursive: true, force: true });
|
|
30
|
+
const fileCount = await copyDir(src, dest);
|
|
31
|
+
debug('Copied %d files to %s', fileCount, dest);
|
|
32
|
+
return fileCount;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=copy-starter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-starter.js","sourceRoot":"","sources":["../../src/copy-starter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AACl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AAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,CAAC;IAC/F,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,CAAC;IAE7F,KAAK,CAAC,+BAA+B,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAElD,MAAM,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAE3C,KAAK,CAAC,uBAAuB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAChD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { GenerateReactClientCommand, GenerateReactClientEvents, } from './commands/generate-react-client.js';
|
|
2
|
+
export { commandHandler as generateReactClientCommandHandler } from './commands/generate-react-client.js';
|
|
3
|
+
export declare const COMMANDS: import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
|
|
4
|
+
type: string;
|
|
5
|
+
data: Readonly<Record<string, unknown>>;
|
|
6
|
+
timestamp?: Date;
|
|
7
|
+
requestId?: string;
|
|
8
|
+
correlationId?: string;
|
|
9
|
+
}>>[];
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,cAAc,IAAI,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAG1G,eAAO,MAAM,QAAQ;;;;;;KAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,IAAI,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAE1G,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
import type { StorybookConfig } from '@storybook/react-vite';
|
|
4
|
+
|
|
5
|
+
const config: StorybookConfig = {
|
|
6
|
+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(ts|tsx)'],
|
|
7
|
+
addons: [
|
|
8
|
+
getAbsolutePath('@storybook/addon-docs'),
|
|
9
|
+
{
|
|
10
|
+
name: getAbsolutePath('@storybook/addon-mcp'),
|
|
11
|
+
options: {
|
|
12
|
+
toolsets: {
|
|
13
|
+
dev: true,
|
|
14
|
+
docs: true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
staticDirs: ['../public'],
|
|
20
|
+
features: {
|
|
21
|
+
experimentalComponentsManifest: true,
|
|
22
|
+
},
|
|
23
|
+
framework: {
|
|
24
|
+
name: getAbsolutePath('@storybook/react-vite'),
|
|
25
|
+
options: {},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default config;
|
|
30
|
+
|
|
31
|
+
function getAbsolutePath(value: string): any {
|
|
32
|
+
return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)));
|
|
33
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Preview } from '@storybook/react-vite';
|
|
2
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
3
|
+
import { initialize, mswLoader } from 'msw-storybook-addon';
|
|
4
|
+
import '../src/index.css';
|
|
5
|
+
|
|
6
|
+
initialize();
|
|
7
|
+
|
|
8
|
+
const queryClient = new QueryClient({
|
|
9
|
+
defaultOptions: {
|
|
10
|
+
queries: {
|
|
11
|
+
retry: false,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const preview: Preview = {
|
|
17
|
+
decorators: [
|
|
18
|
+
(Story) => (
|
|
19
|
+
<QueryClientProvider client={queryClient}>
|
|
20
|
+
<Story />
|
|
21
|
+
</QueryClientProvider>
|
|
22
|
+
),
|
|
23
|
+
],
|
|
24
|
+
parameters: {
|
|
25
|
+
controls: {
|
|
26
|
+
matchers: {
|
|
27
|
+
color: /(background|color)$/i,
|
|
28
|
+
date: /Date$/i,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
loaders: [mswLoader],
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default preview;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": false,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "src/index.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"aliases": {
|
|
14
|
+
"components": "@/components",
|
|
15
|
+
"utils": "@/lib/utils",
|
|
16
|
+
"ui": "@/components/ui",
|
|
17
|
+
"lib": "@/lib",
|
|
18
|
+
"hooks": "@/hooks"
|
|
19
|
+
},
|
|
20
|
+
"iconLibrary": "lucide",
|
|
21
|
+
"registries": {
|
|
22
|
+
"@shadcraft": {
|
|
23
|
+
"url": "https://registry-shadcraft.vercel.app/r/{name}",
|
|
24
|
+
"headers": {
|
|
25
|
+
"X-License-Key": "${SHADCRAFT_LICENSE_KEY}"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>React App</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="root"></div>
|
|
10
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-client",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "tsc -b && vite build",
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"type-check": "tsc --noEmit -p tsconfig.app.json",
|
|
11
|
+
"storybook": "storybook dev -p 6006",
|
|
12
|
+
"build-storybook": "storybook build"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@base-ui/react": "^1.1.0",
|
|
16
|
+
"@hookform/resolvers": "^5.2.2",
|
|
17
|
+
"@tanstack/react-query": "^5.90.19",
|
|
18
|
+
"class-variance-authority": "^0.7.1",
|
|
19
|
+
"clsx": "^2.1.1",
|
|
20
|
+
"cmdk": "^1.1.1",
|
|
21
|
+
"date-fns": "^4.1.0",
|
|
22
|
+
"embla-carousel-react": "^8.6.0",
|
|
23
|
+
"input-otp": "^1.4.2",
|
|
24
|
+
"lucide-react": "^0.539.0",
|
|
25
|
+
"next-themes": "^0.4.6",
|
|
26
|
+
"radix-ui": "^1.4.3",
|
|
27
|
+
"react": "^19.0.0",
|
|
28
|
+
"react-day-picker": "^9.13.0",
|
|
29
|
+
"react-dom": "^19.0.0",
|
|
30
|
+
"react-hook-form": "^7.71.1",
|
|
31
|
+
"react-resizable-panels": "^4.6.1",
|
|
32
|
+
"react-router-dom": "^7.13.0",
|
|
33
|
+
"recharts": "2.15.4",
|
|
34
|
+
"sonner": "^2.0.7",
|
|
35
|
+
"tailwind-merge": "^3.3.1",
|
|
36
|
+
"vaul": "^1.1.2",
|
|
37
|
+
"zod": "^4.3.6"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@storybook/addon-docs": "^10.2.8",
|
|
41
|
+
"@storybook/addon-mcp": "^0.2.2",
|
|
42
|
+
"@storybook/react-vite": "^10.2.8",
|
|
43
|
+
"@tailwindcss/vite": "^4.1.16",
|
|
44
|
+
"@types/react": "^19.2.7",
|
|
45
|
+
"@types/react-dom": "^19.2.3",
|
|
46
|
+
"@vitejs/plugin-react-swc": "^4.2.2",
|
|
47
|
+
"msw": "^2.12.10",
|
|
48
|
+
"msw-storybook-addon": "^2.0.6",
|
|
49
|
+
"storybook": "^10.2.8",
|
|
50
|
+
"tailwindcss": "^4.1.16",
|
|
51
|
+
"tw-animate-css": "^1.3.7",
|
|
52
|
+
"typescript": "^5.9.3",
|
|
53
|
+
"vite": "^7.3.0"
|
|
54
|
+
},
|
|
55
|
+
"msw": {
|
|
56
|
+
"workerDirectory": [
|
|
57
|
+
"public"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|