@antora/site-publisher 3.0.0-alpha.9 → 3.0.0-beta.1

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/README.md CHANGED
@@ -5,7 +5,7 @@ More than one destination may be specified, and this component supports differen
5
5
  Custom providers can be used to add support for additional destinations.
6
6
 
7
7
  [Antora](https://antora.org) is a modular static site generator designed for creating documentation sites from AsciiDoc documents.
8
- Its site generator pipeline aggregates documents from versioned content repositories and processes them using [Asciidoctor](https://asciidoctor.org).
8
+ Its site generator aggregates documents from versioned content repositories and processes them using [Asciidoctor](https://asciidoctor.org).
9
9
 
10
10
  ## Copyright and License
11
11
 
package/lib/index.js CHANGED
@@ -3,8 +3,8 @@
3
3
  /**
4
4
  * Site Publisher component for Antora
5
5
  *
6
- * Publishes the files generated in an Antora documentation pipeline to the
7
- * destination(s) specified in the playbook.
6
+ * Publishes the files generated by the Antora generator to the destination(s)
7
+ * specified in the playbook.
8
8
  *
9
9
  * @namespace site-publisher
10
10
  */
@@ -19,40 +19,10 @@ function publishToFs (config, files, playbook) {
19
19
  fileUri: 'file://' + (posixify ? '/' + posixify(absDestDir) : absDestDir),
20
20
  }
21
21
  return config.clean
22
- ? rmdir(absDestDir)
22
+ ? fsp['rm' in fsp ? 'rm' : 'rmdir'](absDestDir, { recursive: true, force: true })
23
23
  .then(() => publishStream(vfsDest(absDestDir), files))
24
24
  .then(() => report)
25
25
  : publishStream(vfsDest(absDestDir), files).then(() => report)
26
26
  }
27
27
 
28
- /**
29
- * Removes the specified directory (including all of its contents) or file.
30
- * Equivalent to fs.promises.rmdir(dir, { recursive: true }) in Node 12.
31
- */
32
- function rmdir (dir) {
33
- return fsp
34
- .readdir(dir, { withFileTypes: true })
35
- .then((lst) =>
36
- Promise.all(
37
- lst.map((it) =>
38
- it.isDirectory()
39
- ? rmdir(ospath.join(dir, it.name))
40
- : fsp.unlink(ospath.join(dir, it.name)).catch((unlinkErr) => {
41
- if (unlinkErr.code !== 'ENOENT') throw unlinkErr
42
- })
43
- )
44
- )
45
- )
46
- .then(() => fsp.rmdir(dir))
47
- .catch((err) => {
48
- if (err.code === 'ENOENT') return
49
- if (err.code === 'ENOTDIR') {
50
- return fsp.unlink(dir).catch((unlinkErr) => {
51
- if (unlinkErr.code !== 'ENOENT') throw unlinkErr
52
- })
53
- }
54
- throw err
55
- })
56
- }
57
-
58
28
  module.exports = publishToFs
@@ -56,7 +56,7 @@ async function publishSite (playbook, catalogs) {
56
56
  return userRequire(provider, userRequireContext).bind(null, options)
57
57
  } catch (err) {
58
58
  const prettyErr = new Error('Unsupported destination provider: ' + provider)
59
- prettyErr.stack = `\nCaused by: ${err.stack}`
59
+ prettyErr.stack += `\nCaused by: ${err.stack || err}`
60
60
  throw prettyErr
61
61
  }
62
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antora/site-publisher",
3
- "version": "3.0.0-alpha.9",
3
+ "version": "3.0.0-beta.1",
4
4
  "description": "Publishes the files generated in an Antora documentation pipeline to the destination(s) specified in the playbook.",
5
5
  "license": "MPL-2.0",
6
6
  "author": "OpenDevise Inc. (https://opendevise.com)",
@@ -22,7 +22,7 @@
22
22
  "vinyl-fs": "~3.0"
23
23
  },
24
24
  "engines": {
25
- "node": ">=10.17.0"
25
+ "node": ">=12.21.0"
26
26
  },
27
27
  "files": [
28
28
  "lib/"
@@ -35,5 +35,5 @@
35
35
  "static site",
36
36
  "web publishing"
37
37
  ],
38
- "gitHead": "a504d6889819b548e8a5416a7194cbb6f9a93e93"
38
+ "gitHead": "7c5ef1ea93dd489af533c80a936c736013c41769"
39
39
  }