Skip to content

Commit 47f7645

Browse files
committed
chore: code cleanup
1 parent 58f842f commit 47f7645

File tree

8 files changed

+155
-92
lines changed

8 files changed

+155
-92
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@ logs
2727
.history
2828

2929
# Project
30-
.private
3130
public/assets
3231
package-lock.json

TODO.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# ToDo
2+
3+
## Site Finalization
4+
5+
- [ ] Figure out legal policies
6+
- [ ] Logo needs fixed (replace text with svg to fix it)
7+
- [ ] Seo for entire site
8+
- [ ] Expand ftp script to push data,images,videos separately
9+
10+
## Rebrand
11+
12+
### Usernames & Social Media
13+
14+
- GitHub: [projectM-visualizer](https://github.com/projectM-visualizer)
15+
- Twitter/X: [@projectMvisual](https://x.com/projectMViz)
16+
- Mastodon: [@projectm](https://fosstodon.org/@projectm)
17+
- Discord: [projectM](https://discord.gg/projectM)
18+
19+
### UPDATED - Usernames & Social Media
20+
21+
- GitHub: [ProjectM Visualizer](https://github.com/projectm-visualizer)
22+
- Twitter/X: [@ProjectMVisualizer](https://twitter.com/projectm-visualizer)
23+
- Mastodon: [ProjectM Visualizer](https://fosstodon.org/@projectm-visualizer)
24+
- Bluesky: [ProjectM Visualizer](https://bsky.app/profile/projectm-visualizer.org)
25+
- Discord: [ProjectM Visualizer](https://discord.gg/projectm-visualizer)

app/app.config.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,48 @@ export default defineAppConfig({
33
colors: {
44
primary: 'teal',
55
neutral: 'gray'
6+
},
7+
icons: {
8+
arrowUp: 'i-lucide-arrow-up',
9+
arrowDown: 'i-lucide-arrow-down',
10+
caution: 'i-lucide-circle-alert',
11+
copy: 'i-lucide-copy',
12+
copyCheck: 'i-lucide-copy-check',
13+
dark: 'i-lucide-moon',
14+
error: 'i-lucide-circle-x',
15+
eye: 'i-lucide-eye',
16+
eyeOff: 'i-lucide-eye-off',
17+
file: 'i-lucide-file-text',
18+
folder: 'i-lucide-folder',
19+
folderOpen: 'i-lucide-folder-open',
20+
hash: 'i-lucide-hash',
21+
info: 'i-lucide-info',
22+
light: 'i-lucide-sun',
23+
menu: 'i-lucide-menu',
24+
panelClose: 'i-lucide-panel-left-close',
25+
panelOpen: 'i-lucide-panel-left-open',
26+
reload: 'i-lucide-rotate-ccw',
27+
stop: 'i-lucide-square',
28+
success: 'i-lucide-circle-check',
29+
system: 'i-lucide-monitor',
30+
tip: 'i-lucide-lightbulb',
31+
warning: 'i-lucide-triangle-alert',
32+
arrowLeft: 'i-lucide-arrow-left',
33+
arrowRight: 'i-lucide-arrow-right',
34+
check: 'i-lucide-check',
35+
chevronDoubleLeft: 'i-lucide-chevrons-left',
36+
chevronDoubleRight: 'i-lucide-chevrons-right',
37+
chevronDown: 'i-lucide-chevron-down',
38+
chevronLeft: 'i-lucide-chevron-left',
39+
chevronRight: 'i-lucide-chevron-right',
40+
chevronUp: 'i-lucide-chevron-up',
41+
close: 'i-lucide-x',
42+
ellipsis: 'i-lucide-ellipsis',
43+
external: 'i-lucide-arrow-up-right',
44+
loading: 'i-lucide-loader-circle',
45+
minus: 'i-lucide-minus',
46+
plus: 'i-lucide-plus',
47+
search: 'i-lucide-search'
648
}
749
}
850
})
Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,5 @@
11
---
22
title: Introduction
3-
description: Welcome to Nuxt UI Pro SaaS template.
3+
description: Welcome to our User Guide
44
---
55

6-
This template is a ready-to-use SaaS template made with [Nuxt UI Pro](https://ui.nuxt.com/pro), a collection of premium components built on top of [Nuxt UI](https://ui.nuxt.com) to create beautiful & responsive Nuxt applications in minutes.
7-
8-
This template includes a customizable landing page, a pricing page, a documentation, a blog and authentication pages (login, register).
9-
10-
## Features
11-
12-
- Powered by [Nuxt 3](https://nuxt.com)
13-
- Built with [Nuxt UI](https://ui.nuxt.com) and [Nuxt UI Pro](https://ui.nuxt.com/pro)
14-
- Write content with [MDC syntax](https://content.nuxt.com/usage/markdown) thanks to [Nuxt Content](https://content.nuxt.com)
15-
- Beautiful Typography styles
16-
- Full-Text Search out of the box
17-
- Dark mode support
18-
- And more...
19-
20-
## Play online
21-
22-
You can start playing with this template in your browser using our online sandboxes:
23-
24-
::u-button
25-
---
26-
class: mr-4
27-
icon: i-simple-icons-stackblitz
28-
label: Play on StackBlitz
29-
target: _blank
30-
to: https://stackblitz.com/github/nuxt-ui-pro/saas/
31-
---
32-
::
33-
34-
::u-button
35-
---
36-
class: mt-2 sm:mt-0
37-
icon: i-simple-icons-codesandbox
38-
label: Play on CodeSandbox
39-
target: _blank
40-
to: https://codesandbox.io/s/github/nuxt-ui-pro/saas/
41-
---
42-
::
43-
44-
Or open [Nuxt UI playground](https://ui.nuxt.com/playground).
Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
11
---
22
title: Installation
3-
description: Get started with Nuxt UI Pro SaaS template.
3+
description: Get started with the installation of our software.
44
---
5-
6-
## Quick Start
7-
8-
You can start a fresh new project with:
9-
10-
```bash [Terminal]
11-
npx nuxi init -t github:nuxt-ui-pro/saas
12-
```
13-
14-
or create a new repository from GitHub:
15-
16-
1. Open <https://github.com/nuxt-ui-pro/saas>
17-
2. Click on `Use this template` button
18-
3. Enter repository name and click on `Create repository from template` button
19-
4. Clone your new repository
20-
5. Install dependencies with your favorite package manager
21-
6. Start development server

nuxt.config.ts

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,34 +68,64 @@ export default defineNuxtConfig({
6868
clientBundle: {
6969
scan: true,
7070
icons: [
71-
'lucide:menu',
72-
'lucide:chevron-down',
73-
'lucide:arrow-up-right',
71+
'lucide:arrow-down',
72+
'lucide:arrow-left',
7473
'lucide:arrow-right',
75-
'lucide:x',
76-
'lucide:hash',
77-
'lucide:sun',
78-
'lucide:moon',
74+
'lucide:arrow-up',
75+
'lucide:arrow-up-right',
7976
'lucide:book',
8077
'lucide:book-open',
8178
'lucide:book-text',
79+
'lucide:check',
80+
'lucide:chevron-down',
81+
'lucide:chevron-left',
82+
'lucide:chevron-right',
83+
'lucide:chevron-up',
84+
'lucide:chevrons-left',
85+
'lucide:chevrons-right',
86+
'lucide:circle-alert',
87+
'lucide:circle-check',
88+
'lucide:circle-x',
8289
'lucide:code-xml',
90+
'lucide:copy',
91+
'lucide:copy-check',
8392
'lucide:credit-card',
8493
'lucide:download',
94+
'lucide:ellipsis',
8595
'lucide:equal-approximately',
96+
'lucide:eye',
97+
'lucide:eye-off',
98+
'lucide:file-text',
99+
'lucide:folder',
100+
'lucide:folder-open',
86101
'lucide:folder-root',
87102
'lucide:git-fork',
103+
'lucide:hash',
104+
'lucide:info',
105+
'lucide:lightbulb',
106+
'lucide:loader-circle',
107+
'lucide:menu',
108+
'lucide:minus',
109+
'lucide:monitor',
110+
'lucide:moon',
88111
'lucide:newspaper',
112+
'lucide:panel-left-close',
113+
'lucide:panel-left-open',
89114
'lucide:pencil',
115+
'lucide:plus',
116+
'lucide:rotate-ccw',
117+
'lucide:search',
90118
'lucide:spline',
119+
'lucide:square',
91120
'lucide:star',
121+
'lucide:sun',
122+
'lucide:triangle-alert',
123+
'lucide:x',
92124
'simple-icons:apple',
93-
'simple-icons:codesandbox',
94125
'simple-icons:discord',
95126
'simple-icons:github',
96127
'simple-icons:linux',
97128
'simple-icons:mastodon',
98-
'simple-icons:stackblitz',
99129
'simple-icons:windows',
100130
'simple-icons:x',
101131
'simple-icons:youtube'

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"eslint": "^9.28.0",
5353
"libsodium-wrappers": "^0.7.15",
5454
"lint-staged": "^16.1.1",
55-
"node-gyp": "^11.2.0",
5655
"octokit": "^5.0.3",
5756
"semantic-release": "^24.2.5",
5857
"simple-git-hooks": "^2.13.0",

scripts/extract-icons.ts

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ import { readdirSync, statSync } from 'node:fs'
1010

1111
// ---------- Config & Constants ----------
1212

13-
// const NUXT_CONFIG_FILE = 'nuxt.config.ts'
13+
const NUXT_CONFIG_FILE = 'nuxt.config.ts'
1414
// Match only icons that start with "i-" and follow the pattern: i-[namespace]-[icon-name]
15-
const ICON_REGEX = /\bi-([\w]+-[\w-]+)\b/g
15+
const ICON_REGEX = /\bi-([a-zA-Z0-9_-]+)\b/g
1616
const VALID_EXTENSIONS = ['.yml', '.yaml', '.json', '.md', '.vue', '.ts']
1717
const DIRS = ['./app', './content', './shared']
18+
const ICON_COLLECTIONS = [
19+
'lucide',
20+
'simple-icons'
21+
]
1822

1923
// ---------- Arg Parser ----------
2024

@@ -71,39 +75,58 @@ async function scanDirRecursively(dir: string, icons: Set<string>) {
7175

7276
// ---------- Nuxt Config Update ----------
7377

74-
// TODO: Implement this function to update the Nuxt config file with the extracted icons
75-
// without overwriting existing icons.
76-
// async function updateNuxtConfig(icons: string[]) {
77-
// const nuxtConfigPath = join(process.cwd(), NUXT_CONFIG_FILE)
78-
// const config = await Bun.file(nuxtConfigPath).text()
78+
async function updateNuxtConfig(icons: string[]) {
79+
const nuxtConfigPath = join(process.cwd(), NUXT_CONFIG_FILE)
80+
const configContent = await Bun.file(nuxtConfigPath).text()
7981

80-
// const mergedIcons = new Set([
81-
// ...(config.icon?.clientBundle?.icons || []),
82-
// ...icons
83-
// ])
82+
const formattedIcons = icons.map(icon => ` '${icon}'`).join(',\n ')
8483

85-
// config.icon.clientBundle.icons = mergedIcons
84+
const updated = configContent.replace(
85+
/icons:\s*\[[\s\S]*?\]/m,
86+
`icons: [\n ${formattedIcons}\n ]`
87+
)
8688

87-
// await Bun.write(nuxtConfigPath, config)
88-
// console.log(`✅ Updated ${NUXT_CONFIG_FILE} with ${icons.length} icons.`)
89-
// }
89+
if (updated === configContent) {
90+
console.warn('⚠️ No change made. Could not locate icons array to update.')
91+
return
92+
}
93+
94+
await Bun.write(nuxtConfigPath, updated)
95+
console.log(`✅ Updated ${NUXT_CONFIG_FILE} with ${icons.length} icons.`)
96+
}
9097

9198
// ---------- Format ----------
9299

93100
function cleanIcons(icons: Set<string>): string[] {
94101
return Array.from(icons)
95102
.map(icon => icon.trim())
96-
.filter(icon => icon.length > 0 && !icon.includes(' '))
97-
.map(icon => icon.replace(/_/g, '-'))
103+
.filter(icon => ICON_COLLECTIONS.some(collection => icon.includes(`${collection}-`)))
98104
.map((icon) => {
99-
const lastDash = icon.lastIndexOf('-')
100-
return lastDash !== -1
101-
? icon.slice(0, lastDash) + ':' + icon.slice(lastDash + 1)
102-
: icon
105+
const raw = icon.replace(/i-/, '').trim()
106+
107+
const matchedCollection = ICON_COLLECTIONS
108+
.filter(collection => raw.startsWith(`${collection}-`))
109+
.sort((a, b) => b.length - a.length)[0]
110+
111+
if (!matchedCollection) {
112+
console.warn(`⚠️ Unknown icon collection for: ${icon}`)
113+
return null
114+
}
115+
116+
const iconName = raw.slice(matchedCollection.length + 1)
117+
118+
if (!iconName) {
119+
console.warn(`⚠️ Empty icon name for: ${icon}`)
120+
return null
121+
}
122+
123+
return `${matchedCollection}:${iconName}`
103124
})
125+
.filter((icon): icon is string => !!icon)
104126
.filter((icon, index, self) => self.indexOf(icon) === index)
105127
.sort((a, b) => a.localeCompare(b))
106128
}
129+
107130
// ---------- Main ----------
108131

109132
async function main() {
@@ -115,11 +138,12 @@ async function main() {
115138
}
116139

117140
const sortedIcons = cleanIcons(icons)
118-
console.log(`🔍 Found ${sortedIcons.length} styled icons:`)
141+
console.log(`🔍 Extracted ${icons.size} icons from directories: ${dirs.join(', ')}`)
119142
console.log(sortedIcons.map(i => ` '${i}'`).join(',\n'))
143+
console.log(`🔍 Sorted ${sortedIcons.length} icons:`)
120144

121145
if (write) {
122-
// await updateNuxtConfig(sortedIcons)
146+
await updateNuxtConfig(sortedIcons)
123147
}
124148
}
125149

0 commit comments

Comments
 (0)