@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 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-rc.6",
4
+ "version": "1.0.0-rc.7",
5
5
  "author": "Getty Digital",
6
6
  "license": "SEE LICENSE IN https://github.com/thegetty/quire/blob/main/LICENSE",
7
7
  "bugs": {
@@ -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 <version>', 'quire-11ty version to install', 'latest' ],
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
  ],
@@ -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.quire` overrides the version in starter
115
+ * A version specified in `options.quireVersion` overrides the version in starter
116
116
  * project `package.json`.
117
117
  */
118
- const quireVersion = options.quire || await getVersionFromStarter(projectPath)
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.quire || 'latest'
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 version = options.quire || 'latest'
203
- console.debug(`[CLI:quire] installing quire-11ty@${version} into ${projectPath}`)
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(`${PACKAGE_NAME}@${version}`, installOptions)
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')