@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 +1 -1
- package/package.json +1 -1
- package/src/commands/preview.js +1 -1
- package/src/lib/11ty/api.js +19 -21
- package/src/lib/11ty/paths.js +11 -2
package/bin/cli.js
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-pre-release.
|
|
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": {
|
package/src/commands/preview.js
CHANGED
|
@@ -40,7 +40,7 @@ export default class PreviewCommand extends Command {
|
|
|
40
40
|
super(PreviewCommand.definition)
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
async action(
|
|
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
|
}
|
package/src/lib/11ty/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 } =
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
package/src/lib/11ty/paths.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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',
|