@yannosay/sinth 0.0.4

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/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # Sinth
2
+
3
+ A declarative language that compiles to pure HTML, CSS, and JavaScript. Zero runtime, maximum control.
4
+
5
+ ## Install
6
+ @'
7
+ # Sinth
8
+
9
+ A declarative language that compiles to pure HTML, CSS, and JavaScript. Zero runtime, maximum control.
10
+
11
+ ## Install
12
+ npm install -g sinth
13
+
14
+ text
15
+
16
+ ## Quick start
17
+ sinth init
18
+ sinth dev
19
+
20
+ text
21
+
22
+ ## Commands
23
+ - `sinth init` — scaffold a new project
24
+ - `sinth dev` — start dev server with live reload
25
+ - `sinth build` — compile to static files
26
+ - `sinth check` — lint without output
27
+ - `sinth version` — print version
28
+
29
+ ## License
30
+ AGPL-3.0
package/bin/sinth.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ const path = require('path');
3
+ const tsSource = path.join(__dirname, '..', 'src', 'sinth.ts');
4
+ require('ts-node').register({ project: path.join(__dirname, '..', 'tsconfig.json') });
5
+ require(tsSource);
@@ -0,0 +1,21 @@
1
+ -- Card component
2
+
3
+ component Card(title, color = "blue") {
4
+ Div(class: "card") {
5
+ Heading(level: 2) { "$title" }
6
+ Div(class: "card-body") { "$slot" }
7
+ }
8
+
9
+ style {
10
+ .card {
11
+ backgroundColor: "#f7f7f7"
12
+ borderRadius: "1rem"
13
+ padding: "1.5rem"
14
+ textAlign: "center"
15
+ marginBottom: "1rem"
16
+ }
17
+ .card-body {
18
+ marginTop: "0.75rem"
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,38 @@
1
+ -- Navbar component
2
+
3
+ component Navbar {
4
+ Header {
5
+ Nav {
6
+ Link(href: "/", class: "logo") { "MySite" }
7
+ Div(class: "nav-links") {
8
+ NavLink(href: "/") { "Home" }
9
+ NavLink(href: "/about") { "About" }
10
+ }
11
+ }
12
+ }
13
+
14
+ style {
15
+ Header {
16
+ display: "flex"
17
+ alignItems: "center"
18
+ padding: "1rem 2rem"
19
+ backgroundColor: "#1a1a2e"
20
+ color: "white"
21
+ }
22
+ .logo {
23
+ fontSize: "1.5rem"
24
+ fontWeight: "700"
25
+ color: "white"
26
+ textDecoration: "none"
27
+ }
28
+ .nav-links {
29
+ marginLeft: "auto"
30
+ display: "flex"
31
+ gap: "1.5rem"
32
+ }
33
+ .nav-links a {
34
+ color: "rgba(255,255,255,0.8)"
35
+ textDecoration: "none"
36
+ }
37
+ }
38
+ }
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@yannosay/sinth",
3
+ "version": "0.0.4",
4
+ "scripts": {
5
+ "build": "npx ts-node sinth.ts build",
6
+ "dev": "npx ts-node sinth.ts dev"
7
+ },
8
+ "devDependencies": {
9
+ "ts-node": "^10.0.0",
10
+ "typescript": "^5.0.0",
11
+ "sass": "^1.70.0"
12
+ }
13
+ }
@@ -0,0 +1,46 @@
1
+ -- My Sinth Site
2
+
3
+ page
4
+
5
+ import "../components/Navbar.sinth"
6
+ import css "../styles/reset.css"
7
+
8
+ title = "My Site"
9
+ fav = "assets/favicon.ico"
10
+ descr = "Built with Sinth."
11
+
12
+ Navbar
13
+
14
+ Hero {
15
+ Heading(level: 1) { "Welcome to Sinth" }
16
+ Paragraph { "A declarative, component-based web UI language." }
17
+ Button(onClick: "handleCTA") { "Get Started" }
18
+ }
19
+
20
+ Main {
21
+ Section {
22
+ Heading(level: 2) { "Features" }
23
+ CardGrid {
24
+ -- Add cards here
25
+ }
26
+ }
27
+ }
28
+
29
+ style {
30
+ Hero {
31
+ padding: "4rem 2rem"
32
+ textAlign: "center"
33
+ backgroundColor: "#f0f4ff"
34
+ }
35
+ Main {
36
+ maxWidth: "1100px"
37
+ margin: "0 auto"
38
+ padding: "2rem"
39
+ }
40
+ }
41
+
42
+ script {
43
+ function handleCTA() {
44
+ alert("Hello from Sinth!")
45
+ }
46
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "outDir": "./dist",
3
+ "libraryPaths": [
4
+ "./libraries"
5
+ ],
6
+ "minify": false
7
+ }