@stacksjs/server 0.65.0 → 0.67.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/dist/index.js +1 -4
- package/package.json +7 -9
- package/dist/index.js.map +0 -10
- package/src/config.ts +0 -85
- package/src/index.ts +0 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ports as t}from"@stacksjs/config";function r(o){
|
|
3
|
-
|
|
4
|
-
//# debugId=9727226D678B531364756E2164756E21
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
import{ports as t}from"@stacksjs/config";function r(o){let s={frontend:{host:"localhost",port:t.frontend},backend:{host:"localhost",port:t.backend},api:{host:"localhost",port:t.api},admin:{host:"localhost",port:t.admin},library:{host:"localhost",port:t.library},desktop:{host:"localhost",port:t.desktop},docs:{host:"localhost",port:t.docs},email:{host:"localhost",port:t.email},inspect:{host:"localhost",port:t.inspect},"system-tray":{host:"localhost",port:t.systemTray},database:{host:"localhost",port:t.database}};if(o.type&&["frontend","api","library","desktop","docs","example","dashboard","system-tray","database"].includes(o.type))return{host:s[o.type].host,port:s[o.type].port,open:!0};return{host:o.host||"stacks.localhost",port:o.port||3000,open:o.open||!1}}export{r as server};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.67.0",
|
|
5
5
|
"description": "Local development and production-ready.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
|
|
@@ -27,30 +27,28 @@
|
|
|
27
27
|
],
|
|
28
28
|
"exports": {
|
|
29
29
|
".": {
|
|
30
|
-
"bun": "./src/index.ts",
|
|
31
30
|
"import": "./dist/index.js"
|
|
32
31
|
},
|
|
33
32
|
"./*": {
|
|
34
|
-
"bun": "./src/*",
|
|
35
33
|
"import": "./dist/*"
|
|
36
34
|
}
|
|
37
35
|
},
|
|
38
36
|
"module": "dist/index.js",
|
|
39
37
|
"types": "dist/index.d.ts",
|
|
40
|
-
"files": ["README.md", "dist"
|
|
38
|
+
"files": ["README.md", "dist"],
|
|
41
39
|
"scripts": {
|
|
42
40
|
"build": "bun build.ts",
|
|
43
41
|
"typecheck": "bun tsc --noEmit",
|
|
44
42
|
"prepublishOnly": "bun run build"
|
|
45
43
|
},
|
|
46
44
|
"dependencies": {
|
|
47
|
-
"@stacksjs/config": "0.
|
|
48
|
-
"@stacksjs/path": "0.
|
|
49
|
-
"@stacksjs/router": "0.
|
|
50
|
-
"@stacksjs/validation": "0.
|
|
45
|
+
"@stacksjs/config": "0.67.0",
|
|
46
|
+
"@stacksjs/path": "0.67.0",
|
|
47
|
+
"@stacksjs/router": "0.67.0",
|
|
48
|
+
"@stacksjs/validation": "0.67.0"
|
|
51
49
|
},
|
|
52
50
|
"devDependencies": {
|
|
53
|
-
"@stacksjs/development": "0.
|
|
51
|
+
"@stacksjs/development": "0.67.0",
|
|
54
52
|
"vite": "^5.4.8"
|
|
55
53
|
}
|
|
56
54
|
}
|
package/dist/index.js.map
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/config.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import type { ServerOptions } from '@stacksjs/types'\nimport { ports } from '@stacksjs/config'\n\nexport function config(options: ServerOptions): {\n host: string\n port: number\n open: boolean\n} {\n const serversMap = {\n 'frontend': {\n host: 'localhost',\n port: ports.frontend,\n },\n\n 'backend': {\n host: 'localhost',\n port: ports.backend,\n },\n\n 'api': {\n host: 'localhost',\n port: ports.api,\n },\n\n 'admin': {\n host: 'localhost',\n port: ports.admin,\n },\n\n 'library': {\n // component library\n host: 'localhost',\n port: ports.library,\n },\n\n 'desktop': {\n host: 'localhost',\n port: ports.desktop,\n },\n\n 'docs': {\n host: 'localhost',\n port: ports.docs,\n },\n\n 'email': {\n host: 'localhost',\n port: ports.email,\n },\n\n 'inspect': {\n host: 'localhost',\n port: ports.inspect,\n },\n\n 'system-tray': {\n host: 'localhost',\n port: ports.systemTray,\n },\n\n 'database': {\n host: 'localhost',\n port: ports.database,\n },\n }\n\n if (\n options.type\n && ['frontend', 'api', 'library', 'desktop', 'docs', 'example', 'dashboard', 'system-tray', 'database'].includes(\n options.type,\n )\n ) {\n return {\n host: serversMap[options.type].host,\n port: serversMap[options.type].port,\n open: true,\n }\n }\n\n return {\n host: options.host || 'stacks.localhost',\n port: options.port || 3000,\n open: options.open || false,\n }\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";AACA,gBAAS,yBAEF,SAAS,CAAM,CAAC,EAIrB,CACA,MAAM,EAAa,CACjB,SAAY,CACV,KAAM,YACN,KAAM,EAAM,QACd,EAEA,QAAW,CACT,KAAM,YACN,KAAM,EAAM,OACd,EAEA,IAAO,CACL,KAAM,YACN,KAAM,EAAM,GACd,EAEA,MAAS,CACP,KAAM,YACN,KAAM,EAAM,KACd,EAEA,QAAW,CAET,KAAM,YACN,KAAM,EAAM,OACd,EAEA,QAAW,CACT,KAAM,YACN,KAAM,EAAM,OACd,EAEA,KAAQ,CACN,KAAM,YACN,KAAM,EAAM,IACd,EAEA,MAAS,CACP,KAAM,YACN,KAAM,EAAM,KACd,EAEA,QAAW,CACT,KAAM,YACN,KAAM,EAAM,OACd,EAEA,cAAe,CACb,KAAM,YACN,KAAM,EAAM,UACd,EAEA,SAAY,CACV,KAAM,YACN,KAAM,EAAM,QACd,CACF,EAEA,GACE,EAAQ,MACL,CAAC,WAAY,MAAO,UAAW,UAAW,OAAQ,UAAW,YAAa,cAAe,UAAU,EAAE,SACtG,EAAQ,IACV,EAEA,MAAO,CACL,KAAM,EAAW,EAAQ,MAAM,KAC/B,KAAM,EAAW,EAAQ,MAAM,KAC/B,KAAM,EACR,EAGF,MAAO,CACL,KAAM,EAAQ,MAAQ,mBACtB,KAAM,EAAQ,MAAQ,KACtB,KAAM,EAAQ,MAAQ,EACxB",
|
|
8
|
-
"debugId": "9727226D678B531364756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/src/config.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { ServerOptions } from '@stacksjs/types'
|
|
2
|
-
import { ports } from '@stacksjs/config'
|
|
3
|
-
|
|
4
|
-
export function config(options: ServerOptions): {
|
|
5
|
-
host: string
|
|
6
|
-
port: number
|
|
7
|
-
open: boolean
|
|
8
|
-
} {
|
|
9
|
-
const serversMap = {
|
|
10
|
-
'frontend': {
|
|
11
|
-
host: 'localhost',
|
|
12
|
-
port: ports.frontend,
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
'backend': {
|
|
16
|
-
host: 'localhost',
|
|
17
|
-
port: ports.backend,
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
'api': {
|
|
21
|
-
host: 'localhost',
|
|
22
|
-
port: ports.api,
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
'admin': {
|
|
26
|
-
host: 'localhost',
|
|
27
|
-
port: ports.admin,
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
'library': {
|
|
31
|
-
// component library
|
|
32
|
-
host: 'localhost',
|
|
33
|
-
port: ports.library,
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
'desktop': {
|
|
37
|
-
host: 'localhost',
|
|
38
|
-
port: ports.desktop,
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
'docs': {
|
|
42
|
-
host: 'localhost',
|
|
43
|
-
port: ports.docs,
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
'email': {
|
|
47
|
-
host: 'localhost',
|
|
48
|
-
port: ports.email,
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
'inspect': {
|
|
52
|
-
host: 'localhost',
|
|
53
|
-
port: ports.inspect,
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
'system-tray': {
|
|
57
|
-
host: 'localhost',
|
|
58
|
-
port: ports.systemTray,
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
'database': {
|
|
62
|
-
host: 'localhost',
|
|
63
|
-
port: ports.database,
|
|
64
|
-
},
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (
|
|
68
|
-
options.type
|
|
69
|
-
&& ['frontend', 'api', 'library', 'desktop', 'docs', 'example', 'dashboard', 'system-tray', 'database'].includes(
|
|
70
|
-
options.type,
|
|
71
|
-
)
|
|
72
|
-
) {
|
|
73
|
-
return {
|
|
74
|
-
host: serversMap[options.type].host,
|
|
75
|
-
port: serversMap[options.type].port,
|
|
76
|
-
open: true,
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return {
|
|
81
|
-
host: options.host || 'stacks.localhost',
|
|
82
|
-
port: options.port || 3000,
|
|
83
|
-
open: options.open || false,
|
|
84
|
-
}
|
|
85
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { config as server } from './config'
|