@rip-lang/server 1.4.8 → 1.4.10
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 +1 -1
- package/serving/logging.rip +7 -3
- package/serving/static.rip +15 -15
package/package.json
CHANGED
package/serving/logging.rip
CHANGED
|
@@ -73,9 +73,13 @@ export logAccessJson = (app, req, res, totalSeconds, workerSeconds) ->
|
|
|
73
73
|
length: if len then Number(len) else undefined
|
|
74
74
|
|
|
75
75
|
typeAbbrev =
|
|
76
|
-
html: 'html', css: 'css', javascript: 'js', json: 'json', plain: 'text'
|
|
77
|
-
png: 'png', jpeg: 'jpg', gif: 'gif', webp: 'webp',
|
|
78
|
-
'svg+xml': 'svg',
|
|
76
|
+
html: 'html', css: 'css', javascript: 'js', json: 'json', plain: 'text', xml: 'xml'
|
|
77
|
+
png: 'png', jpeg: 'jpg', gif: 'gif', webp: 'webp', avif: 'avif'
|
|
78
|
+
'svg+xml': 'svg', svg: 'svg', 'x-icon': 'icon', 'vnd.microsoft.icon': 'icon'
|
|
79
|
+
woff: 'font', woff2: 'font', ttf: 'font', otf: 'font'
|
|
80
|
+
mpeg: 'mp3', mp4: 'mp4', ogg: 'ogg', webm: 'webm'
|
|
81
|
+
pdf: 'pdf', zip: 'zip', gzip: 'gz', wasm: 'wasm'
|
|
82
|
+
'octet-stream': 'bin', 'x-rip': 'rip'
|
|
79
83
|
|
|
80
84
|
export logAccessHuman = (app, req, res, totalSeconds, workerSeconds) ->
|
|
81
85
|
{ timestamp, timezone } = formatTimestamp()
|
package/serving/static.rip
CHANGED
|
@@ -246,33 +246,33 @@ export renderMarkdown = (filePath) ->
|
|
|
246
246
|
|
|
247
247
|
# --- Text file rendering with syntax highlighting ---
|
|
248
248
|
|
|
249
|
-
|
|
250
|
-
'
|
|
251
|
-
'
|
|
252
|
-
'
|
|
253
|
-
'
|
|
254
|
-
'
|
|
255
|
-
'
|
|
256
|
-
'
|
|
257
|
-
'
|
|
258
|
-
'
|
|
259
|
-
'lock', 'license', 'licence', 'readme', 'changelog', 'contributing', 'authors'
|
|
249
|
+
BINARY_EXTS = new Set [
|
|
250
|
+
'png', 'jpg', 'jpeg', 'gif', 'webp', 'avif', 'ico', 'bmp', 'tiff', 'tif'
|
|
251
|
+
'svg'
|
|
252
|
+
'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'rtf'
|
|
253
|
+
'zip', 'gz', 'tar', 'bz2', 'xz', '7z', 'rar', 'dmg', 'iso'
|
|
254
|
+
'mp3', 'mp4', 'wav', 'ogg', 'webm', 'flac', 'aac', 'm4a', 'avi', 'mov', 'mkv'
|
|
255
|
+
'woff', 'woff2', 'ttf', 'otf', 'eot'
|
|
256
|
+
'wasm', 'bin', 'exe', 'dll', 'so', 'dylib', 'o', 'a'
|
|
257
|
+
'sqlite', 'db', 'duckdb'
|
|
258
|
+
'DS_Store'
|
|
260
259
|
]
|
|
261
260
|
|
|
262
261
|
HLJS_LANG_MAP =
|
|
263
262
|
js: 'javascript', mjs: 'javascript', cjs: 'javascript', jsx: 'javascript'
|
|
264
263
|
ts: 'typescript', tsx: 'typescript'
|
|
265
264
|
rb: 'ruby', py: 'python', rs: 'rust', go: 'go', sh: 'bash', zsh: 'bash'
|
|
265
|
+
cr: 'crystal', ex: 'elixir', exs: 'elixir', elm: 'elm', hs: 'haskell'
|
|
266
|
+
lua: 'lua', nim: 'nim', zig: 'zig', pl: 'perl', r: 'r', m: 'objectivec'
|
|
266
267
|
yml: 'yaml', toml: 'ini', conf: 'ini', cfg: 'ini'
|
|
267
268
|
rip: 'rip', coffee: 'coffeescript'
|
|
268
|
-
md: 'markdown', htm: 'xml'
|
|
269
|
+
md: 'markdown', htm: 'xml'
|
|
269
270
|
dockerfile: 'dockerfile', makefile: 'makefile'
|
|
270
271
|
jsonc: 'json', gql: 'graphql'
|
|
271
272
|
|
|
272
273
|
export isTextFile = (filePath) ->
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
TEXT_EXTS.has(ext) or TEXT_EXTS.has(name)
|
|
274
|
+
ext = basename(filePath).toLowerCase().slice(basename(filePath).lastIndexOf('.') + 1)
|
|
275
|
+
not BINARY_EXTS.has(ext)
|
|
276
276
|
|
|
277
277
|
hljsLang = (filePath) ->
|
|
278
278
|
name = basename(filePath).toLowerCase()
|