@thegetty/quire-cli 1.0.0-pre-release.16 → 1.0.0-rc.0
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 +2 -2
- package/src/lib/11ty/api.js +21 -21
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-
|
|
4
|
+
"version": "1.0.0-rc.0",
|
|
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,9 +40,9 @@ export default class PreviewCommand extends Command {
|
|
|
40
40
|
super(PreviewCommand.definition)
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
action(options, command) {
|
|
44
44
|
if (options.debug) {
|
|
45
|
-
console.debug('[CLI] Command \'%s\' called with arguments [%o] and options %o', this.name(),
|
|
45
|
+
console.debug('[CLI] Command \'%s\' called with arguments [%o] and options %o', this.name(), options)
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
if (options['11ty'] === 'cli') {
|
package/src/lib/11ty/api.js
CHANGED
|
@@ -18,7 +18,7 @@ const factory = async (options = {}) => {
|
|
|
18
18
|
console.debug('[CLI:11ty] %o', paths)
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Dynamically import the correct version of Eleventy
|
|
21
|
+
* Dynamically import the correct version of Eleventy
|
|
22
22
|
*/
|
|
23
23
|
const modulePath = path.join(eleventyRoot, 'node_modules', '@11ty', 'eleventy', 'src', 'Eleventy.js')
|
|
24
24
|
const { default: Eleventy } = await dynamicImport(modulePath)
|
|
@@ -29,8 +29,7 @@ const factory = async (options = {}) => {
|
|
|
29
29
|
* @see https://github.com/timkendrick/recursive-copy
|
|
30
30
|
*/
|
|
31
31
|
const copyOptions = {
|
|
32
|
-
debug: options.debug || false
|
|
33
|
-
expand: false,
|
|
32
|
+
debug: options.debug || false
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
/**
|
|
@@ -64,23 +63,23 @@ const factory = async (options = {}) => {
|
|
|
64
63
|
* to the `config` file however the quire-cli separates 11ty from the
|
|
65
64
|
* project directory (`input`) and needs to use absolute system paths.
|
|
66
65
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
66
|
+
const addPassthroughCopy = eleventyConfig.addPassthroughCopy.bind(eleventyConfig)
|
|
67
|
+
eleventyConfig.addPassthroughCopy = (entry) => {
|
|
68
|
+
if (typeof entry === 'string') {
|
|
69
|
+
const filePath = path.resolve(entry) //path.join(projectRoot, file)
|
|
70
|
+
// console.debug('[11ty:API] passthrough copy %s', filePath)
|
|
71
|
+
return addPassthroughCopy(filePath, copyOptions)
|
|
72
|
+
} else {
|
|
73
|
+
// console.debug('[11ty:API] passthrough copy %o', entry)
|
|
74
|
+
entry = Object.fromEntries(
|
|
75
|
+
Object.entries(entry).map(([ src, dest ]) => {
|
|
76
|
+
return [ path.join(eleventyRoot, src), path.resolve(dest) ]
|
|
77
|
+
})
|
|
78
|
+
)
|
|
79
|
+
// console.debug('[11ty:API] passthrough copy %o', entry)
|
|
80
|
+
return addPassthroughCopy(entry, copyOptions)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
84
83
|
|
|
85
84
|
/**
|
|
86
85
|
* Event callback when a build completes
|
|
@@ -114,8 +113,8 @@ export default {
|
|
|
114
113
|
if (options.debug) process.env.DEBUG = 'Eleventy*'
|
|
115
114
|
|
|
116
115
|
const eleventy = await factory(options)
|
|
117
|
-
|
|
118
116
|
eleventy.setDryRun(options.dryrun)
|
|
117
|
+
eleventy.setIncrementalBuild(true)
|
|
119
118
|
|
|
120
119
|
await eleventy.write()
|
|
121
120
|
},
|
|
@@ -128,6 +127,7 @@ export default {
|
|
|
128
127
|
if (options.debug) process.env.DEBUG = 'Eleventy*'
|
|
129
128
|
|
|
130
129
|
const eleventy = await factory(options)
|
|
130
|
+
eleventy.setIncrementalBuild(true)
|
|
131
131
|
|
|
132
132
|
await eleventy.serve(options.port)
|
|
133
133
|
}
|