create-gardener 2.0.0 → 2.0.2

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 CHANGED
@@ -1,5 +1,3 @@
1
- ---
2
-
3
1
  # 🌱 Gardener
4
2
 
5
3
  **Gardener** is a lightweight, DOM-first front-end library for building and manipulating HTML/SVG elements using a clean, declarative JavaScript object syntax.
@@ -13,6 +11,12 @@ Everything is explicit and inspectable directly in the browser.
13
11
 
14
12
  ---
15
13
 
14
+ ## Version: 2.0.0
15
+
16
+ * lsp support on frontend
17
+ * separate files for js logic inside /static/pages/(filename)
18
+ * bug fixes in application and scripts
19
+
16
20
  ## ✨ Philosophy
17
21
 
18
22
  Gardener follows a **DOM-first, deterministic approach**:
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "git",
6
6
  "url": "https://github.com/ritishDas/gardener"
7
7
  },
8
- "version": "2.0.0",
8
+ "version": "2.0.2",
9
9
  "description": "A dom gardener converting dom elements into json and vice versa",
10
10
  "main": "index.js",
11
11
  "bin": {
@@ -7,7 +7,7 @@ async function buildHelper() {
7
7
 
8
8
  await fs.cp(src, dest, { recursive: true });
9
9
 
10
- await fs.writeFile(path.join(dest, 'static', 'gardenerConfig.js'), "export const mode = 'pro';", 'utf8');
10
+ await fs.writeFile(path.join(dest, 'static', 'gardenerConfig.js'), "export const mode = 'prod';", 'utf8');
11
11
 
12
12
  }
13
13
 
@@ -2,7 +2,6 @@
2
2
  "compilerOptions": {
3
3
  "target": "esnext",
4
4
  "module": "nodenext",
5
- "noUncheckedSideEffectImports": true,
6
5
  "moduleResolution": "Bundler",
7
6
  "checkJs": true,
8
7
  "baseUrl": ".",
@@ -16,7 +15,6 @@
16
15
  "declarationMap": true,
17
16
 
18
17
 
19
- "strict":true,
20
18
  "verbatimModuleSyntax": true,
21
19
  "isolatedModules": true,
22
20
  "noUncheckedSideEffectImports": true,
@@ -2,11 +2,10 @@
2
2
  "name": "create-gardener",
3
3
  "version": "2.0.0",
4
4
  "description": "A dom gardener converting dom elements into json and vice versa",
5
- "main": "src/build/server.js",
6
5
  "type": "module",
7
6
  "scripts": {
8
- "start": "NODE_ENV=production node build/backend/server.js",
9
- "dev": "concurrently \"NODE_ENV=development tsx watch src/backend/server.ts\" \"tailwindcss -w -i src/frontend/tailwind.css -o src/frontend/static/style.css\"",
7
+ "start": "cross-env NODE_ENV=production node build/backend/server.js",
8
+ "dev": "concurrently \"cross-env NODE_ENV=development tsx watch src/backend/server.ts\" \"tailwindcss -w -i src/frontend/tailwind.css -o src/frontend/static/style.css\"",
10
9
  "build": "tailwindcss -i src/frontend/tailwind.css -o src/frontend/static/style.css --minify && tsc && node buildHelper.js",
11
10
  "test": "echo \"Error: no test specified\" && exit 1"
12
11
  },
@@ -18,18 +17,16 @@
18
17
  "ejs": "^3.1.10",
19
18
  "express": "^5.2.1",
20
19
  "sharp": "^0.34.5",
21
- "types": "^0.1.1",
22
20
  "zod": "^4.3.6"
23
21
  },
24
22
  "devDependencies": {
25
- "tailwindcss": "^4.1.18",
26
- "tsx": "^4.21.0",
27
23
  "@types/ejs": "^3.1.5",
28
24
  "@types/express": "^5.0.6",
29
25
  "@types/node": "^25.0.2",
30
- "typescript": "^5.9.3",
31
- "concurrently": "^9.2.1"
26
+ "concurrently": "^9.2.1",
27
+ "tailwindcss": "^4.1.18",
28
+ "cross-env": "^10.1.0",
29
+ "tsx": "^4.21.0",
30
+ "typescript": "^5.9.3"
32
31
  }
33
32
  }
34
-
35
-
@@ -8,6 +8,9 @@ importers:
8
8
 
9
9
  .:
10
10
  dependencies:
11
+ cross-env:
12
+ specifier: ^10.1.0
13
+ version: 10.1.0
11
14
  dotenv:
12
15
  specifier: ^17.2.3
13
16
  version: 17.3.1
@@ -54,6 +57,9 @@ packages:
54
57
  '@emnapi/runtime@1.8.1':
55
58
  resolution: {integrity: sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==}
56
59
 
60
+ '@epic-web/invariant@1.0.0':
61
+ resolution: {integrity: sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==}
62
+
57
63
  '@esbuild/aix-ppc64@0.27.3':
58
64
  resolution: {integrity: sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==}
59
65
  engines: {node: '>=18'}
@@ -453,6 +459,15 @@ packages:
453
459
  resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==}
454
460
  engines: {node: '>= 0.6'}
455
461
 
462
+ cross-env@10.1.0:
463
+ resolution: {integrity: sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==}
464
+ engines: {node: '>=20'}
465
+ hasBin: true
466
+
467
+ cross-spawn@7.0.6:
468
+ resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
469
+ engines: {node: '>= 8'}
470
+
456
471
  debug@4.4.3:
457
472
  resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}
458
473
  engines: {node: '>=6.0'}
@@ -601,6 +616,9 @@ packages:
601
616
  is-promise@4.0.0:
602
617
  resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==}
603
618
 
619
+ isexe@2.0.0:
620
+ resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
621
+
604
622
  jake@10.9.4:
605
623
  resolution: {integrity: sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==}
606
624
  engines: {node: '>=10'}
@@ -652,6 +670,10 @@ packages:
652
670
  resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==}
653
671
  engines: {node: '>= 0.8'}
654
672
 
673
+ path-key@3.1.1:
674
+ resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
675
+ engines: {node: '>=8'}
676
+
655
677
  path-to-regexp@8.3.0:
656
678
  resolution: {integrity: sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==}
657
679
 
@@ -711,6 +733,14 @@ packages:
711
733
  resolution: {integrity: sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==}
712
734
  engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
713
735
 
736
+ shebang-command@2.0.0:
737
+ resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
738
+ engines: {node: '>=8'}
739
+
740
+ shebang-regex@3.0.0:
741
+ resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
742
+ engines: {node: '>=8'}
743
+
714
744
  shell-quote@1.8.3:
715
745
  resolution: {integrity: sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==}
716
746
  engines: {node: '>= 0.4'}
@@ -794,6 +824,11 @@ packages:
794
824
  resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}
795
825
  engines: {node: '>= 0.8'}
796
826
 
827
+ which@2.0.2:
828
+ resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
829
+ engines: {node: '>= 8'}
830
+ hasBin: true
831
+
797
832
  wrap-ansi@7.0.0:
798
833
  resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
799
834
  engines: {node: '>=10'}
@@ -823,6 +858,8 @@ snapshots:
823
858
  tslib: 2.8.1
824
859
  optional: true
825
860
 
861
+ '@epic-web/invariant@1.0.0': {}
862
+
826
863
  '@esbuild/aix-ppc64@0.27.3':
827
864
  optional: true
828
865
 
@@ -1119,6 +1156,17 @@ snapshots:
1119
1156
 
1120
1157
  cookie@0.7.2: {}
1121
1158
 
1159
+ cross-env@10.1.0:
1160
+ dependencies:
1161
+ '@epic-web/invariant': 1.0.0
1162
+ cross-spawn: 7.0.6
1163
+
1164
+ cross-spawn@7.0.6:
1165
+ dependencies:
1166
+ path-key: 3.1.1
1167
+ shebang-command: 2.0.0
1168
+ which: 2.0.2
1169
+
1122
1170
  debug@4.4.3:
1123
1171
  dependencies:
1124
1172
  ms: 2.1.3
@@ -1299,6 +1347,8 @@ snapshots:
1299
1347
 
1300
1348
  is-promise@4.0.0: {}
1301
1349
 
1350
+ isexe@2.0.0: {}
1351
+
1302
1352
  jake@10.9.4:
1303
1353
  dependencies:
1304
1354
  async: 3.2.6
@@ -1337,6 +1387,8 @@ snapshots:
1337
1387
 
1338
1388
  parseurl@1.3.3: {}
1339
1389
 
1390
+ path-key@3.1.1: {}
1391
+
1340
1392
  path-to-regexp@8.3.0: {}
1341
1393
 
1342
1394
  picocolors@1.1.1: {}
@@ -1439,6 +1491,12 @@ snapshots:
1439
1491
  '@img/sharp-win32-ia32': 0.34.5
1440
1492
  '@img/sharp-win32-x64': 0.34.5
1441
1493
 
1494
+ shebang-command@2.0.0:
1495
+ dependencies:
1496
+ shebang-regex: 3.0.0
1497
+
1498
+ shebang-regex@3.0.0: {}
1499
+
1442
1500
  shell-quote@1.8.3: {}
1443
1501
 
1444
1502
  side-channel-list@1.0.0:
@@ -1520,6 +1578,10 @@ snapshots:
1520
1578
 
1521
1579
  vary@1.1.2: {}
1522
1580
 
1581
+ which@2.0.2:
1582
+ dependencies:
1583
+ isexe: 2.0.0
1584
+
1523
1585
  wrap-ansi@7.0.0:
1524
1586
  dependencies:
1525
1587
  ansi-styles: 4.3.0
@@ -13,7 +13,7 @@ export async function imageOptimiser(req: Request, res: Response) {
13
13
  try {
14
14
  const { name } = req.params;
15
15
 
16
- if (typeof name !== 'string') return;
16
+ if (typeof name !== 'string') return res.status(400).json({ success: false, message: "invalid path" });
17
17
  // name format: test_500x300.webp
18
18
  const match = name.match(/^(.+?)_(\d+)x(\d+)\.webp$/);
19
19
 
@@ -16,6 +16,7 @@
16
16
 
17
17
 
18
18
 
19
+ </div>
19
20
  </body>
20
21
  <script type='module' src='/static/global.js'> </script>
21
22
  </html>
@@ -73,12 +73,13 @@ if (mode === 'dev') {
73
73
  }
74
74
  ]
75
75
  }))
76
+
77
+ togglehotreload();
76
78
  }
77
79
 
78
80
  //appendElement(body, gardener())
79
81
 
80
82
 
81
- togglehotreload();
82
83
 
83
84
  document.addEventListener('keydown', function(e) {
84
85
  // Detect Ctrl + H
@@ -4,9 +4,16 @@ import { gardener, fetchElement, replaceElement, appendElement } from "/static/g
4
4
  import { log, parser, addEl, State } from "/static/gardenerDev.js"
5
5
 
6
6
  addEl('.copybtn', 'click', () => {
7
- navigator.clipboard.writeText(fetchElement('.initCommand').innerText)
8
- replaceElement('.copybtn', copybtn());
9
- addNotification({ status: 'success', message: 'Copied' })
7
+ try {
8
+ navigator.clipboard.writeText(fetchElement('.initCommand').innerText)
9
+ replaceElement('.copybtn', copybtn());
10
+ addNotification({ status: 'success', message: 'Copied' })
11
+ }
12
+ catch (err) {
13
+ addNotification({
14
+ status: 'failure', message: "Couldn't Copy"
15
+ });
16
+ }
10
17
  })
11
18
 
12
19