@stone-js/starters 0.8.3
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/LICENSE +21 -0
- package/README.md +101 -0
- package/basic-react-declarative/LICENSE +21 -0
- package/basic-react-declarative/README.md +39 -0
- package/basic-react-declarative/app/Application.tsx +89 -0
- package/basic-react-declarative/assets/css/index.css +26 -0
- package/basic-react-declarative/package.json +39 -0
- package/basic-react-declarative/public/logo.png +0 -0
- package/basic-react-declarative/tests/Application.spec.ts +96 -0
- package/basic-react-declarative/tests/__snapshots__/Application.spec.ts.snap +3 -0
- package/basic-react-declarative/tsconfig.json +33 -0
- package/basic-react-declarative/vitest.config.ts +24 -0
- package/basic-react-imperative/LICENSE +21 -0
- package/basic-react-imperative/README.md +39 -0
- package/basic-react-imperative/app/Application.tsx +89 -0
- package/basic-react-imperative/assets/css/index.css +26 -0
- package/basic-react-imperative/package.json +39 -0
- package/basic-react-imperative/public/logo.png +0 -0
- package/basic-react-imperative/tests/Application.spec.ts +80 -0
- package/basic-react-imperative/tests/__snapshots__/Application.spec.ts.snap +3 -0
- package/basic-react-imperative/tsconfig.json +33 -0
- package/basic-react-imperative/vitest.config.ts +24 -0
- package/basic-service-declarative/LICENSE +21 -0
- package/basic-service-declarative/README.md +39 -0
- package/basic-service-declarative/app/Application.ts +56 -0
- package/basic-service-declarative/package.json +34 -0
- package/basic-service-declarative/tests/Application.spec.ts +60 -0
- package/basic-service-declarative/tsconfig.json +25 -0
- package/basic-service-declarative/vitest.config.ts +24 -0
- package/basic-service-imperative/LICENSE +21 -0
- package/basic-service-imperative/README.md +39 -0
- package/basic-service-imperative/app/Application.ts +60 -0
- package/basic-service-imperative/package.json +34 -0
- package/basic-service-imperative/tests/Application.spec.ts +52 -0
- package/basic-service-imperative/tsconfig.json +25 -0
- package/basic-service-imperative/vitest.config.ts +24 -0
- package/continuum-showcase/README.md +44 -0
- package/continuum-showcase/app/env.d.ts +34 -0
- package/continuum-showcase/app/layouts/MainLayout.tsx +20 -0
- package/continuum-showcase/app/pages/BlogPostPage.tsx +62 -0
- package/continuum-showcase/app/pages/HomePage.tsx +58 -0
- package/continuum-showcase/package.json +25 -0
- package/continuum-showcase/stone.config.mjs +20 -0
- package/full-react-declarative/.env.example +1 -0
- package/full-react-declarative/.env.public.example +1 -0
- package/full-react-declarative/LICENSE +21 -0
- package/full-react-declarative/README.md +39 -0
- package/full-react-declarative/app/Application.ts +85 -0
- package/full-react-declarative/app/clients/AxiosClient.ts +136 -0
- package/full-react-declarative/app/clients/CommentClient.ts +61 -0
- package/full-react-declarative/app/clients/PostClient.ts +90 -0
- package/full-react-declarative/app/clients/SecurityClient.ts +66 -0
- package/full-react-declarative/app/clients/UserClient.ts +97 -0
- package/full-react-declarative/app/components/ChangePasswordForm/ChangePasswordForm.tsx +50 -0
- package/full-react-declarative/app/components/CommentForm/CommentForm.tsx +37 -0
- package/full-react-declarative/app/components/CommentItem/CommentItem.tsx +42 -0
- package/full-react-declarative/app/components/CommentWidget/CommentWidget.tsx +95 -0
- package/full-react-declarative/app/components/LoginForm/LoginForm.css +0 -0
- package/full-react-declarative/app/components/LoginForm/LoginForm.tsx +71 -0
- package/full-react-declarative/app/components/PostDetails/PostDetails.tsx +44 -0
- package/full-react-declarative/app/components/PostForm/PostForm.css +0 -0
- package/full-react-declarative/app/components/PostForm/PostForm.tsx +47 -0
- package/full-react-declarative/app/components/PostItem/PostItem.css +0 -0
- package/full-react-declarative/app/components/PostItem/PostItem.tsx +34 -0
- package/full-react-declarative/app/components/RegisterForm/RegisterForm.tsx +110 -0
- package/full-react-declarative/app/components/UserForm/UserForm.tsx +47 -0
- package/full-react-declarative/app/configurations/AppConfiguration.ts +17 -0
- package/full-react-declarative/app/error-pages/DefaultErrorPage/DefaultErrorPage.css +0 -0
- package/full-react-declarative/app/error-pages/DefaultErrorPage/DefaultErrorPage.tsx +52 -0
- package/full-react-declarative/app/error-pages/ForbiddenErrorPage/ForbiddenErrorPage.css +0 -0
- package/full-react-declarative/app/error-pages/ForbiddenErrorPage/ForbiddenErrorPage.tsx +53 -0
- package/full-react-declarative/app/error-pages/NotFoundErrorPage/NotFoundErrorPage.css +0 -0
- package/full-react-declarative/app/error-pages/NotFoundErrorPage/NotFoundErrorPage.tsx +54 -0
- package/full-react-declarative/app/error-pages/UnauthorizedErrorPage/UnauthorizedErrorPage.css +0 -0
- package/full-react-declarative/app/error-pages/UnauthorizedErrorPage/UnauthorizedErrorPage.tsx +53 -0
- package/full-react-declarative/app/errors/ForbiddenError.ts +11 -0
- package/full-react-declarative/app/errors/PostNotFoundError.ts +11 -0
- package/full-react-declarative/app/errors/UnauthorizedError.ts +11 -0
- package/full-react-declarative/app/errors/UserNotFoundError.ts +11 -0
- package/full-react-declarative/app/events/UserEvent.ts +18 -0
- package/full-react-declarative/app/layout/AppLayout/AppLayout.css +20 -0
- package/full-react-declarative/app/layout/AppLayout/AppLayout.tsx +101 -0
- package/full-react-declarative/app/layout/ErrorLayout/ErrorLayout.css +0 -0
- package/full-react-declarative/app/layout/ErrorLayout/ErrorLayout.tsx +41 -0
- package/full-react-declarative/app/layout/SecurityLayout/SecurityLayout.css +0 -0
- package/full-react-declarative/app/layout/SecurityLayout/SecurityLayout.tsx +39 -0
- package/full-react-declarative/app/middleware/AuthMiddleware.ts +85 -0
- package/full-react-declarative/app/models/Comment.ts +31 -0
- package/full-react-declarative/app/models/Post.ts +22 -0
- package/full-react-declarative/app/models/User.ts +62 -0
- package/full-react-declarative/app/pages/home/HomePage.tsx +44 -0
- package/full-react-declarative/app/pages/login/LoginPage.css +0 -0
- package/full-react-declarative/app/pages/login/LoginPage.tsx +73 -0
- package/full-react-declarative/app/pages/posts/CreatePostPage/CreatePostPage.css +0 -0
- package/full-react-declarative/app/pages/posts/CreatePostPage/CreatePostPage.tsx +67 -0
- package/full-react-declarative/app/pages/posts/PostPage/PostPage.tsx +60 -0
- package/full-react-declarative/app/pages/posts/ShowPostPage/ShowPostPage.tsx +83 -0
- package/full-react-declarative/app/pages/posts/UpdatePostPage/UpdatePostPage.tsx +77 -0
- package/full-react-declarative/app/pages/register/RegisterPage.tsx +68 -0
- package/full-react-declarative/app/pages/users/CreateUserPage.tsx +48 -0
- package/full-react-declarative/app/pages/users/ShowUserPage.tsx +62 -0
- package/full-react-declarative/app/pages/users/UpdateUserPage.tsx +57 -0
- package/full-react-declarative/app/pages/users/UserPage.tsx +57 -0
- package/full-react-declarative/app/providers/AppServiceProvider.ts +43 -0
- package/full-react-declarative/app/services/CommentService.ts +59 -0
- package/full-react-declarative/app/services/PostService.ts +108 -0
- package/full-react-declarative/app/services/SecurityService.ts +80 -0
- package/full-react-declarative/app/services/TokenService.ts +116 -0
- package/full-react-declarative/app/services/UserService.ts +126 -0
- package/full-react-declarative/app/utils.ts +17 -0
- package/full-react-declarative/assets/css/index.css +301 -0
- package/full-react-declarative/assets/img/logo.png +0 -0
- package/full-react-declarative/package.json +46 -0
- package/full-react-declarative/public/logo.png +0 -0
- package/full-react-declarative/public/vite.svg +1 -0
- package/full-react-declarative/stone.config.mjs +12 -0
- package/full-react-declarative/tsconfig.json +29 -0
- package/full-react-declarative/vitest.config.ts +24 -0
- package/full-react-imperative/.env.example +1 -0
- package/full-react-imperative/.env.public.example +1 -0
- package/full-react-imperative/LICENSE +21 -0
- package/full-react-imperative/README.md +39 -0
- package/full-react-imperative/app/Application.ts +79 -0
- package/full-react-imperative/app/clients/AxiosClient.ts +124 -0
- package/full-react-imperative/app/clients/CommentClient.ts +57 -0
- package/full-react-imperative/app/clients/PostClient.ts +86 -0
- package/full-react-imperative/app/clients/SecurityClient.ts +60 -0
- package/full-react-imperative/app/clients/UserClient.ts +93 -0
- package/full-react-imperative/app/clients/contracts/IAxiosClient.ts +97 -0
- package/full-react-imperative/app/clients/contracts/ICommentClient.ts +31 -0
- package/full-react-imperative/app/clients/contracts/IPostClient.ts +55 -0
- package/full-react-imperative/app/clients/contracts/ISecurityClient.ts +33 -0
- package/full-react-imperative/app/clients/contracts/IUserClient.ts +61 -0
- package/full-react-imperative/app/components/ChangePasswordForm/ChangePasswordForm.tsx +50 -0
- package/full-react-imperative/app/components/CommentForm/CommentForm.css +35 -0
- package/full-react-imperative/app/components/CommentForm/CommentForm.tsx +45 -0
- package/full-react-imperative/app/components/CommentItem/CommentItem.css +74 -0
- package/full-react-imperative/app/components/CommentItem/CommentItem.tsx +62 -0
- package/full-react-imperative/app/components/CommentWidget/CommentWidget.css +25 -0
- package/full-react-imperative/app/components/CommentWidget/CommentWidget.tsx +119 -0
- package/full-react-imperative/app/components/Dropdown/Dropdown.css +52 -0
- package/full-react-imperative/app/components/Dropdown/Dropdown.tsx +40 -0
- package/full-react-imperative/app/components/LayoutHeader/LayoutHeader.css +62 -0
- package/full-react-imperative/app/components/LayoutHeader/LayoutHeader.tsx +61 -0
- package/full-react-imperative/app/components/LayoutLeftMenu/LayoutLeftMenu.css +25 -0
- package/full-react-imperative/app/components/LayoutLeftMenu/LayoutLeftMenu.tsx +32 -0
- package/full-react-imperative/app/components/LoginForm/LoginForm.css +0 -0
- package/full-react-imperative/app/components/LoginForm/LoginForm.tsx +71 -0
- package/full-react-imperative/app/components/NotificationBadge/NotificationBadge.css +41 -0
- package/full-react-imperative/app/components/NotificationBadge/NotificationBadge.tsx +63 -0
- package/full-react-imperative/app/components/PostCard/PostCard.css +129 -0
- package/full-react-imperative/app/components/PostCard/PostCard.tsx +65 -0
- package/full-react-imperative/app/components/PostForm/PostForm.css +92 -0
- package/full-react-imperative/app/components/PostForm/PostForm.tsx +76 -0
- package/full-react-imperative/app/components/PostSkeleton/PostSkeleton.css +65 -0
- package/full-react-imperative/app/components/PostSkeleton/PostSkeleton.tsx +25 -0
- package/full-react-imperative/app/components/PostWidget/PostWidget.tsx +95 -0
- package/full-react-imperative/app/components/ProfileForm/ProfileForm.css +84 -0
- package/full-react-imperative/app/components/ProfileForm/ProfileForm.tsx +79 -0
- package/full-react-imperative/app/components/RegisterForm/RegisterForm.tsx +110 -0
- package/full-react-imperative/app/components/RightAsidePanel/RightAsidePanel.css +32 -0
- package/full-react-imperative/app/components/RightAsidePanel/RightAsidePanel.tsx +62 -0
- package/full-react-imperative/app/components/SettingsForm/SettingsForm.css +126 -0
- package/full-react-imperative/app/components/SettingsForm/SettingsForm.tsx +86 -0
- package/full-react-imperative/app/components/UserAvatar/UserAvatar.css +18 -0
- package/full-react-imperative/app/components/UserAvatar/UserAvatar.tsx +60 -0
- package/full-react-imperative/app/components/UserBadge/UserBadge.css +33 -0
- package/full-react-imperative/app/components/UserBadge/UserBadge.tsx +49 -0
- package/full-react-imperative/app/components/UserCard/UserCard.css +70 -0
- package/full-react-imperative/app/components/UserCard/UserCard.tsx +43 -0
- package/full-react-imperative/app/configurations/AppConfiguration.ts +19 -0
- package/full-react-imperative/app/error-pages/DefaultErrorPage/DefaultErrorPage.css +0 -0
- package/full-react-imperative/app/error-pages/DefaultErrorPage/DefaultErrorPage.tsx +41 -0
- package/full-react-imperative/app/error-pages/ForbiddenErrorPage/ForbiddenErrorPage.css +0 -0
- package/full-react-imperative/app/error-pages/ForbiddenErrorPage/ForbiddenErrorPage.tsx +42 -0
- package/full-react-imperative/app/error-pages/NotFoundErrorPage/NotFoundErrorPage.css +0 -0
- package/full-react-imperative/app/error-pages/NotFoundErrorPage/NotFoundErrorPage.tsx +49 -0
- package/full-react-imperative/app/error-pages/UnauthorizedErrorPage/UnauthorizedErrorPage.css +0 -0
- package/full-react-imperative/app/error-pages/UnauthorizedErrorPage/UnauthorizedErrorPage.tsx +42 -0
- package/full-react-imperative/app/errors/ForbiddenError.ts +11 -0
- package/full-react-imperative/app/errors/PostNotFoundError.ts +11 -0
- package/full-react-imperative/app/errors/UnauthorizedError.ts +11 -0
- package/full-react-imperative/app/errors/UserNotFoundError.ts +11 -0
- package/full-react-imperative/app/events/UserEvent.ts +18 -0
- package/full-react-imperative/app/layout/AppLayout/AppLayout.css +106 -0
- package/full-react-imperative/app/layout/AppLayout/AppLayout.tsx +48 -0
- package/full-react-imperative/app/layout/ErrorLayout/ErrorLayout.css +0 -0
- package/full-react-imperative/app/layout/ErrorLayout/ErrorLayout.tsx +45 -0
- package/full-react-imperative/app/layout/SecurityLayout/SecurityLayout.css +0 -0
- package/full-react-imperative/app/layout/SecurityLayout/SecurityLayout.tsx +43 -0
- package/full-react-imperative/app/layout/SettingsLayout/SettingsLayout.css +99 -0
- package/full-react-imperative/app/layout/SettingsLayout/SettingsLayout.tsx +44 -0
- package/full-react-imperative/app/middleware/AuthMiddleware.ts +56 -0
- package/full-react-imperative/app/models/Comment.ts +35 -0
- package/full-react-imperative/app/models/Post.ts +27 -0
- package/full-react-imperative/app/models/User.ts +68 -0
- package/full-react-imperative/app/pages/Settings/SettingsPage.tsx +23 -0
- package/full-react-imperative/app/pages/home/HomePage.tsx +58 -0
- package/full-react-imperative/app/pages/login/LoginPage.css +0 -0
- package/full-react-imperative/app/pages/login/LoginPage.tsx +65 -0
- package/full-react-imperative/app/pages/posts/ShowPostPage/ShowPostPage.tsx +64 -0
- package/full-react-imperative/app/pages/posts/UpdatePostPage/UpdatePostPage.tsx +56 -0
- package/full-react-imperative/app/pages/register/RegisterPage.tsx +71 -0
- package/full-react-imperative/app/pages/users/ShowUserPage/ShowUserPage.css +64 -0
- package/full-react-imperative/app/pages/users/ShowUserPage/ShowUserPage.tsx +104 -0
- package/full-react-imperative/app/pages/users/UpdateUserPage/UpdateUserPage.css +0 -0
- package/full-react-imperative/app/pages/users/UpdateUserPage/UpdateUserPage.tsx +43 -0
- package/full-react-imperative/app/pages/users/UserPage/UserPage.css +31 -0
- package/full-react-imperative/app/pages/users/UserPage/UserPage.tsx +59 -0
- package/full-react-imperative/app/pages/utils.ts +67 -0
- package/full-react-imperative/app/providers/AppServiceProvider.ts +40 -0
- package/full-react-imperative/app/services/CommentService.ts +53 -0
- package/full-react-imperative/app/services/PostService.ts +102 -0
- package/full-react-imperative/app/services/SecurityService.ts +72 -0
- package/full-react-imperative/app/services/TokenService.ts +108 -0
- package/full-react-imperative/app/services/UserService.ts +115 -0
- package/full-react-imperative/app/services/contracts/ICommentService.ts +30 -0
- package/full-react-imperative/app/services/contracts/IPostService.ts +65 -0
- package/full-react-imperative/app/services/contracts/ISecurityService.ts +39 -0
- package/full-react-imperative/app/services/contracts/ITokenService.ts +44 -0
- package/full-react-imperative/app/services/contracts/IUserService.ts +70 -0
- package/full-react-imperative/app/utils.ts +31 -0
- package/full-react-imperative/assets/css/index.css +301 -0
- package/full-react-imperative/assets/img/logo.png +0 -0
- package/full-react-imperative/package.json +48 -0
- package/full-react-imperative/public/logo.png +0 -0
- package/full-react-imperative/public/vite.svg +1 -0
- package/full-react-imperative/stone.config.mjs +12 -0
- package/full-react-imperative/tsconfig.json +29 -0
- package/full-react-imperative/vitest.config.ts +24 -0
- package/full-service-declarative/.env.example +2 -0
- package/full-service-declarative/LICENSE +21 -0
- package/full-service-declarative/README.md +65 -0
- package/full-service-declarative/app/Application.ts +327 -0
- package/full-service-declarative/app/commands/ListSessionsCommand.ts +70 -0
- package/full-service-declarative/app/commands/ListUsersCommand.ts +56 -0
- package/full-service-declarative/app/configurations/AppConfiguration.ts +52 -0
- package/full-service-declarative/app/configurations/UserLiveConfiguration.ts +28 -0
- package/full-service-declarative/app/database/DatabaseClient.ts +43 -0
- package/full-service-declarative/app/database/schema.ts +43 -0
- package/full-service-declarative/app/error-handlers/SecurityErrorHandler.ts +61 -0
- package/full-service-declarative/app/errors/CredentialsError.ts +12 -0
- package/full-service-declarative/app/events/UserEvent.ts +17 -0
- package/full-service-declarative/app/handlers/CommentEventHandler.ts +103 -0
- package/full-service-declarative/app/handlers/PostEventHandler.ts +104 -0
- package/full-service-declarative/app/handlers/SecurityEventHandler.ts +108 -0
- package/full-service-declarative/app/handlers/UserEventHandler.ts +159 -0
- package/full-service-declarative/app/listeners/UserEventListener.ts +35 -0
- package/full-service-declarative/app/middleware/AuthMiddleware.ts +54 -0
- package/full-service-declarative/app/models/Comment.ts +38 -0
- package/full-service-declarative/app/models/Post.ts +50 -0
- package/full-service-declarative/app/models/Session.ts +14 -0
- package/full-service-declarative/app/models/User.ts +77 -0
- package/full-service-declarative/app/providers/DrizzleServiceProvider.ts +59 -0
- package/full-service-declarative/app/repositories/CommentRepository.ts +155 -0
- package/full-service-declarative/app/repositories/PostRepository.ts +138 -0
- package/full-service-declarative/app/repositories/SessionRepository.ts +123 -0
- package/full-service-declarative/app/repositories/UserRepository.ts +99 -0
- package/full-service-declarative/app/services/CommentService.ts +112 -0
- package/full-service-declarative/app/services/PostService.ts +100 -0
- package/full-service-declarative/app/services/SecurityService.ts +232 -0
- package/full-service-declarative/app/services/SessionService.ts +130 -0
- package/full-service-declarative/app/services/UserService.ts +110 -0
- package/full-service-declarative/app/subscribers/UserEventSubscriber.ts +38 -0
- package/full-service-declarative/drizzle.config.ts +13 -0
- package/full-service-declarative/package.json +48 -0
- package/full-service-declarative/stone.config.mjs +12 -0
- package/full-service-declarative/tsconfig.json +25 -0
- package/full-service-declarative/vitest.config.ts +24 -0
- package/full-service-imperative/.env.example +2 -0
- package/full-service-imperative/LICENSE +21 -0
- package/full-service-imperative/README.md +65 -0
- package/full-service-imperative/app/Application.ts +317 -0
- package/full-service-imperative/app/commands/ListSessionsCommand.ts +54 -0
- package/full-service-imperative/app/commands/ListUsersCommand.ts +42 -0
- package/full-service-imperative/app/configurations/AppConfiguration.ts +44 -0
- package/full-service-imperative/app/configurations/UserLiveConfiguration.ts +26 -0
- package/full-service-imperative/app/database/DatabaseClient.ts +39 -0
- package/full-service-imperative/app/database/schema.ts +43 -0
- package/full-service-imperative/app/error-handlers/SecurityErrorHandler.ts +58 -0
- package/full-service-imperative/app/errors/CredentialsError.ts +12 -0
- package/full-service-imperative/app/events/UserEvent.ts +17 -0
- package/full-service-imperative/app/handlers/CommentEventHandler.ts +99 -0
- package/full-service-imperative/app/handlers/PostEventHandler.ts +99 -0
- package/full-service-imperative/app/handlers/SecurityEventHandler.ts +83 -0
- package/full-service-imperative/app/handlers/UserEventHandler.ts +132 -0
- package/full-service-imperative/app/listeners/UserEventListener.ts +23 -0
- package/full-service-imperative/app/middleware/AuthMiddleware.ts +44 -0
- package/full-service-imperative/app/models/Comment.ts +38 -0
- package/full-service-imperative/app/models/Post.ts +50 -0
- package/full-service-imperative/app/models/Session.ts +14 -0
- package/full-service-imperative/app/models/User.ts +77 -0
- package/full-service-imperative/app/providers/DrizzleServiceProvider.ts +56 -0
- package/full-service-imperative/app/repositories/CommentRepository.ts +148 -0
- package/full-service-imperative/app/repositories/PostRepository.ts +130 -0
- package/full-service-imperative/app/repositories/SessionRepository.ts +115 -0
- package/full-service-imperative/app/repositories/UserRepository.ts +91 -0
- package/full-service-imperative/app/repositories/contracts/ICommentRepository.ts +72 -0
- package/full-service-imperative/app/repositories/contracts/IPostRepository.ts +63 -0
- package/full-service-imperative/app/repositories/contracts/ISessionRepository.ts +65 -0
- package/full-service-imperative/app/repositories/contracts/IUserRepository.ts +55 -0
- package/full-service-imperative/app/services/CommentService.ts +109 -0
- package/full-service-imperative/app/services/PostService.ts +97 -0
- package/full-service-imperative/app/services/SecurityService.ts +224 -0
- package/full-service-imperative/app/services/SessionService.ts +124 -0
- package/full-service-imperative/app/services/UserService.ts +105 -0
- package/full-service-imperative/app/services/contracts/ICommentService.ts +62 -0
- package/full-service-imperative/app/services/contracts/IPostService.ts +53 -0
- package/full-service-imperative/app/services/contracts/ISecurityService.ts +97 -0
- package/full-service-imperative/app/services/contracts/ISessionService.ts +73 -0
- package/full-service-imperative/app/services/contracts/IUserService.ts +57 -0
- package/full-service-imperative/app/subscribers/UserEventSubscriber.ts +28 -0
- package/full-service-imperative/drizzle.config.ts +13 -0
- package/full-service-imperative/package.json +48 -0
- package/full-service-imperative/stone.config.mjs +12 -0
- package/full-service-imperative/tsconfig.json +25 -0
- package/full-service-imperative/vitest.config.ts +24 -0
- package/package.json +225 -0
- package/standard-react-declarative/LICENSE +21 -0
- package/standard-react-declarative/README.md +39 -0
- package/standard-react-declarative/app/Application.ts +45 -0
- package/standard-react-declarative/app/pages/welcome/WelcomePage.tsx +57 -0
- package/standard-react-declarative/app/services/WelcomeService.ts +38 -0
- package/standard-react-declarative/assets/css/index.css +26 -0
- package/standard-react-declarative/package.json +42 -0
- package/standard-react-declarative/tsconfig.json +33 -0
- package/standard-react-declarative/vitest.config.ts +24 -0
- package/standard-react-imperative/LICENSE +21 -0
- package/standard-react-imperative/README.md +39 -0
- package/standard-react-imperative/app/Application.ts +41 -0
- package/standard-react-imperative/app/pages/welcome/WelcomePage.tsx +50 -0
- package/standard-react-imperative/app/services/WelcomeService.ts +38 -0
- package/standard-react-imperative/assets/css/index.css +26 -0
- package/standard-react-imperative/package.json +42 -0
- package/standard-react-imperative/tsconfig.json +33 -0
- package/standard-react-imperative/vitest.config.ts +24 -0
- package/standard-service-declarative/LICENSE +21 -0
- package/standard-service-declarative/README.md +39 -0
- package/standard-service-declarative/app/Application.ts +39 -0
- package/standard-service-declarative/app/handlers/WelcomeEventHandler.ts +45 -0
- package/standard-service-declarative/app/services/WelcomeService.ts +38 -0
- package/standard-service-declarative/package.json +36 -0
- package/standard-service-declarative/tsconfig.json +25 -0
- package/standard-service-declarative/vitest.config.ts +24 -0
- package/standard-service-imperative/LICENSE +21 -0
- package/standard-service-imperative/README.md +39 -0
- package/standard-service-imperative/app/Application.ts +11 -0
- package/standard-service-imperative/app/handlers/welcomeEventHandler.ts +31 -0
- package/standard-service-imperative/app/services/welcomeService.ts +38 -0
- package/standard-service-imperative/package.json +35 -0
- package/standard-service-imperative/tsconfig.json +25 -0
- package/standard-service-imperative/vitest.config.ts +24 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Snapshot } from '@stone-js/use-react'
|
|
2
|
+
import { UserEvent } from '../events/UserEvent'
|
|
3
|
+
import { User, UserInput } from '../models/User'
|
|
4
|
+
import { UserClient } from '../clients/UserClient'
|
|
5
|
+
import { UserNotFoundError } from '../errors/UserNotFoundError'
|
|
6
|
+
import { EventEmitter, isEmpty, Service } from '@stone-js/core'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* User Service Options
|
|
10
|
+
*/
|
|
11
|
+
export interface UserServiceOptions {
|
|
12
|
+
userClient: UserClient
|
|
13
|
+
eventEmitter: EventEmitter
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* User Service
|
|
18
|
+
*
|
|
19
|
+
* @Service() decorator is used to define a new service
|
|
20
|
+
* @Service() is an alias of @Stone() decorator.
|
|
21
|
+
* The alias is required to get benefits of desctructuring Dependency Injection.
|
|
22
|
+
* And because the front-end class will be minified, we need to use alias to keep the class name.
|
|
23
|
+
*/
|
|
24
|
+
@Service({ alias: 'userService' })
|
|
25
|
+
export class UserService {
|
|
26
|
+
private _currentUser?: User
|
|
27
|
+
private readonly userClient: UserClient
|
|
28
|
+
private readonly eventEmitter: EventEmitter
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Create a new User Service
|
|
32
|
+
*/
|
|
33
|
+
constructor ({ userClient, eventEmitter }: UserServiceOptions) {
|
|
34
|
+
this.userClient = userClient
|
|
35
|
+
this.eventEmitter = eventEmitter
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* List users
|
|
40
|
+
*
|
|
41
|
+
* @param limit - The limit of users to list
|
|
42
|
+
*/
|
|
43
|
+
async list (limit: number = 10): Promise<User[]> {
|
|
44
|
+
return await this.userClient.list(limit)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get the current user
|
|
49
|
+
*/
|
|
50
|
+
async current (singleton?: boolean): Promise<User> {
|
|
51
|
+
if (isEmpty(this._currentUser) || singleton !== true) {
|
|
52
|
+
this._currentUser = await this.userClient.currentUser()
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return this._currentUser
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Find a user
|
|
60
|
+
*
|
|
61
|
+
* @param conditions - The conditions to find the user
|
|
62
|
+
* @returns The found user
|
|
63
|
+
*/
|
|
64
|
+
async find (conditions: Record<string, any>): Promise<User> {
|
|
65
|
+
try {
|
|
66
|
+
return await this.userClient.find(conditions.id)
|
|
67
|
+
} catch (error: any) {
|
|
68
|
+
if (error.status === 404) {
|
|
69
|
+
throw new UserNotFoundError(error.message, { cause: error })
|
|
70
|
+
} else {
|
|
71
|
+
throw error
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Find a user by key
|
|
78
|
+
*
|
|
79
|
+
* @param key - The key to find the user
|
|
80
|
+
* @param value - The value to find the user
|
|
81
|
+
* @returns The found user
|
|
82
|
+
* @throws UserNotFoundError
|
|
83
|
+
*/
|
|
84
|
+
@Snapshot()
|
|
85
|
+
async findBy (key: string, value: any): Promise<User | undefined> {
|
|
86
|
+
return await this.find({ [key]: value })
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Create a user
|
|
91
|
+
*
|
|
92
|
+
* @param user - The user to create
|
|
93
|
+
*/
|
|
94
|
+
async create (user: UserInput): Promise<void> {
|
|
95
|
+
await this.eventEmitter.emit(new UserEvent(user))
|
|
96
|
+
await this.userClient.create(user)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Update the current user
|
|
101
|
+
*
|
|
102
|
+
* @param user - The user data to update
|
|
103
|
+
*/
|
|
104
|
+
async updateCurrent (user: UserInput): Promise<User> {
|
|
105
|
+
return await this.userClient.updateCurrent(user)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Update a user
|
|
110
|
+
*
|
|
111
|
+
* @param id - The id of the user to update
|
|
112
|
+
* @param user - The user data to update
|
|
113
|
+
*/
|
|
114
|
+
async update (id: number, user: UserInput): Promise<User> {
|
|
115
|
+
return await this.userClient.update(id, user)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Delete a user
|
|
120
|
+
*
|
|
121
|
+
* @param id - The id of the user to delete
|
|
122
|
+
*/
|
|
123
|
+
async delete (id: number): Promise<void> {
|
|
124
|
+
await this.userClient.delete(id)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Format date time
|
|
4
|
+
*
|
|
5
|
+
* @param date - Date in milliseconds
|
|
6
|
+
* @returns The formatted date time
|
|
7
|
+
*/
|
|
8
|
+
export const formatDateTime = (date: number): string => {
|
|
9
|
+
return new Intl.DateTimeFormat('en-US', {
|
|
10
|
+
year: 'numeric',
|
|
11
|
+
month: 'short',
|
|
12
|
+
day: 'numeric',
|
|
13
|
+
hour: '2-digit',
|
|
14
|
+
minute: '2-digit',
|
|
15
|
+
second: '2-digit'
|
|
16
|
+
}).format(date)
|
|
17
|
+
}
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
body {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 0;
|
|
4
|
+
color: #333;
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
line-height: 1.5;
|
|
7
|
+
background-color: #fff;
|
|
8
|
+
font-family: 'Roboto', sans-serif;
|
|
9
|
+
}
|
|
10
|
+
h1, h2, h3, h4, h5, h6 {
|
|
11
|
+
margin: 0;
|
|
12
|
+
font-weight: 500;
|
|
13
|
+
}
|
|
14
|
+
.h1 {
|
|
15
|
+
font-size: 3rem;
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
}
|
|
18
|
+
.h2 {
|
|
19
|
+
font-size: 2.5rem;
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
}
|
|
22
|
+
.h3 {
|
|
23
|
+
font-size: 2rem;
|
|
24
|
+
}
|
|
25
|
+
.h4 {
|
|
26
|
+
font-size: 1.5rem;
|
|
27
|
+
}
|
|
28
|
+
.h5 {
|
|
29
|
+
font-size: 1.25rem;
|
|
30
|
+
}
|
|
31
|
+
.h6 {
|
|
32
|
+
font-size: 1rem;
|
|
33
|
+
}
|
|
34
|
+
.container {
|
|
35
|
+
width: 100vw;
|
|
36
|
+
display: flex;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
}
|
|
39
|
+
.text-center {
|
|
40
|
+
text-align: center;
|
|
41
|
+
}
|
|
42
|
+
.mt-8 {
|
|
43
|
+
margin-top: 8px;
|
|
44
|
+
}
|
|
45
|
+
.mt-24 {
|
|
46
|
+
margin-top: 24px;
|
|
47
|
+
}
|
|
48
|
+
.mt-64 {
|
|
49
|
+
margin-top: 64px;
|
|
50
|
+
}
|
|
51
|
+
.px-24 {
|
|
52
|
+
padding-left: 24px;
|
|
53
|
+
padding-right: 24px;
|
|
54
|
+
}
|
|
55
|
+
.pa-24 {
|
|
56
|
+
padding: 24px;
|
|
57
|
+
}
|
|
58
|
+
.pa-32 {
|
|
59
|
+
padding: 32px;
|
|
60
|
+
}
|
|
61
|
+
.logo {
|
|
62
|
+
width: 64px;
|
|
63
|
+
height: 64px;
|
|
64
|
+
}
|
|
65
|
+
.panel {
|
|
66
|
+
padding: 16px;
|
|
67
|
+
max-width: 600px;
|
|
68
|
+
border-radius: 6px;
|
|
69
|
+
background-color: #fff;
|
|
70
|
+
border: 1px solid #d1d9e0;
|
|
71
|
+
}
|
|
72
|
+
.text-muted {
|
|
73
|
+
color: #59636e;
|
|
74
|
+
}
|
|
75
|
+
/* Base Button Styles */
|
|
76
|
+
.button {
|
|
77
|
+
border: none;
|
|
78
|
+
outline: none;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
font-size: 16px;
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
padding: 12px 20px;
|
|
83
|
+
border-radius: 8px;
|
|
84
|
+
align-items: center;
|
|
85
|
+
display: inline-flex;
|
|
86
|
+
text-decoration: none;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
transition: all 0.3s ease-in-out;
|
|
89
|
+
}
|
|
90
|
+
.button-full {
|
|
91
|
+
display: block;
|
|
92
|
+
width: 100%;
|
|
93
|
+
}
|
|
94
|
+
.button-primary {
|
|
95
|
+
color: white;
|
|
96
|
+
/* box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3); */
|
|
97
|
+
background: linear-gradient(135deg, #4F46E5, #9333EA);
|
|
98
|
+
}
|
|
99
|
+
.button-primary:hover {
|
|
100
|
+
box-shadow: 0 6px 14px rgba(79, 70, 229, 0.4);
|
|
101
|
+
background: linear-gradient(135deg, #4338CA, #7C3AED);
|
|
102
|
+
}
|
|
103
|
+
.button-primary:active {
|
|
104
|
+
box-shadow: 0 2px 8px rgba(79, 70, 229, 0.5);
|
|
105
|
+
background: linear-gradient(135deg, #3730A3, #6D28D9);
|
|
106
|
+
}
|
|
107
|
+
.button-primary:disabled {
|
|
108
|
+
opacity: 0.6;
|
|
109
|
+
cursor: not-allowed;
|
|
110
|
+
background: linear-gradient(135deg, #A5B4FC, #D8B4FE);
|
|
111
|
+
}
|
|
112
|
+
.button-secondary {
|
|
113
|
+
color: #4F46E5;
|
|
114
|
+
background: white;
|
|
115
|
+
border: 2px solid #4F46E5;
|
|
116
|
+
}
|
|
117
|
+
.button-secondary:hover {
|
|
118
|
+
color: white;
|
|
119
|
+
background: #4F46E5;
|
|
120
|
+
box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
|
|
121
|
+
}
|
|
122
|
+
.button-secondary:active {
|
|
123
|
+
color: white;
|
|
124
|
+
background: #3730A3;
|
|
125
|
+
box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
|
|
126
|
+
}
|
|
127
|
+
.button-secondary:disabled {
|
|
128
|
+
opacity: 0.6;
|
|
129
|
+
color: #A5B4FC;
|
|
130
|
+
background: white;
|
|
131
|
+
cursor: not-allowed;
|
|
132
|
+
border-color: #A5B4FC;
|
|
133
|
+
}
|
|
134
|
+
.button-success {
|
|
135
|
+
color: white;
|
|
136
|
+
box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3);
|
|
137
|
+
background: linear-gradient(135deg, #22C55E, #16A34A);
|
|
138
|
+
}
|
|
139
|
+
.button-success:hover {
|
|
140
|
+
box-shadow: 0 6px 14px rgba(34, 197, 94, 0.4);
|
|
141
|
+
background: linear-gradient(135deg, #16A34A, #15803D);
|
|
142
|
+
}
|
|
143
|
+
.button-success:active {
|
|
144
|
+
box-shadow: 0 2px 8px rgba(34, 197, 94, 0.5);
|
|
145
|
+
background: linear-gradient(135deg, #15803D, #166534);
|
|
146
|
+
}
|
|
147
|
+
.button-success:disabled {
|
|
148
|
+
opacity: 0.6;
|
|
149
|
+
cursor: not-allowed;
|
|
150
|
+
background: linear-gradient(135deg, #86EFAC, #BBF7D0);
|
|
151
|
+
}
|
|
152
|
+
.button-danger {
|
|
153
|
+
color: white;
|
|
154
|
+
box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
|
|
155
|
+
background: linear-gradient(135deg, #EF4444, #DC2626);
|
|
156
|
+
}
|
|
157
|
+
.button-danger:hover {
|
|
158
|
+
box-shadow: 0 6px 14px rgba(239, 68, 68, 0.4);
|
|
159
|
+
background: linear-gradient(135deg, #DC2626, #B91C1C);
|
|
160
|
+
}
|
|
161
|
+
.button-danger:active {
|
|
162
|
+
box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
|
|
163
|
+
background: linear-gradient(135deg, #B91C1C, #991B1B);
|
|
164
|
+
}
|
|
165
|
+
.button-danger:disabled {
|
|
166
|
+
opacity: 0.6;
|
|
167
|
+
cursor: not-allowed;
|
|
168
|
+
background: linear-gradient(135deg, #FCA5A5, #FECACA);
|
|
169
|
+
}
|
|
170
|
+
.button-outline {
|
|
171
|
+
color: #4F46E5;
|
|
172
|
+
background: transparent;
|
|
173
|
+
border: 2px solid #4F46E5;
|
|
174
|
+
}
|
|
175
|
+
.button-outline:hover {
|
|
176
|
+
color: white;
|
|
177
|
+
background: #4F46E5;
|
|
178
|
+
}
|
|
179
|
+
.button-outline:active {
|
|
180
|
+
color: white;
|
|
181
|
+
background: #4338CA;
|
|
182
|
+
}
|
|
183
|
+
.button-outline:disabled {
|
|
184
|
+
opacity: 0.6;
|
|
185
|
+
color: #A5B4FC;
|
|
186
|
+
cursor: not-allowed;
|
|
187
|
+
border-color: #A5B4FC;
|
|
188
|
+
}
|
|
189
|
+
.button-rounded {
|
|
190
|
+
border-radius: 50px;
|
|
191
|
+
}
|
|
192
|
+
.button-icon {
|
|
193
|
+
padding: 12px;
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
justify-content: center;
|
|
197
|
+
}
|
|
198
|
+
.button-icon svg {
|
|
199
|
+
width: 20px;
|
|
200
|
+
height: 20px;
|
|
201
|
+
fill: currentColor;
|
|
202
|
+
}
|
|
203
|
+
.input, .select, .textarea {
|
|
204
|
+
outline: none;
|
|
205
|
+
display: block;
|
|
206
|
+
font-size: 16px;
|
|
207
|
+
min-width: 300px;
|
|
208
|
+
font-weight: 500;
|
|
209
|
+
color: #1E293B;
|
|
210
|
+
padding: 12px 16px;
|
|
211
|
+
border-radius: 8px;
|
|
212
|
+
background: white;
|
|
213
|
+
border: 2px solid #CBD5E1;
|
|
214
|
+
transition: all 0.3s ease-in-out;
|
|
215
|
+
}
|
|
216
|
+
.input:focus, .select:focus, .textarea:focus {
|
|
217
|
+
border-color: #4F46E5;
|
|
218
|
+
box-shadow: 0 0 8px rgba(79, 70, 229, 0.4);
|
|
219
|
+
}
|
|
220
|
+
.input:disabled, .select:disabled, .textarea:disabled {
|
|
221
|
+
opacity: 0.6;
|
|
222
|
+
cursor: not-allowed;
|
|
223
|
+
background: #F1F5F9;
|
|
224
|
+
}
|
|
225
|
+
.input::placeholder, .textarea::placeholder {
|
|
226
|
+
color: #94A3B8;
|
|
227
|
+
font-weight: 400;
|
|
228
|
+
}
|
|
229
|
+
.input.error, .select.error, .textarea.error {
|
|
230
|
+
border-color: #EF4444;
|
|
231
|
+
box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
|
|
232
|
+
}
|
|
233
|
+
.input.error:focus, .select.error:focus, .textarea.error:focus {
|
|
234
|
+
border-color: #B91C1C;
|
|
235
|
+
box-shadow: 0 0 8px rgba(185, 28, 28, 0.5);
|
|
236
|
+
}
|
|
237
|
+
.input.success, .select.success, .textarea.success {
|
|
238
|
+
border-color: #22C55E;
|
|
239
|
+
box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
|
|
240
|
+
}
|
|
241
|
+
.input.success:focus, .select.success:focus, .textarea.success:focus {
|
|
242
|
+
border-color: #15803D;
|
|
243
|
+
box-shadow: 0 0 8px rgba(21, 128, 61, 0.5);
|
|
244
|
+
}
|
|
245
|
+
.input-rounded {
|
|
246
|
+
border-radius: 50px;
|
|
247
|
+
}
|
|
248
|
+
.select {
|
|
249
|
+
appearance: none;
|
|
250
|
+
padding-right: 40px;
|
|
251
|
+
background-size: 16px;
|
|
252
|
+
background: white url('data:image/svg+xml;utf8,<svg fill="%23637481" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 12px center;
|
|
253
|
+
}
|
|
254
|
+
.select:focus {
|
|
255
|
+
background-color: #ffffff;
|
|
256
|
+
}
|
|
257
|
+
.textarea {
|
|
258
|
+
resize: vertical;
|
|
259
|
+
min-height: 120px;
|
|
260
|
+
}
|
|
261
|
+
.label {
|
|
262
|
+
display: block;
|
|
263
|
+
padding: 6px 0;
|
|
264
|
+
cursor: pointer;
|
|
265
|
+
font-size: 16px;
|
|
266
|
+
color: #59636e;
|
|
267
|
+
font-weight: 600;
|
|
268
|
+
}
|
|
269
|
+
.alert {
|
|
270
|
+
gap: 12px;
|
|
271
|
+
padding: 16px;
|
|
272
|
+
display: flex;
|
|
273
|
+
font-size: 16px;
|
|
274
|
+
font-weight: 500;
|
|
275
|
+
border-radius: 8px;
|
|
276
|
+
align-items: center;
|
|
277
|
+
}
|
|
278
|
+
.alert-small {
|
|
279
|
+
padding: 8px;
|
|
280
|
+
max-width: 316px;
|
|
281
|
+
}
|
|
282
|
+
.alert-info {
|
|
283
|
+
color: #1E40AF;
|
|
284
|
+
background: #DBEAFE;
|
|
285
|
+
border-left: 4px solid #3B82F6;
|
|
286
|
+
}
|
|
287
|
+
.alert-success {
|
|
288
|
+
color: #065F46;
|
|
289
|
+
background: #D1FAE5;
|
|
290
|
+
border-left: 4px solid #10B981;
|
|
291
|
+
}
|
|
292
|
+
.alert-warning {
|
|
293
|
+
color: #92400E;
|
|
294
|
+
background: #FEF3C7;
|
|
295
|
+
border-left: 4px solid #F59E0B;
|
|
296
|
+
}
|
|
297
|
+
.alert-danger {
|
|
298
|
+
color: #B91C1C;
|
|
299
|
+
background: #FEE2E2;
|
|
300
|
+
border-left: 4px solid #EF4444;
|
|
301
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "full-react-declarative",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Stone.js's full starter to create react app using declarative API.",
|
|
6
|
+
"author": "Mr. Stone <evensstone@gmail.com>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=20.0.0"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "stone dev",
|
|
14
|
+
"build": "stone build",
|
|
15
|
+
"preview": "stone preview",
|
|
16
|
+
"build:ssr": "stone build --ssr",
|
|
17
|
+
"test": "vitest run",
|
|
18
|
+
"test:cvg": "npm run test -- --coverage"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@stone-js/env": "^0.8.3",
|
|
22
|
+
"@stone-js/http-core": "^0.8.3",
|
|
23
|
+
"@stone-js/node-http-adapter": "^0.8.3",
|
|
24
|
+
"@stone-js/router": "^0.8.3",
|
|
25
|
+
"@stone-js/filesystem": "^0.8.3",
|
|
26
|
+
"@stone-js/core": "^0.8.3",
|
|
27
|
+
"@stone-js/use-react": "^0.8.3",
|
|
28
|
+
"@stone-js/browser-adapter": "^0.8.3",
|
|
29
|
+
"@stone-js/node-cli-adapter": "^0.8.3",
|
|
30
|
+
"axios": "^1.7.9",
|
|
31
|
+
"react": "^19.0.0",
|
|
32
|
+
"react-dom": "^19.0.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@babel/plugin-proposal-decorators": "^7.25.9",
|
|
36
|
+
"@babel/preset-env": "^7.26.9",
|
|
37
|
+
"@babel/preset-typescript": "^7.27.0",
|
|
38
|
+
"@stone-js/cli": "^0.8.3",
|
|
39
|
+
"@types/axios": "^0.14.4",
|
|
40
|
+
"@types/node": "^24.0.7",
|
|
41
|
+
"@types/react": "^19.0.7",
|
|
42
|
+
"@types/react-dom": "^19.0.3",
|
|
43
|
+
"@vitest/coverage-v8": "^3.0.9",
|
|
44
|
+
"vitest": "^3.0.9"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"experimentalDecorators": true,
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"moduleDetection": "force",
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
"jsx": "react-jsx",
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
|
|
19
|
+
/* Linting */
|
|
20
|
+
"strict": true,
|
|
21
|
+
"noUnusedLocals": true,
|
|
22
|
+
"noUnusedParameters": true,
|
|
23
|
+
"noFallthroughCasesInSwitch": true,
|
|
24
|
+
"noUncheckedSideEffectImports": true,
|
|
25
|
+
|
|
26
|
+
"types": ["node", "vite/client"],
|
|
27
|
+
},
|
|
28
|
+
"include": ["app"]
|
|
29
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
globals: true,
|
|
6
|
+
environment: 'node',
|
|
7
|
+
include: ['./tests/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
|
|
8
|
+
coverage: {
|
|
9
|
+
provider: 'v8',
|
|
10
|
+
include: ['app/**/*.ts', 'app/**/*.tsx'],
|
|
11
|
+
reporter: ['text', 'html'],
|
|
12
|
+
reportsDirectory: './coverage',
|
|
13
|
+
thresholds: {
|
|
14
|
+
100: true
|
|
15
|
+
},
|
|
16
|
+
watermarks: {
|
|
17
|
+
statements: [60, 80],
|
|
18
|
+
functions: [60, 80],
|
|
19
|
+
branches: [60, 80],
|
|
20
|
+
lines: [60, 80]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
BASE_URL=http://localhost:3100
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
API_BASE_URL=http://localhost:8080
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright © 2026 Stone Foundation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Stone.js - Full starter
|
|
2
|
+
|
|
3
|
+
Stone.js's full starter to create web app using declarative API.
|
|
4
|
+
|
|
5
|
+
## Project Setup
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Compile and Hot-Reload for Development
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm run dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Compile and Bundle for Production
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npm run build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Run the Production build
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
npm run preview
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Run tests
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npm run test
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Run tests with coverage
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
npm run test:cvg
|
|
39
|
+
```
|