@thegetty/quire-cli 1.0.0-rc.6 → 1.0.0-rc.7
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/package.json +1 -1
- package/src/commands/create.js +2 -1
- package/src/lib/quire/index.js +7 -6
package/package.json
CHANGED
package/src/commands/create.js
CHANGED
|
@@ -22,7 +22,8 @@ export default class CreateCommand extends Command {
|
|
|
22
22
|
[ '[starter]', 'repository url or local path for a starter project' ],
|
|
23
23
|
],
|
|
24
24
|
options: [
|
|
25
|
-
[ '--quire <
|
|
25
|
+
[ '--quire-path <path>', 'local path to quire-11ty package' ],
|
|
26
|
+
[ '--quire-version <version>', 'quire-11ty version to install', 'latest' ],
|
|
26
27
|
// [ '--eject', 'install quire-11ty into the project directory', true ],
|
|
27
28
|
[ '--debug', 'debug the `quire new` command', false ],
|
|
28
29
|
],
|
package/src/lib/quire/index.js
CHANGED
|
@@ -112,10 +112,10 @@ async function initStarter (starter, projectPath, options) {
|
|
|
112
112
|
/**
|
|
113
113
|
* Determine `quire-11ty` version required by the starter project.
|
|
114
114
|
*
|
|
115
|
-
* A version specified in `options.
|
|
115
|
+
* A version specified in `options.quireVersion` overrides the version in starter
|
|
116
116
|
* project `package.json`.
|
|
117
117
|
*/
|
|
118
|
-
const quireVersion = options.
|
|
118
|
+
const quireVersion = options.quireVersion || await getVersionFromStarter(projectPath)
|
|
119
119
|
setVersion(projectPath, quireVersion)
|
|
120
120
|
|
|
121
121
|
// Re-initialize project directory as a new git repository
|
|
@@ -150,7 +150,7 @@ async function initStarter (starter, projectPath, options) {
|
|
|
150
150
|
* @return {Promise}
|
|
151
151
|
*/
|
|
152
152
|
async function install(options = {}) {
|
|
153
|
-
const version = options.
|
|
153
|
+
const version = options.quireVersion || 'latest'
|
|
154
154
|
console.debug(`[CLI:quire] installing quire-11ty@${version}`)
|
|
155
155
|
const absoluteInstallPath = path.join(__dirname, 'versions')
|
|
156
156
|
fs.ensureDirSync(absoluteInstallPath)
|
|
@@ -199,8 +199,9 @@ async function install(options = {}) {
|
|
|
199
199
|
* @return {Promise}
|
|
200
200
|
*/
|
|
201
201
|
async function installInProject(projectPath, options = {}) {
|
|
202
|
-
const
|
|
203
|
-
|
|
202
|
+
const { quirePath, quireVersion } = options
|
|
203
|
+
const quire11tyPackage = fs.existsSync(quirePath) ? quirePath : `${PACKAGE_NAME}@${quireVersion}`
|
|
204
|
+
console.debug(`[CLI:quire] installing ${quire11tyPackage} into ${projectPath}`)
|
|
204
205
|
|
|
205
206
|
/**
|
|
206
207
|
* Delete the starter project package configuration so that it can be replaced
|
|
@@ -227,7 +228,7 @@ async function installInProject(projectPath, options = {}) {
|
|
|
227
228
|
Verbosity: options.debug ? 'Debug' : 'Silent',
|
|
228
229
|
WorkingDirectory: projectPath
|
|
229
230
|
}
|
|
230
|
-
await inv.Install(
|
|
231
|
+
await inv.Install(quire11tyPackage, installOptions)
|
|
231
232
|
|
|
232
233
|
// delete empty `node_modules` directory that `install-npm-version` creates
|
|
233
234
|
const invNodeModulesDir = path.join(projectPath, 'node_modules')
|