@awesomeness-js/server 1.1.0 → 1.1.2

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 (43) hide show
  1. package/index.js +101 -101
  2. package/package.json +36 -36
  3. package/src/componentDependencies.js +2 -2
  4. package/ui/components/statusPage/index.css +120 -0
  5. package/ui/components/statusPage/index.js +39 -0
  6. package/ui/core/public/app.js +23 -23
  7. package/example-site/example.awesomenessjs.com/api/readme.md +0 -1
  8. package/example-site/example.awesomenessjs.com/pages/_md/_info.js +0 -15
  9. package/example-site/example.awesomenessjs.com/pages/_md/css/example.css +0 -4
  10. package/example-site/example.awesomenessjs.com/pages/_md/drafts/example.md +0 -32
  11. package/example-site/example.awesomenessjs.com/pages/_md/getBlogData.js +0 -117
  12. package/example-site/example.awesomenessjs.com/pages/_md/getData.js +0 -36
  13. package/example-site/example.awesomenessjs.com/pages/_md/js/callToAction.js +0 -43
  14. package/example-site/example.awesomenessjs.com/pages/_md/js/init.js +0 -88
  15. package/example-site/example.awesomenessjs.com/pages/_md/meta.template.md +0 -33
  16. package/example-site/example.awesomenessjs.com/pages/_md/pages/mission.md +0 -345
  17. package/example-site/example.awesomenessjs.com/pages/_template/_info.js +0 -9
  18. package/example-site/example.awesomenessjs.com/pages/_template/css/_.css +0 -4
  19. package/example-site/example.awesomenessjs.com/pages/_template/getData.js +0 -6
  20. package/example-site/example.awesomenessjs.com/pages/_template/js/init.js +0 -3
  21. package/example-site/example.awesomenessjs.com/pages/blog/_info.js +0 -14
  22. package/example-site/example.awesomenessjs.com/pages/blog/css/topics.css +0 -17
  23. package/example-site/example.awesomenessjs.com/pages/blog/getData.js +0 -22
  24. package/example-site/example.awesomenessjs.com/pages/blog/js/colors.js +0 -159
  25. package/example-site/example.awesomenessjs.com/pages/blog/js/init.js +0 -242
  26. package/example-site/example.awesomenessjs.com/pages/blog/js/tag.js +0 -111
  27. package/example-site/example.awesomenessjs.com/pages/examples/_info.js +0 -9
  28. package/example-site/example.awesomenessjs.com/pages/examples/css/footer.css +0 -6
  29. package/example-site/example.awesomenessjs.com/pages/examples/css/intro.css +0 -67
  30. package/example-site/example.awesomenessjs.com/pages/examples/css/nav.css +0 -221
  31. package/example-site/example.awesomenessjs.com/pages/examples/getData.js +0 -8
  32. package/example-site/example.awesomenessjs.com/pages/examples/js/init.js +0 -15
  33. package/example-site/example.awesomenessjs.com/pages/examples/js/updateState.js +0 -14
  34. package/example-site/example.awesomenessjs.com/pages/start/_info.js +0 -11
  35. package/example-site/example.awesomenessjs.com/pages/start/css/footer.css +0 -6
  36. package/example-site/example.awesomenessjs.com/pages/start/css/intro.css +0 -67
  37. package/example-site/example.awesomenessjs.com/pages/start/css/nav.css +0 -221
  38. package/example-site/example.awesomenessjs.com/pages/start/getData.js +0 -8
  39. package/example-site/example.awesomenessjs.com/pages/start/js/init.js +0 -30
  40. package/example-site/example.awesomenessjs.com/pages/start/js/updateState.js +0 -14
  41. package/example-site/example.awesomenessjs.com/public/images/awesomeness.webp +0 -0
  42. package/example-site/example.awesomenessjs.com/public/manifest.webmanifest.json +0 -8
  43. package/example-site/example.awesomenessjs.com/specialRoutes.js +0 -14
@@ -1,15 +0,0 @@
1
- export default {
2
- version: 1,
3
- name: '',
4
- description: 'this allows for any url to be treated as a blog post, if the slug matches a blog post, all post are simple md format',
5
- permissions: [ '*' ],
6
- components: [
7
- 'blogPage',
8
- 'blogPost',
9
- 'prism',
10
- 'statusPage',
11
- 'video',
12
- 'riskDisclosure',
13
- 'bibleVerse'
14
- ]
15
- };
@@ -1,4 +0,0 @@
1
- /*
2
- these classes are loaded dynamically ...
3
- If a class can be re-used it is better to be created in /api/ui/common-css/
4
- */
@@ -1,32 +0,0 @@
1
- ---
2
- title: Example Post
3
- subTitle: This post wont show up because its in drafts.
4
- image: /tools/images/posts/investing-101.webp
5
- published: 2025-10-10
6
- priority: null
7
- url: /test-post
8
- tags: [ faith, life hacks, spiritual freedom, christianity ]
9
- tagColor: bg-stone-900
10
- author:
11
- name: Scott Forte
12
- title: Pilot, Investor, Realtor ®
13
- image: /tools/images/scott-forte-america-small-40.webp
14
- url: https://scottmforte.com
15
- ---
16
-
17
- <break-50>
18
-
19
- <youTube>ek_RodYzUCI</youTube>
20
-
21
- ![](/tools/images/posts/c172-glide-distance.webp)
22
-
23
- <div class="blogPost-next-reads">
24
-
25
- ### Next Reads
26
-
27
- - [Investing 101: Planting a Money Tree](/investing-101)
28
- - [🏔️ Moving to NH: The Freest State on Planet Earth](/moving-to-new-hampshire)
29
- - [Alternative Investments: Beyond Stocks, bonds, 401ks and IRAs](/alternative-investments)
30
- - [👨‍✈️ Spiritual Freedom: When Jesus Becomes Your Co-Pilot](/spiritual-freedom)
31
-
32
- </div>
@@ -1,117 +0,0 @@
1
- import fs from 'fs';
2
- import parseMd from '#utils/parseMd.js';
3
- import path from 'path';
4
- import { fileURLToPath } from 'url';
5
-
6
- const __filename = fileURLToPath(import.meta.url);
7
- const __dirname = path.dirname(__filename);
8
-
9
- function tagToFilename(tag) {
10
-
11
- return tag.toLowerCase().replace(/\s+/g, '-').replace(/[^\w-]/g, '');
12
-
13
- }
14
-
15
- export default async function getBlogData(folder = 'pages') {
16
-
17
- const folderPath = path.resolve(__dirname, folder);
18
- const files = fs.readdirSync(folderPath).filter((f) => f.endsWith('.md'));
19
-
20
- const tagImagePath = path.resolve(__dirname, '../../public/tools/images/tags');
21
- const tagImageFiles = fs.existsSync(tagImagePath) ? fs.readdirSync(tagImagePath) : [];
22
-
23
- const tagMap = Object.create(null);
24
-
25
-
26
- const result = {
27
- tags: [], // now array of { name, count }
28
- links: [], // array of urls
29
- posts: [] // array of metadata objects
30
- };
31
-
32
- const linkRegex = /\[([^\]]+)\]\(([^)\s]+)\)/g;
33
-
34
- for (const file of files) {
35
-
36
- try {
37
-
38
- const filePath = path.join(folderPath, file);
39
- const mdContent = fs.readFileSync(filePath, 'utf-8');
40
-
41
- const {
42
- metadata,
43
- cleanedMDContent
44
- } = await parseMd(mdContent);
45
-
46
- if (!metadata || !metadata.published) continue;
47
-
48
- // collect tags
49
- if (Array.isArray(metadata.tags)) {
50
-
51
- for (const tag of metadata.tags) {
52
-
53
- if (!tag) continue;
54
- tagMap[tag] = (tagMap[tag] || 0) + 1;
55
-
56
- }
57
-
58
- }
59
-
60
- // collect links
61
- let match;
62
-
63
-
64
- while ((match = linkRegex.exec(cleanedMDContent)) !== null) {
65
-
66
- const url = match[2];
67
-
68
- result.links.push(url);
69
-
70
- }
71
-
72
- // collect post metadata
73
- result.posts.push({
74
- file,
75
- ...metadata
76
- });
77
-
78
- } catch(err){
79
-
80
- console.error(`Error processing file ${file}:`, err);
81
-
82
- }
83
-
84
-
85
-
86
- }
87
-
88
- // build tag array
89
- result.tags = Object.entries(tagMap)
90
- .map(([ name, count ]) => ({
91
- name,
92
- count,
93
- image: tagImageFiles.includes(tagToFilename(name) + '.webp') ? `/tools/images/tags/${tagToFilename(name)}.webp` : null
94
- }))
95
- .sort((a, b) => a.name.localeCompare(b.name));
96
-
97
- // sort posts by priority (asc), then date (desc), fallback to title
98
- result.posts.sort((a, b) => {
99
-
100
- const ap = (typeof a.priority === 'number') ? a.priority : Infinity;
101
- const bp = (typeof b.priority === 'number') ? b.priority : Infinity;
102
-
103
- if (ap !== bp) return ap - bp;
104
-
105
- const ad = new Date(a.published);
106
- const bd = new Date(b.published);
107
-
108
- if (!isNaN(ad) && !isNaN(bd)) return bd - ad;
109
-
110
- return (a.title || '').localeCompare(b.title || '');
111
-
112
- });
113
-
114
-
115
- return result;
116
-
117
- }
@@ -1,36 +0,0 @@
1
- import parseMd from '#utils/parseMd.js';
2
- import checkAccess from '#server/checkAccess.js';
3
-
4
- // @awesomenessRequest
5
- export default async function getData(awesomenessRequest) {
6
-
7
- let mdContent =
8
- awesomenessRequest.mdContent
9
- || awesomenessRequest.data.mdContent
10
- || '## No Content Found\n\nSorry, no content could be found for this post.';
11
-
12
- let {
13
- metadata,
14
- cleanedMDContent,
15
- } = await parseMd(mdContent);
16
-
17
- mdContent = cleanedMDContent;
18
-
19
- awesomenessRequest.pageInit = '_md';
20
-
21
- // check permissions?
22
- if(metadata?.permissions?.length){
23
-
24
- await checkAccess({
25
- permissionsAllowed: metadata.permissions,
26
- awesomenessRequest,
27
- });
28
-
29
- }
30
-
31
- return {
32
- mdContent,
33
- metadata,
34
- };
35
-
36
- }
@@ -1,43 +0,0 @@
1
- import ui from '#ui';
2
-
3
- app.pages._md.callToAction = async function(){
4
-
5
- $(`.custom-callToAction-real-estate`).each(function(){
6
-
7
- const $container = $(this);
8
-
9
- $container.empty();
10
-
11
- const $break = $(`<div class="break height-100"></div>`)
12
- .appendTo($container);
13
-
14
- const $h1 = $(`<h1 class="">Ready to start investing?</h1>`)
15
- .appendTo($container);
16
-
17
- const $break2 = $(`<div class="break height-25"></div>`)
18
- .appendTo($container);
19
-
20
- const $p = $(`<p class="lead">
21
- I turn down about 200 deals a year <b>because I do the math</b>.
22
- They simply don't pencil out.
23
- I also have an extremely conservative investment criteria.
24
- That said,
25
- Ive flipped over 40 units
26
- from single family homes,
27
- to office condos and hotels.
28
- I currently own over 150 units.
29
- You need me, or someone like me, as your copilot.
30
- If you are interested in learning more about investment real estate,
31
- no matter where in the world you live,
32
- text me
33
- </p>`).appendTo($container);
34
-
35
- const $link = $(`<a href="sms:855.SCOTT.40" class="">855.SCOTT.40</a>`)
36
- .appendTo($p);
37
-
38
- const $break3 = $(`<div class="break height-100"></div>`)
39
- .appendTo($container);
40
-
41
- });
42
-
43
- };
@@ -1,88 +0,0 @@
1
- import ui from '#ui';
2
-
3
- app.pages._md.init = async function(pageData){
4
-
5
- ui.cleanMain();
6
-
7
- if(
8
- pageData.metadata.breadcrumbs
9
- && !pageData.metadata.image
10
- ){
11
-
12
- ui.breadcrumbs({
13
- data: pageData.metadata.breadcrumbs,
14
- color: pageData.metadata.breadcrumbColor ?? 'stone'
15
- }).appendTo(app.$main);
16
-
17
- }
18
-
19
- const $page = ui.blogPost.md(pageData,{
20
- tagBase: '/tag',
21
- customRules: [
22
- (mdContent)=>{
23
-
24
- return mdContent.replace(/<cta-realEstate>/g, '<div class="custom-callToAction-real-estate"></div>');
25
-
26
- },
27
- (mdContent)=>{
28
-
29
- // find <bibleVerse> tags and replace with divs
30
- return mdContent.replace(/<bibleVerse>/g, '<div class="data-bible-verse">').replace(/<\/bibleVerse>/g, '</div>');
31
-
32
- }
33
- ]
34
- }).appendTo(app.$main);
35
-
36
- $page.find('a').click(function(event){
37
-
38
- event.preventDefault();
39
- event.stopPropagation();
40
-
41
- const href = $(this).attr('href');
42
-
43
- if(href && href.startsWith('http')){
44
-
45
- // open target blank
46
- window.open(href, '_blank');
47
-
48
- } else {
49
-
50
- // does this a tag have any awesomeness-* class
51
- if($(this).attr('class') && $(this).attr('class').match(/awesomeness-/)){
52
-
53
- // do nothing, let awesomeness-ui handle it
54
-
55
- } else {
56
-
57
- // internal links
58
- app.page(href);
59
-
60
- }
61
-
62
- }
63
-
64
- });
65
-
66
- // find code blocks that have only a string inside and add class .simple-code-string
67
- $page.find('code').each(function(){
68
-
69
- const $code = $(this);
70
- const codeText = $code.text().trim();
71
-
72
-
73
- if(codeText && !codeText.includes('\n')){
74
-
75
- $code.addClass('simple-code-string');
76
-
77
- }
78
-
79
- });
80
-
81
- Prism.highlightAll();
82
-
83
- app.pages._md.callToAction();
84
-
85
- ui.bibleVerse.init();
86
-
87
-
88
- };
@@ -1,33 +0,0 @@
1
- ---
2
- title: Some Example Blog Post
3
- subTitle: This is a subtitle of a blog post
4
- readTime: null
5
- image: /tools/images/posts/investing-101.png
6
- published: 2025-10-10
7
- priority: null
8
- url: /test-post
9
- tags: [ faith, life hacks, spiritual freedom, christianity ]
10
- tagColor: bg-stone-900
11
- author:
12
- name: Scott Forte
13
- title: Pilot, Investor, Realtor ®
14
- image: /tools/images/scott-forte-america-small-40.webp
15
- url: https://scottmforte.com
16
- ---
17
-
18
- <break-50>
19
-
20
- <youTube>5guXs-675KI</youTube>
21
-
22
- ![](/tools/images/posts/c172-glide-distance.webp)
23
-
24
- <div class="blogPost-next-reads">
25
-
26
- ### Next Reads
27
-
28
- - [👨‍✈️ Spiritual Freedom: When Jesus Becomes Your Co-Pilot](/spiritual-freedom)
29
- - [💸 Financial Freedom: What does it mean?](/financial-freedom)
30
- - [🗽 Political Freedom](/political-freedom)
31
- - [🧠 Mental Freedom: The Basis of Freedom](/mental-freedom)
32
-
33
- </div>