@botim/botim-cli 0.1.6 → 0.1.7

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.
Files changed (92) hide show
  1. package/dist/cli.js +3 -3
  2. package/dist/cli.mjs +2 -2
  3. package/package.json +2 -3
  4. package/dist/templates/templates/react/README.md +0 -48
  5. package/dist/templates/templates/react/docs/code-patterns.md +0 -139
  6. package/dist/templates/templates/react/docs/core-rules.md +0 -69
  7. package/dist/templates/templates/react/docs/figma-workflow.md +0 -81
  8. package/dist/templates/templates/react/docs/validation.md +0 -59
  9. package/dist/templates/templates/react/eslint.config.ts +0 -57
  10. package/dist/templates/templates/react/index.html +0 -12
  11. package/dist/templates/templates/react/package-lock.json +0 -12197
  12. package/dist/templates/templates/react/package.json +0 -102
  13. package/dist/templates/templates/react/scripts/setup.sh +0 -304
  14. package/dist/templates/templates/react/src/api/http-client.ts +0 -8
  15. package/dist/templates/templates/react/src/api/modules/example.ts +0 -12
  16. package/dist/templates/templates/react/src/app.tsx +0 -27
  17. package/dist/templates/templates/react/src/components/not-found-content/index.ts +0 -2
  18. package/dist/templates/templates/react/src/components/not-found-content/not-found-content.tsx +0 -24
  19. package/dist/templates/templates/react/src/components/welcome-card/index.ts +0 -1
  20. package/dist/templates/templates/react/src/components/welcome-card/welcome-card.tsx +0 -10
  21. package/dist/templates/templates/react/src/hooks/use-document-title.ts +0 -11
  22. package/dist/templates/templates/react/src/i18n/index.ts +0 -40
  23. package/dist/templates/templates/react/src/i18n/languages/en.json +0 -10
  24. package/dist/templates/templates/react/src/main.tsx +0 -27
  25. package/dist/templates/templates/react/src/modules/common/README.md +0 -7
  26. package/dist/templates/templates/react/src/modules/common/constants.ts +0 -3
  27. package/dist/templates/templates/react/src/modules/core/README.md +0 -7
  28. package/dist/templates/templates/react/src/modules/core/api/error.ts +0 -6
  29. package/dist/templates/templates/react/src/modules/core/app-providers.tsx +0 -18
  30. package/dist/templates/templates/react/src/modules/core/index.ts +0 -2
  31. package/dist/templates/templates/react/src/pages/home/index.tsx +0 -13
  32. package/dist/templates/templates/react/src/pages/not-found/index.tsx +0 -7
  33. package/dist/templates/templates/react/src/routes.tsx +0 -18
  34. package/dist/templates/templates/react/src/stores/home-store.ts +0 -11
  35. package/dist/templates/templates/react/src/styles/font.css +0 -1
  36. package/dist/templates/templates/react/src/styles/global-style.tsx +0 -27
  37. package/dist/templates/templates/react/src/styles/tailwind.css +0 -4
  38. package/dist/templates/templates/react/src/styles/utility-classes.ts +0 -13
  39. package/dist/templates/templates/react/src/theme/index.tsx +0 -24
  40. package/dist/templates/templates/react/src/theme/types.ts +0 -10
  41. package/dist/templates/templates/react/src/types/global.d.ts +0 -139
  42. package/dist/templates/templates/react/src/types/shims-global.d.ts +0 -97
  43. package/dist/templates/templates/react/src/utils/currency.ts +0 -6
  44. package/dist/templates/templates/react/src/utils/date.ts +0 -5
  45. package/dist/templates/templates/react/src/utils/guard.ts +0 -4
  46. package/dist/templates/templates/react/src/vite-env.d.ts +0 -1
  47. package/dist/templates/templates/react/tsconfig.json +0 -39
  48. package/dist/templates/templates/react/tsconfig.node.json +0 -11
  49. package/dist/templates/templates/react/types/global.d.ts +0 -131
  50. package/dist/templates/templates/react/vite.config.ts +0 -179
  51. package/dist/templates/templates/vue/README.md +0 -19
  52. package/dist/templates/templates/vue/eslint.config.ts +0 -44
  53. package/dist/templates/templates/vue/index.html +0 -12
  54. package/dist/templates/templates/vue/package-lock.json +0 -5774
  55. package/dist/templates/templates/vue/package.json +0 -39
  56. package/dist/templates/templates/vue/src/api/http-client.ts +0 -11
  57. package/dist/templates/templates/vue/src/api/modules/example.ts +0 -12
  58. package/dist/templates/templates/vue/src/app.vue +0 -23
  59. package/dist/templates/templates/vue/src/components/card/index.vue +0 -14
  60. package/dist/templates/templates/vue/src/components/layout/index.ts +0 -1
  61. package/dist/templates/templates/vue/src/components/layout/page-layout.vue +0 -43
  62. package/dist/templates/templates/vue/src/components/layout/styles.ts +0 -5
  63. package/dist/templates/templates/vue/src/components/typography/heading.vue +0 -21
  64. package/dist/templates/templates/vue/src/components/typography/index.ts +0 -1
  65. package/dist/templates/templates/vue/src/hooks/use-document-title.ts +0 -23
  66. package/dist/templates/templates/vue/src/i18n/index.ts +0 -31
  67. package/dist/templates/templates/vue/src/i18n/languages/en.json +0 -10
  68. package/dist/templates/templates/vue/src/main.ts +0 -12
  69. package/dist/templates/templates/vue/src/modules/common/README.md +0 -7
  70. package/dist/templates/templates/vue/src/modules/common/constants.ts +0 -3
  71. package/dist/templates/templates/vue/src/modules/core/README.md +0 -7
  72. package/dist/templates/templates/vue/src/modules/core/api/error.ts +0 -6
  73. package/dist/templates/templates/vue/src/modules/core/app-providers.ts +0 -17
  74. package/dist/templates/templates/vue/src/modules/core/index.ts +0 -2
  75. package/dist/templates/templates/vue/src/pages/home/index.vue +0 -28
  76. package/dist/templates/templates/vue/src/pages/not-found/index.vue +0 -13
  77. package/dist/templates/templates/vue/src/routes.ts +0 -19
  78. package/dist/templates/templates/vue/src/stores/home-store.ts +0 -12
  79. package/dist/templates/templates/vue/src/styles/font.css +0 -1
  80. package/dist/templates/templates/vue/src/styles/global-style.ts +0 -63
  81. package/dist/templates/templates/vue/src/styles/utility-classes.ts +0 -1
  82. package/dist/templates/templates/vue/src/theme/index.ts +0 -33
  83. package/dist/templates/templates/vue/src/theme/types.ts +0 -10
  84. package/dist/templates/templates/vue/src/types/global.d.ts +0 -9
  85. package/dist/templates/templates/vue/src/utils/currency.ts +0 -6
  86. package/dist/templates/templates/vue/src/utils/date.ts +0 -5
  87. package/dist/templates/templates/vue/src/utils/guard.ts +0 -4
  88. package/dist/templates/templates/vue/src/vite-env.d.ts +0 -1
  89. package/dist/templates/templates/vue/tsconfig.json +0 -36
  90. package/dist/templates/templates/vue/tsconfig.node.json +0 -9
  91. package/dist/templates/templates/vue/types/global.d.ts +0 -7
  92. package/dist/templates/templates/vue/vite.config.ts +0 -74
@@ -1,102 +0,0 @@
1
- {
2
- "name": "@botim/react-mp-template",
3
- "version": "0.0.1",
4
- "private": true,
5
- "type": "module",
6
- "scripts": {
7
- "dev": "vite --host",
8
- "build": "vite build",
9
- "preview": "vite preview",
10
- "lint": "eslint .",
11
- "lint:fix": "eslint . --fix",
12
- "type-check": "tsc --noEmit --skipLibCheck",
13
- "test": "vitest"
14
- },
15
- "dependencies": {
16
- "@botim/bootstrap-mp": "^1.1.1",
17
- "@botim/bot": "^2.1.0",
18
- "@botim/bot-plus": "^2.1.0",
19
- "@botim/bridge": "57.0.1",
20
- "@botim/buckit2-icons": "^1.0.3",
21
- "@botim/buckit2-react": "^1.0.27",
22
- "@botim/buckit2-resolver": "^0.0.1",
23
- "@botim/framework": "^1.1.1",
24
- "@botim/interceptors": "^0.2.0",
25
- "@botim/login": "^1.0.6",
26
- "@botim/react-sentry": "^0.0.5",
27
- "@botim/report": "^1.0.5",
28
- "@botim/request": "^0.0.3",
29
- "@botim/sentry": "^0.2.3",
30
- "@botim/unplugin-sentry": "^0.2.2",
31
- "@emotion/react": "^11.11.0",
32
- "@emotion/styled": "^11.11.0",
33
- "@readme/http-status-codes": "^9.0.2",
34
- "@sentry/react": "^9.30.0",
35
- "@stylistic/eslint-plugin": "^4.2.0",
36
- "axios": "^1.9.0",
37
- "classnames": "^2.5.1",
38
- "crypto-js": "^4.2.0",
39
- "date-fns": "^4.1.0",
40
- "dayjs": "^1.11.13",
41
- "i18next": "^25.3.6",
42
- "js-sha256": "^0.9.0",
43
- "jsencrypt": "^3.3.2",
44
- "lodash-es": "^4.17.21",
45
- "lottie-react": "^2.4.1",
46
- "node-rsa": "^1.1.1",
47
- "query-string": "^9.2.0",
48
- "react": "^18.2.0",
49
- "react-dom": "^18.2.0",
50
- "react-i18next": "^15.6.1",
51
- "react-router-dom": "^6.11.2",
52
- "tslib": "^2.8.1",
53
- "vconsole": "^3.15.1",
54
- "vite-tsconfig-paths": "^5.1.4",
55
- "webpack": "^5.99.9",
56
- "zustand": "^4.3.8"
57
- },
58
- "devDependencies": {
59
- "@botim/unplugin-mp": "^0.1.28",
60
- "@emotion/babel-plugin": "^11.13.5",
61
- "@eslint/eslintrc": "^3.3.1",
62
- "@eslint/js": "^9.34.0",
63
- "@types/lodash-es": "^4.17.12",
64
- "@types/minimatch": "^6.0.0",
65
- "@types/node": "^20.2.5",
66
- "@types/node-rsa": "^1.1.4",
67
- "@types/react": "^18.2.7",
68
- "@types/react-dom": "^18.2.4",
69
- "@typescript-eslint/eslint-plugin": "^8.41.0",
70
- "@typescript-eslint/parser": "^8.41.0",
71
- "@typescript-eslint/types": "^8.40.0",
72
- "@typescript-eslint/utils": "^8.40.0",
73
- "@vitejs/plugin-react": "^4.0.0",
74
- "eslint": "^9.34.0",
75
- "eslint-import-resolver-alias": "^1.1.2",
76
- "eslint-import-resolver-typescript": "^4.3.4",
77
- "eslint-plugin-better-styled-components": "^1.1.2",
78
- "eslint-plugin-i18next": "^6.1.3",
79
- "eslint-plugin-import": "^2.31.0",
80
- "eslint-plugin-jsx-a11y": "^6.10.2",
81
- "eslint-plugin-no-secrets": "^2.2.1",
82
- "eslint-plugin-no-unsanitized": "^4.1.2",
83
- "eslint-plugin-react": "^7.37.5",
84
- "eslint-plugin-react-hooks": "^5.2.0",
85
- "eslint-plugin-react-refresh": "^0.4.1",
86
- "eslint-plugin-simple-import-sort": "^12.1.1",
87
- "eslint-plugin-unicorn": "^59.0.0",
88
- "fs-extra": "^11.3.0",
89
- "globals": "^16.0.0",
90
- "husky": "^8.0.0",
91
- "jiti": "^2.4.2",
92
- "lint-staged": "^9.5.0",
93
- "semver": "^7.7.1",
94
- "simple-git": "^3.27.0",
95
- "typescript": "^5.0.4",
96
- "typescript-eslint": "^8.41.0",
97
- "unplugin-auto-import": "^19.1.2",
98
- "vite": "5.4.8",
99
- "vite-plugin-vconsole": "^2.1.1",
100
- "vitest": "^3.2.4"
101
- }
102
- }
@@ -1,304 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Botim CLI and MCP Setup Script
4
- # This script automates the installation of Botim CLI and configuration of MCP servers
5
- # Usage: ./setup.sh [BOTIM_MP_URL]
6
- # Example: ./setup.sh http://localhost:3002/mcp
7
-
8
- set -e # Exit on error
9
-
10
- # Default MCP URL
11
- DEFAULT_BOTIM_MP_MCP_URL="http://botim-mcp-aeuat1.k8s-aeuat1.uae-azure.ops.algento.com/mcp"
12
- BOTIM_MP_MCP_URL="http://botim-mcp-aeuat1.k8s-aeuat1.uae-azure.ops.algento.com/mcp"
13
-
14
- # Hosts entries to add
15
- HOSTS_ENTRIES=(
16
- "10.37.80.6 botim-mcp-aeuat1.k8s-aeuat1.uae-azure.ops.algento.com"
17
- )
18
-
19
- # Colors for output
20
- RED='\033[0;31m'
21
- GREEN='\033[0;32m'
22
- YELLOW='\033[1;33m'
23
- BLUE='\033[0;34m'
24
- NC='\033[0m' # No Color
25
-
26
- # Function to print colored messages
27
- print_success() {
28
- echo -e "${GREEN}✓ $1${NC}"
29
- }
30
-
31
- print_error() {
32
- echo -e "${RED}✗ $1${NC}"
33
- }
34
-
35
- print_info() {
36
- echo -e "${BLUE}ℹ $1${NC}"
37
- }
38
-
39
- print_warning() {
40
- echo -e "${YELLOW}⚠ $1${NC}"
41
- }
42
-
43
- print_header() {
44
- echo -e "\n${BLUE}═══════════════════════════════════════════════════════${NC}"
45
- echo -e "${BLUE} $1${NC}"
46
- echo -e "${BLUE}═══════════════════════════════════════════════════════${NC}\n"
47
- }
48
-
49
- # Function to check if command exists
50
- command_exists() {
51
- command -v "$1" >/dev/null 2>&1
52
- }
53
-
54
- # Function to configure /etc/hosts entries
55
- configure_hosts() {
56
- print_header "Step 1: Configuring /etc/hosts"
57
-
58
- HOSTS_FILE="/etc/hosts"
59
-
60
- for entry in "${HOSTS_ENTRIES[@]}"; do
61
- IP=$(echo "$entry" | awk '{print $1}')
62
- HOSTNAME=$(echo "$entry" | awk '{print $2}')
63
-
64
- # Check if entry already exists
65
- if grep -q "$HOSTNAME" "$HOSTS_FILE" 2>/dev/null; then
66
- print_info "Host entry for $HOSTNAME already exists"
67
- else
68
- print_info "Adding host entry: $entry"
69
-
70
- # Add entry to /etc/hosts (requires sudo)
71
- if echo "$entry" | sudo tee -a "$HOSTS_FILE" > /dev/null; then
72
- print_success "Added: $IP -> $HOSTNAME"
73
- else
74
- print_error "Failed to add host entry. Please add manually:"
75
- echo " sudo sh -c 'echo \"$entry\" >> /etc/hosts'"
76
- fi
77
- fi
78
- done
79
-
80
- print_success "Hosts configuration completed"
81
- }
82
-
83
- # Function to install Botim CLI
84
- install_botim_cli() {
85
- print_header "Step 2: Installing Botim CLI"
86
-
87
- if ! command_exists npm; then
88
- print_error "npm is not installed. Please install Node.js and npm first."
89
- exit 1
90
- fi
91
-
92
- print_info "Installing botim-cli globally..."
93
-
94
- if sudo npm i -g @botim/botim-cli; then
95
- print_success "Botim CLI installed successfully"
96
- else
97
- print_error "Failed to install Botim CLI."
98
- print_info "Please ensure you have npm registry access configured."
99
- exit 1
100
- fi
101
-
102
- # Verify installation
103
- if command_exists botim; then
104
- BOTIM_VERSION=$(botim --version 2>/dev/null || echo "unknown")
105
- print_success "Botim CLI is ready (version: $BOTIM_VERSION)"
106
- else
107
- print_warning "Botim CLI installed but not found in PATH. You may need to restart your terminal."
108
- fi
109
- }
110
-
111
- # Function to configure MCP servers
112
- configure_mcp_servers() {
113
- print_header "Step 3: Configuring MCP Servers"
114
-
115
- CLAUDE_CONFIG="$HOME/.claude.json"
116
-
117
- # Check if Claude config exists
118
- if [ ! -f "$CLAUDE_CONFIG" ]; then
119
- print_warning "Claude configuration file not found at $CLAUDE_CONFIG"
120
- read -p "Would you like to create it? (y/n): " -n 1 -r
121
- echo
122
- if [[ $REPLY =~ ^[Yy]$ ]]; then
123
- echo '{}' > "$CLAUDE_CONFIG"
124
- print_success "Created new Claude configuration file"
125
- else
126
- print_error "Cannot proceed without Claude configuration file"
127
- exit 1
128
- fi
129
- fi
130
-
131
- print_info "Backing up existing configuration..."
132
- cp "$CLAUDE_CONFIG" "${CLAUDE_CONFIG}.backup.$(date +%Y%m%d_%H%M%S)"
133
- print_success "Backup created"
134
-
135
- print_info "Adding MCP server configuration..."
136
-
137
- # Use Node.js to safely update JSON
138
- CLAUDE_CONFIG="$CLAUDE_CONFIG" BOTIM_MP_MCP_URL="$BOTIM_MP_MCP_URL" node - <<'NODESCRIPT'
139
- const fs = require('fs');
140
- const configFile = process.env.CLAUDE_CONFIG;
141
- const botimMpUrl = process.env.BOTIM_MP_MCP_URL;
142
-
143
- let config = {};
144
-
145
- // Read existing config
146
- try {
147
- const content = fs.readFileSync(configFile, 'utf8');
148
- if (content.trim()) {
149
- config = JSON.parse(content);
150
- }
151
- } catch (error) {
152
- // If file doesn't exist or is invalid, start with empty object
153
- config = {};
154
- }
155
-
156
- // Add or update mcpServers
157
- if (!config.mcpServers) {
158
- config.mcpServers = {};
159
- }
160
-
161
- config.mcpServers['botim-figma-mcp'] = {
162
- type: 'http',
163
- url: 'https://mcp.figma.com/mcp'
164
- };
165
-
166
- config.mcpServers['botim-mp-mcp'] = {
167
- type: 'http',
168
- url: botimMpUrl
169
- };
170
-
171
- // Write updated config
172
- fs.writeFileSync(configFile, JSON.stringify(config, null, 2) + '\n', 'utf8');
173
-
174
- console.log('MCP servers configured successfully');
175
- NODESCRIPT
176
-
177
- if [ $? -eq 0 ]; then
178
- print_success "MCP servers configured in $CLAUDE_CONFIG"
179
- else
180
- print_error "Failed to configure MCP servers"
181
- exit 1
182
- fi
183
- }
184
-
185
- # Function to verify MCP setup
186
- verify_mcp_setup() {
187
- print_header "Step 4: Verification"
188
-
189
- print_info "Checking Claude configuration..."
190
-
191
- if grep -q "botim-figma-mcp" "$HOME/.claude.json" && grep -q "botim-mp-mcp" "$HOME/.claude.json"; then
192
- print_success "MCP servers found in configuration"
193
- else
194
- print_error "MCP servers not properly configured"
195
- exit 1
196
- fi
197
-
198
- print_info "\nConfiguration summary:"
199
- echo " • Botim CLI: Installed"
200
- echo " • MCP Servers: Configured"
201
- echo " - botim-figma-mcp: https://mcp.figma.com/mcp"
202
- echo " - botim-mp-mcp: $BOTIM_MP_MCP_URL"
203
- }
204
-
205
- # Function to display next steps
206
- display_next_steps() {
207
- print_header "Next Steps"
208
-
209
- echo "1. Restart Claude Desktop to load the new MCP configuration"
210
- echo ""
211
- echo "2. In Claude Desktop, type: /mcp list"
212
- echo " You should see both MCP servers listed"
213
- echo ""
214
- echo "3. Authorize Figma MCP:"
215
- echo " - Select 'botim-figma-mcp' from the list"
216
- echo " - Click 'Authorize' when prompted"
217
- echo " - Complete the authorization flow"
218
- echo ""
219
- echo "4. Ensure the botim-mp-mcp server is running:"
220
- echo " - The server should be accessible at $BOTIM_MP_MCP_URL"
221
- echo ""
222
- echo "5. Install Botim Claude Plugin:"
223
- echo " - In Claude Desktop, type:"
224
- echo " /plugin marketplace add git@gitlab.corp.algento.com:open-platform/mp-templates/botim-mp-plugin.git"
225
- echo ""
226
- echo " - Then install the plugin:"
227
- echo " /plugin install botim-mp"
228
- echo ""
229
- print_success "Setup completed successfully!"
230
- echo ""
231
- print_info "Run 'botim --help' to see available commands"
232
- }
233
-
234
- # Main execution
235
- main() {
236
- clear
237
- print_header "Botim CLI and MCP Setup"
238
-
239
- # Check if URL was passed as argument
240
- if [ -n "$1" ]; then
241
- BOTIM_MP_MCP_URL="$1"
242
- print_info "Using provided Botim MP MCP URL: $BOTIM_MP_MCP_URL"
243
- else
244
- print_info "Botim MP MCP URL Configuration"
245
- echo ""
246
- read -p "Enter Botim MP MCP URL (press Enter for default: $DEFAULT_BOTIM_MP_MCP_URL): " USER_INPUT
247
-
248
- if [ -z "$USER_INPUT" ]; then
249
- BOTIM_MP_MCP_URL="$DEFAULT_BOTIM_MP_MCP_URL"
250
- print_info "Using default URL: $BOTIM_MP_MCP_URL"
251
- else
252
- BOTIM_MP_MCP_URL="$USER_INPUT"
253
- print_success "Using custom URL: $BOTIM_MP_MCP_URL"
254
- fi
255
- fi
256
-
257
- echo ""
258
- echo "This script will:"
259
- echo " 1. Configure /etc/hosts entries"
260
- echo " 2. Install Botim CLI globally"
261
- echo " 3. Configure MCP servers in Claude"
262
- echo " 4. Verify the installation"
263
- echo ""
264
- echo "Configuration:"
265
- echo " • Botim Figma MCP: https://mcp.figma.com/mcp"
266
- echo " • Botim MP MCP: $BOTIM_MP_MCP_URL"
267
- echo ""
268
-
269
- read -p "Do you want to continue? (y/n): " -n 1 -r
270
- echo
271
- if [[ ! $REPLY =~ ^[Yy]$ ]]; then
272
- print_info "Setup cancelled"
273
- exit 0
274
- fi
275
-
276
- # Check prerequisites
277
- print_header "Checking Prerequisites"
278
-
279
- if ! command_exists node; then
280
- print_error "Node.js is not installed. Please install Node.js first."
281
- exit 1
282
- else
283
- NODE_VERSION=$(node --version)
284
- print_success "Node.js is installed ($NODE_VERSION)"
285
- fi
286
-
287
- if ! command_exists npm; then
288
- print_error "npm is not installed. Please install npm first."
289
- exit 1
290
- else
291
- NPM_VERSION=$(npm --version)
292
- print_success "npm is installed (v$NPM_VERSION)"
293
- fi
294
-
295
- # Run setup steps
296
- configure_hosts
297
- install_botim_cli
298
- configure_mcp_servers
299
- verify_mcp_setup
300
- display_next_steps
301
- }
302
-
303
- # Run main function
304
- main
@@ -1,8 +0,0 @@
1
- import axios from 'axios';
2
-
3
- export const httpClient = axios.create({
4
- baseURL: '/api',
5
- timeout: 15_000
6
- });
7
-
8
- httpClient.interceptors.response.use((response) => response, (error) => Promise.reject(error));
@@ -1,12 +0,0 @@
1
- import { httpClient } from '../http-client';
2
-
3
- export type ExampleResponse = {
4
- id: string;
5
- name: string;
6
- };
7
-
8
- export async function fetchExample(): Promise<ExampleResponse> {
9
- const { data } = await httpClient.get<ExampleResponse>('/example');
10
-
11
- return data;
12
- }
@@ -1,27 +0,0 @@
1
- import { Suspense } from 'react';
2
- import { RouterProvider } from 'react-router-dom';
3
- import { AppProviders } from '@modules/core/app-providers';
4
- import { router } from './routes';
5
-
6
- export default function App(): JSX.Element {
7
- return (
8
- <AppProviders>
9
- <Suspense
10
- fallback={
11
- <div style={{
12
- display: 'flex',
13
- alignItems: 'center',
14
- justifyContent: 'center',
15
- height: '100vh',
16
- fontSize: '16px',
17
- color: '#666'
18
- }}>
19
- Loading...
20
- </div>
21
- }
22
- >
23
- <RouterProvider router={router} />
24
- </Suspense>
25
- </AppProviders>
26
- );
27
- }
@@ -1,2 +0,0 @@
1
- export { NotFoundContent } from './not-found-content';
2
- export type { NotFoundContentProps } from './not-found-content';
@@ -1,24 +0,0 @@
1
- import { useTranslation } from 'react-i18next';
2
- import { useNavigate } from 'react-router-dom';
3
- import { BotEmpty, BotButton } from '@botim/buckit2-react';
4
-
5
- export interface NotFoundContentProps {
6
- className?: string;
7
- }
8
-
9
- export function NotFoundContent({ className }: NotFoundContentProps): JSX.Element {
10
- const { t } = useTranslation();
11
- const navigate = useNavigate();
12
-
13
- const handleGoHome = (): void => {
14
- navigate('/');
15
- };
16
-
17
- return (
18
- <BotEmpty description={t('common.notFound')} className={className}>
19
- <BotButton type="primary" onClick={handleGoHome}>
20
- Go to Home
21
- </BotButton>
22
- </BotEmpty>
23
- );
24
- }
@@ -1 +0,0 @@
1
- export { WelcomeCard } from './welcome-card';
@@ -1,10 +0,0 @@
1
- import { useTranslation } from 'react-i18next';
2
- import { BotCell } from '@botim/buckit2-react';
3
-
4
- export function WelcomeCard(): JSX.Element {
5
- const { t } = useTranslation();
6
-
7
- return (
8
- <BotCell title={t('home.title')} label={t('home.welcome')} />
9
- );
10
- }
@@ -1,11 +0,0 @@
1
- import { useEffect } from 'react';
2
-
3
- export function useDocumentTitle(title: string, restore = 'App'): void {
4
- useEffect(() => {
5
- document.title = title;
6
-
7
- return () => {
8
- document.title = restore;
9
- };
10
- }, [ title, restore ]);
11
- }
@@ -1,40 +0,0 @@
1
- import { createInstance, InitOptions } from 'i18next';
2
- import { initReactI18next } from 'react-i18next';
3
- import en from './languages/en.json';
4
-
5
- const defaultOptions: InitOptions = {
6
- lng: 'en',
7
- fallbackLng: 'en',
8
- defaultNS: 'translation',
9
- interpolation: {
10
- escapeValue: false
11
- },
12
- resources: {
13
- en: {
14
- translation: en
15
- }
16
- },
17
- debug: false
18
- };
19
-
20
- let cachedInstance: ReturnType<typeof createInstance> | null = null;
21
-
22
- export function initI18n(options?: InitOptions) {
23
- if (cachedInstance?.isInitialized)
24
- return cachedInstance;
25
-
26
- const instance = createInstance();
27
-
28
- instance.use(initReactI18next).init({
29
- ...defaultOptions,
30
- ...options,
31
- resources: {
32
- ...defaultOptions.resources,
33
- ...(options?.resources ?? {})
34
- }
35
- });
36
-
37
- cachedInstance = instance;
38
-
39
- return instance;
40
- }
@@ -1,10 +0,0 @@
1
- {
2
- "home": {
3
- "title": "Home",
4
- "welcome": "Welcome to your new mini application"
5
- },
6
- "common": {
7
- "loading": "Loading...",
8
- "notFound": "The page you are looking for could not be found"
9
- }
10
- }
@@ -1,27 +0,0 @@
1
- import '@botim/buckit2-react/css/index.css';
2
- import { StrictMode } from 'react';
3
- import { createRoot } from 'react-dom/client';
4
- import { useFramework } from '@botim/framework';
5
- import App from './app';
6
- import { AppProviders } from '@modules/core/app-providers';
7
-
8
-
9
- async function bootstrap() {
10
- // eslint-disable-next-line react-hooks/rules-of-hooks
11
- await useFramework();
12
-
13
- const rootElement = document.getElementById('root');
14
-
15
- if (!rootElement)
16
- throw new Error('Root element #root is missing');
17
-
18
- createRoot(rootElement).render(
19
- <StrictMode>
20
- <AppProviders>
21
- <App />
22
- </AppProviders>
23
- </StrictMode>
24
- );
25
- }
26
-
27
- bootstrap();
@@ -1,7 +0,0 @@
1
- # Common Module
2
-
3
- Place shared domain logic, constants, and utilities here. This folder mirrors the structure of the source application and can be extended with sub-folders such as:
4
-
5
- - `constants/` for reusable values and enums.
6
- - `utilities/` for helpers that are consumed across modules.
7
- - `data-tracking/` or similar analytics-related integrations.
@@ -1,3 +0,0 @@
1
- export const STORAGE_KEYS = {
2
- language: 'app:language'
3
- } as const;
@@ -1,7 +0,0 @@
1
- # Core Module
2
-
3
- The core module aggregates cross-cutting concerns such as providers, API infrastructure, and application-wide constants. Extend this area with sub-folders for:
4
-
5
- - `api/` – shared HTTP clients, interceptors, and error helpers.
6
- - `constants/` – environment tokens or application identifiers.
7
- - `utils/` – low-level helpers that modules can build upon.
@@ -1,6 +0,0 @@
1
- export class ApiError extends Error {
2
- constructor(message: string, public readonly status?: number) {
3
- super(message);
4
- this.name = 'ApiError';
5
- }
6
- }
@@ -1,18 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- import { I18nextProvider } from 'react-i18next';
3
- import { GlobalStyle } from '@styles/global-style';
4
- import { AppThemeProvider } from '@theme/index';
5
- import { initI18n } from '@i18n/index';
6
-
7
- const i18n = initI18n();
8
-
9
- export function AppProviders({ children }: PropsWithChildren): JSX.Element {
10
- return (
11
- <AppThemeProvider>
12
- <I18nextProvider i18n={i18n}>
13
- <GlobalStyle />
14
- {children}
15
- </I18nextProvider>
16
- </AppThemeProvider>
17
- );
18
- }
@@ -1,2 +0,0 @@
1
- export { AppProviders } from './app-providers';
2
- export { ApiError } from './api/error';
@@ -1,13 +0,0 @@
1
- import { useTranslation } from 'react-i18next';
2
- import { useDocumentTitle } from '@hooks/use-document-title';
3
- import { BotCell } from '@botim/buckit2-react';
4
-
5
- export default function HomePage(): JSX.Element {
6
- const { t } = useTranslation();
7
-
8
- useDocumentTitle(t('home.title'));
9
-
10
- return (
11
- <BotCell title={t('home.title')} label={t('home.welcome')} />
12
- );
13
- }
@@ -1,7 +0,0 @@
1
- import { NotFoundContent } from '@components/not-found-content';
2
-
3
- export default function NotFoundPage(): JSX.Element {
4
- return (
5
- <NotFoundContent />
6
- );
7
- }