@stacksjs/server 0.64.6 → 0.65.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.
@@ -0,0 +1,6 @@
1
+ import type { ServerOptions } from "@stacksjs/types";
2
+ export declare function config(options: ServerOptions): {
3
+ host: string;
4
+ port: number;
5
+ open: boolean;
6
+ };
@@ -0,0 +1 @@
1
+ export { config as server } from "./config";
package/dist/index.js.map CHANGED
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/config.ts"],
4
4
  "sourcesContent": [
5
- "import { ports } from '@stacksjs/config'\n\ninterface ServerOptions {\n type?:\n | 'frontend'\n | 'backend'\n | 'api'\n | 'library'\n | 'desktop'\n | 'docs'\n | 'email'\n | 'admin'\n | 'system-tray'\n | 'database'\n host?: string\n port?: number\n open?: boolean\n}\n\nexport function config(options: ServerOptions) {\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"
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
6
  ],
7
- "mappings": ";AAAA,gBAAS,yBAmBF,SAAS,CAAM,CAAC,EAAwB,CAC7C,MAAM,EAAa,CACjB,SAAU,CACR,KAAM,YACN,KAAM,EAAM,QACd,EAEA,QAAS,CACP,KAAM,YACN,KAAM,EAAM,OACd,EAEA,IAAK,CACH,KAAM,YACN,KAAM,EAAM,GACd,EAEA,MAAO,CACL,KAAM,YACN,KAAM,EAAM,KACd,EAEA,QAAS,CAEP,KAAM,YACN,KAAM,EAAM,OACd,EAEA,QAAS,CACP,KAAM,YACN,KAAM,EAAM,OACd,EAEA,KAAM,CACJ,KAAM,YACN,KAAM,EAAM,IACd,EAEA,MAAO,CACL,KAAM,YACN,KAAM,EAAM,KACd,EAEA,QAAS,CACP,KAAM,YACN,KAAM,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,MAAQ,KACtB,KAAM,EAAQ,MAAQ,EACxB",
8
8
  "debugId": "9727226D678B531364756E2164756E21",
9
9
  "names": []
10
10
  }
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@stacksjs/server",
3
3
  "type": "module",
4
- "version": "0.64.6",
4
+ "version": "0.65.0",
5
5
  "description": "Local development and production-ready.",
6
6
  "author": "Chris Breuer",
7
+ "contributors": ["Chris Breuer <chris@stacksjs.org>"],
7
8
  "license": "MIT",
8
9
  "funding": "https://github.com/sponsors/chrisbbreuer",
9
10
  "homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/server#readme",
@@ -36,27 +37,20 @@
36
37
  },
37
38
  "module": "dist/index.js",
38
39
  "types": "dist/index.d.ts",
39
- "contributors": [
40
- "Chris Breuer <chris@stacksjs.org>"
41
- ],
42
- "files": [
43
- "README.md",
44
- "dist",
45
- "src"
46
- ],
40
+ "files": ["README.md", "dist", "src"],
47
41
  "scripts": {
48
- "build": "bun --bun build.ts",
49
- "typecheck": "bun --bun tsc --noEmit",
42
+ "build": "bun build.ts",
43
+ "typecheck": "bun tsc --noEmit",
50
44
  "prepublishOnly": "bun run build"
51
45
  },
52
46
  "dependencies": {
53
- "@stacksjs/config": "latest",
54
- "@stacksjs/path": "latest",
55
- "@stacksjs/router": "latest",
56
- "@stacksjs/validation": "latest"
47
+ "@stacksjs/config": "0.64.6",
48
+ "@stacksjs/path": "0.64.6",
49
+ "@stacksjs/router": "0.64.6",
50
+ "@stacksjs/validation": "0.64.6"
57
51
  },
58
52
  "devDependencies": {
59
- "vite": "^5.4.2",
60
- "@stacksjs/development": "latest"
53
+ "@stacksjs/development": "0.64.6",
54
+ "vite": "^5.4.8"
61
55
  }
62
56
  }
package/src/config.ts CHANGED
@@ -1,66 +1,54 @@
1
+ import type { ServerOptions } from '@stacksjs/types'
1
2
  import { ports } from '@stacksjs/config'
2
3
 
3
- interface ServerOptions {
4
- type?:
5
- | 'frontend'
6
- | 'backend'
7
- | 'api'
8
- | 'library'
9
- | 'desktop'
10
- | 'docs'
11
- | 'email'
12
- | 'admin'
13
- | 'system-tray'
14
- | 'database'
15
- host?: string
16
- port?: number
17
- open?: boolean
18
- }
19
-
20
- export function config(options: ServerOptions) {
4
+ export function config(options: ServerOptions): {
5
+ host: string
6
+ port: number
7
+ open: boolean
8
+ } {
21
9
  const serversMap = {
22
- frontend: {
10
+ 'frontend': {
23
11
  host: 'localhost',
24
12
  port: ports.frontend,
25
13
  },
26
14
 
27
- backend: {
15
+ 'backend': {
28
16
  host: 'localhost',
29
17
  port: ports.backend,
30
18
  },
31
19
 
32
- api: {
20
+ 'api': {
33
21
  host: 'localhost',
34
22
  port: ports.api,
35
23
  },
36
24
 
37
- admin: {
25
+ 'admin': {
38
26
  host: 'localhost',
39
27
  port: ports.admin,
40
28
  },
41
29
 
42
- library: {
30
+ 'library': {
43
31
  // component library
44
32
  host: 'localhost',
45
33
  port: ports.library,
46
34
  },
47
35
 
48
- desktop: {
36
+ 'desktop': {
49
37
  host: 'localhost',
50
38
  port: ports.desktop,
51
39
  },
52
40
 
53
- docs: {
41
+ 'docs': {
54
42
  host: 'localhost',
55
43
  port: ports.docs,
56
44
  },
57
45
 
58
- email: {
46
+ 'email': {
59
47
  host: 'localhost',
60
48
  port: ports.email,
61
49
  },
62
50
 
63
- inspect: {
51
+ 'inspect': {
64
52
  host: 'localhost',
65
53
  port: ports.inspect,
66
54
  },
@@ -70,15 +58,15 @@ export function config(options: ServerOptions) {
70
58
  port: ports.systemTray,
71
59
  },
72
60
 
73
- database: {
61
+ 'database': {
74
62
  host: 'localhost',
75
63
  port: ports.database,
76
64
  },
77
65
  }
78
66
 
79
67
  if (
80
- options.type &&
81
- ['frontend', 'api', 'library', 'desktop', 'docs', 'example', 'dashboard', 'system-tray', 'database'].includes(
68
+ options.type
69
+ && ['frontend', 'api', 'library', 'desktop', 'docs', 'example', 'dashboard', 'system-tray', 'database'].includes(
82
70
  options.type,
83
71
  )
84
72
  ) {