@seip/blue-bird 0.4.5 → 0.4.6

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 (51) hide show
  1. package/.env_example +26 -25
  2. package/AGENTS.md +199 -199
  3. package/README.md +79 -79
  4. package/backend/index.js +13 -13
  5. package/backend/routes/frontend.js +41 -41
  6. package/backend/routes/seo.js +39 -39
  7. package/core/app.js +328 -325
  8. package/core/auth.js +114 -114
  9. package/core/cache.js +44 -44
  10. package/core/cli/component.js +42 -42
  11. package/core/cli/init.js +119 -118
  12. package/core/cli/react.js +435 -435
  13. package/core/cli/route.js +42 -42
  14. package/core/config.js +48 -47
  15. package/core/debug.js +248 -248
  16. package/core/logger.js +100 -100
  17. package/core/middleware.js +27 -27
  18. package/core/router.js +333 -333
  19. package/core/seo.js +95 -100
  20. package/core/template.js +472 -462
  21. package/core/upload.js +76 -76
  22. package/core/validate.js +380 -380
  23. package/frontend/index.html +26 -26
  24. package/frontend/landing.html +69 -69
  25. package/frontend/resources/css/tailwind.css +17 -17
  26. package/frontend/resources/js/App.jsx +70 -70
  27. package/frontend/resources/js/Main.jsx +18 -18
  28. package/frontend/resources/js/blue-bird/components/Button.jsx +67 -67
  29. package/frontend/resources/js/blue-bird/components/Card.jsx +18 -18
  30. package/frontend/resources/js/blue-bird/components/DataTable.jsx +126 -126
  31. package/frontend/resources/js/blue-bird/components/Input.jsx +21 -21
  32. package/frontend/resources/js/blue-bird/components/Label.jsx +12 -12
  33. package/frontend/resources/js/blue-bird/components/LanguageButton.jsx +23 -23
  34. package/frontend/resources/js/blue-bird/components/Link.jsx +15 -15
  35. package/frontend/resources/js/blue-bird/components/Modal.jsx +27 -27
  36. package/frontend/resources/js/blue-bird/components/Skeleton.jsx +44 -44
  37. package/frontend/resources/js/blue-bird/components/Translate.jsx +12 -12
  38. package/frontend/resources/js/blue-bird/components/Typography.jsx +69 -69
  39. package/frontend/resources/js/blue-bird/contexts/LanguageContext.jsx +41 -41
  40. package/frontend/resources/js/blue-bird/contexts/SPAContext.jsx +239 -237
  41. package/frontend/resources/js/blue-bird/contexts/SnackbarContext.jsx +38 -38
  42. package/frontend/resources/js/blue-bird/contexts/ThemeContext.jsx +49 -49
  43. package/frontend/resources/js/blue-bird/locales/en.json +47 -47
  44. package/frontend/resources/js/blue-bird/locales/es.json +47 -47
  45. package/frontend/resources/js/components/Header.jsx +55 -55
  46. package/frontend/resources/js/pages/About.jsx +31 -31
  47. package/frontend/resources/js/pages/Home.jsx +82 -82
  48. package/package.json +57 -57
  49. package/vite.config.js +22 -22
  50. package/frontend/public/robots.txt +0 -0
  51. package/frontend/public/sitemap.xml +0 -0
package/core/cli/route.js CHANGED
@@ -1,43 +1,43 @@
1
- import path from 'path';
2
- import fs from 'fs';
3
- import Config from "../config.js";
4
-
5
- const __dirname = Config.dirname();
6
-
7
- class RouteCLI {
8
- /**
9
- * Create route
10
- */
11
- create() {
12
- let nameRoute = process.argv[2];
13
- if (!nameRoute) {
14
- console.log("Please provide a route name. Usage: npm run route <route-name>");
15
- return;
16
- }
17
- nameRoute =nameRoute.charAt(0).toUpperCase() + nameRoute.slice(1);
18
- const folder= path.join(__dirname, 'backend/routes');
19
- if (!fs.existsSync(folder)){
20
- fs.mkdirSync(folder, { recursive: true });
21
- }
22
- const filePath = path.join(folder, `${nameRoute}.js`);
23
- if (fs.existsSync(filePath)) {
24
- console.log(`Route ${nameRoute} already exists.`);
25
- return;
26
- }
27
- const content =`import Router from "@seip/blue-bird/core/router.js"
28
-
29
- const router${nameRoute} = new Router("/${nameRoute.toLowerCase()}");
30
-
31
- router${nameRoute}.get("/", (req, res) => {
32
- res.json({ message: "Hello from ${nameRoute} route!" });
33
- });
34
-
35
- export default router${nameRoute};
36
- `;
37
- fs.writeFileSync(filePath, content);
38
- console.log(`Route ${nameRoute} created successfully at ${filePath}`);
39
- }
40
- }
41
-
42
- const routeCLI = new RouteCLI();
1
+ import path from 'path';
2
+ import fs from 'fs';
3
+ import Config from "../config.js";
4
+
5
+ const __dirname = Config.dirname();
6
+
7
+ class RouteCLI {
8
+ /**
9
+ * Create route
10
+ */
11
+ create() {
12
+ let nameRoute = process.argv[2];
13
+ if (!nameRoute) {
14
+ console.log("Please provide a route name. Usage: npm run route <route-name>");
15
+ return;
16
+ }
17
+ nameRoute =nameRoute.charAt(0).toUpperCase() + nameRoute.slice(1);
18
+ const folder= path.join(__dirname, 'backend/routes');
19
+ if (!fs.existsSync(folder)){
20
+ fs.mkdirSync(folder, { recursive: true });
21
+ }
22
+ const filePath = path.join(folder, `${nameRoute}.js`);
23
+ if (fs.existsSync(filePath)) {
24
+ console.log(`Route ${nameRoute} already exists.`);
25
+ return;
26
+ }
27
+ const content =`import Router from "@seip/blue-bird/core/router.js"
28
+
29
+ const router${nameRoute} = new Router("/${nameRoute.toLowerCase()}");
30
+
31
+ router${nameRoute}.get("/", (req, res) => {
32
+ res.json({ message: "Hello from ${nameRoute} route!" });
33
+ });
34
+
35
+ export default router${nameRoute};
36
+ `;
37
+ fs.writeFileSync(filePath, content);
38
+ console.log(`Route ${nameRoute} created successfully at ${filePath}`);
39
+ }
40
+ }
41
+
42
+ const routeCLI = new RouteCLI();
43
43
  routeCLI.create()
package/core/config.js CHANGED
@@ -1,47 +1,48 @@
1
- import path from "path";
2
-
3
- let _cachedProps = null;
4
-
5
- /**
6
- * Configuration class to manage application-wide settings and environment variables.
7
- */
8
- class Config {
9
- /**
10
- * Returns the base directory of the application.
11
- * @returns {string} The current working directory.
12
- */
13
- static dirname() {
14
- return process.cwd();
15
- }
16
-
17
- /**
18
- * Retrieves application properties from environment variables or default values.
19
- * Results are cached after first call for performance.
20
- * @returns {Object} The configuration properties object.
21
- */
22
- static props() {
23
- if (_cachedProps) return _cachedProps;
24
-
25
- const portRaw = parseInt(process.env.PORT);
26
-
27
- _cachedProps = {
28
- debug: process.env.DEBUG === "true",
29
- descriptionMeta: process.env.DESCRIPTION_META || "",
30
- keywordsMeta: process.env.KEYWORDS_META || "",
31
- titleMeta: process.env.TITLE_META || "",
32
- authorMeta: process.env.AUTHOR_META || "",
33
- description: process.env.DESCRIPTION || "",
34
- title: process.env.TITLE || "",
35
- version: process.env.VERSION || "1.0.0",
36
- langMeta: process.env.LANGMETA || "en",
37
- host: process.env.HOST || "http://localhost",
38
- port: Number.isNaN(portRaw) ? 3000 : portRaw,
39
- static: {
40
- path: process.env.STATIC_PATH || "frontend/public",
41
- options: {},
42
- },
43
- };
44
- return _cachedProps;
45
- }
46
- }
47
- export default Config;
1
+ import path from "path";
2
+
3
+ let _cachedProps = null;
4
+
5
+ /**
6
+ * Configuration class to manage application-wide settings and environment variables.
7
+ */
8
+ class Config {
9
+ /**
10
+ * Returns the base directory of the application.
11
+ * @returns {string} The current working directory.
12
+ */
13
+ static dirname() {
14
+ return process.cwd();
15
+ }
16
+
17
+ /**
18
+ * Retrieves application properties from environment variables or default values.
19
+ * Results are cached after first call for performance.
20
+ * @returns {Object} The configuration properties object.
21
+ */
22
+ static props() {
23
+ if (_cachedProps) return _cachedProps;
24
+
25
+ const portRaw = parseInt(process.env.PORT);
26
+
27
+ _cachedProps = {
28
+ debug: process.env.DEBUG === "true",
29
+ descriptionMeta: process.env.DESCRIPTION_META || "",
30
+ keywordsMeta: process.env.KEYWORDS_META || "",
31
+ titleMeta: process.env.TITLE_META || "",
32
+ authorMeta: process.env.AUTHOR_META || "",
33
+ description: process.env.DESCRIPTION || "",
34
+ title: process.env.TITLE || "",
35
+ version: process.env.VERSION || "1.0.0",
36
+ langMeta: process.env.LANGMETA || "en",
37
+ host: process.env.HOST || "http://localhost",
38
+ appUrl: process.env.APP_URL || process.env.HOST || "http://localhost",
39
+ port: Number.isNaN(portRaw) ? 3000 : portRaw,
40
+ static: {
41
+ path: process.env.STATIC_PATH || "frontend/public",
42
+ options: {},
43
+ },
44
+ };
45
+ return _cachedProps;
46
+ }
47
+ }
48
+ export default Config;