@thegetty/quire-cli 1.0.0-rc.45 → 1.0.0-rc.46
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 +0 -36
- package/README.md +0 -9
- package/bin/cli.js +1 -46
- package/package.json +10 -27
- package/src/Command.js +6 -26
- package/src/commands/README.md +122 -213
- package/src/commands/build.js +37 -45
- package/src/commands/clean.js +19 -33
- package/src/commands/conf.js +43 -0
- package/src/commands/create.js +14 -42
- package/src/commands/epub.js +31 -67
- package/src/commands/index.js +2 -9
- package/src/commands/info.js +86 -88
- package/src/commands/pdf.js +82 -63
- package/src/commands/preview.js +31 -32
- package/src/commands/validate.js +20 -64
- package/src/commands/version.js +43 -0
- package/src/errors/validation/validation-error.js +11 -20
- package/src/helpers/clean.js +1 -1
- package/src/helpers/is-quire.js +31 -0
- package/src/helpers/test-cwd.js +6 -5
- package/src/helpers/which.js +4 -10
- package/src/lib/11ty/README.md +19 -135
- package/src/lib/11ty/api.js +93 -235
- package/src/lib/11ty/cli.js +37 -112
- package/src/lib/11ty/index.js +5 -64
- package/src/lib/11ty/paths.js +103 -0
- package/src/lib/README.md +0 -330
- package/src/lib/conf/README.md +69 -86
- package/src/lib/conf/config.js +3 -5
- package/src/lib/conf/defaults.js +0 -65
- package/src/lib/conf/schema.js +9 -103
- package/src/lib/epub/README.md +2 -133
- package/src/lib/epub/epub.js +11 -36
- package/src/lib/epub/index.js +21 -111
- package/src/lib/epub/pandoc.js +4 -33
- package/src/lib/git/README.md +2 -151
- package/src/lib/git/index.js +13 -217
- package/src/lib/i18n/README.md +3 -0
- package/src/lib/i18n/config.js +53 -0
- package/src/lib/i18n/index.js +43 -0
- package/src/lib/i18n/localeService.js +58 -0
- package/src/lib/pdf/README.md +0 -131
- package/src/lib/pdf/index.js +21 -124
- package/src/lib/pdf/paged.js +52 -100
- package/src/lib/pdf/prince.js +37 -115
- package/src/lib/pdf/split.js +33 -61
- package/src/lib/quire/README.md +19 -0
- package/src/lib/quire/index.js +353 -0
- package/src/lib/reporter/README.md +2 -211
- package/src/lib/reporter/index.js +0 -607
- package/src/main.js +48 -221
- package/src/packageConfig.js +0 -17
- package/src/validators/utils.js +1 -2
- package/man/quire.1 +0 -341
- package/man/quire.1.md +0 -232
- package/schemas/config.schema.json +0 -194
- package/schemas/figures.schema.json +0 -56
- package/schemas/layout.schema.json +0 -5
- package/schemas/objects.schema.json +0 -62
- package/schemas/publication.schema.json +0 -140
- package/schemas/references.schema.json +0 -29
- package/src/Command.spec.js +0 -99
- package/src/commands/build.spec.js +0 -113
- package/src/commands/build.test.js +0 -397
- package/src/commands/clean.spec.js +0 -118
- package/src/commands/clean.test.js +0 -382
- package/src/commands/config.js +0 -238
- package/src/commands/config.spec.js +0 -107
- package/src/commands/config.test.js +0 -845
- package/src/commands/create.spec.js +0 -112
- package/src/commands/create.test.js +0 -415
- package/src/commands/doctor.js +0 -251
- package/src/commands/doctor.spec.js +0 -115
- package/src/commands/doctor.test.js +0 -1409
- package/src/commands/epub.spec.js +0 -114
- package/src/commands/epub.test.js +0 -503
- package/src/commands/help.js +0 -60
- package/src/commands/help.test.js +0 -132
- package/src/commands/info.spec.js +0 -72
- package/src/commands/info.test.js +0 -512
- package/src/commands/pdf.spec.js +0 -114
- package/src/commands/pdf.test.js +0 -464
- package/src/commands/preview.spec.js +0 -97
- package/src/commands/preview.test.js +0 -250
- package/src/commands/use.js +0 -56
- package/src/commands/use.spec.js +0 -61
- package/src/commands/use.test.js +0 -280
- package/src/commands/validate.spec.js +0 -90
- package/src/commands/validate.test.js +0 -378
- package/src/commands/workflows.js +0 -70
- package/src/errors/build/build-failed-error.js +0 -19
- package/src/errors/build/config-field-missing-error.js +0 -20
- package/src/errors/build/config-file-not-found-error.js +0 -20
- package/src/errors/build/index.js +0 -11
- package/src/errors/help/help-topic-not-found-error.js +0 -30
- package/src/errors/help/index.js +0 -8
- package/src/errors/index.js +0 -58
- package/src/errors/input/index.js +0 -8
- package/src/errors/input/invalid-input-error.js +0 -21
- package/src/errors/install/dependency-install-error.js +0 -19
- package/src/errors/install/directory-not-empty-error.js +0 -25
- package/src/errors/install/index.js +0 -12
- package/src/errors/install/invalid-path-error.js +0 -31
- package/src/errors/install/invalid-starter-error.js +0 -27
- package/src/errors/install/version-not-found-error.js +0 -35
- package/src/errors/output/epub-generation-error.js +0 -19
- package/src/errors/output/index.js +0 -14
- package/src/errors/output/invalid-epub-library-error.js +0 -20
- package/src/errors/output/invalid-pdf-library-error.js +0 -20
- package/src/errors/output/missing-build-output-error.js +0 -21
- package/src/errors/output/pdf-generation-error.js +0 -24
- package/src/errors/output/tool-not-found-error.js +0 -37
- package/src/errors/project/index.js +0 -10
- package/src/errors/project/not-in-project-error.js +0 -20
- package/src/errors/project/project-create-error.js +0 -21
- package/src/errors/quire-error.js +0 -27
- package/src/errors/validation/index.js +0 -3
- package/src/errors/validation/unknown-config-key-error.js +0 -27
- package/src/errors/validation/unknown-config-operation-error.js +0 -24
- package/src/helpers/docs-url.js +0 -32
- package/src/helpers/pager.js +0 -59
- package/src/helpers/pager.test.js +0 -85
- package/src/helpers/suggest-similar.js +0 -124
- package/src/helpers/suggest-similar.test.js +0 -108
- package/src/helpers/test-cwd.test.js +0 -192
- package/src/lib/11ty/index.test.js +0 -655
- package/src/lib/commander/index.js +0 -103
- package/src/lib/commander/index.test.js +0 -86
- package/src/lib/commander/options.js +0 -237
- package/src/lib/commander/options.test.js +0 -205
- package/src/lib/conf/build-status.js +0 -103
- package/src/lib/conf/build-status.test.js +0 -247
- package/src/lib/conf/config.test.js +0 -281
- package/src/lib/conf/format.js +0 -60
- package/src/lib/conf/format.test.js +0 -106
- package/src/lib/conf/helpers.js +0 -91
- package/src/lib/conf/helpers.test.js +0 -136
- package/src/lib/conf/index.js +0 -22
- package/src/lib/constants.js +0 -28
- package/src/lib/doctor/README.md +0 -667
- package/src/lib/doctor/checks/environment/cli-version.js +0 -62
- package/src/lib/doctor/checks/environment/cli-version.test.js +0 -132
- package/src/lib/doctor/checks/environment/git-available.js +0 -77
- package/src/lib/doctor/checks/environment/git-available.test.js +0 -52
- package/src/lib/doctor/checks/environment/index.js +0 -13
- package/src/lib/doctor/checks/environment/node-version.js +0 -66
- package/src/lib/doctor/checks/environment/node-version.test.js +0 -17
- package/src/lib/doctor/checks/environment/npm-available.js +0 -66
- package/src/lib/doctor/checks/environment/npm-available.test.js +0 -52
- package/src/lib/doctor/checks/environment/os-info.js +0 -48
- package/src/lib/doctor/checks/environment/os-info.test.js +0 -81
- package/src/lib/doctor/checks/environment/runtime-info.js +0 -51
- package/src/lib/doctor/checks/environment/runtime-info.test.js +0 -132
- package/src/lib/doctor/checks/outputs/epub-output.js +0 -119
- package/src/lib/doctor/checks/outputs/epub-output.test.js +0 -277
- package/src/lib/doctor/checks/outputs/index.js +0 -10
- package/src/lib/doctor/checks/outputs/pdf-output.js +0 -144
- package/src/lib/doctor/checks/outputs/pdf-output.test.js +0 -377
- package/src/lib/doctor/checks/outputs/stale-build.js +0 -122
- package/src/lib/doctor/checks/outputs/stale-build.test.js +0 -282
- package/src/lib/doctor/checks/project/data-files.js +0 -56
- package/src/lib/doctor/checks/project/data-files.test.js +0 -125
- package/src/lib/doctor/checks/project/dependencies.js +0 -53
- package/src/lib/doctor/checks/project/dependencies.test.js +0 -71
- package/src/lib/doctor/checks/project/index.js +0 -11
- package/src/lib/doctor/checks/project/quire-11ty.js +0 -98
- package/src/lib/doctor/checks/project/quire-11ty.test.js +0 -170
- package/src/lib/doctor/checks/project/quire-project.js +0 -38
- package/src/lib/doctor/checks/project/quire-project.test.js +0 -47
- package/src/lib/doctor/checks/tools/index.js +0 -10
- package/src/lib/doctor/checks/tools/pandoc-available.js +0 -82
- package/src/lib/doctor/checks/tools/pandoc-available.test.js +0 -73
- package/src/lib/doctor/checks/tools/prince-available.js +0 -81
- package/src/lib/doctor/checks/tools/prince-available.test.js +0 -73
- package/src/lib/doctor/constants.js +0 -39
- package/src/lib/doctor/formatDuration.js +0 -108
- package/src/lib/doctor/formatDuration.test.js +0 -76
- package/src/lib/doctor/formatters/human.js +0 -257
- package/src/lib/doctor/formatters/human.test.js +0 -463
- package/src/lib/doctor/formatters/index.js +0 -8
- package/src/lib/doctor/formatters/json.js +0 -78
- package/src/lib/doctor/formatters/json.test.js +0 -174
- package/src/lib/doctor/formatters/shared.js +0 -129
- package/src/lib/doctor/formatters/shared.test.js +0 -194
- package/src/lib/doctor/index.js +0 -271
- package/src/lib/doctor/index.test.js +0 -797
- package/src/lib/epub/engines.js +0 -46
- package/src/lib/epub/index.test.js +0 -518
- package/src/lib/epub/pandoc.test.js +0 -122
- package/src/lib/epub/schema.js +0 -21
- package/src/lib/error/README.md +0 -170
- package/src/lib/error/handler.js +0 -107
- package/src/lib/git/index.spec.js +0 -80
- package/src/lib/git/index.test.js +0 -453
- package/src/lib/help/frontmatter.js +0 -77
- package/src/lib/help/frontmatter.test.js +0 -139
- package/src/lib/help/index.js +0 -146
- package/src/lib/help/index.test.js +0 -188
- package/src/lib/help/topics/configuration.md +0 -77
- package/src/lib/help/topics/debugging.md +0 -69
- package/src/lib/help/topics/epub.md +0 -74
- package/src/lib/help/topics/pdf.md +0 -74
- package/src/lib/help/topics/publishing.md +0 -80
- package/src/lib/help/topics/workflows.md +0 -50
- package/src/lib/installer/index.js +0 -309
- package/src/lib/installer/index.spec.js +0 -83
- package/src/lib/installer/index.test.js +0 -545
- package/src/lib/logger/README.md +0 -424
- package/src/lib/logger/debug.js +0 -132
- package/src/lib/logger/debug.spec.js +0 -130
- package/src/lib/logger/debug.test.js +0 -128
- package/src/lib/logger/index.js +0 -228
- package/src/lib/logger/index.spec.js +0 -131
- package/src/lib/logger/index.test.js +0 -578
- package/src/lib/npm/README.md +0 -127
- package/src/lib/npm/index.js +0 -198
- package/src/lib/npm/index.spec.js +0 -60
- package/src/lib/npm/index.test.js +0 -355
- package/src/lib/pdf/engines.js +0 -46
- package/src/lib/pdf/index.test.js +0 -708
- package/src/lib/pdf/paged.test.js +0 -366
- package/src/lib/pdf/prince.test.js +0 -202
- package/src/lib/pdf/schema.js +0 -21
- package/src/lib/pdf/split.test.js +0 -445
- package/src/lib/platform.js +0 -95
- package/src/lib/process/manager.js +0 -110
- package/src/lib/process/manager.test.js +0 -55
- package/src/lib/project/build.js +0 -162
- package/src/lib/project/build.test.js +0 -275
- package/src/lib/project/config.js +0 -48
- package/src/lib/project/config.test.js +0 -134
- package/src/lib/project/detect.js +0 -47
- package/src/lib/project/detect.test.js +0 -157
- package/src/lib/project/index.js +0 -56
- package/src/lib/project/output-paths.js +0 -87
- package/src/lib/project/output-paths.test.js +0 -66
- package/src/lib/project/paths.js +0 -272
- package/src/lib/project/version.js +0 -110
- package/src/lib/project/version.test.js +0 -350
- package/src/lib/reporter/index.test.js +0 -862
- package/src/main.spec.js +0 -61
- package/src/main.test.js +0 -347
- package/src/validators/validate-data-files.js +0 -154
- package/src/validators/validate-data-files.test.js +0 -217
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url'
|
|
2
|
+
import fs from 'fs-extra'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
6
|
+
const __dirname = path.dirname(__filename)
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Eleventy configuration paths
|
|
10
|
+
* @see https://www.11ty.dev/docs/config/#configuration-options
|
|
11
|
+
*
|
|
12
|
+
* Resolve the absolute path to the Eleventy configuration module,
|
|
13
|
+
* `eleventyRoot` is _relative_ to `main.js`, the CLI entry point.
|
|
14
|
+
* Both `input` and `output` are _relative_ to the `config` module.
|
|
15
|
+
*
|
|
16
|
+
* @todo
|
|
17
|
+
* - refactor the paths module as a concern of the `lib/quire` module
|
|
18
|
+
* - refactor resolving an absolute path to the correct eleventy version root;
|
|
19
|
+
* this needs to use the correct `quire-11ty` version for the project
|
|
20
|
+
* and correctly resolve the path to the target of the 'latest' symlink
|
|
21
|
+
*/
|
|
22
|
+
const cliRoot = path.resolve(__dirname, path.join('..', '..'))
|
|
23
|
+
const eleventyConfig = '.eleventy.js'
|
|
24
|
+
const version = 'latest'
|
|
25
|
+
|
|
26
|
+
export const projectRoot = process.cwd()
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Absolute path to the latest installed version of `quire-11ty`
|
|
30
|
+
* @todo use version read from the project `.quire-version` file
|
|
31
|
+
*/
|
|
32
|
+
const libQuirePath = path.resolve(__dirname, path.join(cliRoot, 'lib', 'quire', 'versions', version))
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Absolute path to the current version of `quire-11ty`
|
|
36
|
+
* Nota bene: to get a relative path to the `eleventyRoot`,
|
|
37
|
+
* for example when the version is specified is 'latest',
|
|
38
|
+
* it must be set to the real path to the symlink target.
|
|
39
|
+
*
|
|
40
|
+
* @todo refactor how and *when* the eleventyRoot is determined:
|
|
41
|
+
* - we only need eleventyRoot for cli commands that run 11ty
|
|
42
|
+
* - paths module is a concern of the `quire` module
|
|
43
|
+
* - global quire-cli installation
|
|
44
|
+
* - local quire-cli installation
|
|
45
|
+
*
|
|
46
|
+
* For an excellent developer experience, the quire-11ty code should be
|
|
47
|
+
* installed into an `11ty` or `quire-11ty` directory in the `projectRoot`
|
|
48
|
+
* this will allow us to more easily manage symlinks for local development
|
|
49
|
+
* using unpublished `quire-11ty` code.
|
|
50
|
+
* @example
|
|
51
|
+
* ```sh
|
|
52
|
+
* blargh/
|
|
53
|
+
* .git/
|
|
54
|
+
* .gitignore
|
|
55
|
+
* .node-version
|
|
56
|
+
* .quire-version
|
|
57
|
+
* 11ty@ --> /Users/mph/Code/Getty/quire/packages/11ty
|
|
58
|
+
* content/
|
|
59
|
+
* CHANGELOG.md
|
|
60
|
+
* LICENSE
|
|
61
|
+
* README.md
|
|
62
|
+
* package.json
|
|
63
|
+
* package-lock.json
|
|
64
|
+
* ```
|
|
65
|
+
* Installing to a directory will allow more cleanly `eject` and `uneject`
|
|
66
|
+
* using a symlink or single directory `rm -rf`.
|
|
67
|
+
* Should the `11ty` directory be a dot directory to hide the complexity from
|
|
68
|
+
* users or should it be visible to be more explicit when project is ejected?
|
|
69
|
+
*/
|
|
70
|
+
const getEleventyRoot = () => {
|
|
71
|
+
// try {
|
|
72
|
+
// return fs.readdirSync(projectRoot).includes(eleventyConfig)
|
|
73
|
+
// ? projectRoot
|
|
74
|
+
// : fs.realpathSync(libQuirePath)
|
|
75
|
+
// } catch (error) {
|
|
76
|
+
// throw new Error(`[CLI:11ty] Unable to read project directory for eleventy config ${error}`)
|
|
77
|
+
// }
|
|
78
|
+
return projectRoot
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const eleventyRoot = getEleventyRoot()
|
|
82
|
+
|
|
83
|
+
const inputDir = path.join(projectRoot, 'content')
|
|
84
|
+
|
|
85
|
+
export default {
|
|
86
|
+
/**
|
|
87
|
+
* An abolsute path to eleventy config module
|
|
88
|
+
*/
|
|
89
|
+
config: path.join(eleventyRoot, '.eleventy.js'),
|
|
90
|
+
/**
|
|
91
|
+
* Paths _relative to_ the eleventy config module
|
|
92
|
+
*/
|
|
93
|
+
input: path.relative(eleventyRoot, inputDir),
|
|
94
|
+
output: path.relative(eleventyRoot, path.join(projectRoot, '_site')),
|
|
95
|
+
epub: path.relative(eleventyRoot, path.join(projectRoot, '_epub')),
|
|
96
|
+
/**
|
|
97
|
+
* Paths _relative to_ the `input` directory
|
|
98
|
+
*/
|
|
99
|
+
data: '_computed',
|
|
100
|
+
includes: path.relative(inputDir, path.join(eleventyRoot, '_includes')),
|
|
101
|
+
layouts: path.relative(inputDir, path.join(eleventyRoot, '_layouts')),
|
|
102
|
+
public: './public',
|
|
103
|
+
}
|
package/src/lib/README.md
CHANGED
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
# CLI Library Modules
|
|
2
|
-
|
|
3
|
-
This directory contains domain-specific modules that encapsulate the core functionality of the Quire CLI. Each module is designed around a single responsibility and provides a façade for its domain.
|
|
4
|
-
|
|
5
|
-
## Architecture Overview
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
Commands Layer
|
|
9
|
-
┌───────────────────────────────────────────────────┐
|
|
10
|
-
│ build preview new pdf epub info doctor │
|
|
11
|
-
└────────────────────────┬──────────────────────────┘
|
|
12
|
-
│
|
|
13
|
-
┌────────────────────────┴──────────────────────────┐
|
|
14
|
-
│ lib/ modules │
|
|
15
|
-
└───────────────────────────────────────────────────┘
|
|
16
|
-
|
|
17
|
-
┌─────────────────────────────────────────────────────────────────────────┐
|
|
18
|
-
│ Domain Modules │
|
|
19
|
-
│ ┌────────────┐ ┌──────────┐ ┌────────────┐ ┌──────────┐ ┌────────┐ │
|
|
20
|
-
│ │ project/ │ │ 11ty/ │ │ pdf/ │ │ epub/ │ │doctor/ │ │
|
|
21
|
-
│ │ │ │ │ │ │ │ │ │ │ │
|
|
22
|
-
│ │ - paths │ │ - api │ │ - pagedjs │ │ - epubjs │ │-checks │ │
|
|
23
|
-
│ │ - config │ │ - cli │ │ - prince │ │ - pandoc │ │-format │ │
|
|
24
|
-
│ │ - detect │ │ │ │ │ │ │ │ │ │
|
|
25
|
-
│ │ - version │ │ │ │ │ │ │ │ │ │
|
|
26
|
-
│ └────┬───────┘ └────┬─────┘ └────┬───────┘ └────┬─────┘ └───┬────┘ │
|
|
27
|
-
└───────┼───────────────┼─────────────┼───────────────┼─────────────┼──────┘
|
|
28
|
-
│ │ │ │ │
|
|
29
|
-
│ ┌────────┴─────────────┴───────────────┴─────────────┘
|
|
30
|
-
│ │
|
|
31
|
-
┌───────┴──────┴──────────────────────────────────────────────────┐
|
|
32
|
-
│ Installation Module │
|
|
33
|
-
│ ┌──────────────────────────────────────────────────────────┐ │
|
|
34
|
-
│ │ installer/ │ │
|
|
35
|
-
│ │ - initStarter (clone starter, setup project) │ │
|
|
36
|
-
│ │ - installInProject (install @thegetty/quire-11ty) │ │
|
|
37
|
-
│ │ - latest (resolve version from npm) │ │
|
|
38
|
-
│ │ - versions (list published versions) │ │
|
|
39
|
-
│ └──────────────────────────────────────────────────────────┘ │
|
|
40
|
-
└───────────────────────────────┬─────────────────────────────────┘
|
|
41
|
-
│
|
|
42
|
-
┌───────────────────────────────┴─────────────────────────────────┐
|
|
43
|
-
│ Infrastructure Modules │
|
|
44
|
-
│ ┌────────┐ ┌────────┐ ┌────────┐ ┌─────────┐ ┌──────────┐ │
|
|
45
|
-
│ │ npm/ │ │ git/ │ │ conf/ │ │ error/ │ │ logger/ │ │
|
|
46
|
-
│ │ │ │ │ │ │ │ │ │ │ │
|
|
47
|
-
│ └────────┘ └────────┘ └────────┘ └─────────┘ └──────────┘ │
|
|
48
|
-
│ ┌───────────┐ ┌───────────┐ │
|
|
49
|
-
│ │ reporter/ │ │ ui/ │ │
|
|
50
|
-
│ │ │ │ (prompt) │ │
|
|
51
|
-
│ └───────────┘ └───────────┘ │
|
|
52
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Module Reference
|
|
56
|
-
|
|
57
|
-
### Domain Modules
|
|
58
|
-
|
|
59
|
-
These modules encapsulate specific business domains of Quire.
|
|
60
|
-
|
|
61
|
-
#### `project/`
|
|
62
|
-
**Purpose:** Project-level concerns including paths, detection, configuration, and version management.
|
|
63
|
-
|
|
64
|
-
| Export | Description |
|
|
65
|
-
|--------|-------------|
|
|
66
|
-
| `paths` (default) | Singleton for path resolution |
|
|
67
|
-
| `Paths` | Class for custom path instances |
|
|
68
|
-
| `DATA_DIR` | Path to data files directory (`content/_data`) |
|
|
69
|
-
| `PROJECT_MARKERS` | Files that identify a Quire project |
|
|
70
|
-
| `REQUIRED_DATA_FILES` | Required data files (`publication.yaml`) |
|
|
71
|
-
| `SOURCE_DIRECTORIES` | Directories monitored for changes |
|
|
72
|
-
| `detect(dirpath)` | Check if directory is a Quire project |
|
|
73
|
-
| `loadProjectConfig(projectRoot?)` | Load and validate project config |
|
|
74
|
-
| `getVersion(projectPath?)` | Read `quire-11ty` version from project |
|
|
75
|
-
| `setVersion(version, projectPath?)` | Write `quire-11ty` version to project |
|
|
76
|
-
| `getVersionsFromStarter(projectPath)` | Read versions from starter package.json |
|
|
77
|
-
| `readVersionFile(projectPath)` | Read raw version file contents |
|
|
78
|
-
| `writeVersionFile(projectPath, info)` | Write version file contents |
|
|
79
|
-
|
|
80
|
-
**Dependencies:** `conf/`, `fs-extra`
|
|
81
|
-
|
|
82
|
-
#### `11ty/`
|
|
83
|
-
**Purpose:** Eleventy build system integration via API or CLI.
|
|
84
|
-
|
|
85
|
-
| Export | Description |
|
|
86
|
-
|--------|-------------|
|
|
87
|
-
| `api` | Programmatic Eleventy control |
|
|
88
|
-
| `cli` | CLI-based Eleventy execution |
|
|
89
|
-
| `paths` | Re-exported from `project/` |
|
|
90
|
-
| `Paths` | Re-exported from `project/` |
|
|
91
|
-
|
|
92
|
-
**Dependencies:** `project/`
|
|
93
|
-
|
|
94
|
-
#### `pdf/`
|
|
95
|
-
**Purpose:** PDF generation using Prince or Paged.js.
|
|
96
|
-
|
|
97
|
-
| Export | Description |
|
|
98
|
-
|--------|-------------|
|
|
99
|
-
| `default` | Factory returning configured PDF generator |
|
|
100
|
-
|
|
101
|
-
**Implementations:** `prince.js`, `paged.js`
|
|
102
|
-
|
|
103
|
-
**Dependencies:** `project/`
|
|
104
|
-
|
|
105
|
-
#### `epub/`
|
|
106
|
-
**Purpose:** EPUB generation using Pandoc.
|
|
107
|
-
|
|
108
|
-
| Export | Description |
|
|
109
|
-
|--------|-------------|
|
|
110
|
-
| `default` | EPUB generator façade |
|
|
111
|
-
|
|
112
|
-
**Dependencies:** `project/`
|
|
113
|
-
|
|
114
|
-
#### `doctor/`
|
|
115
|
-
**Purpose:** Diagnostic checks for Quire environment and project health.
|
|
116
|
-
|
|
117
|
-
| Export | Description |
|
|
118
|
-
|--------|-------------|
|
|
119
|
-
| `default` | Object with all check functions and arrays |
|
|
120
|
-
| `checks` | Flat array of all diagnostic checks |
|
|
121
|
-
| `checkSections` | Checks organized by section (Environment, Project) |
|
|
122
|
-
| `runAllChecks()` | Run all checks, return flat results array |
|
|
123
|
-
| `runAllChecksWithSections()` | Run all checks, return results by section |
|
|
124
|
-
| `checkNodeVersion()` | Verify Node.js >= 22 |
|
|
125
|
-
| `checkNpmAvailable()` | Verify npm in PATH |
|
|
126
|
-
| `checkGitAvailable()` | Verify git in PATH |
|
|
127
|
-
| `checkQuireProject()` | Detect project marker files |
|
|
128
|
-
| `checkDependencies()` | Verify node_modules exists |
|
|
129
|
-
| `checkDataFiles()` | Validate YAML files in content/_data/ |
|
|
130
|
-
| `checkStaleBuild()` | Compare source vs build timestamps |
|
|
131
|
-
|
|
132
|
-
**Sub-modules:**
|
|
133
|
-
|
|
134
|
-
| File | Description |
|
|
135
|
-
|------|-------------|
|
|
136
|
-
| `formatDuration.js` | Human-readable time duration formatting |
|
|
137
|
-
|
|
138
|
-
**Duration Formatting:**
|
|
139
|
-
|
|
140
|
-
The `formatDuration` function converts milliseconds to the most appropriate time unit:
|
|
141
|
-
|
|
142
|
-
| Duration | Example Output |
|
|
143
|
-
|----------------|-----------------|
|
|
144
|
-
| < 1 minute | "45 seconds" |
|
|
145
|
-
| < 1 hour | "30 minutes" |
|
|
146
|
-
| < 1 day | "5 hours" |
|
|
147
|
-
| < 1 week | "3 days" |
|
|
148
|
-
| < 1 month | "2 weeks" |
|
|
149
|
-
| < 1 year | "3 months" |
|
|
150
|
-
| >= 1 year | "2 years" |
|
|
151
|
-
|
|
152
|
-
**Data Files Validation:**
|
|
153
|
-
|
|
154
|
-
The `checkDataFiles` function validates YAML files in `content/_data/`:
|
|
155
|
-
|
|
156
|
-
| Validation | Description |
|
|
157
|
-
|------------|-------------|
|
|
158
|
-
| Required files | Checks `publication.yaml` exists |
|
|
159
|
-
| YAML syntax | Parses each file and reports syntax errors |
|
|
160
|
-
| Schema validation | Validates against JSON schemas in `schemas/` |
|
|
161
|
-
| Duplicate IDs | Detects duplicate `id` values in arrays |
|
|
162
|
-
|
|
163
|
-
**Dependencies:** `project/`, `npm/`, `git/`, `validators/validate-data-files`
|
|
164
|
-
|
|
165
|
-
#### `installer/`
|
|
166
|
-
**Purpose:** Installation of `@thegetty/quire-11ty` into Quire projects.
|
|
167
|
-
|
|
168
|
-
| Export | Description |
|
|
169
|
-
|--------|-------------|
|
|
170
|
-
| `installer` | Object with all installer methods |
|
|
171
|
-
| `initStarter(starter, projectPath, options)` | Clone and setup starter project |
|
|
172
|
-
| `installInProject(projectPath, version, options)` | Install `@thegetty/quire-11ty` package |
|
|
173
|
-
| `latest(version?)` | Resolve version from npm registry |
|
|
174
|
-
| `versions()` | List all published `@thegetty/quire-11ty` versions |
|
|
175
|
-
|
|
176
|
-
**Dependencies:** `project/`, `npm/`, `git/`
|
|
177
|
-
|
|
178
|
-
### Infrastructure Modules
|
|
179
|
-
|
|
180
|
-
These modules provide cross-cutting concerns and external tool integrations.
|
|
181
|
-
|
|
182
|
-
#### `npm/`
|
|
183
|
-
**Purpose:** NPM operations façade.
|
|
184
|
-
|
|
185
|
-
| Export | Description |
|
|
186
|
-
|--------|-------------|
|
|
187
|
-
| `default` | Singleton npm façade |
|
|
188
|
-
| `init(cwd, options?)` | Run `npm init` |
|
|
189
|
-
| `install(cwd, options?)` | Run `npm install` |
|
|
190
|
-
| `pack(spec, dest, options?)` | Run `npm pack` |
|
|
191
|
-
| `cacheClean(cwd?)` | Run `npm cache clean` |
|
|
192
|
-
| `view(pkg, field?)` | Query package info |
|
|
193
|
-
| `show(pkg, field?)` | Query package versions |
|
|
194
|
-
| `version()` | Get npm version |
|
|
195
|
-
| `isAvailable()` | Check npm in PATH |
|
|
196
|
-
| `fetchFromRegistry(pkg)` | Direct registry API call |
|
|
197
|
-
| `getCompatibleVersion(pkg, range)` | Resolve semver range |
|
|
198
|
-
|
|
199
|
-
**Dependencies:** `execa`, `node-fetch`
|
|
200
|
-
|
|
201
|
-
#### `git/`
|
|
202
|
-
**Purpose:** Git operations via simple-git.
|
|
203
|
-
|
|
204
|
-
| Export | Description |
|
|
205
|
-
|--------|-------------|
|
|
206
|
-
| `default` | Configured simple-git instance |
|
|
207
|
-
|
|
208
|
-
**Dependencies:** `simple-git`
|
|
209
|
-
|
|
210
|
-
#### `conf/`
|
|
211
|
-
**Purpose:** CLI configuration persistence and schema-aware helpers.
|
|
212
|
-
|
|
213
|
-
| Export | Source | Description |
|
|
214
|
-
|--------|--------|-------------|
|
|
215
|
-
| `default` | `config.js` | `Conf` singleton instance |
|
|
216
|
-
| `isValidKey(key)` | `helpers.js` | Check if key exists in schema |
|
|
217
|
-
| `getValidKeys()` | `helpers.js` | Sorted array of all schema keys |
|
|
218
|
-
| `coerceValue(key, value)` | `helpers.js` | Coerce CLI string to schema type |
|
|
219
|
-
| `formatValidationError(key, value)` | `helpers.js` | Format error with enum/description hints |
|
|
220
|
-
| `getDefault(key)` | `helpers.js` | Get default value for a key |
|
|
221
|
-
| `getKeyDescription(key)` | `helpers.js` | Get schema description for a key |
|
|
222
|
-
| `formatSettings(store, options)` | `helpers.js` | Format all settings for display |
|
|
223
|
-
|
|
224
|
-
Uses a barrel export (`index.js`) rather than a wrapper class to keep pure helper functions separate from the stateful `Conf` singleton. This avoids circular dependencies with the logger module and keeps helpers directly testable without mocking.
|
|
225
|
-
|
|
226
|
-
**Dependencies:** `conf`
|
|
227
|
-
|
|
228
|
-
#### `logger.js`
|
|
229
|
-
**Purpose:** Logging abstraction.
|
|
230
|
-
|
|
231
|
-
| Export | Description |
|
|
232
|
-
|--------|-------------|
|
|
233
|
-
| `default` | Logger instance (loglevel) |
|
|
234
|
-
|
|
235
|
-
**Dependencies:** `loglevel`
|
|
236
|
-
|
|
237
|
-
#### `reporter/`
|
|
238
|
-
**Purpose:** Progress reporting for long-running operations.
|
|
239
|
-
|
|
240
|
-
| Export | Description |
|
|
241
|
-
|--------|-------------|
|
|
242
|
-
| `default` | Reporter façade |
|
|
243
|
-
|
|
244
|
-
#### `error/`
|
|
245
|
-
**Purpose:** Centralized error handling and formatting.
|
|
246
|
-
|
|
247
|
-
| Export | Description |
|
|
248
|
-
|--------|-------------|
|
|
249
|
-
| `formatError(error, options)` | Format error for display |
|
|
250
|
-
| `handleError(error, options)` | Handle single error (format, log, exit) |
|
|
251
|
-
| `handleErrors(errors, options)` | Handle multiple errors (batch validation) |
|
|
252
|
-
|
|
253
|
-
**Features:**
|
|
254
|
-
- Consistent error formatting with suggestion, docs URL, file path
|
|
255
|
-
- Debug mode shows error codes and stack traces
|
|
256
|
-
- Conditional `--debug` hint (controlled by `showDebugHint` property)
|
|
257
|
-
- Exit code management per error category
|
|
258
|
-
|
|
259
|
-
**Dependencies:** `logger/`
|
|
260
|
-
|
|
261
|
-
#### `ui/`
|
|
262
|
-
**Purpose:** Display and interactive prompt
|
|
263
|
-
|
|
264
|
-
_Future feature: Not yet impemented._
|
|
265
|
-
|
|
266
|
-
## Design Patterns
|
|
267
|
-
|
|
268
|
-
### Singleton façade
|
|
269
|
-
Most modules export a singleton instance as the default export:
|
|
270
|
-
```javascript
|
|
271
|
-
import npm from '#lib/npm/index.js'
|
|
272
|
-
await npm.install('/path/to/project')
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
### Optional Parameters with Defaults
|
|
276
|
-
Functions that operate on projects default to `cwd` when path not provided:
|
|
277
|
-
```javascript
|
|
278
|
-
// Uses current working directory
|
|
279
|
-
setVersion('1.0.0')
|
|
280
|
-
|
|
281
|
-
// Uses explicit path
|
|
282
|
-
setVersion('1.0.0', '/path/to/project')
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
### Re-exports for Convenience
|
|
286
|
-
Modules re-export commonly used dependencies:
|
|
287
|
-
```javascript
|
|
288
|
-
// 11ty/ re-exports paths from project/
|
|
289
|
-
import { paths } from '#lib/11ty/index.js'
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
## Import Aliases
|
|
293
|
-
|
|
294
|
-
Use these aliases for imports:
|
|
295
|
-
|
|
296
|
-
| Alias | Path |
|
|
297
|
-
|-------|------|
|
|
298
|
-
| `#lib/` | `src/lib/` |
|
|
299
|
-
| `#src/` | `src/` |
|
|
300
|
-
| `#helpers/` | `src/helpers/` |
|
|
301
|
-
|
|
302
|
-
Example:
|
|
303
|
-
```javascript
|
|
304
|
-
import npm from '#lib/npm/index.js'
|
|
305
|
-
import { installer } from '#lib/installer/index.js'
|
|
306
|
-
import paths, { loadProjectConfig } from '#lib/project/index.js'
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
## Testing
|
|
310
|
-
|
|
311
|
-
Each module has associated test files:
|
|
312
|
-
|
|
313
|
-
| Pattern | Purpose |
|
|
314
|
-
|---------|---------|
|
|
315
|
-
| `*.spec.js` | Unit tests (interface contracts) |
|
|
316
|
-
| `*.test.js` | Integration tests (with mocked dependencies) |
|
|
317
|
-
|
|
318
|
-
Tests use:
|
|
319
|
-
- **AVA** for test runner
|
|
320
|
-
- **esmock** for ESM module mocking
|
|
321
|
-
- **sinon** for stubs and spies
|
|
322
|
-
- **memfs** for in-memory filesystem
|
|
323
|
-
|
|
324
|
-
## Adding a New Module
|
|
325
|
-
|
|
326
|
-
1. Create directory: `lib/<module-name>/`
|
|
327
|
-
2. Create entry point: `index.js` with façade pattern
|
|
328
|
-
3. Export singleton or factory as default
|
|
329
|
-
4. Add tests: `index.spec.js` and/or `index.test.js`
|
|
330
|
-
5. Update this README with module documentation
|
package/src/lib/conf/README.md
CHANGED
|
@@ -1,121 +1,104 @@
|
|
|
1
|
-
## CLI Configuration
|
|
1
|
+
## CLI Configuration Manager
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This `quire-cli/lib/config` module manages reading and writing (persisting) options for the Quire CLI using the [`conf`](https://github.com/sindresorhus/conf) package.
|
|
4
4
|
|
|
5
5
|
`conf` stores the config in the system default [user config directory](https://github.com/sindresorhus/env-paths#pathsconfig). For example, on macOS, the config file will be stored in the `~/Library/Preferences/@thegetty/quire-cli` directory.
|
|
6
6
|
|
|
7
7
|
> Changes are written to disk atomically, so if the process crashes during a write, it will not corrupt the existing config.
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### Configuration
|
|
10
10
|
|
|
11
|
+
`logLevel` The default logging level for the Quire CLI output; default `'info'`.
|
|
12
|
+
|
|
13
|
+
`projectTemplate` A default project starter template to use when creating new projects; default `'quire-starter-default'`.
|
|
14
|
+
|
|
15
|
+
`quirePath` The relative path to `quire-11ty` installed in the project directory; default `./11ty`. When set to `null`, `quire-11ty` is installed to the CLI `lib/quire/versions/<version>/` directory.
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
❯ quire config quire-path '.'
|
|
11
19
|
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
├── defaults.js Default configuration values
|
|
18
|
-
├── schema.js JSON Schema definitions
|
|
19
|
-
├── migrations.js Version migration functions
|
|
20
|
-
├── config.test.js Integration tests for Conf instance
|
|
21
|
-
├── helpers.test.js Unit tests for validation/coercion helpers
|
|
22
|
-
└── format.test.js Unit tests for display formatting
|
|
20
|
+
|
|
21
|
+
`quireVersion` The default version of `quire-11ty` to install when creating new Quire projects; default `'latest'`.
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
❯ quire config quire-version '1.0.0'
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
`telemetry` Send anonymous data about Quire usage; default `false`.
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
```sh
|
|
30
|
+
❯ quire config telemetry --enabled
|
|
31
|
+
```
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- **`index.js`** re-exports all three, providing a single import path for consumers.
|
|
33
|
+
```sh
|
|
34
|
+
❯ quire config telemetry --disabled
|
|
35
|
+
```
|
|
33
36
|
|
|
34
|
-
A
|
|
37
|
+
`updateChannels` A list of distribution tags to use when checking for version updates; default `['latest']`. To show notifications for pre-releases version updates include `'pre-release'` in the array of channels. This can be set using the configuration `--pre-release` command flag.
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
```sh
|
|
40
|
+
❯ quire config update-channels
|
|
41
|
+
Quire configured to check for updates tagged 'latest'
|
|
42
|
+
```
|
|
39
43
|
|
|
40
|
-
|
|
44
|
+
```sh
|
|
45
|
+
❯ quire config update-channels --add 'pre-release'
|
|
46
|
+
Quire configured to check for updates tagged 'latest', 'pre-release'
|
|
47
|
+
```
|
|
41
48
|
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
```sh
|
|
50
|
+
❯ quire config update-channels --rm 'pre-release'
|
|
51
|
+
Quire configured to check for updates tagged 'latest'
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`updateInterval` Interval at which to check for updates to the Quire CLI and project's `quire-11ty` version; default `'DAILY'`.
|
|
45
55
|
|
|
46
|
-
|
|
47
|
-
|
|
56
|
+
```sh
|
|
57
|
+
❯ quire config update-interval
|
|
58
|
+
Quire configured to check for updates DAILY
|
|
48
59
|
```
|
|
49
60
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
| `isValidKey(key)` | `helpers.js` | Check if key exists in schema |
|
|
54
|
-
| `getValidKeys()` | `helpers.js` | Sorted array of all schema keys |
|
|
55
|
-
| `coerceValue(key, value)` | `helpers.js` | Coerce CLI string to schema type |
|
|
56
|
-
| `formatValidationError(key, value)` | `helpers.js` | Format error with enum/description hints |
|
|
57
|
-
| `getDefault(key)` | `helpers.js` | Get default value for a key |
|
|
58
|
-
| `getKeyDescription(key)` | `format.js` | Get schema description for a key |
|
|
59
|
-
| `formatSettings(store, options)` | `format.js` | Format all settings for display (with optional chalk styling) |
|
|
61
|
+
```sh
|
|
62
|
+
❯ quire config update-interval WEEKLY
|
|
63
|
+
```
|
|
60
64
|
|
|
61
|
-
|
|
65
|
+
`versionFile ['.quire-version']` The default file name for the `quire-11ty` version file.
|
|
62
66
|
|
|
63
|
-
|
|
67
|
+
```sh
|
|
68
|
+
❯ quire config version-file '.blargh'
|
|
69
|
+
```
|
|
64
70
|
|
|
65
|
-
|
|
66
|
-
|--------|------|---------|-------------|
|
|
67
|
-
| `configPath` | string | — | Path shown in header (e.g. `quire-cli configuration /path/to/config`) |
|
|
68
|
-
| `showInternal` | boolean | `false` | Include `__internal__`-prefixed keys |
|
|
69
|
-
| `useColor` | boolean | `false` | Apply chalk styling (bold header, cyan keys, dim descriptions) |
|
|
71
|
+
### Quire CLI `config` Command
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
- **Bold** for the header line
|
|
73
|
-
- **Cyan** for key names
|
|
74
|
-
- **Dim** for descriptions and the help hint
|
|
73
|
+
Running the `config` command without any arguments will start an interactive prompt to configure Quire.
|
|
75
74
|
|
|
76
|
-
|
|
75
|
+
To view an individual configuration value and its default value use:
|
|
77
76
|
|
|
78
|
-
|
|
77
|
+
```sh
|
|
78
|
+
❯ quire config [key]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
To view the current `logLevel` setting for example:
|
|
79
82
|
|
|
80
|
-
|
|
83
|
+
```sh
|
|
84
|
+
❯ quire config logLevel
|
|
85
|
+
loglevel: 'debug' (default 'info')
|
|
86
|
+
```
|
|
81
87
|
|
|
82
|
-
|
|
88
|
+
To set an individual configuration value, use the `set` argument:
|
|
83
89
|
|
|
84
90
|
```sh
|
|
85
|
-
quire
|
|
86
|
-
quire settings get <key> # Get a single value
|
|
87
|
-
quire settings set <key> <value> # Set a value
|
|
88
|
-
quire settings delete <key> # Delete (reset to default)
|
|
89
|
-
quire settings reset [key] # Reset all or single key
|
|
90
|
-
quire settings path # Show settings file path
|
|
91
|
-
quire settings --json # Output all settings as JSON
|
|
92
|
-
quire settings get <key> --json # Output single value as JSON
|
|
93
|
-
quire settings --json --debug # Include __internal__ keys in JSON output
|
|
91
|
+
❯ quire config set <key> <value>
|
|
94
92
|
```
|
|
95
93
|
|
|
96
|
-
|
|
94
|
+
To reset *all* keys to their default values, use the `reset` argument:
|
|
97
95
|
|
|
98
96
|
```sh
|
|
99
|
-
❯ quire config
|
|
97
|
+
❯ quire config reset
|
|
100
98
|
```
|
|
101
99
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
| `epubEngine` | string | `'epubjs'` | EPUB engine (`epubjs`, `pandoc`) |
|
|
108
|
-
| `logLevel` | string | `'info'` | Log level (`trace`, `debug`, `info`, `warn`, `error`, `silent`) |
|
|
109
|
-
| `logPrefix` | string | `'quire'` | Prefix text for log messages |
|
|
110
|
-
| `logPrefixStyle` | string | `'bracket'` | Prefix style (`bracket`, `emoji`, `plain`, `none`) |
|
|
111
|
-
| `logShowLevel` | boolean | `false` | Show level label in output |
|
|
112
|
-
| `logUseColor` | boolean | `true` | Use colored output |
|
|
113
|
-
| `logColorMessages` | boolean | `true` | Color message text by level |
|
|
114
|
-
| `pdfEngine` | string | `'pagedjs'` | PDF engine (`pagedjs`, `prince`) |
|
|
115
|
-
| `projectTemplate` | string | (GitHub URL) | Default starter template |
|
|
116
|
-
| `quire11tyPath` | string | `'.'` | Path to quire-11ty package |
|
|
117
|
-
| `quireVersion` | string | `'latest'` | Version of quire-11ty to install |
|
|
118
|
-
| `updateChannel` | string | `'rc'` | Release channel (`stable`, `rc`, `beta`, `alpha`) |
|
|
119
|
-
| `updateInterval` | string | `'DAILY'` | Update check frequency (`DAILY`, `WEEKLY`, `MONTHLY`, `NEVER`) |
|
|
120
|
-
| `verbose` | boolean | `false` | Enable verbose output by default |
|
|
121
|
-
| `versionFile` | string | `'.quire'` | Filename to identify Quire projects |
|
|
100
|
+
To reset an individual key to its default value:
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
❯ quire config reset [key]
|
|
104
|
+
```
|
package/src/lib/conf/config.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import Conf from 'conf'
|
|
2
|
-
import packageConfig from '#src/packageConfig.js'
|
|
3
2
|
import defaults from './defaults.js'
|
|
4
3
|
import migrations from './migrations.js'
|
|
4
|
+
import packageConfig from '#src/packageConfig.js'
|
|
5
5
|
import schema from './schema.js'
|
|
6
6
|
|
|
7
7
|
const { name, version } = packageConfig
|
|
8
8
|
|
|
9
|
-
const beforeEachMigration = (
|
|
9
|
+
const beforeEachMigration = (store, context) => {
|
|
10
10
|
const { fromVersion, toVersion } = context
|
|
11
|
-
|
|
12
|
-
// Migration messages are rare, so the simpler formatting is acceptable
|
|
13
|
-
console.info(`[quire] Migrating config from ${fromVersion} → ${toVersion}`)
|
|
11
|
+
console.info(`quire-cli migrating config from ${fromVersion} → ${toVersion}`)
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
/**
|