@digimakers/docling-cleaner 1.2.22 → 1.2.24

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 CHANGED
@@ -31,7 +31,7 @@ function getPlatformTag() {
31
31
 
32
32
  function getCacheDir(version) {
33
33
  if (process.platform === 'win32') {
34
- const base = process.env.LOCALAPPDATA || path.json(os.homedir(), 'AppData', 'Local');
34
+ const base = process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local');
35
35
  return path.join(base, 'digimaker', 'docling-cleaner', version);
36
36
  }
37
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digimakers/docling-cleaner",
3
- "version": "1.2.22",
3
+ "version": "1.2.24",
4
4
  "description": "Docling cleaner binary downloader",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -9,9 +9,13 @@
9
9
  "directory": "packages/docling-cleaner"
10
10
  },
11
11
  "main": "index.js",
12
+ "scripts": {
13
+ "postinstall": "node postinstall.js"
14
+ },
12
15
  "files": [
13
16
  "index.js",
14
- "index.d.ts"
17
+ "index.d.ts",
18
+ "postinstall.js"
15
19
  ],
16
20
  "publishConfig": {
17
21
  "access": "public"
package/postinstall.js ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ const { ensureDoclingCleaner } = require('./index.js');
3
+
4
+ async function main() {
5
+ // Skip in CI environments where binaries are handled separately
6
+ if (process.env.CI === 'true') {
7
+ console.log('@digimakers/docling-cleaner: Skipping postinstall in CI');
8
+ return;
9
+ }
10
+
11
+ // Skip if user explicitly opts out
12
+ if (process.env.DOCLING_SKIP_POSTINSTALL === '1') {
13
+ console.log('@digimakers/docling-cleaner: Skipping postinstall (DOCLING_SKIP_POSTINSTALL=1)');
14
+ return;
15
+ }
16
+
17
+ try {
18
+ console.log('@digimakers/docling-cleaner: Downloading platform binary...');
19
+ const binaryPath = await ensureDoclingCleaner();
20
+ console.log(`@digimakers/docling-cleaner: Binary ready at ${binaryPath}`);
21
+ } catch (error) {
22
+ // Don't fail install - uv fallback can be used at runtime
23
+ console.warn('@digimakers/docling-cleaner: Binary download failed, uv fallback will be used');
24
+ console.warn(` Reason: ${error.message}`);
25
+ }
26
+ }
27
+
28
+ main();