Skip to content

Commit ec3a899

Browse files
committed
chore: wip
chore: wip chore: wip chore: wip
1 parent a927b8b commit ec3a899

File tree

5 files changed

+60
-61
lines changed

5 files changed

+60
-61
lines changed

.stacks/core/config/src/defaults.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import cache from '~/config/cache'
55
import cdn from '~/config/cdn'
66
import database from '~/config/database'
77
import dns from '~/config/dns'
8-
import docs from '~/docs/config'
8+
import docs from '~/config/docs'
99
import email from '~/config/email'
1010
import git from '~/config/git'
1111
import hashing from '~/config/hashing'

.stacks/core/docs/src/index.ts

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,53 @@
11
import { defineConfig } from 'vitepress'
2-
import { type UserConfig } from 'vitepress'
3-
import { docs } from '@stacksjs/config'
2+
import { path as p } from '@stacksjs/path'
3+
import { app, docs } from '@stacksjs/config'
4+
import * as c from 'kolorist'
5+
import type { ViteDevServer as DevServer } from '../../vite/src'
6+
import pkgjson from '../package.json'
47

5-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
6-
export default defineConfig(docs as UserConfig)
8+
const { version } = pkgjson
9+
10+
const appUrl = app.url
11+
const docsSubdomain = app.subdomains.docs
12+
const protocolPattern = /^https?:\/\//i
13+
const urlForParsing = protocolPattern.test(appUrl) ? appUrl : `http://${docsSubdomain}.${appUrl}:3333`
14+
const urlObj = new URL(urlForParsing)
15+
const domainParts = urlObj.hostname.split('.')
16+
domainParts[domainParts.length - 1] = 'test' // replace TLD with 'test' for local dev
17+
const host = domainParts.join('.')
18+
const docsUrl = `http://${host}`
19+
20+
const defaultConfig = {
21+
title: 'StacksJS',
22+
vite: {
23+
envDir: p.projectPath(),
24+
envPrefix: 'FRONTEND_',
25+
server: {
26+
host,
27+
port: 3333,
28+
open: true,
29+
},
30+
31+
plugins: [
32+
{
33+
name: 'stacks-plugin',
34+
configureServer(server: DevServer) {
35+
// const base = server.config.base || '/'
36+
// const _print = server.printUrls
37+
server.printUrls = () => { // eslint-disable-next-line no-console
38+
console.log(` ${c.blue(c.bold('STACKS'))} ${c.blue(version)}`)
39+
// eslint-disable-next-line no-console
40+
console.log(` ${c.green('➜')} ${c.bold('Docs')}: ${c.green(docsUrl)}`)
41+
}
42+
},
43+
},
44+
],
45+
},
46+
}
47+
48+
const config = {
49+
...defaultConfig,
50+
...docs,
51+
}
52+
53+
export default defineConfig(config)

.stacks/core/types/src/stacks.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,6 @@ export interface StacksOptions {
7474
*/
7575
database: Partial<DatabaseOptions>
7676

77-
/**
78-
* **Database Options**
79-
*
80-
* This configuration defines all of your Database options. Because Stacks is fully-typed, you
81-
* may hover any of the options below and the definitions will be provided. In case you
82-
* have any questions, feel free to reach out via Discord or GitHub Discussions.
83-
*/
84-
dependencies: Partial<DependenciesOptions>
85-
8677
/**
8778
* **DNS Options**
8879
*

.stacks/docs/.vitepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
* path for the VitePress config.
55
*/
66

7-
import docs from '../../../docs/config'
7+
import docs from '@stacksjs/docs'
88

99
export default docs

docs/config.ts renamed to config/docs.ts

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
import * as c from 'kolorist'
21
import { path as p } from '../.stacks/core/path/src'
32
import type { DocsConfig } from '../.stacks/core/types/src/docs'
4-
import type { ViteDevServer as DevServer } from '../.stacks/core/vite/src'
53
import pkgjson from '../package.json'
6-
import services from '../config/services'
7-
import app from '../config/app'
84

95
const { version } = pkgjson
106

@@ -57,16 +53,6 @@ const sidebar = {
5753
],
5854
}
5955

60-
const appUrl = app.url
61-
const docsSubdomain = app.subdomains.docs
62-
const protocolPattern = /^https?:\/\//i
63-
const urlForParsing = protocolPattern.test(appUrl) ? appUrl : `http://${docsSubdomain}.${appUrl}:3333`
64-
const urlObj = new URL(urlForParsing)
65-
const domainParts = urlObj.hostname.split('.')
66-
domainParts[domainParts.length - 1] = 'test' // replace TLD with 'test' for local dev
67-
const host = domainParts.join('.')
68-
const docsUrl = `http://${host}`
69-
7056
/**
7157
* **Documentation Options**
7258
*
@@ -75,37 +61,12 @@ const docsUrl = `http://${host}`
7561
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
7662
*/
7763
export default {
78-
vite: {
79-
envDir: p.projectPath(),
80-
envPrefix: 'FRONTEND_',
81-
server: {
82-
host,
83-
port: 3333,
84-
open: true,
85-
},
86-
87-
plugins: [
88-
{
89-
name: 'stacks-plugin',
90-
configureServer(server: DevServer) {
91-
// const base = server.config.base || '/'
92-
// const _print = server.printUrls
93-
server.printUrls = () => { // eslint-disable-next-line no-console
94-
console.log(` ${c.blue(c.bold('STACKS'))} ${c.blue(version)}`)
95-
// eslint-disable-next-line no-console
96-
console.log(` ${c.green('➜')} ${c.bold('Docs')}: ${c.green(docsUrl)}`)
97-
}
98-
},
99-
},
100-
],
101-
},
102-
10364
srcDir: p.projectPath('docs'),
10465
outDir: p.projectStoragePath('app/docs'),
10566
cacheDir: p.projectStoragePath('app/cache/docs'),
10667
lang: 'en-US',
10768
title: 'Stacks',
108-
description: 'Composability-First. UI/FX Framework.',
69+
description: 'Rapid application, cloud & library framework.',
10970
lastUpdated: true,
11071

11172
themeConfig: {
@@ -117,18 +78,18 @@ export default {
11778
text: 'Edit this page on GitHub',
11879
},
11980

120-
socialLinks: [
121-
{ icon: 'twitter', link: 'https://twitter.com/stacksjs' },
122-
{ icon: 'github', link: 'https://github.com/stacksjs/stacks' },
123-
{ icon: 'discord', link: 'https://discord.com/' },
124-
],
81+
// socialLinks: [
82+
// { icon: 'twitter', link: 'https://twitter.com/stacksjs' },
83+
// { icon: 'github', link: 'https://github.com/stacksjs/stacks' },
84+
// { icon: 'discord', link: 'https://discord.gg/stacksjs' },
85+
// ],
12586

12687
footer: {
12788
message: 'Released under the MIT License.',
12889
copyright: 'Copyright © 2023-present Stacks',
12990
},
13091

131-
algolia: services.algolia,
92+
// algolia: services.algolia,
13293

13394
carbonAds: {
13495
code: '',

0 commit comments

Comments
 (0)