@thegetty/quire-cli 1.0.0-rc.7 → 1.0.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +187 -7
  2. package/README.md +15 -0
  3. package/bin/cli.js +13 -7
  4. package/package.json +19 -14
  5. package/patches/README.md +19 -0
  6. package/patches/install-npm-version+1.0.9.patch +12119 -0
  7. package/src/Command.js +14 -0
  8. package/src/commands/README.md +8 -8
  9. package/src/commands/conf.js +43 -0
  10. package/src/commands/create.js +13 -9
  11. package/src/commands/epub.js +1 -2
  12. package/src/commands/info.js +130 -0
  13. package/src/commands/pdf.js +60 -10
  14. package/src/commands/validate.js +64 -0
  15. package/src/errors/validation/validation-error.js +13 -0
  16. package/src/errors/validation/yaml-duplicate-error.js +11 -0
  17. package/src/errors/validation/yaml-parse-error.js +11 -0
  18. package/src/errors/validation/yaml-validation-error.js +11 -0
  19. package/src/helpers/clean.js +5 -0
  20. package/src/helpers/is-empty.js +4 -0
  21. package/src/helpers/is-quire.js +4 -0
  22. package/src/helpers/os-utils.js +4 -0
  23. package/src/helpers/test-cwd.js +4 -0
  24. package/src/helpers/which.js +4 -0
  25. package/src/lib/11ty/api.js +1 -0
  26. package/src/lib/11ty/cli.js +29 -6
  27. package/src/lib/conf/README.md +104 -0
  28. package/src/lib/conf/config.js +35 -0
  29. package/src/lib/conf/defaults.js +37 -0
  30. package/src/lib/conf/migrations.js +11 -0
  31. package/src/lib/conf/schema.js +30 -0
  32. package/src/lib/pdf/README.md +11 -4
  33. package/src/lib/pdf/index.js +4 -4
  34. package/src/lib/pdf/paged.js +88 -9
  35. package/src/lib/pdf/pagedPlugin.js +49 -0
  36. package/src/lib/pdf/prince.js +79 -4
  37. package/src/lib/pdf/princePlugin.js +35 -0
  38. package/src/lib/pdf/split.js +61 -0
  39. package/src/lib/quire/index.js +79 -143
  40. package/src/main.js +21 -6
  41. package/src/packageConfig.js +15 -0
  42. package/src/validators/utils.js +98 -0
  43. package/src/validators/validate-yaml.js +38 -0
  44. package/src/lib/config/README.md +0 -3
  45. package/src/lib/config/index.js +0 -1
package/CHANGELOG.md CHANGED
@@ -5,19 +5,199 @@ All notable changes to the `quire-cli` will be documented in this file.
5
5
  The log format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  Changelog entries are classified using the following labels:
8
-
9
8
  - `Added`: for new features
10
-
11
9
  - `Bumped`: updated dependencies, only minor or higher will be listed
12
-
13
10
  - `Changed`: for changes in existing functionality
14
-
15
11
  - `Deprecated`: for once-stable features removed in upcoming releases
16
-
17
12
  - `Fixed`: for any bug fixes
18
-
19
13
  - `Removed`: for deprecated features removed in this release
20
14
 
15
+ ## [1.0.0]
16
+
17
+ - No changes -- first 1.0.0 release!
18
+
19
+ ## [1.0.0-rc.55]
20
+
21
+ ### Bumped
22
+
23
+ - `epubjs-cli` to `0.2.4`
24
+
25
+ ## [1.0.0-rc.54]
26
+
27
+ ### Bumped
28
+
29
+ - `del` to 8.0.1
30
+ - `execa` to 9.6.1
31
+ - `simple-git` to 3.36.0
32
+ - Removed `node-fetch` as no longer needed.
33
+
34
+ ### Changed
35
+
36
+ - Behavior of `quire new` to not force-dump `npm` cache before depenedncy install.
37
+
38
+ ## [1.0.0-rc.53]
39
+
40
+ ### Added
41
+
42
+ - `quire validate` command for validating publication configurations. Thanks @andy-jdl!
43
+
44
+ ## Fixed
45
+
46
+ - Removes package tarballs downloaded during `quire new` commands.
47
+
48
+ ## [1.0.0-rc.33]
49
+
50
+ ### Bumped
51
+
52
+ - Bumped minimum supported node engine verison to 22.
53
+
54
+ ## [1.0.0-rc.31]
55
+
56
+ ### Changed
57
+
58
+ - Improved accessibility of PDFs generated with prince with `--pdf-profile=PDF/UA-1` flag
59
+
60
+ ### Removed
61
+
62
+ - Removed `install-npm-version` in favor of `npm pack` and `tar xfz` run as subprocesses
63
+ - Removed `patch-package`
64
+
65
+ ## [1.0.0-rc.30]
66
+ ## [1.0.0-rc.29]
67
+
68
+ Candidate versions skipped to align with @thegetty/quire-11ty
69
+
70
+ ## [1.0.0-rc.28]
71
+
72
+ ### Fixed
73
+
74
+ - Fixed issue where `quire pdf` errored and failed (DEV-20270)
75
+
76
+ ## [1.0.0-rc.27]
77
+
78
+ ### Fixed
79
+
80
+ - Fixed post-v3 `quire info` bug (DEV-19984)
81
+
82
+ ## [1.0.0-rc.26]
83
+
84
+ ### Changed
85
+
86
+ - Import path using node namespace in the cli info command
87
+ - Correct file extension of cmd module called by the cli
88
+
89
+ ## [1.0.0-rc.25]
90
+
91
+ ### Changed
92
+
93
+ - Use quire-cli config values for quire-11ty version and version file name
94
+
95
+ ### Fixed
96
+
97
+ - Install path for quire-11ty versions
98
+
99
+ ## [1.0.0-rc.24]
100
+
101
+ ### Changed
102
+
103
+ - Replace Node `import` assertions (deprecated) with a packageConfig module
104
+
105
+ ### Fixed
106
+
107
+ - Quire new command fails with newer version of Node #968
108
+
109
+ ## [1.0.0-rc.23]
110
+
111
+ :warning: broken release candidate
112
+
113
+ ## [1.0.0-rc.22]
114
+
115
+ :warning: broken release candidate
116
+
117
+ ## [1.0.0-rc.21]
118
+
119
+ :warning: broken release candidate
120
+
121
+ ## [1.0.0-rc.20]
122
+
123
+ :warning: broken release candidate
124
+
125
+ ## [1.0.0-rc.19]
126
+
127
+ ### Added
128
+
129
+ - `jsdoc-to-markdown` to development dependencies
130
+ - JSDoc configuration (see https://jsdoc.app/about-configuring-jsdoc)
131
+ - Npm script `docs` to run jsdoc-to-markdown
132
+
133
+ ## [1.0.0-rc.18]
134
+
135
+ ### Added
136
+
137
+ - Quire CLI configuration management using the `conf` package
138
+ - `quire conf` command to manage cli configuration properties
139
+
140
+ ## [1.0.0-rc.17]
141
+
142
+ ### Bumped
143
+
144
+ - `install-npm-version` patch version
145
+
146
+ ### Changed
147
+
148
+ - update patch `install-npm-version`
149
+
150
+ ## [1.0.0-rc.16]
151
+
152
+ ### Added
153
+
154
+ - Patch for `install-npm-version`; see https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
155
+
156
+ ### Changed
157
+
158
+ **Nota bene** installing `quire-cli` as a _local package_ requires running `npm install` with the `--install-strategy=nested` flag; installing `quire-cli` as a global node module has not changed.
159
+
160
+ ### Fixed
161
+
162
+ - Dependency instal error on Windows when running quire new DEV-19124
163
+
164
+ ## [1.0.0-rc.12]
165
+
166
+ ### Added
167
+ - Handling for single-page PDFs
168
+ - Paged and Prince plugins to map quire pages to PDF page sections
169
+
170
+ ### Changed
171
+
172
+ - `quire clean` also removes `.11ty-vite` in the project root
173
+
174
+ ## [1.0.0-rc.11]
175
+
176
+ ### Bumped
177
+ - `epubjs-cli` to version 0.1.6
178
+ - `pagedjs-cli` to version 0.4.3
179
+
180
+ ### Fixed
181
+ - EPUB validation error where pages that include SVGs must include SVG as property under `readingOrder`
182
+
183
+ ## [1.0.0-rc.10]
184
+
185
+ ### Added
186
+ - Support semantic version ranges for `quire-11ty` in quire starter projects and the `--quire-version` option of the `quire new` command, and use the latest compatible `quire-11ty` version when creating and installing a new project.
187
+
188
+ ## [1.0.0-rc.9]
189
+
190
+ ### Added
191
+ - Update old `.quire` files when running `info` command on versions prior to `1.0.0-rc.8`
192
+ - Include `quire-cli` version used to generate project in `info` output
193
+ - Adds headings to `info` output
194
+
195
+ ## [1.0.0-rc.8]
196
+
197
+ ### Added
198
+ - Added `info` command to output package versions
21
199
 
22
- ## [Unreleased]
200
+ ## [1.0.0-rc.7]
23
201
 
202
+ ### Added
203
+ - Added `new` command `--quire-path` option to support development with local version of `quire-11ty`
package/README.md CHANGED
@@ -1,7 +1,22 @@
1
1
  ## Quire CLI
2
+ [![CircleCI](https://dl.circleci.com/status-badge/img/gh/thegetty/quire/tree/main.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/thegetty/quire/tree/main)
2
3
 
3
4
  The `quire-cli` implements the [command pattern](https://en.wikipedia.org/wiki/Command_pattern) to receive input from a user and delegate command behavoir to modules for the services, such as `git` and `11ty`, involved in working on Quire publications.
4
5
 
6
+ ### Installing the CLI
7
+
8
+ The `quire-cli` can be installed as a global npm module as follows
9
+
10
+ ```sh
11
+ npm install quire-cli --global
12
+ ```
13
+
14
+ Installing the `quire-cli` as a _local package dependency_ requires additional npm command flags to support patching package dependencies as follows,
15
+
16
+ ```sh
17
+ npm install quire-cli --install-strategy=nested
18
+ ```
19
+
5
20
  ### Using the CLI
6
21
 
7
22
  `npx` supports executing npm package binaries even when they are not yet installed and will download the package into a cache if it does not find either a locally or globally installed version. Simply run
package/bin/cli.js CHANGED
@@ -1,28 +1,34 @@
1
1
  #!/usr/bin/env -S node --no-warnings
2
-
3
2
  import cli from '#src/main.js'
4
- import packageConfig from '#root/package.json' assert { type: 'json' }
3
+ import config from '#src/lib/conf/config.js'
4
+ import packageConfig from '#src/packageConfig.js'
5
5
  import updateNotifier from 'update-notifier'
6
6
 
7
7
  process.removeAllListeners('warning')
8
8
 
9
+ /**
10
+ * Interval constants in milliseconds
11
+ */
9
12
  const INTERVAL = Object.freeze({
10
- MINUTES: 1000 * 60 * 1,
13
+ MINUTE: 1000 * 60 * 1,
11
14
  HOURLY: 1000 * 60 * 60,
12
15
  DAILY: 1000 * 60 * 60 * 24,
13
16
  WEEKLY: 1000 * 60 * 60 * 24 * 7
14
17
  })
15
18
 
19
+ const updateChannel = config.get('updateChannel')
20
+ const updateIterval = config.get('updateIterval')
21
+
16
22
  /**
17
- * Check for quire-cli updates
23
+ * Create a notifier to Check for quire-cli updates
18
24
  * @see https://github.com/yeoman/update-notifier#usage
19
25
  *
20
- * @todo user configuration of choosen update interval
26
+ * @todo refactor to check multiple channels
21
27
  */
22
28
  const notifier = updateNotifier({
23
- distTag: 'latest',
29
+ distTag: updateChannel,
24
30
  pkg: packageConfig,
25
- updateCheckInterval: INTERVAL.DAILY,
31
+ updateCheckInterval: INTERVAL[updateIterval],
26
32
  })
27
33
 
28
34
  notifier.notify({ defer: false })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@thegetty/quire-cli",
3
3
  "description": "Quire command-line interface",
4
- "version": "1.0.0-rc.7",
4
+ "version": "1.0.0",
5
5
  "author": "Getty Digital",
6
6
  "license": "SEE LICENSE IN https://github.com/thegetty/quire/blob/main/LICENSE",
7
7
  "bugs": {
@@ -19,7 +19,8 @@
19
19
  "type": "module",
20
20
  "files": [
21
21
  "bin/",
22
- "scripts",
22
+ "patches/",
23
+ "scripts/",
23
24
  "src/",
24
25
  "CHANGELOG.md",
25
26
  "LICENSE",
@@ -34,9 +35,10 @@
34
35
  "directory": "packages/cli"
35
36
  },
36
37
  "scripts": {
38
+ "docs": "jsdoc2md --configure jsdoc.json --files src/**/*.js > docs/cli.md",
37
39
  "lint": "eslint src --ext .js",
38
40
  "lint:fix": "npm run lint -- --fix",
39
- "test": "echo \"Error: no test specified\" && exit 1"
41
+ "test": "ava ./_tests/**"
40
42
  },
41
43
  "imports": {
42
44
  "#root/*": "./*",
@@ -45,31 +47,34 @@
45
47
  "#lib/*.js": "./src/lib/*.js"
46
48
  },
47
49
  "dependencies": {
50
+ "ajv": "^8.16.0",
48
51
  "boxen": "^7.0.1",
49
52
  "chalk": "^5.2.0",
50
- "commander": "^10.0.0",
51
- "conf": "^11.0.1",
53
+ "commander": "^12.1.0",
54
+ "conf": "^13.1.0",
52
55
  "cross-env": "^7.0.3",
53
- "del": "^7.0.0",
54
- "epubjs-cli": "^0.1.2",
55
- "execa": "^6.1.0",
56
+ "del": "^8.0.1",
57
+ "epubjs-cli": "^0.2.4",
58
+ "execa": "^9.6.1",
56
59
  "fs-extra": "^11.1.0",
57
60
  "hosted-git-info": "^6.1.1",
58
61
  "i18next": "^22.4.9",
59
62
  "inquirer": "^9.1.4",
60
- "install-npm-version": "^1.0.8",
63
+ "js-yaml": "^4.1.0",
61
64
  "loglevel": "^1.8.1",
62
65
  "open": "^8.4.0",
63
66
  "ora": "^6.1.2",
64
- "pagedjs-cli": "^0.3.3",
67
+ "pagedjs-cli": "^0.4.3",
68
+ "read-package-up": "^11.0.0",
65
69
  "semver": "^7.3.8",
66
- "simple-git": "^3.16.0",
67
- "update-notifier": "^6.0.2"
70
+ "simple-git": "^3.36.0",
71
+ "update-notifier": "^7.3.1"
68
72
  },
69
73
  "devDependencies": {
70
- "eslint": "^8.32.0"
74
+ "eslint": "^8.57.1",
75
+ "jsdoc-to-markdown": "^9.1.1"
71
76
  },
72
77
  "engines": {
73
- "node": ">=14.16"
78
+ "node": ">=22"
74
79
  }
75
80
  }
@@ -0,0 +1,19 @@
1
+ ## Quire CLI Patches
2
+
3
+ Patches in this directory are applied to locally installed `node_modules` by the npm `postinstall` script ([npm scripts docs](https://docs.npmjs.com/cli/v10/using-npm/scripts)).
4
+
5
+ See [`patch-package`](https://github.com/ds300/patch-package) documenation for [making](https://github.com/ds300/patch-package#making-patches), [updating](https://github.com/ds300/patch-package#updating-patches), [applying](https://github.com/ds300/patch-package#applying-patches) and [reversing](https://github.com/ds300/patch-package#applying-patches) patches.
6
+
7
+ *Nota bene*
8
+
9
+ Patching the `quire-cli` package dependencies changes the way in which it must be must be installed. When installing the `quire-cli` as a _local package dependency_ the `--install-strategy=nested` flag must be used as follows
10
+
11
+ ```sh
12
+ npm install quire-cli --install-strategy=nested
13
+ ```
14
+
15
+ Installing the `quire-cli` as a global npm module has not changed,
16
+
17
+ ```sh
18
+ npm install quire-cli --global
19
+ ```