@thegetty/quire-cli 1.0.0-rc.26 → 1.0.0-rc.28

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/CHANGELOG.md CHANGED
@@ -12,6 +12,18 @@ Changelog entries are classified using the following labels:
12
12
  - `Fixed`: for any bug fixes
13
13
  - `Removed`: for deprecated features removed in this release
14
14
 
15
+ ## [1.0.0-rc.28]
16
+
17
+ ### Fixed
18
+
19
+ - Fixed issue where `quire pdf` errored and failed (DEV-20270)
20
+
21
+ ## [1.0.0-rc.27]
22
+
23
+ ### Fixed
24
+
25
+ - Fixed post-v3 `quire info` bug (DEV-19984)
26
+
15
27
  ## [1.0.0-rc.26]
16
28
 
17
29
  ### Changed
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.26",
4
+ "version": "1.0.0-rc.28",
5
5
  "author": "Getty Digital",
6
6
  "license": "SEE LICENSE IN https://github.com/thegetty/quire/blob/main/LICENSE",
7
7
  "bugs": {
@@ -40,17 +40,19 @@ export default class InfoCommand extends Command {
40
40
  console.debug('[CLI] Command \'%s\' called', this.name())
41
41
  }
42
42
 
43
+ // Load filename from config with a default constraint if it doesn't exist
43
44
  const versionFileName = this.config.get('versionFile')
45
+ let versionInfo = { cli: '<=1.0.0.rc-7' }
44
46
 
45
47
  try {
46
- // the quire version file is always local to the project root
47
- let fileData = fs.readFileSync(versionFileName, { encoding: 'utf8' })
48
- versionInfo = JSON.parse(fileData)
48
+ const versionFileData = fs.readFileSync(versionFileName, { encoding: 'utf8' })
49
+
50
+ versionInfo = JSON.parse(versionFileData)
49
51
  } catch (error) {
50
52
  console.warn(
51
53
  `This project was generated with the quire-cli prior to version 1.0.0.rc-8. Updating the version file to the new format, though this project's version file will not contain specific starter version information.`
52
54
  )
53
- versionInfo = { cli: '<=1.0.0.rc-7' }
55
+
54
56
  fs.writeFileSync(versionFileName, JSON.stringify(versionInfo))
55
57
  }
56
58
 
@@ -4,6 +4,7 @@ import fs from 'fs-extra'
4
4
  import libPdf from '#lib/pdf/index.js'
5
5
  import open from 'open'
6
6
  import path from 'node:path'
7
+ import { pathToFileURL } from 'node:url'
7
8
  import yaml from 'js-yaml'
8
9
 
9
10
  /**
@@ -29,7 +30,7 @@ async function loadConfig(configPath) {
29
30
 
30
31
  if (fs.existsSync(schemaPath) && fs.existsSync(validatorPath)) {
31
32
 
32
- const { validateUserConfig } = await import(validatorPath)
33
+ const { validateUserConfig } = await import(pathToFileURL(validatorPath))
33
34
 
34
35
  const schemaJSON = fs.readFileSync(schemaPath)
35
36
  const schema = JSON.parse(schemaJSON)
@@ -1,4 +1,5 @@
1
1
  import { execa } from 'execa'
2
+ import fs from 'node:fs'
2
3
  import path from 'node:path'
3
4
  import paths, { eleventyRoot, projectRoot } from './paths.js'
4
5
 
@@ -17,9 +18,24 @@ const factory = (options = {}) => {
17
18
 
18
19
  /**
19
20
  * Use the version of Eleventy installed to `lib/quire/versions`
21
+ *
22
+ * NB: in eleventy v3 the CLI extension (".cjs") is load-bearing but v2 is simply ".js"
23
+ *
20
24
  */
21
- const eleventy =
22
- path.join(eleventyRoot, 'node_modules', '@11ty', 'eleventy', 'cmd.cjs')
25
+ const eleventyModuleDir = path.join(eleventyRoot, 'node_modules', '@11ty', 'eleventy')
26
+ const packagePath = path.join(eleventyModuleDir,'package.json')
27
+
28
+ const pack = JSON.parse(fs.readFileSync(packagePath))
29
+
30
+ const { version } = pack
31
+
32
+ const eleventyMajorVer = version.split('.').at(0)
33
+
34
+ let eleventy = path.join(eleventyModuleDir,'cmd.cjs')
35
+
36
+ if ( Number(eleventyMajorVer) < 3 ) {
37
+ eleventy = path.join(eleventyModuleDir,'cmd.js')
38
+ }
23
39
 
24
40
  const command = [
25
41
  eleventy,