@mixd-id/web-scaffold 0.1.2301231330 → 0.1.2301231332
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/package.json +1 -2
- package/.env +0 -1
- package/index.html +0 -22
- package/postcss.config.js +0 -6
- package/server.js +0 -122
- package/src/UI.vue +0 -864
- package/src/api/feed.js +0 -29
- package/src/api/inbox/index.js +0 -33
- package/src/api/inbox/message/comment.js +0 -33
- package/src/api/inbox/message/index.js +0 -34
- package/src/api/index.js +0 -7
- package/src/pages/Home.vue +0 -3
- package/src/pages/Inbox.vue +0 -129
- package/src/pages/Message.vue +0 -258
- package/src/pages/Playground.vue +0 -237
- package/src/pages/Test.vue +0 -455
- package/src/pages/playground/Ahref.vue +0 -73
- package/src/pages/playground/Alert.vue +0 -80
- package/src/pages/playground/Button.vue +0 -77
- package/src/pages/playground/Carousel.vue +0 -67
- package/src/pages/playground/ContextMenu.vue +0 -77
- package/src/pages/playground/Datepicker.vue +0 -69
- package/src/pages/playground/Dropdown.vue +0 -71
- package/src/pages/playground/Image.vue +0 -67
- package/src/pages/playground/ListItem.vue +0 -109
- package/src/pages/playground/Modal.vue +0 -118
- package/src/pages/playground/Slider.vue +0 -68
- package/src/pages/playground/Switch.vue +0 -57
- package/src/pages/playground/Textarea.vue +0 -78
- package/src/pages/playground/Textbox.vue +0 -80
- package/src/pages/playground/Toast.vue +0 -80
- package/src/pages/playground/components/Preview.vue +0 -15
- package/src/pages/playground/components/PropertyTable.vue +0 -38
- package/src/pages/playground/components/SourceCode.vue +0 -71
- package/src/stores/components.js +0 -193
- package/tailwind.config.js +0 -11
- package/vite.config.js +0 -31
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mixd-id/web-scaffold",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2301231332",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite serve",
|
|
7
7
|
"build": "vite build",
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"exports": {
|
|
12
12
|
".": "./src/index.js",
|
|
13
13
|
"./themes/default": "./src/themes/default/index.js",
|
|
14
|
-
"./UI.vue": "./src/UI.vue",
|
|
15
14
|
"./helpers": {
|
|
16
15
|
"require": "./src/utils/helpers.js",
|
|
17
16
|
"import": "./src/utils/helpers.mjs"
|
package/.env
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
NODE_ENV=local
|
package/index.html
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>Untitled</title>
|
|
7
|
-
<script id="aHlj"><!--serialize-pinia--></script>
|
|
8
|
-
<script id="aHlk">window.__hydration = JSON.parse(document.getElementById('aHlj').innerText)</script>
|
|
9
|
-
<script>
|
|
10
|
-
document.querySelector('html').setAttribute('data-theme', localStorage.getItem('theme') ?? '')
|
|
11
|
-
</script>
|
|
12
|
-
<!--preload-links-->
|
|
13
|
-
</head>
|
|
14
|
-
<body>
|
|
15
|
-
<div><!--app-html--></div>
|
|
16
|
-
<div class="bW9k"><!--modal-overlay--></div>
|
|
17
|
-
<div class="Y29u"><!--context-overlay--></div>
|
|
18
|
-
<div class="YWxl"><!--alert-overlay--></div>
|
|
19
|
-
<div class="dG9h"><!--toast-overlay--></div>
|
|
20
|
-
<script type="module" src="/src/entry-client.js"></script>
|
|
21
|
-
</body>
|
|
22
|
-
</html>
|
package/postcss.config.js
DELETED
package/server.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
const fs = require('fs')
|
|
3
|
-
const path = require('path')
|
|
4
|
-
const express = require('express')
|
|
5
|
-
const cors = require('cors')
|
|
6
|
-
const cookieParser = require('cookie-parser')
|
|
7
|
-
const apiModules = require("./src/api")
|
|
8
|
-
|
|
9
|
-
const isTest = process.env.NODE_ENV === 'test' || !!process.env.VITE_TEST_BUILD
|
|
10
|
-
const isProd = process.argv.includes('--prod')
|
|
11
|
-
|
|
12
|
-
const root = process.cwd()
|
|
13
|
-
|
|
14
|
-
const apiMiddleware = async(req, res, next) => {
|
|
15
|
-
|
|
16
|
-
if(req.originalUrl.indexOf('/api') >= 0){
|
|
17
|
-
|
|
18
|
-
const module = req.originalUrl.replace('/api', '').split('?')[0]
|
|
19
|
-
const method = req.method === 'POST' ? 'store' : 'index'
|
|
20
|
-
|
|
21
|
-
if(apiModules[module] && apiModules[module][method]){
|
|
22
|
-
const json = await apiModules[module][method](req, res)
|
|
23
|
-
if(json) res.send(json)
|
|
24
|
-
}
|
|
25
|
-
else{
|
|
26
|
-
console.warn(`API url not handled: ${req.originalUrl}, ${module}@${method}`)
|
|
27
|
-
}
|
|
28
|
-
res.end()
|
|
29
|
-
}
|
|
30
|
-
else{
|
|
31
|
-
next()
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async function createServer() {
|
|
36
|
-
const resolve = (p) => path.resolve(__dirname, p)
|
|
37
|
-
|
|
38
|
-
const indexProd = ''
|
|
39
|
-
|
|
40
|
-
const manifest = {}
|
|
41
|
-
|
|
42
|
-
const app = express()
|
|
43
|
-
app.disable('x-powered-by')
|
|
44
|
-
app.use(cookieParser())
|
|
45
|
-
|
|
46
|
-
app.use(apiMiddleware)
|
|
47
|
-
app.use(express.json())
|
|
48
|
-
app.use(cors())
|
|
49
|
-
|
|
50
|
-
const http = require('http').createServer(app)
|
|
51
|
-
|
|
52
|
-
const vite = await require('vite').createServer({
|
|
53
|
-
root,
|
|
54
|
-
logLevel: isTest ? 'error' : 'info',
|
|
55
|
-
server: {
|
|
56
|
-
middlewareMode: 'ssr',
|
|
57
|
-
hmr: {
|
|
58
|
-
port: 24677
|
|
59
|
-
},
|
|
60
|
-
watch: {
|
|
61
|
-
usePolling: true,
|
|
62
|
-
interval: 100
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
|
-
app.use(vite.middlewares)
|
|
67
|
-
|
|
68
|
-
app.use('*', async (req, res, next) => {
|
|
69
|
-
|
|
70
|
-
if(req.originalUrl.indexOf('socket.io') >= 0){
|
|
71
|
-
return next()
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
try {
|
|
75
|
-
const url = req.originalUrl
|
|
76
|
-
|
|
77
|
-
let template, render
|
|
78
|
-
template = fs.readFileSync(resolve('index.html'), 'utf-8')
|
|
79
|
-
template = await vite.transformIndexHtml(url, template)
|
|
80
|
-
render = (await vite.ssrLoadModule('/src/entry-server.js')).render
|
|
81
|
-
|
|
82
|
-
const [appHtml, preloadLinks, serializePinia, redirect, cookie, modalOverlay, alertOverlay, contextOverlay ] = await render(req, manifest)
|
|
83
|
-
|
|
84
|
-
if(cookie.length > 0){
|
|
85
|
-
for(var i in cookie){
|
|
86
|
-
res.cookie(cookie[i][0], cookie[i][1])
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if(typeof redirect !== 'undefined'){
|
|
91
|
-
res.redirect(redirect)
|
|
92
|
-
}
|
|
93
|
-
else{
|
|
94
|
-
const html = template
|
|
95
|
-
.replace(`<!--preload-links-->`, preloadLinks)
|
|
96
|
-
.replace(`<!--app-html-->`, appHtml)
|
|
97
|
-
.replace(`<!--serialize-pinia-->`, serializePinia)
|
|
98
|
-
.replace(`<!--context-overlay-->`, contextOverlay)
|
|
99
|
-
.replace(`<!--modal-overlay-->`, modalOverlay)
|
|
100
|
-
.replace(`<!--alert-overlay-->`, alertOverlay)
|
|
101
|
-
|
|
102
|
-
res.status(200).set({ 'Content-Type': 'text/html' }).end(html)
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
catch (e) {
|
|
106
|
-
vite && vite.ssrFixStacktrace(e)
|
|
107
|
-
console.log(e.stack)
|
|
108
|
-
res.status(500).end(e.stack)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
return { http, app, vite }
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
createServer().then(({ http }) =>{
|
|
117
|
-
|
|
118
|
-
http.listen(3002, () => {
|
|
119
|
-
console.log('Listening on port ' + 3002)
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
})
|