gardenjs 0.9.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.
- package/.babelrc +3 -0
- package/.eslintrc.yml +19 -0
- package/.github/workflows/npm-publish.yml +32 -0
- package/.husky/pre-commit +4 -0
- package/.prettierrc +5 -0
- package/LICENSE.md +21 -0
- package/README.md +76 -0
- package/bin/servegarden.js +172 -0
- package/examples/garden_button.svelte +5 -0
- package/examples/garden_button.svelte.das.js +16 -0
- package/examples/garden_button.svelte.md +3 -0
- package/examples/garden_button.vue +9 -0
- package/examples/garden_button.vue.das.js +16 -0
- package/examples/garden_button.vue.md +3 -0
- package/frame.html +21 -0
- package/index.html +14 -0
- package/index.js +1 -0
- package/jsconfig.json +32 -0
- package/package.json +55 -0
- package/src/client/GardenApp.svelte +173 -0
- package/src/client/GardenFrame.svelte +95 -0
- package/src/client/assets/icons/logo.svg +1 -0
- package/src/client/assets/scss/abstracts/root.css +42 -0
- package/src/client/assets/scss/base/buttons.css +5 -0
- package/src/client/assets/scss/base/general.css +77 -0
- package/src/client/assets/scss/base/navs.css +17 -0
- package/src/client/assets/scss/base/typography.css +46 -0
- package/src/client/assets/scss/main.scss +5 -0
- package/src/client/components/highlight/Highlight.js +12 -0
- package/src/client/components/highlight/highlight.css +249 -0
- package/src/client/components/sidebar/Sidebar.svelte +310 -0
- package/src/client/components/sidebar/SidebarNav.svelte +135 -0
- package/src/client/components/sidebar/SidebarNavLinks.svelte +86 -0
- package/src/client/components/splitpanes/HorizontalSplitPane.svelte +85 -0
- package/src/client/components/splitpanes/VerticalSplitPane.svelte +42 -0
- package/src/client/components/stage/Stage.svelte +172 -0
- package/src/client/components/stage/panel/PanelCode.svelte +31 -0
- package/src/client/components/stage/panel/PanelComponent.svelte +161 -0
- package/src/client/components/stage/panel/PanelContent.svelte +5 -0
- package/src/client/components/stage/panel/PanelDescription.svelte +26 -0
- package/src/client/components/stage/panel/PanelStoriesNav.svelte +67 -0
- package/src/client/components/stage/panel/markdown.css +679 -0
- package/src/client/components/topbar/Topbar.svelte +526 -0
- package/src/client/gardenapp.js +12 -0
- package/src/client/gardenframe.js +11 -0
- package/src/client/index.js +2 -0
- package/src/client/logic/navTree.js +146 -0
- package/src/client/logic/routing.js +50 -0
- package/src/client/logic/stage.js +89 -0
- package/src/client/router.js +82 -0
- package/src/codegenerator/base_generator.js +294 -0
- package/src/codegenerator/copy_base_classes.js +67 -0
- package/src/codegenerator/das_file_finder.js +66 -0
- package/src/codegenerator/shapes/Hellogarden.svelte +63 -0
- package/src/codegenerator/shapes/assets/favicon.svg +1 -0
- package/src/codegenerator/shapes/frame.html +22 -0
- package/src/codegenerator/shapes/gardenframe/index.html +22 -0
- package/src/codegenerator/shapes/index.html +14 -0
- package/src/codegenerator/shapes/lib/gardenapp.js +12 -0
- package/src/codegenerator/shapes/screenshottests/disable_animations.css +12 -0
- package/src/codegenerator/shapes/screenshottests/screenshottest.base.js +48 -0
- package/src/codegenerator/watch.js +36 -0
- package/src/codegenerator/watchcl.js +34 -0
- package/src/config.js +19 -0
- package/src/renderer/SvelteRenderer.js +16 -0
- package/src/renderer/SvelteRenderer.svelte +79 -0
- package/src/renderer/VueRenderer.js +20 -0
- package/src/renderer/VueRenderer.vue +20 -0
- package/src/renderer/state.js +10 -0
- package/src/server.js +26 -0
- package/svelte.config.js +8 -0
- package/vite.config.js +26 -0
package/.babelrc
ADDED
package/.eslintrc.yml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
env:
|
|
2
|
+
browser: true
|
|
3
|
+
commonjs: false
|
|
4
|
+
es6: true
|
|
5
|
+
node: true
|
|
6
|
+
mocha: true
|
|
7
|
+
extends: ['eslint:recommended', 'plugin:svelte/recommended', 'prettier']
|
|
8
|
+
globals:
|
|
9
|
+
Atomics: readonly
|
|
10
|
+
SharedArrayBuffer: readonly
|
|
11
|
+
globalThis: readonly
|
|
12
|
+
expect: readonly
|
|
13
|
+
beforeAll: readonly
|
|
14
|
+
afterAll: readonly
|
|
15
|
+
parserOptions:
|
|
16
|
+
ecmaVersion: latest
|
|
17
|
+
sourceType: module
|
|
18
|
+
rules:
|
|
19
|
+
no-console: 0
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
+
|
|
4
|
+
name: Node.js Package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [created]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v3
|
|
15
|
+
- uses: actions/setup-node@v3
|
|
16
|
+
with:
|
|
17
|
+
node-version: 18
|
|
18
|
+
- run: npm ci
|
|
19
|
+
|
|
20
|
+
publish-npm:
|
|
21
|
+
needs: build
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v3
|
|
25
|
+
- uses: actions/setup-node@v3
|
|
26
|
+
with:
|
|
27
|
+
node-version: 18
|
|
28
|
+
registry-url: https://registry.npmjs.org/
|
|
29
|
+
- run: npm ci
|
|
30
|
+
- run: npm publish
|
|
31
|
+
env:
|
|
32
|
+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
package/.prettierrc
ADDED
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-present, Robin Danzinger, Martin Farkas - Rabbit Development
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Component library explorer
|
|
2
|
+
|
|
3
|
+
Gardenjs is a lightweight UI component explorer for JavaScript front-end libraries that makes it easier to develop, test and document UI components and pages. Svelte, Vue and React are currently supported out of the box. Other libraries can also be easily connected to Garden.
|
|
4
|
+
|
|
5
|
+
## Why Garden?
|
|
6
|
+
|
|
7
|
+
- Gardenjs is significantly faster than comparable tools such as Storybook.
|
|
8
|
+
- Gardenjs is multi-framework compatible.
|
|
9
|
+
- Gardenjs has many useful features without being complex and bloated.
|
|
10
|
+
- Gardenjs simply looks good :)
|
|
11
|
+
|
|
12
|
+
## Getting Started
|
|
13
|
+
|
|
14
|
+
Please follow the documentation at [gardenjs.org](https://www.gardenjs.org)
|
|
15
|
+
|
|
16
|
+
Happy Gardening :)
|
|
17
|
+
|
|
18
|
+
## Sponsors
|
|
19
|
+
|
|
20
|
+
Gardenjs is an open source project and is licensed under the MIT license. Become a sponsor to give us more scope for further development. We are grateful for this and will publish your logo and website URL in our README on Github and on our website/documentation.
|
|
21
|
+
|
|
22
|
+
## Contributing
|
|
23
|
+
|
|
24
|
+
GardenJS was developed and is contributed by [Rabbit Development](https://www.rabbitdevelopment.de). We look forward to your feedback, please report any bugs. We also welcome contributions and are happy about sponsoring.
|
|
25
|
+
|
|
26
|
+
## License
|
|
27
|
+
|
|
28
|
+
[MIT](https://opensource.org/license/mit/)
|
|
29
|
+
|
|
30
|
+
Copyright (C) 2020 - present by Robin Danzinger & Martin Farkas from [Rabbit Development](https://www.rabbitdevelopment.de).
|
|
31
|
+
|
|
32
|
+
## Todo´s
|
|
33
|
+
|
|
34
|
+
### v1.0
|
|
35
|
+
|
|
36
|
+
- [task] Gardenjs npm modul. (yarn?)
|
|
37
|
+
- [task] Add renderer plugins for svelte, vue and react. npm modules (@gardenjs/plugin-xyz).
|
|
38
|
+
- [task] Add hooks before, after.
|
|
39
|
+
- [task] Make Gardenjs compatible with React.
|
|
40
|
+
- [task] Public Gardenjs docs.
|
|
41
|
+
- [task] Public Gardenjs demo of Gardenjs docs.
|
|
42
|
+
- [refactor] Move logic to own file / use stores?. Handle user interaction.
|
|
43
|
+
- [task] Set Gardenjs repository public.
|
|
44
|
+
- [task] Set repository of Gardenjs docs public.
|
|
45
|
+
- [task] Public Rabbit dev website.
|
|
46
|
+
|
|
47
|
+
### v1.1
|
|
48
|
+
|
|
49
|
+
- [feature] Evaluation of "Make Storybook stories compatible with Garden". If relatively easy possible then development. Otherwise prioritize other tasks/features depending on complexity.
|
|
50
|
+
- [task] Add tests (or v1.1 ?).
|
|
51
|
+
|
|
52
|
+
### v1.x
|
|
53
|
+
|
|
54
|
+
- [task] Add [line numbers plugin](https://github.com/wcoder/highlightjs-line-numbers.js) to highlightjs.
|
|
55
|
+
- [task] Sidebarnav is closed by default on narrow display devices.
|
|
56
|
+
- [task] Make setting of default mode possible via garden.config.js.
|
|
57
|
+
- [task] If full mode is active, switching to portrait mode is deactivated.
|
|
58
|
+
- [task] Store selection in panel nav for refresh or if another component is selected.
|
|
59
|
+
- [task] Store selection of stage for refresh or if another component is selected.
|
|
60
|
+
- [task] Make Gardenjs docs link optional via garden.config.js.
|
|
61
|
+
- [task] Show custom favicon.svg configured in garden.config.js.
|
|
62
|
+
- [feature] Screenshot tests:
|
|
63
|
+
- Docker image oder alternativ for screenshot test.
|
|
64
|
+
- Automatic create test file & and folder (like init garden).
|
|
65
|
+
- Settings.
|
|
66
|
+
- [feature] Set width and height of stage by size input.
|
|
67
|
+
- [feature] Add zoom button 100% and if zoomed show size in % with switch possibility.
|
|
68
|
+
- [feature] Vertical dragbar to drag stage horizontical to show rwd behaviour. Already integrated staticly, just needs to be commented out in topbar.svelte: Show 'px' width/height of stage next to rwd-navi.
|
|
69
|
+
- [task] Switch from md to mdx.
|
|
70
|
+
- [feature] Set stagesize values for "mobile, tablet, desktop" inside garden.config.js. Option: Set list of custom values like iPhone 15, iPad, Samsung etc. in garden.config and show dropdown in Gardenjs instead of icons.
|
|
71
|
+
- [task] Integrate Svelte A11y features.
|
|
72
|
+
- [feature] Build kickstarter "carrots". Define components for carrots.
|
|
73
|
+
- [feature] Bookmarks. (siehe ReactCosmos)
|
|
74
|
+
- [feature] Measure.
|
|
75
|
+
|
|
76
|
+
<br><br><br><p align="center"><img src="src/client/assets/icons/logo.svg"></p>
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { init } from '../src/codegenerator/watchcl.js'
|
|
4
|
+
import { input, confirm } from '@inquirer/prompts'
|
|
5
|
+
import checkbox from '@inquirer/checkbox'
|
|
6
|
+
import { createServer } from '../src/server.js'
|
|
7
|
+
import fs from 'node:fs'
|
|
8
|
+
import path, { dirname } from 'path'
|
|
9
|
+
import { fileURLToPath } from 'url'
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
11
|
+
const __dirname = dirname(__filename)
|
|
12
|
+
const exampleSourceFolder = path.resolve(__dirname, '../examples') + '/'
|
|
13
|
+
|
|
14
|
+
if (fs.existsSync('./garden.config.js')) {
|
|
15
|
+
initAndCreateServer()
|
|
16
|
+
} else {
|
|
17
|
+
runSetupScript()
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async function initAndCreateServer() {
|
|
21
|
+
await init()
|
|
22
|
+
await createServer()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async function runSetupScript() {
|
|
26
|
+
console.clear()
|
|
27
|
+
console.log('Welcome to the garden setup process')
|
|
28
|
+
console.log('')
|
|
29
|
+
separator()
|
|
30
|
+
console.log('')
|
|
31
|
+
|
|
32
|
+
const title = await input({ message: 'Enter your project title:' })
|
|
33
|
+
|
|
34
|
+
const libraries = await checkbox({
|
|
35
|
+
message: 'UI Library',
|
|
36
|
+
choices: [
|
|
37
|
+
{ name: 'Svelte', value: 'Svelte' },
|
|
38
|
+
{ name: 'Vue', value: 'Vue' },
|
|
39
|
+
{ name: 'React', value: 'React' },
|
|
40
|
+
],
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const componentFolder = await input({
|
|
44
|
+
message: 'Enter your component source folder:',
|
|
45
|
+
default: 'src/',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const shallCreateExample = await confirm({
|
|
49
|
+
message: 'Should garden create an example component?',
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
separator()
|
|
53
|
+
console.log('')
|
|
54
|
+
console.log('Creating garden config file...:')
|
|
55
|
+
console.log('')
|
|
56
|
+
|
|
57
|
+
createConfigFile({ title, libraries, componentFolder })
|
|
58
|
+
if (shallCreateExample) {
|
|
59
|
+
createExample({ libraries, componentFolder })
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
separator()
|
|
63
|
+
console.log('')
|
|
64
|
+
console.log('Done. Edit garden.config.js file according to your needs.')
|
|
65
|
+
console.log('Happy gardening!')
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function separator() {
|
|
69
|
+
console.log('===================================')
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function createConfigFile({ title, componentFolder, libraries }) {
|
|
73
|
+
const importStmts = libraries
|
|
74
|
+
.map((lib) => {
|
|
75
|
+
return `import ${lib}RendererBuilder from "garden/${lib.toLowerCase()}"`
|
|
76
|
+
})
|
|
77
|
+
.join('\n')
|
|
78
|
+
const renderer = libraries
|
|
79
|
+
.map((lib) => {
|
|
80
|
+
return `${lib.toLowerCase()}: ${lib}RendererBuilder,`
|
|
81
|
+
})
|
|
82
|
+
.join('\n ')
|
|
83
|
+
|
|
84
|
+
const watchLibFiles = libraries
|
|
85
|
+
.map((lib) => {
|
|
86
|
+
return `".${lib.toLowerCase()}"`
|
|
87
|
+
})
|
|
88
|
+
.join(', ')
|
|
89
|
+
|
|
90
|
+
const content = `
|
|
91
|
+
${importStmts}
|
|
92
|
+
|
|
93
|
+
export default {
|
|
94
|
+
// Define the server port:
|
|
95
|
+
serverport: 3010,
|
|
96
|
+
|
|
97
|
+
// Stop auto opening Gardenjs on start:
|
|
98
|
+
// "no_open_browser": true,
|
|
99
|
+
|
|
100
|
+
// This title is displayed above the navigation:
|
|
101
|
+
project_title: "${title}",
|
|
102
|
+
|
|
103
|
+
// Here you can set a path to your own start page:
|
|
104
|
+
// "welcome_page": "/src/custom_welcome_page.${libraries[0]}",
|
|
105
|
+
|
|
106
|
+
// vite config file:
|
|
107
|
+
// vite_config: "./garden.vite.config.js",
|
|
108
|
+
|
|
109
|
+
// Each entry is output with its subpages in the page tree:
|
|
110
|
+
structure: {
|
|
111
|
+
components: "/${componentFolder}",
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
watch: {
|
|
115
|
+
directories: ["./${componentFolder}"],
|
|
116
|
+
include: [${watchLibFiles}, ".das.json", ".scss", ".css", ".less", ".js", ".ts"],
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
renderer: {
|
|
120
|
+
${renderer}
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
// Add global style files needed for your project:
|
|
124
|
+
// "additional_style_files": [
|
|
125
|
+
// 'src/assets/scss/main.scss'
|
|
126
|
+
// ],
|
|
127
|
+
|
|
128
|
+
// Edit or disable "Themes" depending on whether your app uses themes.
|
|
129
|
+
// According to your requirements, you may also need to adjust the
|
|
130
|
+
// "onThemeChange" function below accordingly.
|
|
131
|
+
// "themes": [
|
|
132
|
+
// {name: 'default', stageBg: 'white'},
|
|
133
|
+
// {name: 'dark', stageBg: '#101010'}, // manually set default active theme on start {active: true, name: 'dark', stageBg: '#101010'},
|
|
134
|
+
// {name: 'light', stageBg: '#eee'}
|
|
135
|
+
// ],
|
|
136
|
+
// "themeHandler": onThemeChange
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
//// Edit or disable the function "onThemeChange" according to your project (see also "themes" above):
|
|
140
|
+
//function onThemeChange(theme) {
|
|
141
|
+
// if (theme === 'default') {
|
|
142
|
+
// delete document.body.dataset.theme
|
|
143
|
+
// } else {
|
|
144
|
+
// document.body.dataset.theme = theme
|
|
145
|
+
// }
|
|
146
|
+
//}
|
|
147
|
+
`
|
|
148
|
+
fs.writeFileSync('garden.config.js', content)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function createExample({ libraries, componentFolder }) {
|
|
152
|
+
for (const library of libraries) {
|
|
153
|
+
console.log('Create example for library', library)
|
|
154
|
+
copyExampleFiles(library.toLowerCase(), componentFolder)
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function copyExampleFiles(library, componentFolder) {
|
|
159
|
+
fs.mkdirSync(`${componentFolder}/garden_example/`, { recursive: true })
|
|
160
|
+
fs.copyFileSync(
|
|
161
|
+
`${exampleSourceFolder}garden_button.${library}.das.js`,
|
|
162
|
+
`${componentFolder}/garden_example/garden_button.${library}.das.js`
|
|
163
|
+
)
|
|
164
|
+
fs.copyFileSync(
|
|
165
|
+
`${exampleSourceFolder}garden_button.${library}`,
|
|
166
|
+
`${componentFolder}/garden_example/garden_button.${library}`
|
|
167
|
+
)
|
|
168
|
+
fs.copyFileSync(
|
|
169
|
+
`${exampleSourceFolder}garden_button.${library}.md`,
|
|
170
|
+
`${componentFolder}/garden_example/garden_button.${library}.md`
|
|
171
|
+
)
|
|
172
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
name: 'GardenSvelteButton',
|
|
3
|
+
description: './garden_button.svelte.md',
|
|
4
|
+
file: './garden_button.svelte',
|
|
5
|
+
in: [{ name: 'name', type: 'String' }],
|
|
6
|
+
out: [{ name: 'click', type: 'String' }],
|
|
7
|
+
examples: [
|
|
8
|
+
{
|
|
9
|
+
story: 'with text',
|
|
10
|
+
input: {
|
|
11
|
+
name: 'GardenButton',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
{ story: 'no text', input: {} },
|
|
15
|
+
],
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
name: 'GardenVueButton',
|
|
3
|
+
file: './garden_button.vue',
|
|
4
|
+
description: './garden_button.vue.md',
|
|
5
|
+
in: [{ name: 'name', type: 'String' }],
|
|
6
|
+
out: [{ name: 'click', type: 'String' }],
|
|
7
|
+
examples: [
|
|
8
|
+
{
|
|
9
|
+
story: 'with text',
|
|
10
|
+
input: {
|
|
11
|
+
name: 'GardenButton',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
{ story: 'no text', input: { name: '' } },
|
|
15
|
+
],
|
|
16
|
+
}
|
package/frame.html
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" style="overflow: hidden">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" href="/assets/favicon.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Garden Component Library by Rabbit Development</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body
|
|
10
|
+
style="
|
|
11
|
+
margin: 0;
|
|
12
|
+
height: 100%;
|
|
13
|
+
width: 100%;
|
|
14
|
+
top: 0px;
|
|
15
|
+
position: absolute;
|
|
16
|
+
overflow: auto;
|
|
17
|
+
"
|
|
18
|
+
>
|
|
19
|
+
<script type="module" src="./src/client/gardenframe.js"></script>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
package/index.html
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" href="/assets/favicon.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Garden UI Component Explorer</title>
|
|
8
|
+
</head>
|
|
9
|
+
|
|
10
|
+
<body>
|
|
11
|
+
<div id="app"></div>
|
|
12
|
+
<script type="module" src="./src/client/gardenapp.js"></script>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { marked } from 'marked'
|
package/jsconfig.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"moduleResolution": "bundler",
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
/**
|
|
7
|
+
* svelte-preprocess cannot figure out whether you have
|
|
8
|
+
* a value or a type, so tell TypeScript to enforce using
|
|
9
|
+
* `import type` instead of `import` for Types.
|
|
10
|
+
*/
|
|
11
|
+
"verbatimModuleSyntax": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
/**
|
|
15
|
+
* To have warnings / errors of the Svelte compiler at the
|
|
16
|
+
* correct position, enable source maps by default.
|
|
17
|
+
*/
|
|
18
|
+
"sourceMap": true,
|
|
19
|
+
"esModuleInterop": true,
|
|
20
|
+
"skipLibCheck": true,
|
|
21
|
+
/**
|
|
22
|
+
* Typecheck JS in `.svelte` and `.js` files by default.
|
|
23
|
+
* Disable this if you'd like to use dynamic types.
|
|
24
|
+
*/
|
|
25
|
+
"checkJs": true
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* Use global.d.ts instead of compilerOptions.types
|
|
29
|
+
* to avoid limiting type declarations.
|
|
30
|
+
*/
|
|
31
|
+
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
|
|
32
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gardenjs",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "A lightweight UI component explorer for JavaScript front-end libraries",
|
|
5
|
+
"repository": "https://github.com/gardenjs/gardenjs",
|
|
6
|
+
"homepage": "https://github.com/gardenjs/gardenjs/blob/main/README.md",
|
|
7
|
+
"main": "index.js",
|
|
8
|
+
"svelte": "src/client/index.js",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"author": "Robin Danzinger, Martin Farkas @ Rabbit Development",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"bin": {
|
|
13
|
+
"garden": "bin/servegarden.js"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./src/client/index.js",
|
|
17
|
+
"./init": "./src/codegenerator/watchcl.js",
|
|
18
|
+
"./GardenFrame": "./src/client/GardenFrame.svelte",
|
|
19
|
+
"./svelte": "./src/renderer/SvelteRenderer.js",
|
|
20
|
+
"./vue": "./src/renderer/VueRenderer.js",
|
|
21
|
+
"./main.scss": "./src/client/assets/scss/main.scss"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"prepare": "husky install",
|
|
25
|
+
"build": "vite build",
|
|
26
|
+
"dev": "vite",
|
|
27
|
+
"preview": "vite preview",
|
|
28
|
+
"format": "prettier --write --plugin prettier-plugin-svelte .",
|
|
29
|
+
"lint": "eslint src/."
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@sveltejs/vite-plugin-svelte": "2.4.5",
|
|
33
|
+
"eslint": "8.44.0",
|
|
34
|
+
"eslint-config-prettier": "9.0.0",
|
|
35
|
+
"eslint-plugin-svelte": "2.32.2",
|
|
36
|
+
"husky": "8.0.3",
|
|
37
|
+
"lint-staged": "14.0.1",
|
|
38
|
+
"node-watch": "0.7.3",
|
|
39
|
+
"prettier": "3.0.3",
|
|
40
|
+
"prettier-plugin-svelte": "3.0.3",
|
|
41
|
+
"sass": "1.69.0",
|
|
42
|
+
"svelte": "4.2.0",
|
|
43
|
+
"vite": "4.4.9"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@inquirer/checkbox": "1.5.0",
|
|
47
|
+
"@inquirer/prompts": "3.3.0",
|
|
48
|
+
"highlight.js": "11.7.0",
|
|
49
|
+
"marked": "4.3.0",
|
|
50
|
+
"open": "8.4.0"
|
|
51
|
+
},
|
|
52
|
+
"lint-staged": {
|
|
53
|
+
"**/*": "prettier --write --ignore-unknown"
|
|
54
|
+
}
|
|
55
|
+
}
|