@thegetty/quire-cli 1.0.0-rc.3 → 1.0.0-rc.31

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 (44) hide show
  1. package/CHANGELOG.md +148 -7
  2. package/README.md +15 -0
  3. package/bin/cli.js +14 -8
  4. package/package.json +16 -10
  5. package/patches/.DS_Store +0 -0
  6. package/patches/README.md +19 -0
  7. package/patches/install-npm-version+1.0.9.patch +12119 -0
  8. package/src/.DS_Store +0 -0
  9. package/src/Command.js +14 -0
  10. package/src/commands/README.md +28 -8
  11. package/src/commands/conf.js +43 -0
  12. package/src/commands/create.js +22 -10
  13. package/src/commands/epub.js +1 -2
  14. package/src/commands/info.js +130 -0
  15. package/src/commands/pdf.js +60 -10
  16. package/src/helpers/.DS_Store +0 -0
  17. package/src/helpers/clean.js +5 -0
  18. package/src/helpers/is-empty.js +4 -0
  19. package/src/helpers/is-quire.js +4 -0
  20. package/src/helpers/os-utils.js +4 -0
  21. package/src/helpers/test-cwd.js +4 -0
  22. package/src/helpers/which.js +4 -0
  23. package/src/lib/11ty/cli.js +18 -2
  24. package/src/lib/conf/README.md +104 -0
  25. package/src/lib/conf/config.js +35 -0
  26. package/src/lib/conf/defaults.js +37 -0
  27. package/src/lib/conf/migrations.js +11 -0
  28. package/src/lib/conf/schema.js +30 -0
  29. package/src/lib/epub/index.js +3 -1
  30. package/src/lib/pdf/README.md +11 -4
  31. package/src/lib/pdf/index.js +7 -5
  32. package/src/lib/pdf/paged.js +88 -9
  33. package/src/lib/pdf/pagedPlugin.js +49 -0
  34. package/src/lib/pdf/prince.js +79 -4
  35. package/src/lib/pdf/princePlugin.js +35 -0
  36. package/src/lib/pdf/split.js +61 -0
  37. package/src/lib/quire/index.js +84 -141
  38. package/src/main.js +21 -6
  39. package/src/packageConfig.js +15 -0
  40. package/src/lib/11ty/plugins/before.js +0 -16
  41. package/src/lib/config/README.md +0 -3
  42. package/src/lib/config/index.js +0 -1
  43. package/src/lib/quire/constants.js +0 -6
  44. package/src/lib/quire/project.js +0 -104
package/CHANGELOG.md CHANGED
@@ -5,19 +5,160 @@ 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-rc.31]
16
+
17
+ ### Changed
18
+
19
+ - Improved accessibility of PDFs generated with prince with `--pdf-profile=PDF/UA-1` flag
20
+
21
+ ### Removed
22
+
23
+ - Removed `install-npm-version` in favor of `npm pack` and `tar xfz` run as subprocesses
24
+ - Removed `patch-package`
25
+
26
+ ## [1.0.0-rc.30]
27
+ ## [1.0.0-rc.29]
28
+
29
+ Candidate versions skipped to align with @thegetty/quire-11ty
30
+
31
+ ## [1.0.0-rc.28]
32
+
33
+ ### Fixed
34
+
35
+ - Fixed issue where `quire pdf` errored and failed (DEV-20270)
36
+
37
+ ## [1.0.0-rc.27]
38
+
39
+ ### Fixed
40
+
41
+ - Fixed post-v3 `quire info` bug (DEV-19984)
42
+
43
+ ## [1.0.0-rc.26]
44
+
45
+ ### Changed
46
+
47
+ - Import path using node namespace in the cli info command
48
+ - Correct file extension of cmd module called by the cli
49
+
50
+ ## [1.0.0-rc.25]
51
+
52
+ ### Changed
53
+
54
+ - Use quire-cli config values for quire-11ty version and version file name
55
+
56
+ ### Fixed
57
+
58
+ - Install path for quire-11ty versions
59
+
60
+ ## [1.0.0-rc.24]
61
+
62
+ ### Changed
63
+
64
+ - Replace Node `import` assertions (deprecated) with a packageConfig module
65
+
66
+ ### Fixed
67
+
68
+ - Quire new command fails with newer version of Node #968
69
+
70
+ ## [1.0.0-rc.23]
71
+
72
+ :warning: broken release candidate
73
+
74
+ ## [1.0.0-rc.22]
75
+
76
+ :warning: broken release candidate
77
+
78
+ ## [1.0.0-rc.21]
79
+
80
+ :warning: broken release candidate
81
+
82
+ ## [1.0.0-rc.20]
83
+
84
+ :warning: broken release candidate
85
+
86
+ ## [1.0.0-rc.19]
87
+
88
+ ### Added
89
+
90
+ - `jsdoc-to-markdown` to development dependencies
91
+ - JSDoc configuration (see https://jsdoc.app/about-configuring-jsdoc)
92
+ - Npm script `docs` to run jsdoc-to-markdown
93
+
94
+ ## [1.0.0-rc.18]
95
+
96
+ ### Added
97
+
98
+ - Quire CLI configuration management using the `conf` package
99
+ - `quire conf` command to manage cli configuration properties
100
+
101
+ ## [1.0.0-rc.17]
102
+
103
+ ### Bumped
104
+
105
+ - `install-npm-version` patch version
106
+
107
+ ### Changed
108
+
109
+ - update patch `install-npm-version`
110
+
111
+ ## [1.0.0-rc.16]
112
+
113
+ ### Added
114
+
115
+ - Patch for `install-npm-version`; see https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
116
+
117
+ ### Changed
118
+
119
+ **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.
120
+
121
+ ### Fixed
122
+
123
+ - Dependency instal error on Windows when running quire new DEV-19124
124
+
125
+ ## [1.0.0-rc.12]
126
+
127
+ ### Added
128
+ - Handling for single-page PDFs
129
+ - Paged and Prince plugins to map quire pages to PDF page sections
130
+
131
+ ### Changed
132
+
133
+ - `quire clean` also removes `.11ty-vite` in the project root
134
+
135
+ ## [1.0.0-rc.11]
136
+
137
+ ### Bumped
138
+ - `epubjs-cli` to version 0.1.6
139
+ - `pagedjs-cli` to version 0.4.3
140
+
141
+ ### Fixed
142
+ - EPUB validation error where pages that include SVGs must include SVG as property under `readingOrder`
143
+
144
+ ## [1.0.0-rc.10]
145
+
146
+ ### Added
147
+ - 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.
148
+
149
+ ## [1.0.0-rc.9]
150
+
151
+ ### Added
152
+ - Update old `.quire` files when running `info` command on versions prior to `1.0.0-rc.8`
153
+ - Include `quire-cli` version used to generate project in `info` output
154
+ - Adds headings to `info` output
155
+
156
+ ## [1.0.0-rc.8]
157
+
158
+ ### Added
159
+ - Added `info` command to output package versions
21
160
 
22
- ## [Unreleased]
161
+ ## [1.0.0-rc.7]
23
162
 
163
+ ### Added
164
+ - 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,31 +1,37 @@
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: 'rc',
29
+ distTag: updateChannel,
24
30
  pkg: packageConfig,
25
- updateCheckInterval: INTERVAL.DAILY,
31
+ updateCheckInterval: INTERVAL[updateIterval],
26
32
  })
27
33
 
28
- notifier.notify()
34
+ notifier.notify({ defer: false })
29
35
 
30
36
  /**
31
37
  * Run the cli program
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.3",
4
+ "version": "1.0.0-rc.31",
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": "echo \"No test specified\" && exit 0"
40
42
  },
41
43
  "imports": {
42
44
  "#root/*": "./*",
@@ -45,29 +47,33 @@
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
56
  "del": "^7.0.0",
54
- "epubjs-cli": "^0.1.2",
57
+ "epubjs-cli": "^0.1.6",
55
58
  "execa": "^6.1.0",
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",
65
+ "node-fetch": "^3.3.2",
62
66
  "open": "^8.4.0",
63
67
  "ora": "^6.1.2",
64
- "pagedjs-cli": "^0.3.3",
68
+ "pagedjs-cli": "^0.4.3",
69
+ "read-package-up": "^11.0.0",
65
70
  "semver": "^7.3.8",
66
71
  "simple-git": "^3.16.0",
67
- "update-notifier": "^6.0.2"
72
+ "update-notifier": "^7.3.1"
68
73
  },
69
74
  "devDependencies": {
70
- "eslint": "^8.32.0"
75
+ "eslint": "^8.32.0",
76
+ "jsdoc-to-markdown": "^9.1.1"
71
77
  },
72
78
  "engines": {
73
79
  "node": ">=14.16"
Binary file
@@ -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
+ ```