@nextsparkjs/core 0.1.0-beta.27 → 0.1.0-beta.28

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.
Files changed (31) hide show
  1. package/dist/components/docs/docs-sidebar.d.ts +6 -0
  2. package/dist/components/docs/docs-sidebar.d.ts.map +1 -1
  3. package/dist/components/docs/docs-sidebar.js +86 -264
  4. package/dist/components/docs/index.d.ts +1 -0
  5. package/dist/components/docs/index.d.ts.map +1 -1
  6. package/dist/components/docs/index.js +3 -1
  7. package/dist/components/docs/superadmin-docs-sidebar.d.ts +7 -0
  8. package/dist/components/docs/superadmin-docs-sidebar.d.ts.map +1 -0
  9. package/dist/components/docs/superadmin-docs-sidebar.js +122 -0
  10. package/dist/components/superadmin/layouts/SuperadminSidebar.d.ts.map +1 -1
  11. package/dist/components/superadmin/layouts/SuperadminSidebar.js +9 -1
  12. package/dist/lib/config/types.d.ts +14 -19
  13. package/dist/lib/config/types.d.ts.map +1 -1
  14. package/dist/styles/classes.json +2 -3
  15. package/dist/styles/ui.css +1 -1
  16. package/dist/templates/contents/themes/starter/config/app.config.ts +14 -11
  17. package/dist/templates/contents/themes/starter/docs/superadmin/01-setup/01-configuration.md +31 -0
  18. package/dist/templates/contents/themes/starter/tests/cypress.config.ts +5 -5
  19. package/dist/templates/scripts/cy-tags.cjs +83 -0
  20. package/dist/types/docs.d.ts +11 -6
  21. package/dist/types/docs.d.ts.map +1 -1
  22. package/package.json +1 -1
  23. package/scripts/build/docs-registry.mjs +59 -135
  24. package/templates/contents/themes/starter/config/app.config.ts +14 -11
  25. package/templates/contents/themes/starter/docs/superadmin/01-setup/01-configuration.md +31 -0
  26. package/templates/contents/themes/starter/tests/cypress.config.ts +5 -5
  27. package/templates/scripts/cy-tags.cjs +83 -0
  28. /package/dist/templates/contents/themes/starter/docs/{01-overview → public/01-overview}/01-introduction.md +0 -0
  29. /package/dist/templates/contents/themes/starter/docs/{01-overview → public/01-overview}/02-customization.md +0 -0
  30. /package/templates/contents/themes/starter/docs/{01-overview → public/01-overview}/01-introduction.md +0 -0
  31. /package/templates/contents/themes/starter/docs/{01-overview → public/01-overview}/02-customization.md +0 -0
@@ -0,0 +1,31 @@
1
+ # Admin Configuration
2
+
3
+ This guide covers the configuration options available to administrators.
4
+
5
+ ## Environment Variables
6
+
7
+ Configure your application through environment variables:
8
+
9
+ ```bash
10
+ # Database
11
+ DATABASE_URL="postgresql://..."
12
+
13
+ # Authentication
14
+ BETTER_AUTH_SECRET="your-secret"
15
+
16
+ # Application
17
+ NEXT_PUBLIC_APP_URL="https://your-domain.com"
18
+ ```
19
+
20
+ ## Configuration Files
21
+
22
+ Customize your application through config files in `config/`:
23
+
24
+ - `app.config.ts` - Main application settings
25
+ - `permissions.config.ts` - Roles and permissions
26
+ - `billing.config.ts` - Subscription plans
27
+ - `dev.config.ts` - Development settings
28
+
29
+ ## Next Steps
30
+
31
+ Refer to the main documentation for detailed guides on each configuration area.
@@ -2,17 +2,17 @@
2
2
  * Cypress Configuration for Starter Theme
3
3
  *
4
4
  * This config is self-contained for npm projects created with `nextspark init`.
5
- * Run with: pnpm cy:open
5
+ * Run with: pnpm cy:open or pnpm cy:run
6
+ *
7
+ * Filter by tags: pnpm cy:tags "@smoke" or pnpm cy:run --env grepTags="@smoke"
6
8
  */
7
9
 
8
10
  import { defineConfig } from 'cypress'
9
11
  import path from 'path'
10
12
  import fs from 'fs'
11
- import { fileURLToPath } from 'url'
12
13
 
13
- // ESM-compatible __dirname
14
- const __filename = fileURLToPath(import.meta.url)
15
- const __dirname = path.dirname(__filename)
14
+ // __dirname is available because ts-node processes this file as CommonJS
15
+ // (Next.js projects don't use "type": "module" in package.json)
16
16
 
17
17
  // Paths relative to this config file
18
18
  const themeRoot = path.resolve(__dirname, '..')
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Cypress Tags Runner
4
+ *
5
+ * A wrapper script that converts --tags to --env grepTags for @cypress/grep
6
+ *
7
+ * Usage:
8
+ * pnpm cy:tags "@smoke" # Run tests with @smoke tag
9
+ * pnpm cy:tags "@P0+@auth" # Run tests with @P0 AND @auth tags
10
+ * pnpm cy:tags "@smoke @auth" # Run tests with @smoke OR @auth tags
11
+ * pnpm cy:tags "-@slow" # Exclude tests with @slow tag
12
+ * pnpm cy:tags "@smoke" --headed # Run with browser visible
13
+ */
14
+
15
+ const { spawnSync } = require('child_process')
16
+ const path = require('path')
17
+ const fs = require('fs')
18
+
19
+ // Get arguments after script name
20
+ const args = process.argv.slice(2)
21
+
22
+ // First argument is the tag(s), rest are additional cypress args
23
+ const tags = args[0] || ''
24
+ const extraArgs = args.slice(1)
25
+
26
+ // Find the active theme's cypress config
27
+ function findCypressConfig() {
28
+ const contentsDir = path.join(process.cwd(), 'contents', 'themes')
29
+
30
+ if (!fs.existsSync(contentsDir)) {
31
+ console.error('Error: contents/themes directory not found')
32
+ process.exit(1)
33
+ }
34
+
35
+ const themes = fs.readdirSync(contentsDir).filter((name) => {
36
+ const themePath = path.join(contentsDir, name)
37
+ return fs.statSync(themePath).isDirectory()
38
+ })
39
+
40
+ // Check NEXT_PUBLIC_ACTIVE_THEME env var first
41
+ const activeTheme = process.env.NEXT_PUBLIC_ACTIVE_THEME
42
+
43
+ if (activeTheme && themes.includes(activeTheme)) {
44
+ const configPath = path.join(contentsDir, activeTheme, 'tests', 'cypress.config.ts')
45
+ if (fs.existsSync(configPath)) {
46
+ return configPath
47
+ }
48
+ }
49
+
50
+ // Otherwise use the first theme found
51
+ for (const theme of themes) {
52
+ const configPath = path.join(contentsDir, theme, 'tests', 'cypress.config.ts')
53
+ if (fs.existsSync(configPath)) {
54
+ return configPath
55
+ }
56
+ }
57
+
58
+ console.error('Error: No cypress.config.ts found in any theme')
59
+ process.exit(1)
60
+ }
61
+
62
+ const configFile = findCypressConfig()
63
+
64
+ // Build cypress arguments
65
+ const cypressArgs = ['cypress', 'run', '--config-file', configFile]
66
+
67
+ if (tags) {
68
+ cypressArgs.push('--env', `grepTags=${tags}`)
69
+ }
70
+
71
+ // Add any extra arguments
72
+ cypressArgs.push(...extraArgs)
73
+
74
+ console.log(`Running: npx ${cypressArgs.join(' ')}`)
75
+
76
+ // Execute cypress
77
+ const result = spawnSync('npx', cypressArgs, {
78
+ stdio: 'inherit',
79
+ shell: true,
80
+ cwd: process.cwd(),
81
+ })
82
+
83
+ process.exit(result.status || 0)
@@ -3,26 +3,31 @@
3
3
  *
4
4
  * Type definitions for the documentation registry system.
5
5
  * Used by the auto-generated docs-registry.ts file.
6
+ *
7
+ * Structure:
8
+ * - public: User-facing documentation → /docs
9
+ * - superadmin: Admin documentation → /superadmin/docs
10
+ *
11
+ * NOTE: Plugin docs are NOT included in the registry - they are for developer
12
+ * reference only (IDE/LLM). End users see public documentation at /docs routes.
6
13
  */
7
14
  export interface DocPageMeta {
8
15
  slug: string;
9
16
  title: string;
10
17
  order: number;
11
18
  path: string;
12
- source: 'core' | 'theme' | 'plugin';
19
+ source: 'public' | 'superadmin';
13
20
  }
14
21
  export interface DocSectionMeta {
15
22
  title: string;
16
23
  slug: string;
17
24
  order: number;
18
25
  pages: DocPageMeta[];
19
- source: 'core' | 'theme' | 'plugin';
20
- pluginName?: string;
26
+ source: 'public' | 'superadmin';
21
27
  }
22
28
  export interface DocsRegistryStructure {
23
- core: DocSectionMeta[];
24
- theme: DocSectionMeta[];
25
- plugins: DocSectionMeta[];
29
+ public: DocSectionMeta[];
30
+ superadmin: DocSectionMeta[];
26
31
  all: DocSectionMeta[];
27
32
  }
28
33
  //# sourceMappingURL=docs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/types/docs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;CACpC;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;IACnC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,cAAc,EAAE,CAAA;IACtB,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,GAAG,EAAE,cAAc,EAAE,CAAA;CACtB"}
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/types/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,QAAQ,GAAG,YAAY,CAAA;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB,MAAM,EAAE,QAAQ,GAAG,YAAY,CAAA;CAChC;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,UAAU,EAAE,cAAc,EAAE,CAAA;IAC5B,GAAG,EAAE,cAAc,EAAE,CAAA;CACtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextsparkjs/core",
3
- "version": "0.1.0-beta.27",
3
+ "version": "0.1.0-beta.28",
4
4
  "description": "NextSpark - The complete SaaS framework for Next.js",
5
5
  "license": "MIT",
6
6
  "author": "NextSpark <hello@nextspark.dev>",
@@ -3,9 +3,15 @@
3
3
  /**
4
4
  * Documentation Registry Builder
5
5
  *
6
- * Scans core/docs/, contents/themes/{THEME}/docs/, and plugin docs directories
6
+ * Scans contents/themes/{THEME}/docs/public/ and docs/superadmin/ directories
7
7
  * Generates static registry at .nextspark/registries/docs-registry.ts
8
8
  *
9
+ * Structure:
10
+ * - public: User-facing documentation → /docs
11
+ * - superadmin: Admin documentation → /superadmin/docs
12
+ *
13
+ * NOTE: Plugin docs are NOT included - they are for developer reference only (IDE/LLM).
14
+ *
9
15
  * ZERO RUNTIME I/O - Build-time only
10
16
  * Part of the registry system
11
17
  */
@@ -61,12 +67,12 @@ console.log(`📚 Building docs registry...`)
61
67
  console.log(` Project root: ${PROJECT_ROOT}`)
62
68
  console.log(` Mode: ${IS_NPM_MODE ? 'NPM' : 'Monorepo'}`)
63
69
 
64
- // Paths based on mode
65
- const CORE_DIR = IS_NPM_MODE
66
- ? path.join(PROJECT_ROOT, 'node_modules/@nextsparkjs/core')
67
- : path.join(PROJECT_ROOT, 'packages/core')
68
-
69
- const CONTENTS_DIR = path.join(PROJECT_ROOT, 'contents')
70
+ // Paths - themes directory
71
+ // In NPM mode: contents/themes
72
+ // In Monorepo mode: themes/ (directly in root)
73
+ const THEMES_DIR = IS_NPM_MODE
74
+ ? path.join(PROJECT_ROOT, 'contents/themes')
75
+ : path.join(PROJECT_ROOT, 'themes')
70
76
 
71
77
  const OUTPUT_DIR = path.join(PROJECT_ROOT, '.nextspark/registries')
72
78
 
@@ -77,7 +83,7 @@ const ROOT_DIR = PROJECT_ROOT
77
83
  * Scan a documentation directory and build registry metadata
78
84
  *
79
85
  * @param {string} docsPath - Absolute path to docs directory
80
- * @param {'core' | 'theme' | 'plugin'} source - Source type
86
+ * @param {'theme' | 'plugin'} source - Source type
81
87
  * @returns {Array} Array of section metadata
82
88
  */
83
89
  function scanDocsDirectory(docsPath, source) {
@@ -161,75 +167,6 @@ function slugToTitle(slug) {
161
167
  .join(' ')
162
168
  }
163
169
 
164
- /**
165
- * Get active plugins from theme configuration
166
- */
167
- function getActiveThemePlugins(activeTheme) {
168
- const themeConfigPath = path.join(CONTENTS_DIR, 'themes', activeTheme, 'theme.config.ts')
169
-
170
- try {
171
- const configContent = fs.readFileSync(themeConfigPath, 'utf8')
172
-
173
- // Extract plugin dependencies from theme config
174
- const pluginsMatch = configContent.match(/plugins:\s*\[([^\]]+)\]/)
175
- const plugins = pluginsMatch
176
- ? pluginsMatch[1].split(',').map(p => p.trim().replace(/['"]/g, '')).filter(Boolean)
177
- : []
178
-
179
- return plugins
180
- } catch (error) {
181
- console.log(` Warning: Could not read theme config: ${error.message}`)
182
- return []
183
- }
184
- }
185
-
186
- /**
187
- * Read app config to check if plugin docs should be shown in production
188
- */
189
- function shouldShowPluginDocsInProd(activeTheme) {
190
- const appConfigPath = path.join(CONTENTS_DIR, 'themes', activeTheme, 'app.config.ts')
191
-
192
- try {
193
- const configContent = fs.readFileSync(appConfigPath, 'utf8')
194
-
195
- // Look for showPluginsDocsInProd setting
196
- const match = configContent.match(/showPluginsDocsInProd:\s*(true|false)/)
197
- if (match) {
198
- return match[1] === 'true'
199
- }
200
-
201
- // Default to false if not found
202
- return false
203
- } catch (error) {
204
- console.log(` Warning: Could not read app config: ${error.message}`)
205
- return false
206
- }
207
- }
208
-
209
- /**
210
- * Scan plugin docs directories for all active plugins
211
- */
212
- function scanPluginDocs(activePlugins) {
213
- const allPluginDocs = []
214
-
215
- for (const pluginName of activePlugins) {
216
- const pluginDocsPath = path.join(CONTENTS_DIR, 'plugins', pluginName, 'docs')
217
-
218
- if (!fs.existsSync(pluginDocsPath)) {
219
- continue
220
- }
221
-
222
- const sections = scanDocsDirectory(pluginDocsPath, 'plugin')
223
-
224
- // Add plugin context to each section
225
- for (const section of sections) {
226
- section.pluginName = pluginName
227
- allPluginDocs.push(section)
228
- }
229
- }
230
-
231
- return allPluginDocs
232
- }
233
170
 
234
171
  /**
235
172
  * Build the documentation registry
@@ -238,49 +175,35 @@ async function buildDocsRegistry() {
238
175
  const activeTheme = process.env.NEXT_PUBLIC_ACTIVE_THEME || 'default'
239
176
  console.log(` Active theme: ${activeTheme}`)
240
177
 
241
- // Scan core docs
242
- const coreDocsPath = path.join(CORE_DIR, 'docs')
243
- const coreDocs = scanDocsDirectory(coreDocsPath, 'core')
244
- console.log(` Core sections: ${coreDocs.length}`)
178
+ const themeDocsDir = path.join(THEMES_DIR, activeTheme, 'docs')
245
179
 
246
- // Scan theme docs
247
- const themeDocs = scanDocsDirectory(
248
- path.join(CONTENTS_DIR, `themes/${activeTheme}/docs`),
249
- 'theme'
180
+ // Scan public docs (user-facing → /docs)
181
+ const publicDocs = scanDocsDirectory(
182
+ path.join(themeDocsDir, 'public'),
183
+ 'public'
250
184
  )
251
- console.log(` Theme sections: ${themeDocs.length}`)
252
-
253
- // Scan plugin docs (conditionally based on environment and config)
254
- const isProd = process.env.NODE_ENV === 'production'
255
- const showPluginDocsInProd = shouldShowPluginDocsInProd(activeTheme)
256
- const shouldIncludePluginDocs = !isProd || showPluginDocsInProd
185
+ console.log(` Public sections: ${publicDocs.length}`)
257
186
 
258
- let pluginDocs = []
259
- if (shouldIncludePluginDocs) {
260
- const activePlugins = getActiveThemePlugins(activeTheme)
261
- console.log(` Active plugins: [${activePlugins.join(', ')}]`)
262
-
263
- pluginDocs = scanPluginDocs(activePlugins)
264
- console.log(` Plugin sections: ${pluginDocs.length}`)
265
-
266
- if (pluginDocs.length > 0) {
267
- const pluginPages = pluginDocs.reduce((sum, section) => sum + section.pages.length, 0)
268
- console.log(` Plugin pages: ${pluginPages}`)
269
- }
270
- } else {
271
- console.log(` Plugin docs: EXCLUDED (production + showPluginsDocsInProd: false)`)
272
- }
187
+ // Scan superadmin docs (admin-facing → /superadmin/docs)
188
+ const superadminDocs = scanDocsDirectory(
189
+ path.join(themeDocsDir, 'superadmin'),
190
+ 'superadmin'
191
+ )
192
+ console.log(` Superadmin sections: ${superadminDocs.length}`)
273
193
 
274
- // Merge and create registry
194
+ // Create registry (public + superadmin, no plugins)
275
195
  const registry = {
276
- core: coreDocs,
277
- theme: themeDocs,
278
- plugins: pluginDocs,
279
- all: [...coreDocs, ...themeDocs, ...pluginDocs].sort((a, b) => a.order - b.order)
196
+ public: publicDocs,
197
+ superadmin: superadminDocs,
198
+ all: [...publicDocs, ...superadminDocs].sort((a, b) => a.order - b.order)
280
199
  }
281
200
 
282
201
  // Total pages count
283
- const totalPages = registry.all.reduce((sum, section) => sum + section.pages.length, 0)
202
+ const publicPages = publicDocs.reduce((sum, section) => sum + section.pages.length, 0)
203
+ const superadminPages = superadminDocs.reduce((sum, section) => sum + section.pages.length, 0)
204
+ const totalPages = publicPages + superadminPages
205
+ console.log(` Public pages: ${publicPages}`)
206
+ console.log(` Superadmin pages: ${superadminPages}`)
284
207
  console.log(` Total pages: ${totalPages}`)
285
208
 
286
209
  // Generate TypeScript registry file
@@ -288,60 +211,61 @@ async function buildDocsRegistry() {
288
211
  * Auto-generated Documentation Registry
289
212
  *
290
213
  * Generated at: ${new Date().toISOString()}
291
- * Core sections: ${coreDocs.length}
292
- * Theme sections: ${themeDocs.length}
293
- * Plugin sections: ${pluginDocs.length}
214
+ * Public sections: ${publicDocs.length}
215
+ * Superadmin sections: ${superadminDocs.length}
294
216
  * Total pages: ${totalPages}
295
217
  *
218
+ * Structure:
219
+ * - public: User-facing documentation → /docs
220
+ * - superadmin: Admin documentation → /superadmin/docs
221
+ *
222
+ * NOTE: Plugin docs are NOT included - they are for developer reference only (IDE/LLM).
223
+ *
296
224
  * DO NOT EDIT - This file is auto-generated by scripts/build/docs-registry.mjs
297
225
  */
298
226
 
299
227
  import type { DocPageMeta, DocSectionMeta, DocsRegistryStructure } from '@nextsparkjs/core/types/docs'
300
228
 
229
+ // Re-export types for external use
230
+ export type { DocPageMeta, DocSectionMeta, DocsRegistryStructure }
231
+
301
232
  export const DOCS_REGISTRY: DocsRegistryStructure = ${JSON.stringify(registry, null, 2)} as const
302
233
 
303
234
  export type DocsRegistry = typeof DOCS_REGISTRY
304
235
 
305
236
  /**
306
- * Get all documentation sections (core + theme + plugins)
237
+ * Get all documentation sections (public + superadmin)
307
238
  */
308
239
  export function getAllDocSections(): DocSectionMeta[] {
309
240
  return DOCS_REGISTRY.all
310
241
  }
311
242
 
312
243
  /**
313
- * Get core documentation sections only
314
- */
315
- export function getCoreDocSections(): DocSectionMeta[] {
316
- return DOCS_REGISTRY.core
317
- }
318
-
319
- /**
320
- * Get theme documentation sections only
244
+ * Get public documentation sections only (for /docs)
321
245
  */
322
- export function getThemeDocSections(): DocSectionMeta[] {
323
- return DOCS_REGISTRY.theme
246
+ export function getPublicDocSections(): DocSectionMeta[] {
247
+ return DOCS_REGISTRY.public
324
248
  }
325
249
 
326
250
  /**
327
- * Get plugin documentation sections only
251
+ * Get superadmin documentation sections only (for /superadmin/docs)
328
252
  */
329
- export function getPluginDocSections(): DocSectionMeta[] {
330
- return DOCS_REGISTRY.plugins
253
+ export function getSuperadminDocSections(): DocSectionMeta[] {
254
+ return DOCS_REGISTRY.superadmin
331
255
  }
332
256
 
333
257
  /**
334
- * Get documentation sections for a specific plugin
258
+ * Find a section by slug
335
259
  */
336
- export function getPluginDocSectionsByName(pluginName: string): DocSectionMeta[] {
337
- return DOCS_REGISTRY.plugins.filter(section => section.pluginName === pluginName)
260
+ export function findDocSection(slug: string): DocSectionMeta | undefined {
261
+ return DOCS_REGISTRY.all.find(section => section.slug === slug)
338
262
  }
339
263
 
340
264
  /**
341
- * Find a section by slug
265
+ * Find a section by slug in a specific category
342
266
  */
343
- export function findDocSection(slug: string): DocSectionMeta | undefined {
344
- return DOCS_REGISTRY.all.find(section => section.slug === slug)
267
+ export function findDocSectionInCategory(slug: string, category: 'public' | 'superadmin'): DocSectionMeta | undefined {
268
+ return DOCS_REGISTRY[category].find(section => section.slug === slug)
345
269
  }
346
270
 
347
271
  /**
@@ -98,25 +98,28 @@ export const APP_CONFIG_OVERRIDES = {
98
98
  // =============================================================================
99
99
  // DOCUMENTATION
100
100
  // =============================================================================
101
+ /**
102
+ * Documentation system configuration
103
+ *
104
+ * Structure:
105
+ * - public: User-facing documentation at /docs
106
+ * - superadmin: Admin documentation at /superadmin/docs
107
+ *
108
+ * NOTE: Plugin docs are NOT in the registry - they are for developer reference only (IDE/LLM).
109
+ */
101
110
  docs: {
102
111
  enabled: true,
103
- public: true,
112
+ publicAccess: true,
104
113
  searchEnabled: true,
105
114
  breadcrumbs: true,
106
- theme: {
115
+ public: {
107
116
  enabled: true,
108
117
  open: true,
109
- label: 'Starter',
118
+ label: 'Documentation',
110
119
  },
111
- plugins: {
120
+ superadmin: {
112
121
  enabled: true,
113
- open: false,
114
- label: 'Plugins',
115
- },
116
- core: {
117
- enabled: true,
118
- open: true,
119
- label: 'Core',
122
+ label: 'Admin Docs',
120
123
  },
121
124
  },
122
125
 
@@ -0,0 +1,31 @@
1
+ # Admin Configuration
2
+
3
+ This guide covers the configuration options available to administrators.
4
+
5
+ ## Environment Variables
6
+
7
+ Configure your application through environment variables:
8
+
9
+ ```bash
10
+ # Database
11
+ DATABASE_URL="postgresql://..."
12
+
13
+ # Authentication
14
+ BETTER_AUTH_SECRET="your-secret"
15
+
16
+ # Application
17
+ NEXT_PUBLIC_APP_URL="https://your-domain.com"
18
+ ```
19
+
20
+ ## Configuration Files
21
+
22
+ Customize your application through config files in `config/`:
23
+
24
+ - `app.config.ts` - Main application settings
25
+ - `permissions.config.ts` - Roles and permissions
26
+ - `billing.config.ts` - Subscription plans
27
+ - `dev.config.ts` - Development settings
28
+
29
+ ## Next Steps
30
+
31
+ Refer to the main documentation for detailed guides on each configuration area.
@@ -2,17 +2,17 @@
2
2
  * Cypress Configuration for Starter Theme
3
3
  *
4
4
  * This config is self-contained for npm projects created with `nextspark init`.
5
- * Run with: pnpm cy:open
5
+ * Run with: pnpm cy:open or pnpm cy:run
6
+ *
7
+ * Filter by tags: pnpm cy:tags "@smoke" or pnpm cy:run --env grepTags="@smoke"
6
8
  */
7
9
 
8
10
  import { defineConfig } from 'cypress'
9
11
  import path from 'path'
10
12
  import fs from 'fs'
11
- import { fileURLToPath } from 'url'
12
13
 
13
- // ESM-compatible __dirname
14
- const __filename = fileURLToPath(import.meta.url)
15
- const __dirname = path.dirname(__filename)
14
+ // __dirname is available because ts-node processes this file as CommonJS
15
+ // (Next.js projects don't use "type": "module" in package.json)
16
16
 
17
17
  // Paths relative to this config file
18
18
  const themeRoot = path.resolve(__dirname, '..')
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Cypress Tags Runner
4
+ *
5
+ * A wrapper script that converts --tags to --env grepTags for @cypress/grep
6
+ *
7
+ * Usage:
8
+ * pnpm cy:tags "@smoke" # Run tests with @smoke tag
9
+ * pnpm cy:tags "@P0+@auth" # Run tests with @P0 AND @auth tags
10
+ * pnpm cy:tags "@smoke @auth" # Run tests with @smoke OR @auth tags
11
+ * pnpm cy:tags "-@slow" # Exclude tests with @slow tag
12
+ * pnpm cy:tags "@smoke" --headed # Run with browser visible
13
+ */
14
+
15
+ const { spawnSync } = require('child_process')
16
+ const path = require('path')
17
+ const fs = require('fs')
18
+
19
+ // Get arguments after script name
20
+ const args = process.argv.slice(2)
21
+
22
+ // First argument is the tag(s), rest are additional cypress args
23
+ const tags = args[0] || ''
24
+ const extraArgs = args.slice(1)
25
+
26
+ // Find the active theme's cypress config
27
+ function findCypressConfig() {
28
+ const contentsDir = path.join(process.cwd(), 'contents', 'themes')
29
+
30
+ if (!fs.existsSync(contentsDir)) {
31
+ console.error('Error: contents/themes directory not found')
32
+ process.exit(1)
33
+ }
34
+
35
+ const themes = fs.readdirSync(contentsDir).filter((name) => {
36
+ const themePath = path.join(contentsDir, name)
37
+ return fs.statSync(themePath).isDirectory()
38
+ })
39
+
40
+ // Check NEXT_PUBLIC_ACTIVE_THEME env var first
41
+ const activeTheme = process.env.NEXT_PUBLIC_ACTIVE_THEME
42
+
43
+ if (activeTheme && themes.includes(activeTheme)) {
44
+ const configPath = path.join(contentsDir, activeTheme, 'tests', 'cypress.config.ts')
45
+ if (fs.existsSync(configPath)) {
46
+ return configPath
47
+ }
48
+ }
49
+
50
+ // Otherwise use the first theme found
51
+ for (const theme of themes) {
52
+ const configPath = path.join(contentsDir, theme, 'tests', 'cypress.config.ts')
53
+ if (fs.existsSync(configPath)) {
54
+ return configPath
55
+ }
56
+ }
57
+
58
+ console.error('Error: No cypress.config.ts found in any theme')
59
+ process.exit(1)
60
+ }
61
+
62
+ const configFile = findCypressConfig()
63
+
64
+ // Build cypress arguments
65
+ const cypressArgs = ['cypress', 'run', '--config-file', configFile]
66
+
67
+ if (tags) {
68
+ cypressArgs.push('--env', `grepTags=${tags}`)
69
+ }
70
+
71
+ // Add any extra arguments
72
+ cypressArgs.push(...extraArgs)
73
+
74
+ console.log(`Running: npx ${cypressArgs.join(' ')}`)
75
+
76
+ // Execute cypress
77
+ const result = spawnSync('npx', cypressArgs, {
78
+ stdio: 'inherit',
79
+ shell: true,
80
+ cwd: process.cwd(),
81
+ })
82
+
83
+ process.exit(result.status || 0)