@awesomeness-js/server 1.1.7 → 1.1.8
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/index.js +101 -101
- package/package.json +1 -1
- package/src/koa/routeRequest.js +87 -26
- package/example-site/example.awesomenessjs.com/components/example/index.js +0 -3
- package/example-site/example.awesomenessjs.com/components/notCommonExample/_.css +0 -1
- package/example-site/example.awesomenessjs.com/components/notCommonExample/index.js +0 -3
- package/ui/README.md +0 -438
- package/ui/awesomeness-ui.instructions.md +0 -156
- package/ui/build.js +0 -119
- package/ui/commonComponent.test.js +0 -27
- package/ui/components/blogPost/all.css +0 -371
- package/ui/components/blogPost/headerImage.js +0 -153
- package/ui/components/blogPost/index.js +0 -45
- package/ui/components/blogPost/marked.js +0 -74
- package/ui/components/blogPost/md.js +0 -73
- package/ui/components/blogPost/parseAwesomeness.jQuery.js +0 -47
- package/ui/components/blogPost/readme.md +0 -8
- package/ui/components/colors/README.md +0 -65
- package/ui/components/colors/dynamic.css +0 -1884
- package/ui/components/colors/dynamic.css.js +0 -135
- package/ui/components/colors/dynamic.css.php +0 -79
- package/ui/components/colors/example.js +0 -133
- package/ui/components/colors/index.js +0 -65
- package/ui/components/colors/map.js +0 -13
- package/ui/components/colors/random.js +0 -17
- package/ui/components/colors/tailwind-colors.css +0 -247
- package/ui/components/insertIntoList/insertIntoList.jquery.js +0 -150
- package/ui/components/statusPage/index.css +0 -120
- package/ui/components/statusPage/index.js +0 -39
- package/ui/components/tag/category.js +0 -8
- package/ui/components/tag/index.js +0 -33
- package/ui/components/tag/list.js +0 -42
- package/ui/components/tag/map.js +0 -64
- package/ui/components/tag/tagMap.css +0 -60
- package/ui/components/tag/tags.css +0 -20
- package/ui/core/css/_normalize.css +0 -57
- package/ui/core/css/dynamic/flex.js +0 -36
- package/ui/core/css/dynamic/grid.js +0 -185
- package/ui/core/css/dynamic/shortcuts.js +0 -48
- package/ui/core/css/dynamic/spacing.js +0 -61
- package/ui/core/css/dynamic/text.js +0 -80
- package/ui/core/css/dynamic/width.js +0 -75
- package/ui/core/css/dynamic.js +0 -40
- package/ui/core/js/app/api.js +0 -143
- package/ui/core/js/app/init.js +0 -88
- package/ui/core/js/app/initDarkMode.js +0 -26
- package/ui/core/js/app/initialScroll.js +0 -28
- package/ui/core/js/app/meta/update/components.js +0 -65
- package/ui/core/js/app/meta/update/pages.js +0 -86
- package/ui/core/js/app/metaUpdates.js +0 -10
- package/ui/core/js/app/page.js +0 -319
- package/ui/core/js/app/resize.js +0 -52
- package/ui/core/js/app/state/back.js +0 -16
- package/ui/core/js/app/state/create.js +0 -50
- package/ui/core/js/app/state/get.js +0 -5
- package/ui/core/js/app/state/init.js +0 -25
- package/ui/core/js/app.js +0 -41
- package/ui/core/js/jquery-3.7.1.min.js +0 -2
- package/ui/core/public/app.css +0 -1
- package/ui/core/public/app.js +0 -975
- package/ui/core/public/favicon.ico +0 -0
- package/ui/core/public/index.html +0 -40
package/index.js
CHANGED
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is auto-generated by the build script.
|
|
3
|
-
* It consolidates API functions for use in the application.
|
|
4
|
-
* Do not edit manually.
|
|
5
|
-
*/
|
|
6
|
-
import _applicationMap from './src/applicationMap.js';
|
|
7
|
-
import _awesomenessNormalizeRequest from './src/awesomenessNormalizeRequest.js';
|
|
8
|
-
import _brotliJsonResponse from './src/brotliJsonResponse.js';
|
|
9
|
-
import _checkAccess from './src/checkAccess.js';
|
|
10
|
-
import _componentDependencies from './src/componentDependencies.js';
|
|
11
|
-
import _config from './src/config.js';
|
|
12
|
-
import _fetchPage from './src/fetchPage.js';
|
|
13
|
-
import _getConfig from './src/getConfig.js';
|
|
14
|
-
import _getMD from './src/getMD.js';
|
|
15
|
-
import _init from './src/init.js';
|
|
16
|
-
import _koa_attachAwesomenessRequest from './src/koa/attachAwesomenessRequest.js';
|
|
17
|
-
import _koa_cors from './src/koa/cors.js';
|
|
18
|
-
import _koa_errorHandler from './src/koa/errorHandler.js';
|
|
19
|
-
import _koa_finalFormat from './src/koa/finalFormat.js';
|
|
20
|
-
import _koa_jsonBodyParser from './src/koa/jsonBodyParser.js';
|
|
21
|
-
import _koa_routeRequest from './src/koa/routeRequest.js';
|
|
22
|
-
import _koa_serverUp from './src/koa/serverUp.js';
|
|
23
|
-
import _koa_staticFiles from './src/koa/staticFiles.js';
|
|
24
|
-
import _koa_timeout from './src/koa/timeout.js';
|
|
25
|
-
import _pageInfo from './src/pageInfo.js';
|
|
26
|
-
import _reRoute from './src/reRoute.js';
|
|
27
|
-
import _resolveRealCasePath from './src/resolveRealCasePath.js';
|
|
28
|
-
import _specialPaths from './src/specialPaths.js';
|
|
29
|
-
import _start from './src/start.js';
|
|
30
|
-
import _validateRequest from './src/validateRequest.js';
|
|
31
|
-
import _ws_handlers from './src/ws/handlers.js';
|
|
32
|
-
import _ws_index from './src/ws/index.js';
|
|
33
|
-
|
|
34
|
-
export { _applicationMap as applicationMap };
|
|
35
|
-
export { _awesomenessNormalizeRequest as awesomenessNormalizeRequest };
|
|
36
|
-
export { _brotliJsonResponse as brotliJsonResponse };
|
|
37
|
-
export { _checkAccess as checkAccess };
|
|
38
|
-
export { _componentDependencies as componentDependencies };
|
|
39
|
-
export { _config as config };
|
|
40
|
-
export { _fetchPage as fetchPage };
|
|
41
|
-
export { _getConfig as getConfig };
|
|
42
|
-
export { _getMD as getMD };
|
|
43
|
-
export { _init as init };
|
|
44
|
-
export { _pageInfo as pageInfo };
|
|
45
|
-
export { _reRoute as reRoute };
|
|
46
|
-
export { _resolveRealCasePath as resolveRealCasePath };
|
|
47
|
-
export { _specialPaths as specialPaths };
|
|
48
|
-
export { _start as start };
|
|
49
|
-
export { _validateRequest as validateRequest };
|
|
50
|
-
|
|
51
|
-
export const koa = {
|
|
52
|
-
attachAwesomenessRequest: _koa_attachAwesomenessRequest,
|
|
53
|
-
cors: _koa_cors,
|
|
54
|
-
errorHandler: _koa_errorHandler,
|
|
55
|
-
finalFormat: _koa_finalFormat,
|
|
56
|
-
jsonBodyParser: _koa_jsonBodyParser,
|
|
57
|
-
routeRequest: _koa_routeRequest,
|
|
58
|
-
serverUp: _koa_serverUp,
|
|
59
|
-
staticFiles: _koa_staticFiles,
|
|
60
|
-
timeout: _koa_timeout
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const ws = {
|
|
64
|
-
handlers: _ws_handlers,
|
|
65
|
-
index: _ws_index
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
export default {
|
|
70
|
-
applicationMap: _applicationMap,
|
|
71
|
-
awesomenessNormalizeRequest: _awesomenessNormalizeRequest,
|
|
72
|
-
brotliJsonResponse: _brotliJsonResponse,
|
|
73
|
-
checkAccess: _checkAccess,
|
|
74
|
-
componentDependencies: _componentDependencies,
|
|
75
|
-
config: _config,
|
|
76
|
-
fetchPage: _fetchPage,
|
|
77
|
-
getConfig: _getConfig,
|
|
78
|
-
getMD: _getMD,
|
|
79
|
-
init: _init,
|
|
80
|
-
pageInfo: _pageInfo,
|
|
81
|
-
reRoute: _reRoute,
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the build script.
|
|
3
|
+
* It consolidates API functions for use in the application.
|
|
4
|
+
* Do not edit manually.
|
|
5
|
+
*/
|
|
6
|
+
import _applicationMap from './src/applicationMap.js';
|
|
7
|
+
import _awesomenessNormalizeRequest from './src/awesomenessNormalizeRequest.js';
|
|
8
|
+
import _brotliJsonResponse from './src/brotliJsonResponse.js';
|
|
9
|
+
import _checkAccess from './src/checkAccess.js';
|
|
10
|
+
import _componentDependencies from './src/componentDependencies.js';
|
|
11
|
+
import _config from './src/config.js';
|
|
12
|
+
import _fetchPage from './src/fetchPage.js';
|
|
13
|
+
import _getConfig from './src/getConfig.js';
|
|
14
|
+
import _getMD from './src/getMD.js';
|
|
15
|
+
import _init from './src/init.js';
|
|
16
|
+
import _koa_attachAwesomenessRequest from './src/koa/attachAwesomenessRequest.js';
|
|
17
|
+
import _koa_cors from './src/koa/cors.js';
|
|
18
|
+
import _koa_errorHandler from './src/koa/errorHandler.js';
|
|
19
|
+
import _koa_finalFormat from './src/koa/finalFormat.js';
|
|
20
|
+
import _koa_jsonBodyParser from './src/koa/jsonBodyParser.js';
|
|
21
|
+
import _koa_routeRequest from './src/koa/routeRequest.js';
|
|
22
|
+
import _koa_serverUp from './src/koa/serverUp.js';
|
|
23
|
+
import _koa_staticFiles from './src/koa/staticFiles.js';
|
|
24
|
+
import _koa_timeout from './src/koa/timeout.js';
|
|
25
|
+
import _pageInfo from './src/pageInfo.js';
|
|
26
|
+
import _reRoute from './src/reRoute.js';
|
|
27
|
+
import _resolveRealCasePath from './src/resolveRealCasePath.js';
|
|
28
|
+
import _specialPaths from './src/specialPaths.js';
|
|
29
|
+
import _start from './src/start.js';
|
|
30
|
+
import _validateRequest from './src/validateRequest.js';
|
|
31
|
+
import _ws_handlers from './src/ws/handlers.js';
|
|
32
|
+
import _ws_index from './src/ws/index.js';
|
|
33
|
+
|
|
34
|
+
export { _applicationMap as applicationMap };
|
|
35
|
+
export { _awesomenessNormalizeRequest as awesomenessNormalizeRequest };
|
|
36
|
+
export { _brotliJsonResponse as brotliJsonResponse };
|
|
37
|
+
export { _checkAccess as checkAccess };
|
|
38
|
+
export { _componentDependencies as componentDependencies };
|
|
39
|
+
export { _config as config };
|
|
40
|
+
export { _fetchPage as fetchPage };
|
|
41
|
+
export { _getConfig as getConfig };
|
|
42
|
+
export { _getMD as getMD };
|
|
43
|
+
export { _init as init };
|
|
44
|
+
export { _pageInfo as pageInfo };
|
|
45
|
+
export { _reRoute as reRoute };
|
|
46
|
+
export { _resolveRealCasePath as resolveRealCasePath };
|
|
47
|
+
export { _specialPaths as specialPaths };
|
|
48
|
+
export { _start as start };
|
|
49
|
+
export { _validateRequest as validateRequest };
|
|
50
|
+
|
|
51
|
+
export const koa = {
|
|
52
|
+
attachAwesomenessRequest: _koa_attachAwesomenessRequest,
|
|
53
|
+
cors: _koa_cors,
|
|
54
|
+
errorHandler: _koa_errorHandler,
|
|
55
|
+
finalFormat: _koa_finalFormat,
|
|
56
|
+
jsonBodyParser: _koa_jsonBodyParser,
|
|
57
|
+
routeRequest: _koa_routeRequest,
|
|
58
|
+
serverUp: _koa_serverUp,
|
|
59
|
+
staticFiles: _koa_staticFiles,
|
|
60
|
+
timeout: _koa_timeout
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const ws = {
|
|
64
|
+
handlers: _ws_handlers,
|
|
65
|
+
index: _ws_index
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
export default {
|
|
70
|
+
applicationMap: _applicationMap,
|
|
71
|
+
awesomenessNormalizeRequest: _awesomenessNormalizeRequest,
|
|
72
|
+
brotliJsonResponse: _brotliJsonResponse,
|
|
73
|
+
checkAccess: _checkAccess,
|
|
74
|
+
componentDependencies: _componentDependencies,
|
|
75
|
+
config: _config,
|
|
76
|
+
fetchPage: _fetchPage,
|
|
77
|
+
getConfig: _getConfig,
|
|
78
|
+
getMD: _getMD,
|
|
79
|
+
init: _init,
|
|
80
|
+
pageInfo: _pageInfo,
|
|
81
|
+
reRoute: _reRoute,
|
|
82
82
|
/**
|
|
83
83
|
* Case-insensitive real path resolver.
|
|
84
84
|
* Works correctly on Windows, macOS, and Linux/Docker.
|
|
85
|
-
*/
|
|
86
|
-
resolveRealCasePath: _resolveRealCasePath,
|
|
87
|
-
specialPaths: _specialPaths,
|
|
88
|
-
start: _start,
|
|
89
|
-
validateRequest: _validateRequest,
|
|
90
|
-
koa: {
|
|
91
|
-
attachAwesomenessRequest: _koa_attachAwesomenessRequest,
|
|
92
|
-
cors: _koa_cors,
|
|
93
|
-
errorHandler: _koa_errorHandler,
|
|
94
|
-
finalFormat: _koa_finalFormat,
|
|
95
|
-
jsonBodyParser: _koa_jsonBodyParser,
|
|
96
|
-
routeRequest: _koa_routeRequest,
|
|
97
|
-
serverUp: _koa_serverUp,
|
|
98
|
-
staticFiles: _koa_staticFiles,
|
|
99
|
-
timeout: _koa_timeout,
|
|
100
|
-
},
|
|
101
|
-
ws: {
|
|
102
|
-
handlers: _ws_handlers,
|
|
103
|
-
index: _ws_index,
|
|
104
|
-
},
|
|
85
|
+
*/
|
|
86
|
+
resolveRealCasePath: _resolveRealCasePath,
|
|
87
|
+
specialPaths: _specialPaths,
|
|
88
|
+
start: _start,
|
|
89
|
+
validateRequest: _validateRequest,
|
|
90
|
+
koa: {
|
|
91
|
+
attachAwesomenessRequest: _koa_attachAwesomenessRequest,
|
|
92
|
+
cors: _koa_cors,
|
|
93
|
+
errorHandler: _koa_errorHandler,
|
|
94
|
+
finalFormat: _koa_finalFormat,
|
|
95
|
+
jsonBodyParser: _koa_jsonBodyParser,
|
|
96
|
+
routeRequest: _koa_routeRequest,
|
|
97
|
+
serverUp: _koa_serverUp,
|
|
98
|
+
staticFiles: _koa_staticFiles,
|
|
99
|
+
timeout: _koa_timeout,
|
|
100
|
+
},
|
|
101
|
+
ws: {
|
|
102
|
+
handlers: _ws_handlers,
|
|
103
|
+
index: _ws_index,
|
|
104
|
+
},
|
|
105
105
|
};
|
package/package.json
CHANGED
package/src/koa/routeRequest.js
CHANGED
|
@@ -165,63 +165,124 @@ export default async function routeRequest(ctx, next) {
|
|
|
165
165
|
let specific = false;
|
|
166
166
|
|
|
167
167
|
// Prefer filesystem existence checks so we don't rely on import() throwing for control flow
|
|
168
|
-
|
|
168
|
+
awesomenessRequest.log('Trying site specific route.', {
|
|
169
|
+
siteSpecificIndexPath,
|
|
170
|
+
siteSpecificInfoPath
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
let siteSpecificIndexExists = false;
|
|
174
|
+
let siteSpecificInfoExists = false;
|
|
169
175
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
siteSpecificInfoPath
|
|
173
|
-
});
|
|
176
|
+
|
|
177
|
+
try {
|
|
174
178
|
|
|
175
179
|
await fs.access(siteSpecificIndexPath);
|
|
180
|
+
siteSpecificIndexExists = true;
|
|
181
|
+
|
|
182
|
+
} catch {}
|
|
183
|
+
|
|
184
|
+
try {
|
|
185
|
+
|
|
176
186
|
await fs.access(siteSpecificInfoPath);
|
|
187
|
+
siteSpecificInfoExists = true;
|
|
188
|
+
|
|
189
|
+
} catch {}
|
|
190
|
+
|
|
191
|
+
if (siteSpecificIndexExists && siteSpecificInfoExists) {
|
|
177
192
|
|
|
178
193
|
awesomenessRequest.log('Site specific route found.', {
|
|
179
194
|
siteSpecificIndexPath,
|
|
180
195
|
siteSpecificInfoPath
|
|
181
196
|
});
|
|
182
197
|
|
|
183
|
-
|
|
184
|
-
const infoMod = await import(pathToFileURL(siteSpecificInfoPath).href);
|
|
185
|
-
|
|
186
|
-
routeInfo = infoMod.default;
|
|
198
|
+
try {
|
|
187
199
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
});
|
|
200
|
+
routeIndex = await import(pathToFileURL(siteSpecificIndexPath).href);
|
|
201
|
+
const infoMod = await import(pathToFileURL(siteSpecificInfoPath).href);
|
|
191
202
|
|
|
203
|
+
routeInfo = infoMod.default;
|
|
204
|
+
awesomenessRequest.log('Site specific route info loaded.', {
|
|
205
|
+
routeInfo
|
|
206
|
+
});
|
|
207
|
+
specific = true;
|
|
208
|
+
|
|
209
|
+
} catch (importError) {
|
|
192
210
|
|
|
193
|
-
|
|
211
|
+
ctx.status = 500;
|
|
212
|
+
ctx.body = {
|
|
213
|
+
success: false,
|
|
214
|
+
message: "Site specific route import error",
|
|
215
|
+
error: importError,
|
|
216
|
+
siteSpecificRoute: siteSpecificIndexPath,
|
|
217
|
+
siteSpecificInfo: siteSpecificInfoPath,
|
|
218
|
+
};
|
|
219
|
+
finalFormat(awesomenessRequest, ctx);
|
|
220
|
+
|
|
221
|
+
return;
|
|
222
|
+
|
|
223
|
+
}
|
|
194
224
|
|
|
195
|
-
}
|
|
225
|
+
} else {
|
|
226
|
+
|
|
227
|
+
awesomenessRequest.log('Site specific route not found, trying generic route.', {
|
|
228
|
+
siteSpecificIndexExists: siteSpecificIndexExists,
|
|
229
|
+
siteSpecificInfoExists: siteSpecificInfoExists
|
|
230
|
+
});
|
|
231
|
+
let genericIndexExists = false;
|
|
232
|
+
let genericInfoExists = false;
|
|
196
233
|
|
|
197
|
-
awesomenessRequest.log('Site specific route not found, trying generic route.', { error });
|
|
198
234
|
|
|
199
235
|
try {
|
|
200
236
|
|
|
201
237
|
await fs.access(genericIndexPath);
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const infoMod = await import(pathToFileURL(genericInfoPath).href);
|
|
238
|
+
genericIndexExists = true;
|
|
239
|
+
|
|
240
|
+
} catch {}
|
|
206
241
|
|
|
207
|
-
|
|
242
|
+
try {
|
|
208
243
|
|
|
209
|
-
|
|
244
|
+
await fs.access(genericInfoPath);
|
|
245
|
+
genericInfoExists = true;
|
|
246
|
+
|
|
247
|
+
} catch {}
|
|
248
|
+
|
|
249
|
+
if (genericIndexExists && genericInfoExists) {
|
|
250
|
+
|
|
251
|
+
try {
|
|
252
|
+
|
|
253
|
+
routeIndex = await import(pathToFileURL(genericIndexPath).href);
|
|
254
|
+
const infoMod = await import(pathToFileURL(genericInfoPath).href);
|
|
255
|
+
|
|
256
|
+
routeInfo = infoMod.default;
|
|
257
|
+
specific = false;
|
|
258
|
+
|
|
259
|
+
} catch (importError2) {
|
|
260
|
+
|
|
261
|
+
ctx.status = 500;
|
|
262
|
+
ctx.body = {
|
|
263
|
+
success: false,
|
|
264
|
+
message: "Generic route import error",
|
|
265
|
+
error: importError2,
|
|
266
|
+
genericRoute: genericIndexPath,
|
|
267
|
+
genericInfo: genericInfoPath,
|
|
268
|
+
};
|
|
269
|
+
finalFormat(awesomenessRequest, ctx);
|
|
270
|
+
|
|
271
|
+
return;
|
|
272
|
+
|
|
273
|
+
}
|
|
210
274
|
|
|
211
|
-
}
|
|
275
|
+
} else {
|
|
212
276
|
|
|
213
277
|
ctx.status = 404;
|
|
214
|
-
|
|
215
278
|
ctx.body = {
|
|
216
279
|
success: false,
|
|
217
280
|
message: "route not found",
|
|
218
|
-
error: error2,
|
|
219
281
|
siteSpecificRoute: siteSpecificIndexPath,
|
|
220
282
|
genericRoute: genericIndexPath,
|
|
221
283
|
};
|
|
222
|
-
|
|
223
284
|
finalFormat(awesomenessRequest, ctx);
|
|
224
|
-
|
|
285
|
+
|
|
225
286
|
return;
|
|
226
287
|
|
|
227
288
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/* test */
|