@stacksjs/defaults 0.70.54
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.
- package/LICENSE.md +21 -0
- package/README.md +2 -0
- package/package.json +20 -0
- package/resources/assets/fonts/013717e9.woff +0 -0
- package/resources/assets/fonts/03355817.woff2 +0 -0
- package/resources/assets/fonts/0380de7e.woff2 +0 -0
- package/resources/assets/fonts/0ba5d32a.woff +0 -0
- package/resources/assets/fonts/0bd57ddf.woff2 +0 -0
- package/resources/assets/fonts/19de0a60.woff2 +0 -0
- package/resources/assets/fonts/20b87e84.woff +0 -0
- package/resources/assets/fonts/4bbc67e1.woff +0 -0
- package/resources/assets/fonts/576fb0d7.woff +0 -0
- package/resources/assets/fonts/5ea10ee5.woff2 +0 -0
- package/resources/assets/fonts/6413fc0a.woff +0 -0
- package/resources/assets/fonts/72c114cf.woff +0 -0
- package/resources/assets/fonts/73c57e73.woff2 +0 -0
- package/resources/assets/fonts/813dca6c.woff +0 -0
- package/resources/assets/fonts/8a9b0995.woff2 +0 -0
- package/resources/assets/fonts/90b4832f.woff +0 -0
- package/resources/assets/fonts/9394ab85.woff2 +0 -0
- package/resources/assets/fonts/9b3c7d7f.woff2 +0 -0
- package/resources/assets/fonts/Monaco.ttf +0 -0
- package/resources/assets/fonts/b1b36d74.woff +0 -0
- package/resources/assets/fonts/b5d74798.woff2 +0 -0
- package/resources/assets/fonts/b9f81a4d.woff +0 -0
- package/resources/assets/fonts/c9784008.woff2 +0 -0
- package/resources/assets/fonts/cf692227.woff +0 -0
- package/resources/assets/fonts/d1c6ab51.woff2 +0 -0
- package/resources/assets/fonts/e2eb62fc.woff +0 -0
- package/resources/assets/fonts/fe21f8d8.woff2 +0 -0
- package/resources/assets/fonts/nps/CampmateScript-Regular.woff2 +0 -0
- package/resources/assets/fonts/nps/NPS_2026-variable.woff2 +0 -0
- package/resources/assets/fonts/nps/RedwoodSerif-Regular.woff2 +0 -0
- package/resources/assets/fonts/nps/SequoiaSans-Regular.woff2 +0 -0
- package/resources/assets/fonts/nps/Switchback-Regular.woff2 +0 -0
- package/resources/assets/images/app-icon.png +0 -0
- package/resources/assets/images/bg-img.png +0 -0
- package/resources/assets/images/park-ridge.svg +15 -0
- package/resources/assets/images/topography.svg +1 -0
- package/resources/assets/scripts/main.ts +2153 -0
- package/resources/assets/styles/README.md +19 -0
- package/resources/assets/styles/docs/main.css +1 -0
- package/resources/assets/styles/docs/overrides.css +1 -0
- package/resources/assets/styles/docs/vars.css +8 -0
- package/resources/assets/styles/main.css +1419 -0
- package/resources/components/Button.stx +70 -0
- package/resources/components/Buttons/BaseButton.stx +39 -0
- package/resources/components/Buttons/Counter.stx +28 -0
- package/resources/components/Buttons/ToggleDark.stx +11 -0
- package/resources/components/Container.stx +10 -0
- package/resources/components/Dashboard/.gitkeep +0 -0
- package/resources/components/Dashboard/Auth/ForgotPassword.stx +127 -0
- package/resources/components/Dashboard/Auth/Login.stx +212 -0
- package/resources/components/Dashboard/Auth/Register.stx +306 -0
- package/resources/components/Dashboard/Avatar.stx +123 -0
- package/resources/components/Dashboard/Billing/ActivePlan.stx +57 -0
- package/resources/components/Dashboard/Billing/CardBrands.stx +32 -0
- package/resources/components/Dashboard/Billing/CardForm.stx +34 -0
- package/resources/components/Dashboard/Billing/OneTimePayment.stx +28 -0
- package/resources/components/Dashboard/Billing/PaymentForm.stx +33 -0
- package/resources/components/Dashboard/Billing/PaymentMethod.stx +66 -0
- package/resources/components/Dashboard/Billing/PaymentMethodList.stx +52 -0
- package/resources/components/Dashboard/Billing/Plans.stx +136 -0
- package/resources/components/Dashboard/Buttons/AppButton.stx +48 -0
- package/resources/components/Dashboard/Buttons/IconButton.stx +20 -0
- package/resources/components/Dashboard/Card.stx +78 -0
- package/resources/components/Dashboard/Chart.stx +75 -0
- package/resources/components/Dashboard/CodeEditor.stx +41 -0
- package/resources/components/Dashboard/Commerce/BulkActionBar.stx +70 -0
- package/resources/components/Dashboard/Commerce/CategoriesTable.stx +133 -0
- package/resources/components/Dashboard/Commerce/CouponsTable.stx +161 -0
- package/resources/components/Dashboard/Commerce/CustomersTable.stx +142 -0
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +80 -0
- package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryTable.stx +85 -0
- package/resources/components/Dashboard/Commerce/Delivery/DriversTable.stx +99 -0
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysTable.stx +92 -0
- package/resources/components/Dashboard/Commerce/Delivery/LicenseTemplatesTable.stx +88 -0
- package/resources/components/Dashboard/Commerce/Delivery/Pagination.stx +122 -0
- package/resources/components/Dashboard/Commerce/Delivery/SearchFilter.stx +23 -0
- package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsTable.stx +80 -0
- package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesTable.stx +59 -0
- package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesTable.stx +71 -0
- package/resources/components/Dashboard/Commerce/Delivery/TabNavigation.stx +36 -0
- package/resources/components/Dashboard/Commerce/Forms/CouponsForm.stx +191 -0
- package/resources/components/Dashboard/Commerce/OrdersTable.stx +131 -0
- package/resources/components/Dashboard/Commerce/ProductsTable.stx +170 -0
- package/resources/components/Dashboard/CreateRecordModal.stx +363 -0
- package/resources/components/Dashboard/DashboardLayout.stx +155 -0
- package/resources/components/Dashboard/Deployments/ActivityFeed.stx +54 -0
- package/resources/components/Dashboard/Deployments/DeployScript.stx +23 -0
- package/resources/components/Dashboard/Deployments/DeploymentHistory.stx +97 -0
- package/resources/components/Dashboard/Deployments/DeploymentList.stx +94 -0
- package/resources/components/Dashboard/Deployments/LiveTerminalOutput.stx +18 -0
- package/resources/components/Dashboard/Elements/Dropdown.stx +57 -0
- package/resources/components/Dashboard/Email/EmailActivityChart.stx +111 -0
- package/resources/components/Dashboard/Email/EmailCompose.stx +72 -0
- package/resources/components/Dashboard/Email/EmailDetail.stx +105 -0
- package/resources/components/Dashboard/Email/EmailList.stx +117 -0
- package/resources/components/Dashboard/Email/EmailSearch.stx +40 -0
- package/resources/components/Dashboard/Email/EmailSidebar.stx +133 -0
- package/resources/components/Dashboard/GlobalSearch.stx +124 -0
- package/resources/components/Dashboard/MobileSidebar.stx +47 -0
- package/resources/components/Dashboard/Modals/BaseModal.stx +50 -0
- package/resources/components/Dashboard/Modals/Popups/Alert.stx +112 -0
- package/resources/components/Dashboard/Modals/Popups/Toast.stx +70 -0
- package/resources/components/Dashboard/Modals/ToastWrapper.stx +35 -0
- package/resources/components/Dashboard/Monitoring/ErrorDetailModal.stx +228 -0
- package/resources/components/Dashboard/Monitoring/ErrorsTable.stx +184 -0
- package/resources/components/Dashboard/Navbar.stx +194 -0
- package/resources/components/Dashboard/NavbarModern.stx +188 -0
- package/resources/components/Dashboard/NotificationErrorModal.stx +105 -0
- package/resources/components/Dashboard/NotificationStatusBadge.stx +20 -0
- package/resources/components/Dashboard/Pagination.stx +90 -0
- package/resources/components/Dashboard/Queue/QueueTable.stx +127 -0
- package/resources/components/Dashboard/Settings/Forms/AIForm.stx +126 -0
- package/resources/components/Dashboard/Settings/Forms/AnalyticsForm.stx +52 -0
- package/resources/components/Dashboard/Settings/Forms/AppForm.stx +157 -0
- package/resources/components/Dashboard/Settings/Forms/CLIForm.stx +66 -0
- package/resources/components/Dashboard/Settings/Forms/CacheForm.stx +253 -0
- package/resources/components/Dashboard/Settings/Forms/CloudForm.stx +441 -0
- package/resources/components/Dashboard/Settings/Forms/DNSForm.stx +307 -0
- package/resources/components/Dashboard/Settings/Forms/DatabaseForm.stx +168 -0
- package/resources/components/Dashboard/Settings/Forms/EmailForm.stx +100 -0
- package/resources/components/Dashboard/Settings/Forms/FileSystemForm.stx +259 -0
- package/resources/components/Dashboard/Settings/Forms/HashingForm.stx +119 -0
- package/resources/components/Dashboard/Settings/Forms/LibraryForm.stx +389 -0
- package/resources/components/Dashboard/Settings/Forms/QueueForm.stx +219 -0
- package/resources/components/Dashboard/Settings/Forms/SearchEngineForm.stx +48 -0
- package/resources/components/Dashboard/Settings/Forms/SecurityForm.stx +143 -0
- package/resources/components/Dashboard/Settings/Forms/ServicesForm.stx +194 -0
- package/resources/components/Dashboard/Settings/Forms/StorageForm.stx +191 -0
- package/resources/components/Dashboard/Settings/Forms/TeamsForm.stx +33 -0
- package/resources/components/Dashboard/Settings/SettingsFormManager.stx +181 -0
- package/resources/components/Dashboard/SettingsHeader.stx +88 -0
- package/resources/components/Dashboard/SettingsSidebar.stx +234 -0
- package/resources/components/Dashboard/Sidebar.stx +23 -0
- package/resources/components/Dashboard/SidebarModern.stx +249 -0
- package/resources/components/Dashboard/Skeleton/LoadingCard.stx +15 -0
- package/resources/components/Dashboard/Skeleton/LoadingDetails.stx +26 -0
- package/resources/components/Dashboard/Table.stx +82 -0
- package/resources/components/Dashboard/TerminalContainer.stx +97 -0
- package/resources/components/Dashboard/Tooltip.stx +166 -0
- package/resources/components/Dashboard/Transaction/index.stx +88 -0
- package/resources/components/Dashboard/UI/ActivityTable.stx +54 -0
- package/resources/components/Dashboard/UI/Avatar.stx +102 -0
- package/resources/components/Dashboard/UI/Badge.stx +66 -0
- package/resources/components/Dashboard/UI/Button.stx +73 -0
- package/resources/components/Dashboard/UI/Card.stx +51 -0
- package/resources/components/Dashboard/UI/ChartCard.stx +36 -0
- package/resources/components/Dashboard/UI/Checkbox.stx +74 -0
- package/resources/components/Dashboard/UI/ConfirmDialog.stx +74 -0
- package/resources/components/Dashboard/UI/DataTable.stx +45 -0
- package/resources/components/Dashboard/UI/Dropdown.stx +72 -0
- package/resources/components/Dashboard/UI/DropdownItem.stx +80 -0
- package/resources/components/Dashboard/UI/EmptyState.stx +50 -0
- package/resources/components/Dashboard/UI/FilterBar.stx +48 -0
- package/resources/components/Dashboard/UI/Input.stx +77 -0
- package/resources/components/Dashboard/UI/Modal.stx +75 -0
- package/resources/components/Dashboard/UI/PageHeader.stx +69 -0
- package/resources/components/Dashboard/UI/PageLayout.stx +84 -0
- package/resources/components/Dashboard/UI/Pagination.stx +126 -0
- package/resources/components/Dashboard/UI/QuickLinks.stx +31 -0
- package/resources/components/Dashboard/UI/RouterLink.stx +31 -0
- package/resources/components/Dashboard/UI/Select.stx +84 -0
- package/resources/components/Dashboard/UI/ServiceHealth.stx +38 -0
- package/resources/components/Dashboard/UI/StatsCard.stx +79 -0
- package/resources/components/Dashboard/UI/Table.stx +143 -0
- package/resources/components/Dashboard/UI/Tabs.stx +45 -0
- package/resources/components/Dashboard/UI/Textarea.stx +93 -0
- package/resources/components/Dashboard/UI/Toggle.stx +84 -0
- package/resources/components/Dashboard/UI/WindowControls.stx +135 -0
- package/resources/components/Dashboard/Widget.stx +89 -0
- package/resources/components/Dashboard/WindowControls.stx +119 -0
- package/resources/components/Dashboard/index.ts +106 -0
- package/resources/components/Docs/Demo/ComboboxCode.md +114 -0
- package/resources/components/Docs/Demo/ComboboxDemo.stx +91 -0
- package/resources/components/Docs/Demo/DialogCode.md +42 -0
- package/resources/components/Docs/Demo/DialogDemo.stx +76 -0
- package/resources/components/Docs/Demo/DocsPlayground.stx +39 -0
- package/resources/components/Docs/Demo/DropdownCode.md +109 -0
- package/resources/components/Docs/Demo/DropdownDemo.stx +82 -0
- package/resources/components/Docs/Demo/Hero.stx +100 -0
- package/resources/components/Docs/Demo/ListboxCode.md +87 -0
- package/resources/components/Docs/Demo/ListboxDemo.stx +59 -0
- package/resources/components/Docs/Demo/NotificationCode.md +173 -0
- package/resources/components/Docs/Demo/NotificationDemo.stx +99 -0
- package/resources/components/Docs/Demo/PopoverCode.md +161 -0
- package/resources/components/Docs/Demo/PopoverDemo.stx +96 -0
- package/resources/components/Docs/Demo/RadioGroupCode.md +98 -0
- package/resources/components/Docs/Demo/RadioGroupDemo.stx +53 -0
- package/resources/components/Docs/Demo/StepperCode.md +216 -0
- package/resources/components/Docs/Demo/StepperDemo.stx +137 -0
- package/resources/components/Docs/Demo/SwitchCode.md +24 -0
- package/resources/components/Docs/Demo/SwitchDemo.stx +28 -0
- package/resources/components/Docs/Home.stx +7 -0
- package/resources/components/Docs/HomeContributors.stx +23 -0
- package/resources/components/Docs/HomeSponsors.stx +17 -0
- package/resources/components/Docs/HomeTeam.stx +18 -0
- package/resources/components/Docs/TeamMember.stx +79 -0
- package/resources/components/Email/EmailButton.stx +32 -0
- package/resources/components/Email/EmailDivider.stx +20 -0
- package/resources/components/Email/EmailImage.stx +24 -0
- package/resources/components/Email/EmailLayout.stx +55 -0
- package/resources/components/Email/EmailLink.stx +22 -0
- package/resources/components/Email/EmailSection.stx +20 -0
- package/resources/components/Email/EmailText.stx +30 -0
- package/resources/components/Forum/ForumBreadcrumb.stx +38 -0
- package/resources/components/Forum/ForumCategory.stx +16 -0
- package/resources/components/Forum/ForumCategoryItem.stx +46 -0
- package/resources/components/Forum/ForumLayout.stx +36 -0
- package/resources/components/Forum/ForumPagination.stx +39 -0
- package/resources/components/Forum/ForumPost.stx +71 -0
- package/resources/components/Forum/ForumReplyForm.stx +76 -0
- package/resources/components/Forum/ForumSidebar.stx +86 -0
- package/resources/components/Forum/ForumTopicItem.stx +77 -0
- package/resources/components/Forum/ForumTopicList.stx +23 -0
- package/resources/components/HelloWorld.stx +253 -0
- package/resources/components/Logo.stx +10 -0
- package/resources/components/Marketing/CallToAction.stx +30 -0
- package/resources/components/Marketing/ComingSoon.stx +155 -0
- package/resources/components/Marketing/Faqs.stx +99 -0
- package/resources/components/Marketing/Feature.stx +32 -0
- package/resources/components/Marketing/Fields.stx +28 -0
- package/resources/components/Marketing/Footer.stx +33 -0
- package/resources/components/Marketing/Header.stx +51 -0
- package/resources/components/Marketing/Hero.stx +46 -0
- package/resources/components/Marketing/Layout.stx +26 -0
- package/resources/components/Marketing/NavLink.stx +13 -0
- package/resources/components/Marketing/Plan.stx +43 -0
- package/resources/components/Marketing/Pricing.stx +120 -0
- package/resources/components/Marketing/PrimaryFeatures.stx +80 -0
- package/resources/components/Marketing/PrimaryFeatures2.stx +98 -0
- package/resources/components/Marketing/SecondaryFeatures.stx +80 -0
- package/resources/components/Marketing/Testimonials.stx +120 -0
- package/resources/components/Pagination.stx +149 -0
- package/resources/components/Playground.stx +9 -0
- package/resources/components/README.md +87 -0
- package/resources/components/Storefront/AnnouncementBar.stx +17 -0
- package/resources/components/Storefront/CartDrawer.stx +227 -0
- package/resources/components/Storefront/CheckoutSteps.stx +50 -0
- package/resources/components/Storefront/Footer.stx +81 -0
- package/resources/components/Storefront/Header.stx +66 -0
- package/resources/components/Storefront/OrderSummary.stx +79 -0
- package/resources/components/Storefront/ProductCard.stx +63 -0
- package/resources/components/Storefront/ProductGallery.stx +88 -0
- package/resources/components/Storefront/QuantitySelector.stx +97 -0
- package/resources/components/index.ts +13 -0
- package/resources/emails/email-verification.stx +46 -0
- package/resources/emails/layouts/base.html +113 -0
- package/resources/emails/password-changed.stx +55 -0
- package/resources/emails/password-reset.stx +43 -0
- package/resources/emails/subscription-confirmation.stx +99 -0
- package/resources/emails/welcome.stx +48 -0
- package/resources/functions/README.md +28 -0
- package/resources/functions/counter.ts +13 -0
- package/resources/functions/dark.ts +4 -0
- package/resources/functions/dashboard/analytics.ts +238 -0
- package/resources/functions/dashboard/config-io.ts +316 -0
- package/resources/functions/dashboard/data.ts +375 -0
- package/resources/functions/dashboard/library.ts +250 -0
- package/resources/functions/dashboard/sidebar.ts +537 -0
- package/resources/functions/dashboard/system.ts +150 -0
- package/resources/layouts/403.stx +188 -0
- package/resources/layouts/404.stx +34 -0
- package/resources/layouts/README.md +14 -0
- package/resources/layouts/dashboard/default.stx +20 -0
- package/resources/layouts/dashboard/guest.stx +10 -0
- package/resources/layouts/default.stx +3 -0
- package/resources/layouts/maintenance.stx +11 -0
- package/resources/layouts/storefront.stx +73 -0
- package/resources/layouts/system-tray/default.stx +3 -0
- package/resources/modules/.gitkeep +0 -0
- package/resources/plugins/.gitkeep +0 -0
- package/resources/plugins/preloader.ts +308 -0
- package/resources/types/README.md +3 -0
- package/resources/views/cart.stx +149 -0
- package/resources/views/checkout/contact.stx +101 -0
- package/resources/views/checkout/payment.stx +114 -0
- package/resources/views/checkout/shipping.stx +120 -0
- package/resources/views/coming-soon.stx +9 -0
- package/resources/views/dashboard/custom-page.stx +45 -0
- package/resources/views/dashboard/index.stx +24 -0
- package/resources/views/emails/welcome.stx +0 -0
- package/resources/views/errors/tester.stx +26 -0
- package/resources/views/index.stx +2865 -0
- package/resources/views/orders/[id].stx +130 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Library-section helpers — list framework components, functions, and
|
|
3
|
+
* packages by scanning the filesystem rather than querying a model.
|
|
4
|
+
* These pages document developer-facing surface area; they have no DB
|
|
5
|
+
* counterpart.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs'
|
|
9
|
+
import { join, resolve } from 'node:path'
|
|
10
|
+
import process from 'node:process'
|
|
11
|
+
|
|
12
|
+
let projectRootCache: string | null = null
|
|
13
|
+
function projectRoot(): string {
|
|
14
|
+
if (projectRootCache) return projectRootCache
|
|
15
|
+
let dir = process.cwd()
|
|
16
|
+
for (let i = 0; i < 8; i++) {
|
|
17
|
+
if (existsSync(resolve(dir, 'storage/framework/defaults'))) {
|
|
18
|
+
projectRootCache = dir
|
|
19
|
+
return dir
|
|
20
|
+
}
|
|
21
|
+
const parent = resolve(dir, '..')
|
|
22
|
+
if (parent === dir) break
|
|
23
|
+
dir = parent
|
|
24
|
+
}
|
|
25
|
+
projectRootCache = process.cwd()
|
|
26
|
+
return projectRootCache
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ComponentEntry {
|
|
30
|
+
name: string
|
|
31
|
+
path: string
|
|
32
|
+
category: string
|
|
33
|
+
size: number
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Scan the dashboard component directory plus any user component
|
|
38
|
+
* directories. Returns one entry per `.stx` / `.vue` file with the file
|
|
39
|
+
* size (so the UI can show "small", "medium", "large" hints).
|
|
40
|
+
*/
|
|
41
|
+
export function listComponents(): ComponentEntry[] {
|
|
42
|
+
const root = projectRoot()
|
|
43
|
+
const dirs = [
|
|
44
|
+
{ dir: 'storage/framework/defaults/resources/components/Dashboard', category: 'dashboard' },
|
|
45
|
+
{ dir: 'resources/components', category: 'app' },
|
|
46
|
+
]
|
|
47
|
+
const out: ComponentEntry[] = []
|
|
48
|
+
for (const { dir, category } of dirs) {
|
|
49
|
+
const abs = resolve(root, dir)
|
|
50
|
+
if (!existsSync(abs)) continue
|
|
51
|
+
walkSync(abs, (file) => {
|
|
52
|
+
if (!/\.(?:stx|vue|tsx|jsx)$/.test(file)) return
|
|
53
|
+
try {
|
|
54
|
+
const stat = statSync(file)
|
|
55
|
+
out.push({
|
|
56
|
+
name: file.split('/').pop()!.replace(/\.[^.]+$/, ''),
|
|
57
|
+
path: file.slice(root.length + 1),
|
|
58
|
+
category,
|
|
59
|
+
size: stat.size,
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
catch { /* skip unreadable files */ }
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
return out.sort((a, b) => a.name.localeCompare(b.name))
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface FunctionEntry {
|
|
69
|
+
name: string
|
|
70
|
+
path: string
|
|
71
|
+
category: string
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Scan the resources/functions tree. Each `.ts` file is one logical
|
|
76
|
+
* helper; the category is the immediate parent directory.
|
|
77
|
+
*/
|
|
78
|
+
export function listFunctions(): FunctionEntry[] {
|
|
79
|
+
const root = projectRoot()
|
|
80
|
+
const dirs = [
|
|
81
|
+
'storage/framework/defaults/resources/functions',
|
|
82
|
+
'resources/functions',
|
|
83
|
+
]
|
|
84
|
+
const out: FunctionEntry[] = []
|
|
85
|
+
for (const dir of dirs) {
|
|
86
|
+
const abs = resolve(root, dir)
|
|
87
|
+
if (!existsSync(abs)) continue
|
|
88
|
+
walkSync(abs, (file) => {
|
|
89
|
+
if (!file.endsWith('.ts')) return
|
|
90
|
+
const rel = file.slice(abs.length + 1)
|
|
91
|
+
const parts = rel.split('/')
|
|
92
|
+
const category = parts.length > 1 ? parts[0] : 'core'
|
|
93
|
+
out.push({
|
|
94
|
+
name: parts[parts.length - 1].replace(/\.ts$/, ''),
|
|
95
|
+
path: file.slice(root.length + 1),
|
|
96
|
+
category,
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
return out.sort((a, b) => (a.category + a.name).localeCompare(b.category + b.name))
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface PackageEntry {
|
|
104
|
+
name: string
|
|
105
|
+
version: string
|
|
106
|
+
type: 'workspace' | 'dependency' | 'devDependency'
|
|
107
|
+
description?: string
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Read the root package.json plus every workspace package.json. Workspace
|
|
112
|
+
* packages get `type: 'workspace'`, runtime deps `'dependency'`, dev deps
|
|
113
|
+
* `'devDependency'`. The list is what Library / Packages and Home /
|
|
114
|
+
* Dependencies render.
|
|
115
|
+
*/
|
|
116
|
+
export function listPackages(): PackageEntry[] {
|
|
117
|
+
const root = projectRoot()
|
|
118
|
+
const out: PackageEntry[] = []
|
|
119
|
+
|
|
120
|
+
// Root package.json deps
|
|
121
|
+
const rootPkgPath = resolve(root, 'package.json')
|
|
122
|
+
if (existsSync(rootPkgPath)) {
|
|
123
|
+
try {
|
|
124
|
+
const pkg = JSON.parse(readFileSync(rootPkgPath, 'utf8'))
|
|
125
|
+
for (const [name, version] of Object.entries(pkg.dependencies || {})) {
|
|
126
|
+
out.push({ name, version: String(version), type: 'dependency' })
|
|
127
|
+
}
|
|
128
|
+
for (const [name, version] of Object.entries(pkg.devDependencies || {})) {
|
|
129
|
+
out.push({ name, version: String(version), type: 'devDependency' })
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
catch { /* malformed root package.json */ }
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Workspace packages — scan storage/framework/core/ and storage/framework/<top>/
|
|
136
|
+
const workspaceRoots = [
|
|
137
|
+
'storage/framework/core',
|
|
138
|
+
'storage/framework',
|
|
139
|
+
]
|
|
140
|
+
const seen = new Set<string>()
|
|
141
|
+
for (const wr of workspaceRoots) {
|
|
142
|
+
const abs = resolve(root, wr)
|
|
143
|
+
if (!existsSync(abs)) continue
|
|
144
|
+
for (const entry of readdirSync(abs)) {
|
|
145
|
+
const pkgFile = join(abs, entry, 'package.json')
|
|
146
|
+
if (!existsSync(pkgFile)) continue
|
|
147
|
+
if (seen.has(pkgFile)) continue
|
|
148
|
+
seen.add(pkgFile)
|
|
149
|
+
try {
|
|
150
|
+
const pkg = JSON.parse(readFileSync(pkgFile, 'utf8'))
|
|
151
|
+
if (!pkg.name) continue
|
|
152
|
+
out.push({
|
|
153
|
+
name: pkg.name,
|
|
154
|
+
version: pkg.version || '0.0.0',
|
|
155
|
+
type: 'workspace',
|
|
156
|
+
description: pkg.description,
|
|
157
|
+
})
|
|
158
|
+
}
|
|
159
|
+
catch { /* skip malformed package.json */ }
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return out.sort((a, b) => a.name.localeCompare(b.name))
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface ActionEntry {
|
|
167
|
+
name: string
|
|
168
|
+
path: string
|
|
169
|
+
category: string
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* List user-defined actions plus framework default actions. Actions are
|
|
174
|
+
* `.ts` files under `app/Actions/` (user) or `storage/framework/defaults/actions/`
|
|
175
|
+
* (framework) — one file per action.
|
|
176
|
+
*/
|
|
177
|
+
export function listActions(): ActionEntry[] {
|
|
178
|
+
const root = projectRoot()
|
|
179
|
+
const dirs = [
|
|
180
|
+
{ dir: 'app/Actions', category: 'app' },
|
|
181
|
+
{ dir: 'storage/framework/defaults/actions', category: 'framework' },
|
|
182
|
+
]
|
|
183
|
+
const out: ActionEntry[] = []
|
|
184
|
+
for (const { dir, category } of dirs) {
|
|
185
|
+
const abs = resolve(root, dir)
|
|
186
|
+
if (!existsSync(abs)) continue
|
|
187
|
+
walkSync(abs, (file) => {
|
|
188
|
+
if (!file.endsWith('.ts')) return
|
|
189
|
+
const rel = file.slice(abs.length + 1)
|
|
190
|
+
out.push({
|
|
191
|
+
name: rel.replace(/\.ts$/, '').replace(/\//g, '.'),
|
|
192
|
+
path: file.slice(root.length + 1),
|
|
193
|
+
category,
|
|
194
|
+
})
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
return out.sort((a, b) => a.name.localeCompare(b.name))
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export interface CommandEntry {
|
|
201
|
+
name: string
|
|
202
|
+
path: string
|
|
203
|
+
category: string
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* List user CLI commands (`app/Commands/`) plus framework `buddy`
|
|
208
|
+
* subcommands (`storage/framework/core/buddy/src/commands/`).
|
|
209
|
+
*/
|
|
210
|
+
export function listCommands(): CommandEntry[] {
|
|
211
|
+
const root = projectRoot()
|
|
212
|
+
const dirs = [
|
|
213
|
+
{ dir: 'app/Commands', category: 'app' },
|
|
214
|
+
{ dir: 'storage/framework/core/buddy/src/commands', category: 'buddy' },
|
|
215
|
+
]
|
|
216
|
+
const out: CommandEntry[] = []
|
|
217
|
+
for (const { dir, category } of dirs) {
|
|
218
|
+
const abs = resolve(root, dir)
|
|
219
|
+
if (!existsSync(abs)) continue
|
|
220
|
+
walkSync(abs, (file) => {
|
|
221
|
+
if (!file.endsWith('.ts')) return
|
|
222
|
+
const rel = file.slice(abs.length + 1)
|
|
223
|
+
out.push({
|
|
224
|
+
name: rel.replace(/\.ts$/, '').replace(/\//g, ' '),
|
|
225
|
+
path: file.slice(root.length + 1),
|
|
226
|
+
category,
|
|
227
|
+
})
|
|
228
|
+
})
|
|
229
|
+
}
|
|
230
|
+
return out.sort((a, b) => a.name.localeCompare(b.name))
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Recursively walk a directory, calling `cb` once per file. Skips
|
|
235
|
+
* `node_modules` and `dist` so we don't traverse compiled output.
|
|
236
|
+
*/
|
|
237
|
+
function walkSync(dir: string, cb: (file: string) => void): void {
|
|
238
|
+
let entries: string[]
|
|
239
|
+
try { entries = readdirSync(dir) }
|
|
240
|
+
catch { return }
|
|
241
|
+
for (const e of entries) {
|
|
242
|
+
if (e === 'node_modules' || e === 'dist' || e === '.git' || e.startsWith('.')) continue
|
|
243
|
+
const full = join(dir, e)
|
|
244
|
+
let s
|
|
245
|
+
try { s = statSync(full) }
|
|
246
|
+
catch { continue }
|
|
247
|
+
if (s.isDirectory()) walkSync(full, cb)
|
|
248
|
+
else cb(full)
|
|
249
|
+
}
|
|
250
|
+
}
|