Skip to content

Commit 51aa20c

Browse files
committed
updating website and build
1 parent a85d864 commit 51aa20c

729 files changed

Lines changed: 56127 additions & 43899 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.ts

Lines changed: 0 additions & 92 deletions
This file was deleted.

config/build.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,47 @@ import path from 'node:path';
44
import unocss from 'unocss/vite';
55
//stackpress
66
import { server as http } from 'stackpress/http';
7+
import { CLIENT_TEMPLATE, PAGE_TEMPLATE } from 'stackpress/view';
78
//config
89
import type { Config } from './common.js';
910
import * as common from './common.js';
1011

1112
export const config: Config = {
1213
server: {
1314
...common.server,
14-
mode: 'production'
15+
mode: 'production',
16+
//where to store the build files
17+
build: common.build
1518
},
1619
view: {
1720
...common.view,
1821
//reactus specific settings
1922
engine: {
2023
//path where to save assets (css, images, etc)
21-
assetPath: path.join(common.docs, 'assets'),
24+
assetPath: path.join(common.assets, 'assets'),
2225
//path where to save the client scripts (js)
23-
clientPath: path.join(common.docs, 'client'),
24-
//path where to save the server scripts (js)
25-
pagePath: path.join(common.build, 'pages'),
26+
clientPath: path.join(common.assets, 'client'),
27+
//template wrapper for the client script (tsx)
28+
clientTemplate: CLIENT_TEMPLATE,
2629
//filepath to a global css file
2730
cssFiles: [
2831
'frui/frui.css',
2932
'stackpress/stackpress.css',
3033
'virtual:uno.css'
3134
],
35+
//path where to save and load (live) the server script (js)
36+
pagePath: path.join(common.cwd, '.build/views'),
37+
//template wrapper for the page script (tsx)
38+
pageTemplate: PAGE_TEMPLATE,
3239
//vite plugins
3340
plugins: [ unocss() ],
3441
//original vite options (overrides other settings related to vite)
3542
vite: undefined
3643
}
3744
},
3845
brand: common.brand,
39-
cli: common.cli,
40-
cookie: common.cookie,
4146
language: common.language,
42-
session: common.session
47+
terminal: common.terminal
4348
};
4449

4550
export default async function bootstrap() {

config/common.ts

Lines changed: 33 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,24 @@
11
//node
22
import path from 'node:path';
3-
3+
//modules
4+
import type { ToastPosition } from 'react-toastify';
5+
//types
46
export type { Config } from 'stackpress/types';
5-
7+
//pathnames
68
export const cwd = process.cwd();
79
export const docs = path.join(cwd, 'docs');
810
export const build = path.join(cwd, '.build');
911
export const assets = path.join(cwd, 'public');
12+
export const modules = path.join(cwd, 'node_modules');
1013

14+
//common config
1115
export const brand = {
1216
name: 'Stackpress',
1317
logo: '/logo.png',
1418
icon: '/icon.png',
1519
favicon: '/favicon.ico'
1620
};
1721

18-
export const server = {
19-
port: 3000,
20-
cwd: cwd
21-
};
22-
23-
export const view = {
24-
//url flag (ie. ?json) used to disable template
25-
//rendering and show the raw json data instead
26-
noview: 'json',
27-
//used by vite and in development mode
28-
//to determine the root of the project
29-
base: '/',
30-
//frontend notification display settings
31-
notify: {
32-
position: 'bottom-center',
33-
autoClose: 1000,
34-
hideProgressBar: false,
35-
closeOnClick: true,
36-
pauseOnHover: true,
37-
draggable: true,
38-
theme: 'dark',
39-
}
40-
};
41-
42-
export const session = {
43-
//name of the session cookie
44-
key: 'session',
45-
//used to generate the session id
46-
seed: 'abc123',
47-
access: { GUEST: [ { method: 'ALL', route: '/**' } ] }
48-
};
49-
50-
export const cookie = {
51-
//see: https://github.com/jshttp/cookie?tab=readme-ov-file#options-1
52-
path: '/'
53-
};
54-
5522
export const language = {
5623
//url flag (ie. ?json) used to change the user's locale
5724
//this is also the name of the cookie used to store the locale
@@ -77,7 +44,32 @@ export const language = {
7744
}
7845
};
7946

80-
export const cli = {
47+
export const server = {
48+
host: '127.0.0.1',
49+
port: 3000,
50+
cwd: cwd
51+
};
52+
53+
export const terminal = {
8154
label: '[WWW]',
8255
idea: path.join(cwd, 'schema.idea')
83-
};
56+
};
57+
58+
export const view = {
59+
//url flag (ie. ?json) used to disable template
60+
//rendering and show the raw json data instead
61+
noview: 'json',
62+
//used by vite and in development mode
63+
//to determine the root of the project
64+
base: '/',
65+
//frontend notification display settings
66+
notify: {
67+
position: 'bottom-center' as ToastPosition,
68+
autoClose: 5000,
69+
hideProgressBar: false,
70+
closeOnClick: true,
71+
pauseOnHover: true,
72+
draggable: true,
73+
theme: 'dark',
74+
}
75+
};

config/develop.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
import unocss from 'unocss/vite';
33
//stackpress
44
import { server as http } from 'stackpress/http';
5+
import { CLIENT_TEMPLATE, DOCUMENT_TEMPLATE } from 'stackpress/view';
56
//config
67
import type { Config } from './common.js';
78
import * as common from './common.js';
89

910
export const config: Config = {
1011
server: {
1112
...common.server,
12-
mode: 'development'
13+
mode: 'development',
14+
//where to store the build files
15+
build: common.build
1316
},
1417
view: {
1518
...common.view,
@@ -22,21 +25,30 @@ export const config: Config = {
2225
//<script type="module" src="/client/[id][extname]"></script>
2326
//<script type="module" src="/client/abc123.tsx"></script>
2427
clientRoute: '/client',
28+
//template wrapper for the client script (tsx)
29+
clientTemplate: CLIENT_TEMPLATE,
2530
//filepath to a global css file
2631
cssFiles: [
2732
'frui/frui.css',
2833
'stackpress/stackpress.css',
2934
'virtual:uno.css'
3035
],
36+
optimizeDeps: {
37+
include: [ 'react-dom/client' ]
38+
},
39+
//template wrapper for the document markup (html)
40+
documentTemplate: DOCUMENT_TEMPLATE,
3141
//vite plugins
32-
plugins: [ unocss() ]
42+
plugins: [ unocss() ],
43+
//original vite options (overrides other settings related to vite)
44+
vite: undefined,
45+
//ignore files in watch mode
46+
watchIgnore: []
3347
}
3448
},
3549
brand: common.brand,
36-
cli: common.cli,
37-
cookie: common.cookie,
3850
language: common.language,
39-
session: common.session
51+
terminal: common.terminal
4052
};
4153

4254
export default async function bootstrap() {

config/preview.ts

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)