@thegetty/quire-cli 1.0.0-pre-release.15 → 1.0.0-pre-release.16

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/bin/cli.js CHANGED
@@ -20,7 +20,7 @@ const INTERVAL = Object.freeze({
20
20
  * @todo user configuration of choosen update interval
21
21
  */
22
22
  const notifier = updateNotifier({
23
- distTag: 'latest',
23
+ distTag: 'pre-release',
24
24
  pkg: packageConfig,
25
25
  updateCheckInterval: INTERVAL.DAILY,
26
26
  })
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.15",
4
+ "version": "1.0.0-pre-release.16",
5
5
  "author": "Getty Digital",
6
6
  "license": "SEE LICENSE IN https://github.com/thegetty/quire/blob/main/LICENSE",
7
7
  "bugs": {
@@ -40,7 +40,7 @@ export default class PreviewCommand extends Command {
40
40
  super(PreviewCommand.definition)
41
41
  }
42
42
 
43
- async action(args, options, command) {
43
+ async action(options, command) {
44
44
  if (options.debug) {
45
45
  console.debug('[CLI] Command \'%s\' called with arguments [%o] and options %o', this.name(), args.join(', '), options)
46
46
  }
@@ -1,4 +1,4 @@
1
- import { IS_WINDOWS } from '#helpers/os-utils.js'
1
+ import { dynamicImport } from '#helpers/os-utils.js'
2
2
  import { pathToFileURL } from 'node:url'
3
3
  import path from 'node:path'
4
4
  import paths, { eleventyRoot, projectRoot } from './paths.js'
@@ -21,9 +21,7 @@ const factory = async (options = {}) => {
21
21
  * Dynamically import the correct version of Eleventy from `lib/quire/versions`
22
22
  */
23
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)
24
+ const { default: Eleventy } = await dynamicImport(modulePath)
27
25
 
28
26
  /**
29
27
  * Set Eleventy passthrough copy options
@@ -66,23 +64,23 @@ const factory = async (options = {}) => {
66
64
  * to the `config` file however the quire-cli separates 11ty from the
67
65
  * project directory (`input`) and needs to use absolute system paths.
68
66
  */
69
- const addPassthroughCopy = eleventyConfig.addPassthroughCopy.bind(eleventyConfig)
70
- eleventyConfig.addPassthroughCopy = (entry) => {
71
- if (typeof entry === 'string') {
72
- const filePath = path.resolve(entry) //path.join(projectRoot, file)
73
- // console.debug('[11ty:API] passthrough copy %s', filePath)
74
- return addPassthroughCopy(filePath, copyOptions)
75
- } else {
76
- // console.debug('[11ty:API] passthrough copy %o', entry)
77
- entry = Object.fromEntries(
78
- Object.entries(entry).map(([ src, dest ]) => {
79
- return [ path.join(eleventyRoot, src), path.resolve(dest) ]
80
- })
81
- )
82
- // console.debug('[11ty:API] passthrough copy %o', entry)
83
- return addPassthroughCopy(entry, copyOptions)
84
- }
85
- }
67
+ // const addPassthroughCopy = eleventyConfig.addPassthroughCopy.bind(eleventyConfig)
68
+ // eleventyConfig.addPassthroughCopy = (entry) => {
69
+ // if (typeof entry === 'string') {
70
+ // const filePath = path.resolve(entry) //path.join(projectRoot, file)
71
+ // // console.debug('[11ty:API] passthrough copy %s', filePath)
72
+ // return addPassthroughCopy(filePath, copyOptions)
73
+ // } else {
74
+ // // console.debug('[11ty:API] passthrough copy %o', entry)
75
+ // entry = Object.fromEntries(
76
+ // Object.entries(entry).map(([ src, dest ]) => {
77
+ // return [ path.join(eleventyRoot, src), path.resolve(dest) ]
78
+ // })
79
+ // )
80
+ // // console.debug('[11ty:API] passthrough copy %o', entry)
81
+ // return addPassthroughCopy(entry, copyOptions)
82
+ // }
83
+ // }
86
84
 
87
85
  /**
88
86
  * Event callback when a build completes
@@ -83,11 +83,20 @@ export const eleventyRoot = getEleventyRoot()
83
83
  const inputDir = path.join(projectRoot, 'content')
84
84
 
85
85
  export default {
86
+ /**
87
+ * An abolsute path to eleventy config module
88
+ */
86
89
  config: path.join(eleventyRoot, '.eleventy.js'),
87
- epub: path.relative(eleventyRoot, path.join(projectRoot, '_epub')),
90
+ /**
91
+ * Paths _relative to_ the eleventy config module
92
+ */
88
93
  input: path.relative(eleventyRoot, inputDir),
89
94
  output: path.relative(eleventyRoot, path.join(projectRoot, '_site')),
90
- data: path.relative(inputDir, path.join(eleventyRoot, '_computed')),
95
+ epub: path.relative(eleventyRoot, path.join(projectRoot, '_epub')),
96
+ /**
97
+ * Paths _relative to_ the `input` directory
98
+ */
99
+ data: '_computed',
91
100
  includes: path.relative(inputDir, path.join(eleventyRoot, '_includes')),
92
101
  layouts: path.relative(inputDir, path.join(eleventyRoot, '_layouts')),
93
102
  public: './public',