@design-edito/cli 0.0.73 → 0.0.74
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/cli/assets/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.74
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build:src": "npx esbuild --bundle src/
|
|
7
|
+
"build:src": "npx esbuild --bundle src/index.ts --outdir=dist --sourcemap --platform=node --format=esm --external:debug --external:express --external:cookie-parser --external:morgan",
|
|
8
8
|
"watch:src": "npm run build:src && npx chokidar 'src/**/*' -c 'npm run build:src'",
|
|
9
|
-
"serve": "npx nodemon ./dist/
|
|
9
|
+
"serve": "npx nodemon ./dist/index.js",
|
|
10
10
|
"start:nowatch": "npm run build:src && npm run serve",
|
|
11
11
|
"start": "npx concurrently -n 'watch:src ,serve ' 'npm run watch:src' 'npm run serve'"
|
|
12
12
|
},
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import http from 'node:http'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import cookieParser from 'cookie-parser'
|
|
6
|
+
import logger from 'morgan'
|
|
2
7
|
import debugModule from 'debug'
|
|
3
|
-
import
|
|
8
|
+
import indexRouter from './routes/index.js'
|
|
4
9
|
|
|
5
10
|
const debug = debugModule('<<@mxfb/cli----replace-with-name>>:server')
|
|
6
11
|
const port = normalizePort(process.env.PORT ?? '3000')
|
|
7
|
-
|
|
12
|
+
const app = express()
|
|
13
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
14
|
+
|
|
15
|
+
app.use(logger('dev'))
|
|
16
|
+
app.use(express.json())
|
|
17
|
+
app.use(express.urlencoded({ extended: false }))
|
|
18
|
+
app.use(cookieParser())
|
|
19
|
+
app.use(express.static(path.join(__dirname, 'public')))
|
|
20
|
+
app.use('/', indexRouter)
|
|
8
21
|
app.set('port', port)
|
|
9
22
|
|
|
10
23
|
const server = http.createServer(app)
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import path from 'node:path'
|
|
2
|
-
import { fileURLToPath } from 'node:url'
|
|
3
|
-
import express from 'express'
|
|
4
|
-
import cookieParser from 'cookie-parser'
|
|
5
|
-
import logger from 'morgan'
|
|
6
|
-
import indexRouter from './routes/index.js'
|
|
7
|
-
|
|
8
|
-
const app = express()
|
|
9
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
10
|
-
|
|
11
|
-
app.use(logger('dev'))
|
|
12
|
-
app.use(express.json())
|
|
13
|
-
app.use(express.urlencoded({ extended: false }))
|
|
14
|
-
app.use(cookieParser())
|
|
15
|
-
app.use(express.static(path.join(__dirname, 'public')))
|
|
16
|
-
app.use('/', indexRouter)
|
|
17
|
-
|
|
18
|
-
export default app
|