create-gardener 1.1.8 → 1.1.10

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
@@ -16,8 +16,10 @@ Use it with
16
16
  `npm create-gardener filename`
17
17
  ---
18
18
 
19
- [See Docs](https://ritish.site/Gardener)
20
- [Github](https://github.com/ritishDas/Gardener)
19
+ * [See Docs](https://ritish.site/Gardener)
20
+
21
+
22
+ * [Github](https://github.com/ritishDas/Gardener)
21
23
 
22
24
 
23
25
 
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "git",
6
6
  "url": "https://github.com/ritishDas/gardener"
7
7
  },
8
- "version": "1.1.8",
8
+ "version": "1.1.10",
9
9
  "description": "A dom gardener converting dom elements into json and vice versa",
10
10
  "main": "index.js",
11
11
  "bin": {
@@ -365,6 +365,14 @@ function generateFile(obj) {
365
365
  const formatted = JSON.stringify(obj, null, 2);
366
366
  const { cleanedString, extractedList } = cleanStringAndList(formatted);
367
367
 
368
+ if (extractedList.length === 0) return `
369
+ import { gardener, fetchElement, replaceElement } from '../gardener.js'
370
+
371
+ export default function thisfun() {
372
+ return gardener(${cleanedString})
373
+ }
374
+ `;
375
+
368
376
  return `
369
377
  import { gardener, fetchElement, replaceElement } from '../gardener.js'
370
378
 
@@ -215,16 +215,15 @@ replaceElement(
215
215
  </div>
216
216
 
217
217
  <!-- <div class='test'> -->
218
- <!-- hi there you must be ?name? how old are you let me guess ?age? -->
219
218
  <!-- </div> -->
220
219
 
221
220
  <script src="/static/global.js" type="module"></script>
222
221
  <script type="module">
223
222
  import { gardener,parser, fetchElement,replaceElement } from "/static/gardener.js";
224
- // import parameterised from '/static/components/para.js';
223
+ // import parameterised from '/static/components/test.js';
225
224
 
226
225
  // parser('.test')
227
- // replaceElement('.test', parameterised({name:'ritish',age:'39'}))
226
+ // replaceElement('.test', parameterised())
228
227
 
229
228
 
230
229
  </script>
@@ -1,54 +0,0 @@
1
-
2
- import { gardener, fetchElement, replaceElement } from '/static/gardener.js'
3
-
4
- export default function thisfun() {
5
- return gardener({
6
- "t": "div",
7
- "attr": {
8
- "id": "body"
9
- },
10
- "children": [
11
- {
12
- "t": "div",
13
- "cn": [
14
- "h-screen",
15
- "w-screen",
16
- "bg-white",
17
- "loader",
18
- "absolute"
19
- ],
20
- "attr": {
21
- "style": "transition: 0.4s; opacity: 0;"
22
- },
23
- "txt": ""
24
- },
25
- {
26
- "t": "div",
27
- "cn": [
28
- "hero",
29
- "flex",
30
- "justify-around",
31
- "items-center",
32
- "p-5",
33
- "h-[90vh]"
34
- ],
35
- "children": [
36
- {
37
- "t": "p",
38
- "cn": [
39
- "p-5"
40
- ],
41
- "txt": "Gardener is a front-end library for creating and manipulating DOM elements using a declarative JavaScript object syntax. It includes a development server with features like timely reload and on-the-fly component creation from existing HTML. The server also provides dynamic image resizing and caching."
42
- },
43
- {
44
- "t": "img",
45
- "attr": {
46
- "src": "/cache/gardener_500x500.webp",
47
- "alt": "logo"
48
- }
49
- }
50
- ]
51
- }
52
- ]
53
- })
54
- }