helfy-create 0.0.5 → 0.1.0

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 (44) hide show
  1. package/README.md +49 -38
  2. package/bin/create-helfy.js +8 -0
  3. package/package.json +31 -31
  4. package/template/declaration.d.ts +10 -8
  5. package/template/package-lock.json +6981 -7000
  6. package/template/package.json +29 -30
  7. package/template/rspack.config.js +76 -0
  8. package/template/src/App.hf +20 -0
  9. package/template/src/App.ts +5 -0
  10. package/template/src/context/ThemeContext.ts +18 -0
  11. package/template/src/pages/AboutPage.hf +12 -0
  12. package/template/src/pages/AboutPage.ts +5 -0
  13. package/template/src/pages/CounterPage.hf +13 -0
  14. package/template/src/pages/CounterPage.ts +15 -0
  15. package/template/src/pages/HomePage.hf +17 -0
  16. package/template/src/pages/HomePage.ts +5 -0
  17. package/template/src/pages/_router.hf +21 -0
  18. package/template/src/pages/_router.ts +5 -0
  19. package/template/src/pages/{_routes.tsx → _routes.ts} +10 -10
  20. package/template/src/pages/layouts/MainLayout.hf +24 -0
  21. package/template/src/pages/layouts/MainLayout.ts +5 -0
  22. package/template/src/widgets/Footer/Footer.hf +5 -0
  23. package/template/src/widgets/Footer/Footer.ts +5 -0
  24. package/template/src/widgets/Header/Header.hf +15 -0
  25. package/template/src/widgets/Header/Header.ts +11 -0
  26. package/template/src/widgets/Navbar/Navbar.hf +14 -0
  27. package/template/src/widgets/Navbar/Navbar.ts +11 -0
  28. package/template/src/widgets/NotFound/NotFound.hf +14 -0
  29. package/template/src/widgets/NotFound/NotFound.ts +12 -0
  30. package/template/src/widgets/ThemeToggle/ThemeToggle.hf +16 -0
  31. package/template/src/widgets/ThemeToggle/ThemeToggle.ts +12 -0
  32. package/template/src/widgets/navLinks.ts +5 -0
  33. package/template/tsconfig.json +0 -2
  34. package/template/src/App.tsx +0 -26
  35. package/template/src/context/ThemeContext.tsx +0 -60
  36. package/template/src/pages/AboutPage.tsx +0 -18
  37. package/template/src/pages/CounterPage.tsx +0 -17
  38. package/template/src/pages/HomePage.tsx +0 -22
  39. package/template/src/pages/_router.tsx +0 -15
  40. package/template/src/pages/layouts/MainLayout.tsx +0 -29
  41. package/template/src/widgets/Footer/Footer.tsx +0 -8
  42. package/template/src/widgets/Header/Header.tsx +0 -34
  43. package/template/src/widgets/Navbar/Navbar.tsx +0 -29
  44. package/template/src/widgets/NotFound/NotFound.tsx +0 -31
@@ -1,29 +0,0 @@
1
- import { View } from "@helfy/helfy";
2
-
3
- @View
4
- export class MainLayout {
5
- render() {
6
- return (
7
- <div class="layout">
8
- <header class="header">
9
- @slot:header()
10
- </header>
11
- <div class="layout__body">
12
- <aside class="sidebar">
13
- @slot:sidebar()
14
- </aside>
15
- <main class="main">
16
- <div class="main__content">
17
- @slot:content()
18
- </div>
19
- </main>
20
- </div>
21
- <footer class="footer">
22
- @slot:footer() fallback {
23
- <span>© 2026</span>
24
- }
25
- </footer>
26
- </div>
27
- );
28
- }
29
- }
@@ -1,8 +0,0 @@
1
- import { View } from "@helfy/helfy";
2
-
3
- @View
4
- export class Footer {
5
- render() {
6
- return (<span>Powered by HelfyFramework — © 2026</span>);
7
- }
8
- }
@@ -1,34 +0,0 @@
1
- import { ThemeToggle } from "@context/ThemeContext";
2
- import { Link, path, View } from "@helfy/helfy";
3
-
4
- @View
5
- export class Header {
6
- @path()
7
- private pathname?: string;
8
-
9
- render() {
10
- return (
11
- <div class="header__inner">
12
- <Link to="/" label="Helfy" class="header__logo" />
13
- <nav class="nav">
14
- <Link
15
- to="/"
16
- label="Home"
17
- class={this.pathname === "/" ? "nav-link--active" : ""}
18
- />
19
- <Link
20
- to="/counter"
21
- label="Counter"
22
- class={this.pathname === "/counter" ? "nav-link--active" : ""}
23
- />
24
- <Link
25
- to="/about"
26
- label="About"
27
- class={this.pathname === "/about" ? "nav-link--active" : ""}
28
- />
29
- </nav>
30
- <ThemeToggle />
31
- </div>
32
- );
33
- }
34
- }
@@ -1,29 +0,0 @@
1
- import { Link, path, View } from "@helfy/helfy";
2
-
3
- @View
4
- export class NavBar {
5
- @path()
6
- private pathname?: string;
7
-
8
- render() {
9
- return (
10
- <nav class="sidebar-nav">
11
- <Link
12
- to="/"
13
- label="Home"
14
- class={this.pathname === "/" ? "nav-link nav-link--active" : "nav-link"}
15
- />
16
- <Link
17
- to="/counter"
18
- label="Counter"
19
- class={this.pathname === "/counter" ? "nav-link nav-link--active" : "nav-link"}
20
- />
21
- <Link
22
- to="/about"
23
- label="About"
24
- class={this.pathname === "/about" ? "nav-link nav-link--active" : "nav-link"}
25
- />
26
- </nav>
27
- );
28
- }
29
- }
@@ -1,31 +0,0 @@
1
- import { Link, View } from "@helfy/helfy";
2
-
3
- export interface Props {
4
- pathname?: string;
5
- }
6
-
7
- @View
8
- /** Custom 404 page — overrides the fallback RouterView. */
9
- export class NotFound {
10
- constructor(private readonly props: Props = {}) {}
11
-
12
- render() {
13
- return (
14
- <section class="not-found">
15
- <div class="not-found__code">404</div>
16
- <h1 class="not-found__title">Oops! Page not found</h1>
17
- <p class="not-found__text">
18
- The requested address does not exist or has been moved.
19
- </p>
20
- {(this.props.pathname ?? "") && (
21
- <p class="not-found__path">{this.props.pathname}</p>
22
- )}
23
- <Link
24
- to="/"
25
- label="Back to home"
26
- class="btn btn--primary"
27
- />
28
- </section>
29
- );
30
- }
31
- }