@thegetty/quire-cli 1.0.0-pre-release.8 → 1.0.0-pre-release.9

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
@@ -19,5 +19,5 @@ Changelog entries are classified using the following labels:
19
19
  - `Removed`: for deprecated features removed in this release
20
20
 
21
21
 
22
- ## [Unreleased]
22
+ ## [1.0.0-pre-release]
23
23
 
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-pre-release.8",
4
+ "version": "1.0.0-pre-release.9",
5
5
  "author": "Getty Digital",
6
6
  "license": "J Paul Getty Trust",
7
7
  "bugs": {
@@ -1,4 +1,5 @@
1
- import { fileURLToPath } from 'node:url'
1
+ import { IS_WINDOWS } from '#helpers/os-utils.js'
2
+ import { fileURLToPath, pathToFileURL } from 'node:url'
2
3
  import fs from 'fs-extra'
3
4
  import path from 'node:path'
4
5
 
@@ -14,7 +15,10 @@ const thisfile = path.basename(__filename)
14
15
  const commands = await Promise.all(
15
16
  fs.readdirSync(__dirname)
16
17
  .filter((file) => file !== thisfile && file.match(/^.*\.js$/))
17
- .map((file) => import(path.resolve(__dirname, file)))
18
+ .map((file) => IS_WINDOWS
19
+ ? import(pathToFileURL(path.resolve(__dirname, file)))
20
+ : import(path.resolve(__dirname, file))
21
+ )
18
22
  ).then((modules) => {
19
23
  return modules.map(({ default: CommandClass }) => new CommandClass())
20
24
  })
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Determine if the process is running on Windows operating system
3
+ */
4
+ export const IS_WINDOWS =
5
+ process.platform === 'win32' || /^(cygwin|msys)$/.test(process.env.OSTYPE)
@@ -1,3 +1,5 @@
1
+ import { IS_WINDOWS } from '#helpers/os-utils.js'
2
+ import { pathToFileURL } from 'node:url'
1
3
  import path from 'node:path'
2
4
  import paths, { eleventyRoot, projectRoot } from './paths.js'
3
5
 
@@ -18,7 +20,10 @@ const factory = async (options = {}) => {
18
20
  /**
19
21
  * Dynamically import the correct version of Eleventy from `lib/quire/versions`
20
22
  */
21
- const { default: Eleventy } = await import(path.join(eleventyRoot, 'node_modules', '@11ty', 'eleventy', 'src', 'Eleventy.js'))
23
+ const modulePath = path.join(eleventyRoot, 'node_modules', '@11ty', 'eleventy', 'src', 'Eleventy.js')
24
+ const { default: Eleventy } = IS_WINDOWS
25
+ ? await import(pathToFileURL(modulePath))
26
+ : await import(modulePath)
22
27
 
23
28
  /**
24
29
  * Set Eleventy passthrough copy options
@@ -1,3 +1,4 @@
1
+ import { IS_WINDOWS } from '#helpers/os-utils.js'
1
2
  import { chdir, cwd } from 'node:process'
2
3
  import { execa, execaCommand } from 'execa'
3
4
  import { fileURLToPath } from 'node:url'
@@ -16,9 +17,6 @@ const INSTALL_PATH = path.join('src', 'lib', 'quire', 'versions')
16
17
  const PACKAGE_NAME = '@thegetty/quire-11ty'
17
18
  const VERSION_FILE = '.quire'
18
19
 
19
- const IS_WINDOWS =
20
- process.platform === 'win32' || /^(cygwin|msys)$/.test(process.env.OSTYPE)
21
-
22
20
  /**
23
21
  * Return an absolute path to an installed `quire-11ty` version
24
22
  *
@@ -30,7 +28,7 @@ function getPath(version='latest') {
30
28
  console.error(`[CLI:quire] \`quire-11ty@${version}\` is not installed`)
31
29
  return null
32
30
  }
33
- console.debug(`[CLI:quire] \%`, absolutePath)
31
+ console.debug(`[CLI:quire] %s`, absolutePath)
34
32
  return absolutePath
35
33
  }
36
34