@thegetty/quire-cli 1.0.0-rc.24 → 1.0.0-rc.26
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 +17 -0
- package/package.json +1 -1
- package/src/commands/info.js +1 -1
- package/src/lib/11ty/cli.js +1 -1
- package/src/lib/quire/index.js +13 -7
- package/src/LOGGING.md +0 -16
- package/src/commands/config/config-get.js +0 -35
- package/src/commands/config/config-reset.js +0 -34
- package/src/commands/config/config-set.js +0 -37
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,23 @@ Changelog entries are classified using the following labels:
|
|
|
12
12
|
- `Fixed`: for any bug fixes
|
|
13
13
|
- `Removed`: for deprecated features removed in this release
|
|
14
14
|
|
|
15
|
+
## [1.0.0-rc.26]
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Import path using node namespace in the cli info command
|
|
20
|
+
- Correct file extension of cmd module called by the cli
|
|
21
|
+
|
|
22
|
+
## [1.0.0-rc.25]
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- Use quire-cli config values for quire-11ty version and version file name
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- Install path for quire-11ty versions
|
|
31
|
+
|
|
15
32
|
## [1.0.0-rc.24]
|
|
16
33
|
|
|
17
34
|
### Changed
|
package/package.json
CHANGED
package/src/commands/info.js
CHANGED
package/src/lib/11ty/cli.js
CHANGED
|
@@ -19,7 +19,7 @@ const factory = (options = {}) => {
|
|
|
19
19
|
* Use the version of Eleventy installed to `lib/quire/versions`
|
|
20
20
|
*/
|
|
21
21
|
const eleventy =
|
|
22
|
-
path.join(eleventyRoot, 'node_modules', '@11ty', 'eleventy', 'cmd.
|
|
22
|
+
path.join(eleventyRoot, 'node_modules', '@11ty', 'eleventy', 'cmd.cjs')
|
|
23
23
|
|
|
24
24
|
const command = [
|
|
25
25
|
eleventy,
|
package/src/lib/quire/index.js
CHANGED
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
import { IS_WINDOWS } from '#helpers/os-utils.js'
|
|
2
2
|
import { chdir, cwd } from 'node:process'
|
|
3
3
|
import { execa, execaCommand } from 'execa'
|
|
4
|
+
import { fileURLToPath } from 'node:url'
|
|
4
5
|
import { isEmpty } from '#helpers/is-empty.js'
|
|
6
|
+
import config from '#lib/conf/config.js'
|
|
5
7
|
import fetch from 'node-fetch'
|
|
6
8
|
import fs from 'fs-extra'
|
|
7
|
-
import git from '#
|
|
9
|
+
import git from '#lib/git/index.js'
|
|
8
10
|
import inv from 'install-npm-version'
|
|
9
11
|
import packageConfig from '#src/packageConfig.js'
|
|
10
12
|
import path from 'node:path'
|
|
11
13
|
import semver from 'semver'
|
|
12
14
|
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
16
|
+
const __dirname = path.dirname(__filename)
|
|
17
|
+
|
|
13
18
|
// Version install path is relative to process working directory
|
|
14
19
|
const INSTALL_PATH = path.join('src', 'lib', 'quire', 'versions')
|
|
15
20
|
const PACKAGE_NAME = '@thegetty/quire-11ty'
|
|
16
|
-
|
|
21
|
+
|
|
22
|
+
const QUIRE_VERSION = config.get('quireVersion')
|
|
23
|
+
const VERSION_FILE = config.get('versionFile')
|
|
17
24
|
|
|
18
25
|
/**
|
|
19
26
|
* Return an absolute path to an installed quire-11ty version
|
|
20
27
|
*
|
|
21
28
|
* @return {String} path to installed quire-11ty version
|
|
22
29
|
*/
|
|
23
|
-
function getPath(version=
|
|
30
|
+
function getPath(version=QUIRE_VERSION) {
|
|
24
31
|
const absolutePath = path.relative('/', path.join(INSTALL_PATH, version))
|
|
25
32
|
if (!fs.existsSync(absolutePath)) {
|
|
26
33
|
console.error(`[CLI:quire] quire-11ty@${version} is not installed`)
|
|
@@ -86,8 +93,8 @@ async function initStarter (starter, projectPath, options) {
|
|
|
86
93
|
}
|
|
87
94
|
|
|
88
95
|
console.debug('[CLI:quire] init-starter',
|
|
89
|
-
`\n project
|
|
90
|
-
`\n starter:
|
|
96
|
+
`\n project: ${path.join(__dirname, projectPath)}`,
|
|
97
|
+
`\n starter: ${starter}`
|
|
91
98
|
)
|
|
92
99
|
|
|
93
100
|
/**
|
|
@@ -149,7 +156,7 @@ async function initStarter (starter, projectPath, options) {
|
|
|
149
156
|
* @return {Promise}
|
|
150
157
|
*/
|
|
151
158
|
async function install(options = {}) {
|
|
152
|
-
const version = options.quireVersion ||
|
|
159
|
+
const version = options.quireVersion || QUIRE_VERSION
|
|
153
160
|
console.debug(`[CLI:quire] installing quire-11ty@${version}`)
|
|
154
161
|
const absoluteInstallPath = path.join(__dirname, 'versions')
|
|
155
162
|
fs.ensureDirSync(absoluteInstallPath)
|
|
@@ -180,7 +187,6 @@ async function install(options = {}) {
|
|
|
180
187
|
* these must be `devDependencies` so that they are not bundled into
|
|
181
188
|
* the final `_site` package when running `quire build`
|
|
182
189
|
*/
|
|
183
|
-
const currentWorkingDirectory = cwd()
|
|
184
190
|
chdir(path.join(absoluteInstallPath, version))
|
|
185
191
|
await execaCommand('npm cache clean --force')
|
|
186
192
|
await execaCommand('npm install --save-dev')
|
package/src/LOGGING.md
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
## Logging
|
|
3
|
-
|
|
4
|
-
- https://betterstack.com/community/guides/logging/nodejs-logging-best-practices/
|
|
5
|
-
|
|
6
|
-
### `debug-js`
|
|
7
|
-
- https://github.com/debug-js/debug
|
|
8
|
-
- https://github.com/commenthol/debug-level
|
|
9
|
-
|
|
10
|
-
### Pino
|
|
11
|
-
- https://betterstack.com/community/guides/logging/how-to-install-setup-and-use-pino-to-log-node-js-applications/
|
|
12
|
-
- https://github.com/pinojs/pino
|
|
13
|
-
|
|
14
|
-
### Winston
|
|
15
|
-
- https://betterstack.com/community/guides/logging/how-to-install-setup-and-use-winston-and-morgan-to-log-node-js-applications/
|
|
16
|
-
- https://github.com/winstonjs/winston
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import Command from '#src/Command.js'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Quire CLI `config get` Command
|
|
5
|
-
*
|
|
6
|
-
* @class ConfigGetCommand
|
|
7
|
-
* @extends {Command}
|
|
8
|
-
*/
|
|
9
|
-
export default class ConfigGetCommand extends Command {
|
|
10
|
-
static definition = {
|
|
11
|
-
name: 'config-get',
|
|
12
|
-
description: 'Get the value of a Quire CLI configuration property',
|
|
13
|
-
summary: 'get a cli configuration property',
|
|
14
|
-
version: '1.0.0',
|
|
15
|
-
args: [
|
|
16
|
-
[ '[property]', 'configuration property' ]
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
constructor() {
|
|
21
|
-
super(ConfigGetCommand.definition)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @param {String} key
|
|
26
|
-
* @param {Object} options
|
|
27
|
-
* @return {Promise}
|
|
28
|
-
*/
|
|
29
|
-
async action(property, options = {}) {
|
|
30
|
-
for (const [ key, value ] of Object.entries(this.config.store)) {
|
|
31
|
-
if (key.startsWith('__internal__') && !options.debug) continue
|
|
32
|
-
console.info(`${key}: ${JSON.stringify(value, null, 2)}`)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import Command from '#src/Command.js'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Quire CLI `config reset` Command
|
|
5
|
-
*
|
|
6
|
-
* @class ConfigResetCommand
|
|
7
|
-
* @extends {Command}
|
|
8
|
-
*/
|
|
9
|
-
export default class ConfigResetCommand extends Command {
|
|
10
|
-
static definition = {
|
|
11
|
-
name: 'config-reset',
|
|
12
|
-
description: 'Reset the Quire CLI configuration to the default',
|
|
13
|
-
summary: 'reset cli configuration properties to default values',
|
|
14
|
-
version: '1.0.0',
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
constructor() {
|
|
18
|
-
super(ConfigResetCommand.definition)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @return {Promise}
|
|
23
|
-
*/
|
|
24
|
-
async action(options = {}) {
|
|
25
|
-
if (options.debug) {
|
|
26
|
-
console.info('Command \'%s\' called with options %o', this.name(), options)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
for (const [ key, value ] of Object.entries(this.config.store)) {
|
|
30
|
-
if (key.startsWith('__internal__') && !options.debug) continue
|
|
31
|
-
console.info(`${key}: ${JSON.stringify(value, null, 2)}`)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import Command from '#src/Command.js'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Quire CLI `config set` Command
|
|
5
|
-
*
|
|
6
|
-
* @class ConfigCommand
|
|
7
|
-
* @extends {Command}
|
|
8
|
-
*/
|
|
9
|
-
export default class ConfigSetCommand extends Command {
|
|
10
|
-
static definition = {
|
|
11
|
-
name: 'config-set',
|
|
12
|
-
description: 'Set a Quire CLI configuration property',
|
|
13
|
-
summary: 'set a cli configuration property',
|
|
14
|
-
version: '1.0.0',
|
|
15
|
-
args: [
|
|
16
|
-
[ '[key]', 'configuration property key' ],
|
|
17
|
-
[ '[value]', 'configuration property value' ]
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
constructor() {
|
|
22
|
-
super(ConfigSetCommand.definition)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @param {String} key
|
|
27
|
-
* @param {String} value
|
|
28
|
-
* @param {Object} options
|
|
29
|
-
* @return {Promise}
|
|
30
|
-
*/
|
|
31
|
-
async action(key, value, options = {}) {
|
|
32
|
-
for (const [ key, value ] of Object.entries(this.config.store)) {
|
|
33
|
-
if (key.startsWith('__internal__') && !options.debug) continue
|
|
34
|
-
console.info(`${key}: ${JSON.stringify(value, null, 2)}`)
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|