Skip to content

Commit bf5dda6

Browse files
committed
chore: wip
1 parent 78088fb commit bf5dda6

File tree

4 files changed

+229
-10
lines changed

4 files changed

+229
-10
lines changed

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

Lines changed: 197 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,44 @@ import type { StacksConfig } from '@stacksjs/types'
22
import { path as p } from '@stacksjs/path'
33
// import { userConfig as overrides } from './overrides'
44

5+
const nav = [
6+
{ text: 'Config', link: '/config', activeMatch: '/config' },
7+
{
8+
text: 'Changelog',
9+
link: 'https://github.com/stacksjs/stacks/blob/main/CHANGELOG.md',
10+
},
11+
{ text: 'Blog', link: 'https://updates.ow3.org' },
12+
]
13+
14+
const sidebar = {
15+
'/guide/': [
16+
{
17+
text: 'Introduction',
18+
collapsible: true,
19+
items: [
20+
{ text: 'What is Stacks?', link: '/guide/what-is-stacks' },
21+
{ text: 'Getting Started', link: '/guide/getting-started' },
22+
{ text: 'Configuration', link: '/guide/config' },
23+
],
24+
},
25+
26+
{
27+
text: 'Digging Deeper',
28+
collapsible: true,
29+
items: [
30+
{ text: 'APIs', link: '/guide/apis' },
31+
{ text: 'Apps', link: '/guide/apps' },
32+
{ text: 'Buddy', link: '/guide/buddy' },
33+
{ text: 'CI / CD', link: '/guide/ci' },
34+
{ text: 'Composability', link: '/guide/composability' },
35+
{ text: 'Cloud', link: '/guide/cloud' },
36+
{ text: 'Libraries', link: '/guide/libraries' },
37+
{ text: 'Testing', link: '/guide/testing' },
38+
],
39+
},
40+
],
41+
}
42+
543
export const defaults: StacksConfig = {
644
app: {
745
name: 'Stacks',
@@ -118,11 +156,168 @@ export const defaults: StacksConfig = {
118156
txt: [],
119157
},
120158

121-
docs: {},
159+
docs: {
160+
lang: 'en-US',
161+
title: 'Stacks',
162+
description: 'Rapid application, cloud & library framework.',
163+
lastUpdated: true,
164+
165+
themeConfig: {
166+
nav,
167+
sidebar,
168+
169+
editLink: {
170+
pattern: 'https://github.com/stacksjs/stacks/edit/main/docs/docs/:path',
171+
text: 'Edit this page on GitHub',
172+
},
173+
174+
footer: {
175+
message: 'Released under the MIT License.',
176+
copyright: 'Copyright © 2023-present Stacks',
177+
},
178+
179+
// socialLinks: [
180+
// { icon: 'twitter', link: 'https://twitter.com/stacksjs' },
181+
// { icon: 'github', link: 'https://github.com/stacksjs/stacks' },
182+
// { icon: 'discord', link: 'https://discord.gg/stacksjs' },
183+
// ],
184+
185+
// algolia: services.algolia,
186+
187+
// carbonAds: {
188+
// code: '',
189+
// placement: '',
190+
// },
191+
},
192+
},
122193

123194
email: {
124-
195+
from: {
196+
name: 'Stacks',
197+
address: 'no-reply@stacksjs.com',
198+
},
199+
200+
mailboxes: {}
125201
},
202+
203+
git: {
204+
hooks: {
205+
'pre-commit': 'lint-staged',
206+
},
207+
208+
scopes: [
209+
'', 'ci', 'deps', 'dx', 'release', 'docs', 'test', 'core',
210+
'actions', 'arrays', 'auth', 'build', 'cache', 'cli', 'cloud', 'collections', 'config',
211+
'database', 'datetime', 'docs', 'errors', 'git', 'lint', 'x-ray', 'modules', 'notifications',
212+
'objects', 'path', 'realtime', 'router', 'buddy', 'security', 'server', 'storage', 'strings',
213+
'tests', 'types', 'ui', 'utils',
214+
],
215+
216+
messages: {
217+
type: 'Select the type of change that you\'re committing:',
218+
scope: 'Select the SCOPE of this change (optional):',
219+
customScope: 'Select the SCOPE of this change:',
220+
subject: 'Write a SHORT, IMPERATIVE tense description of the change:\n',
221+
body: 'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',
222+
breaking: 'List any BREAKING CHANGES (optional). Use "|" to break new line:\n',
223+
footerPrefixesSelect: 'Select the ISSUES type of the change list by this change (optional):',
224+
customFooterPrefixes: 'Input ISSUES prefix:',
225+
footer: 'List any ISSUES by this change. E.g.: #31, #34:\n',
226+
confirmCommit: 'Are you sure you want to proceed with the commit above?',
227+
},
228+
229+
types: [
230+
{ value: 'feat', name: 'feat: ✨ A new feature', emoji: ':sparkles:' },
231+
{ value: 'fix', name: 'fix: 🐛 A bug fix', emoji: ':bug:' },
232+
{ value: 'docs', name: 'docs: 📝 Documentation only changes', emoji: ':memo:' },
233+
{ value: 'style', name: 'style: 💄 Changes that do not affect the meaning of the code', emoji: ':lipstick:' },
234+
{ value: 'refactor', name: 'refactor: ♻️ A code change that neither fixes a bug nor adds a feature', emoji: ':recycle:' },
235+
{ value: 'perf', name: 'perf: ⚡️ A code change that improves performance', emoji: ':zap:' },
236+
{ value: 'test', name: 'test: ✅ Adding missing tests or adjusting existing tests', emoji: ':white_check_mark:' },
237+
{ value: 'build', name: 'build: 📦️ Changes that affect the build system or external dependencies', emoji: ':package:' },
238+
{ value: 'ci', name: 'ci: 🎡 Changes to our CI configuration files and scripts', emoji: ':ferris_wheel:' },
239+
{ value: 'chore', name: 'chore: 🔨 Other changes that don\'t modify src or test files', emoji: ':hammer:' },
240+
{ value: 'revert', name: 'revert: ⏪️ Reverts a previous commit', emoji: ':rewind:' },
241+
],
242+
},
243+
244+
hashing: {
245+
driver: 'argon2',
246+
247+
bcrypt: {
248+
rounds: 10,
249+
cost: 4, // number between 4-31
250+
},
251+
252+
argon2: {
253+
memory: 65536, // memory usage in kibibytes
254+
threads: 1,
255+
time: 1, // the number of iterations
256+
},
257+
},
258+
259+
library: {
260+
name: 'hello-world',
261+
owner: '@stacksjs', // you may or may not add the @ prefix here (it is added automatically)
262+
repository: 'stacksjs/stacks',
263+
license: 'MIT',
264+
author: 'Chris Breuer',
265+
contributors: ['Chris Breuer <chris@stacksjs.com>'],
266+
defaultLanguage: 'en',
267+
268+
vueComponents: {
269+
name: 'hello-world-vue',
270+
description: 'Your Vue component library description',
271+
keywords: ['component', 'library', 'vue', 'vite', 'typescript', 'javascript'],
272+
tags: [{
273+
name: ['HelloWorld', 'AppHelloWorld'],
274+
description: 'The Hello World custom element, built via this framework.',
275+
attributes: [{
276+
name: 'greeting',
277+
description: 'The greeting.',
278+
}],
279+
}],
280+
},
281+
282+
webComponents: {
283+
name: 'hello-world-elements',
284+
description: 'Your framework agnostic web component library description.',
285+
keywords: ['custom-elements', 'web-components', 'library', 'framework-agnostic', 'typescript', 'javascript'],
286+
tags: [{
287+
name: ['HelloWorld', 'AppHelloWorld'],
288+
description: 'The Hello World custom element, built via this framework.',
289+
attributes: [{
290+
name: 'greeting',
291+
description: 'The greeting.',
292+
}],
293+
}],
294+
},
295+
296+
functions: {
297+
name: 'hello-world-fx',
298+
description: 'Your function library description.',
299+
keywords: ['functions', 'composables', 'library', 'typescript', 'javascript'],
300+
shouldGenerateSourcemap: false,
301+
functions: [
302+
'counter',
303+
'dark',
304+
],
305+
},
306+
},
307+
308+
notification: {
309+
default: 'email',
310+
},
311+
312+
// wip
313+
payment: {},
314+
315+
queue: {},
316+
searchEngine: {},
317+
security: {},
318+
services: {},
319+
storage: {},
320+
ui: {},
126321
}
127322

128323
// export {

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface HashingOptions {
2121
*
2222
* @see https://stacksjs.dev/docs/hashing
2323
*/
24-
driver: 'argon' | 'bcrypt'
24+
driver: 'argon2' | 'argon2id' | 'argon2i' | 'argon2d' | 'bcrypt'
2525

2626
/**
2727
* **Bcrypt Option**
@@ -43,7 +43,7 @@ export interface HashingOptions {
4343
*
4444
* @see https://stacksjs.dev/docs/hashing
4545
*/
46-
argon?: ArgonOptions
46+
argon2?: ArgonOptions
4747
}
4848

4949
export type HashingConfig = Partial<HashingOptions>
@@ -64,7 +64,14 @@ export interface BcryptOptions {
6464
* @default number 10
6565
* @see https://stacksjs.dev/docs/hashing
6666
*/
67-
rounds?: number
67+
rounds: number
68+
69+
/**
70+
* Bcrypt cost. This is a number between 4-31.
71+
* @default number 4
72+
* @see https://stacksjs.dev/docs/hashing
73+
*/
74+
cost: number
6875
}
6976

7077
/**

config/cloud.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,21 @@ export default {
1414
storage: {
1515
useFileSystem: true,
1616
},
17-
// cdn: {}
17+
cdn: {
18+
enableLogging: true,
19+
compress: true,
20+
allowedMethods: 'ALL',
21+
cachedMethods: 'GET_HEAD',
22+
originShieldRegion: 'us-east-1',
23+
minTtl: 0,
24+
defaultTtl: 86400,
25+
maxTtl: 31536000,
26+
priceClass: 'PriceClass_All',
27+
cookieBehavior: 'none',
28+
allowList: {
29+
cookies: [],
30+
headers: [],
31+
queryStrings: [],
32+
},
33+
},
1834
} satisfies CloudConfig

config/hashing.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ import type { HashingConfig } from '@stacksjs/types'
88
* have any questions, feel free to reach out via Discord or GitHub Discussions.
99
*/
1010
export default {
11-
driver: 'bcrypt',
11+
driver: 'argon2',
1212

1313
bcrypt: {
1414
rounds: 10,
15+
cost: 4, // number between 4-31
1516
},
1617

17-
argon: {
18-
memory: 65536,
18+
argon2: {
19+
memory: 65536, // memory usage in kibibytes
1920
threads: 1,
20-
time: 1,
21+
time: 1, // the number of iterations
2122
},
2223
} satisfies HashingConfig

0 commit comments

Comments
 (0)