@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rip-lang/server",
3
- "version": "1.4.8",
3
+ "version": "1.4.10",
4
4
  "description": "Bun-native content server: static sites, apps, HTTP proxy, and TCP/TLS passthrough",
5
5
  "type": "module",
6
6
  "main": "api.rip",
@@ -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', svg: 'svg'
78
- 'svg+xml': 'svg', 'x-icon': 'ico', 'octet-stream': 'bin', 'x-rip': 'rip'
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()
@@ -246,33 +246,33 @@ export renderMarkdown = (filePath) ->
246
246
 
247
247
  # --- Text file rendering with syntax highlighting ---
248
248
 
249
- TEXT_EXTS = new Set [
250
- 'js', 'mjs', 'cjs', 'ts', 'tsx', 'jsx', 'json', 'jsonc'
251
- 'css', 'scss', 'less', 'html', 'htm', 'xml', 'svg'
252
- 'rip', 'coffee', 'rb', 'py', 'go', 'rs', 'c', 'cpp', 'h', 'hpp', 'java', 'kt', 'swift', 'cs'
253
- 'sh', 'bash', 'zsh', 'fish', 'ps1', 'bat', 'cmd'
254
- 'yaml', 'yml', 'toml', 'ini', 'conf', 'cfg', 'env'
255
- 'md', 'txt', 'log', 'csv', 'tsv', 'diff', 'patch'
256
- 'sql', 'graphql', 'gql', 'prisma'
257
- 'dockerfile', 'makefile', 'gemfile', 'rakefile'
258
- 'gitignore', 'gitattributes', 'editorconfig', 'eslintrc', 'prettierrc'
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', svg: '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
- name = basename(filePath).toLowerCase()
274
- ext = name.slice(name.lastIndexOf('.') + 1)
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()