mdpush 1.1.1 → 1.2.0

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": "mdpush",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20.0.0"
@@ -12,7 +12,9 @@ import { apiRequest } from '../lib/api-request.js'
12
12
  */
13
13
 
14
14
  // Mirrors the server's TEXT_UPLOAD_EXTENSIONS (upload-middleware.js)
15
- const SKILL_FILE_EXTENSIONS = new Set(['.md', '.txt', '.py', '.sh', '.js', '.mjs', '.cjs', '.ps1', '.json', '.yaml', '.yml'])
15
+ // .html rides the server's dedicated artifact pipe (?contentType=html)
16
+ // used by assets/preview.html + assets/slides.html (AUTHORING.md standard).
17
+ const SKILL_FILE_EXTENSIONS = new Set(['.md', '.txt', '.py', '.sh', '.js', '.mjs', '.cjs', '.ps1', '.json', '.yaml', '.yml', '.html'])
16
18
 
17
19
  /** Recursive walk: relative POSIX paths, dotfiles + node_modules skipped. */
18
20
  function walkSkillDir(root, rel = '') {
@@ -64,7 +66,10 @@ export async function skillPushCommand(dir, options) {
64
66
  const formData = new FormData()
65
67
  formData.append('files', new Blob([fs.readFileSync(path.join(root, relPath))]), path.basename(relPath))
66
68
  const folder = path.dirname(relPath)
67
- const query = folder && folder !== '.' ? `?folder=${encodeURIComponent(folder)}` : ''
69
+ const params = new URLSearchParams()
70
+ if (folder && folder !== '.') params.set('folder', folder)
71
+ if (relPath.endsWith('.html')) params.set('contentType', 'html')
72
+ const query = params.size > 0 ? `?${params}` : ''
68
73
  await apiRequest(`/api/projects/${project.slug}/upload${query}`, {
69
74
  method: 'POST',
70
75
  headers: { 'X-Requested-With': 'XMLHttpRequest' },