@thegetty/quire-cli 1.0.0-pre-release.15 → 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 +6 -8
- 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-
|
|
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
|
@@ -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'
|
|
@@ -18,12 +18,10 @@ 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
|
-
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
|
|
@@ -31,8 +29,7 @@ const factory = async (options = {}) => {
|
|
|
31
29
|
* @see https://github.com/timkendrick/recursive-copy
|
|
32
30
|
*/
|
|
33
31
|
const copyOptions = {
|
|
34
|
-
debug: options.debug || false
|
|
35
|
-
expand: false,
|
|
32
|
+
debug: options.debug || false
|
|
36
33
|
}
|
|
37
34
|
|
|
38
35
|
/**
|
|
@@ -116,8 +113,8 @@ export default {
|
|
|
116
113
|
if (options.debug) process.env.DEBUG = 'Eleventy*'
|
|
117
114
|
|
|
118
115
|
const eleventy = await factory(options)
|
|
119
|
-
|
|
120
116
|
eleventy.setDryRun(options.dryrun)
|
|
117
|
+
eleventy.setIncrementalBuild(true)
|
|
121
118
|
|
|
122
119
|
await eleventy.write()
|
|
123
120
|
},
|
|
@@ -130,6 +127,7 @@ export default {
|
|
|
130
127
|
if (options.debug) process.env.DEBUG = 'Eleventy*'
|
|
131
128
|
|
|
132
129
|
const eleventy = await factory(options)
|
|
130
|
+
eleventy.setIncrementalBuild(true)
|
|
133
131
|
|
|
134
132
|
await eleventy.serve(options.port)
|
|
135
133
|
}
|
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',
|