5htp-core 0.3.3-1 → 0.3.3-3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "5htp-core",
3
3
  "description": "Convenient TypeScript framework designed for Performance and Productivity.",
4
- "version": "0.3.3-1",
4
+ "version": "0.3.3-3",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp-core.git",
7
7
  "license": "MIT",
@@ -106,20 +106,4 @@ body {
106
106
  -webkit-font-smoothing: antialiased;
107
107
  -moz-osx-font-smoothing: grayscale;
108
108
 
109
- }
110
-
111
- #loading {
112
- display: flex;
113
- align-items: center;
114
- justify-content: center;
115
-
116
- background: fade(#fff, 50%);
117
- //backdrop-filter: blur(10px);
118
- z-index: 1000;
119
-
120
- position: fixed;
121
- top: 0;
122
- left: 0;
123
- right: 0;
124
- bottom: 0;
125
109
  }
@@ -180,7 +180,10 @@ export default ({
180
180
  </div>
181
181
 
182
182
  {(enableSearch && choices.length !== 0 && search.keywords.length !== 0) && (
183
- <ul class="row al-left wrap sp-05 pd-1">
183
+ <ul class="row al-left wrap sp-05 pd-1" style={{
184
+ maxHeight: '30vh',
185
+ overflowY: 'auto'
186
+ }}>
184
187
  {choices.map( choice => (
185
188
  <ChoiceElement choice={choice}
186
189
  currentList={currentList}
@@ -125,18 +125,20 @@ export class Application<
125
125
  protected async start() {
126
126
 
127
127
  console.log(`5HTP Core`, process.env.npm_package_version);
128
+ const startTime = Date.now();
128
129
 
129
130
  // Handle errors & crashs
130
131
  this.on('error', e => this.Console.createBugReport(e))
131
132
 
132
133
  console.info(`[boot] Start services`);
133
134
  await this.startServices();
135
+ this.debug && console.info(`[boot] Services are ready`);
134
136
 
135
- this.debug && console.info(`[boot] App ready`);
136
137
  await this.ready();
137
138
  await this.runHook('ready');
138
139
 
139
- this.debug && console.info(`[boot] Application is ready.`);
140
+ const startedTime = (Date.now() - startTime) / 1000;
141
+ console.info(`[boot] Application launched in ${startedTime}s`);
140
142
  this.launched = true;
141
143
  }
142
144
 
@@ -167,7 +167,9 @@ export default class Console extends Service<Config, Hooks, Application, Service
167
167
  origLog(logMetaMarkup + formatWithOptions(settings.prettyInspectOptions, ...logArgs) + logErrorsStr);
168
168
  },
169
169
  }
170
- });
170
+ });
171
+
172
+ return;
171
173
 
172
174
  if (console["_wrapped"] !== undefined)
173
175
  return;
@@ -176,7 +178,7 @@ export default class Console extends Service<Config, Hooks, Application, Service
176
178
  console[ logLevel ] = (...args: any[]) => {
177
179
 
178
180
  // Dev mode = no care about performance = rich logging
179
- if (this.app.env.profile === 'dev')
181
+ if (this.app.env.profile === 'dev' || ['warn', 'error'].includes( logLevel ))
180
182
  //this.logger[ logLevel ](...args);
181
183
  origLog(...args);
182
184
  // Prod mode = minimal logging
@@ -121,8 +121,15 @@ export default class HttpServer {
121
121
  serveStatic: {
122
122
  setHeaders: function setCustomCacheControl(res, path) {
123
123
 
124
+ const dontCache = [
125
+ '/public/icons',
126
+ '/public/client'
127
+ ]
128
+
129
+ res.setHeader('Cache-Control', 'public, max-age=0');
130
+
124
131
  // Set long term cache, except for non-hashed filenames
125
- /*if (__DEV__ || path.includes('/icons.')) {
132
+ /*if (dontCache.some( p => path.startsWith( p ))) {
126
133
  res.setHeader('Cache-Control', 'public, max-age=0');
127
134
  } else {
128
135
  res.setHeader('Cache-Control', 'public, max-age=604800000'); // 7 Days