@thegetty/quire-cli 1.0.0-rc.28 → 1.0.0-rc.31

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 CHANGED
@@ -12,6 +12,22 @@ 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.31]
16
+
17
+ ### Changed
18
+
19
+ - Improved accessibility of PDFs generated with prince with `--pdf-profile=PDF/UA-1` flag
20
+
21
+ ### Removed
22
+
23
+ - Removed `install-npm-version` in favor of `npm pack` and `tar xfz` run as subprocesses
24
+ - Removed `patch-package`
25
+
26
+ ## [1.0.0-rc.30]
27
+ ## [1.0.0-rc.29]
28
+
29
+ Candidate versions skipped to align with @thegetty/quire-11ty
30
+
15
31
  ## [1.0.0-rc.28]
16
32
 
17
33
  ### Fixed
package/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  ## Quire CLI
2
+ [![CircleCI](https://dl.circleci.com/status-badge/img/gh/thegetty/quire/tree/main.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/thegetty/quire/tree/main)
2
3
 
3
4
  The `quire-cli` implements the [command pattern](https://en.wikipedia.org/wiki/Command_pattern) to receive input from a user and delegate command behavoir to modules for the services, such as `git` and `11ty`, involved in working on Quire publications.
4
5
 
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.28",
4
+ "version": "1.0.0-rc.31",
5
5
  "author": "Getty Digital",
6
6
  "license": "SEE LICENSE IN https://github.com/thegetty/quire/blob/main/LICENSE",
7
7
  "bugs": {
@@ -38,8 +38,7 @@
38
38
  "docs": "jsdoc2md --configure jsdoc.json --files src/**/*.js > docs/cli.md",
39
39
  "lint": "eslint src --ext .js",
40
40
  "lint:fix": "npm run lint -- --fix",
41
- "postinstall": "cross-env patch-package --error-on-fail",
42
- "test": "echo \"Error: no test specified\" && exit 1"
41
+ "test": "echo \"No test specified\" && exit 0"
43
42
  },
44
43
  "imports": {
45
44
  "#root/*": "./*",
@@ -61,14 +60,12 @@
61
60
  "hosted-git-info": "^6.1.1",
62
61
  "i18next": "^22.4.9",
63
62
  "inquirer": "^9.1.4",
64
- "install-npm-version": "^1.0.9",
65
63
  "js-yaml": "^4.1.0",
66
64
  "loglevel": "^1.8.1",
67
65
  "node-fetch": "^3.3.2",
68
66
  "open": "^8.4.0",
69
67
  "ora": "^6.1.2",
70
68
  "pagedjs-cli": "^0.4.3",
71
- "patch-package": "^8.0.0",
72
69
  "read-package-up": "^11.0.0",
73
70
  "semver": "^7.3.8",
74
71
  "simple-git": "^3.16.0",
Binary file
package/src/.DS_Store ADDED
Binary file
@@ -72,13 +72,7 @@ export default class CreateCommand extends Command {
72
72
  return
73
73
  }
74
74
 
75
- options.eject = true
76
-
77
- if (options.eject) {
78
- await quire.installInProject(projectPath, quireVersion, options)
79
- } else {
80
- await quire.install(options)
81
- }
75
+ await quire.installInProject(projectPath, quireVersion, options)
82
76
  }
83
77
  }
84
78
  }
Binary file
@@ -32,6 +32,7 @@ export default async (publicationInput, coversInput, output, options = {}) => {
32
32
  // These options are for the actual user-facing PDF
33
33
  const cmdOptions = [
34
34
  `--output=${output}`,
35
+ `--pdf-profile=PDF/UA-1`,
35
36
  ]
36
37
 
37
38
  if (options.debug) {
@@ -7,7 +7,6 @@ import config from '#lib/conf/config.js'
7
7
  import fetch from 'node-fetch'
8
8
  import fs from 'fs-extra'
9
9
  import git from '#lib/git/index.js'
10
- import inv from 'install-npm-version'
11
10
  import packageConfig from '#src/packageConfig.js'
12
11
  import path from 'node:path'
13
12
  import semver from 'semver'
@@ -147,51 +146,6 @@ async function initStarter (starter, projectPath, options) {
147
146
  return quireVersion
148
147
  }
149
148
 
150
- /**
151
- * Install quire-11ty (default to 'latest' version)
152
- *
153
- * @TODO refactor this to be callable by the installInProject method
154
- *
155
- * @param {Object} options options passed from `quire new` command
156
- * @return {Promise}
157
- */
158
- async function install(options = {}) {
159
- const version = options.quireVersion || QUIRE_VERSION
160
- console.debug(`[CLI:quire] installing quire-11ty@${version}`)
161
- const absoluteInstallPath = path.join(__dirname, 'versions')
162
- fs.ensureDirSync(absoluteInstallPath)
163
- /**
164
- * `Destination` is relative to `node_modules` of the working-directory
165
- * so we have included a relative path to parent directory in order to
166
- * install versions to a different local path.
167
- * @see https://github.com/scott-lin/install-npm-version
168
- */
169
- const installOptions = {
170
- Destination: path.join('..', version),
171
- Debug: false,
172
- Overwrite: options.force || options.overwrite || false,
173
- Verbosity: options.debug ? 'Debug' : 'Silent',
174
- WorkingDirectory: absoluteInstallPath
175
- }
176
- await inv.Install(`${PACKAGE_NAME}@${version}`, installOptions)
177
-
178
- // delete empty `node_modules` directory that `install-npm-version` creates
179
- const invNodeModulesDir = path.join(absoluteInstallPath, 'node_modules')
180
- if (fs.existsSync(invNodeModulesDir)) fs.rmdir(invNodeModulesDir)
181
-
182
- symlinkLatest()
183
-
184
- console.debug('[CLI:quire] installing dev dependencies')
185
- /**
186
- * Manually install necessary dev dependencies to run 11ty;
187
- * these must be `devDependencies` so that they are not bundled into
188
- * the final `_site` package when running `quire build`
189
- */
190
- chdir(path.join(absoluteInstallPath, version))
191
- await execaCommand('npm cache clean --force')
192
- await execaCommand('npm install --save-dev')
193
- }
194
-
195
149
  /**
196
150
  * Install `quire-11ty` directly into a quire project
197
151
  *
@@ -204,7 +158,8 @@ async function install(options = {}) {
204
158
  */
205
159
  async function installInProject(projectPath, quireVersion, options = {}) {
206
160
  const { quirePath } = options
207
- const quire11tyPackage = fs.existsSync(quirePath) ? quirePath : `${PACKAGE_NAME}@${quireVersion}`
161
+ const quire11tyPackage = `${PACKAGE_NAME}@${quireVersion}`
162
+
208
163
  console.debug(`[CLI:quire] installing ${quire11tyPackage} into ${projectPath}`)
209
164
 
210
165
  /**
@@ -219,27 +174,21 @@ async function installInProject(projectPath, quireVersion, options = {}) {
219
174
  .catch((error) => console.error('[CLI:error] ', error))
220
175
 
221
176
  const temp11tyDirectory = '.temp'
222
- /**
223
- * `Destination` is relative to `node_modules` of the working-directory
224
- * so we have included a relative path to parent directory in order to
225
- * install versions to a different local path.
226
- * @see https://github.com/scott-lin/install-npm-version
227
- */
228
- const installOptions = {
229
- Destination: path.join('..', temp11tyDirectory),
230
- Debug: false,
231
- Overwrite: options.force || options.overwrite || false,
232
- Verbosity: options.debug ? 'Debug' : 'Silent',
233
- WorkingDirectory: projectPath
234
- }
235
- await inv.Install(quire11tyPackage, installOptions)
177
+ const tempDir = path.join(projectPath,temp11tyDirectory)
178
+ fs.mkdirSync(tempDir)
179
+
180
+ // Copy if passed a path and it exists, otherwise attempt to download the tarball for this pathspec
181
+ if (fs.existsSync(quirePath)) {
182
+ fs.copySync(quirePath, tempDir)
183
+ } else {
184
+ await execaCommand(`npm pack ${ options.debug ? '--debug' : '--quiet' } ${quire11tyPackage}`)
236
185
 
237
- // delete empty `node_modules` directory that `install-npm-version` creates
238
- const invNodeModulesDir = path.join(projectPath, 'node_modules')
239
- if (fs.existsSync(invNodeModulesDir)) fs.rmdir(invNodeModulesDir)
186
+ // Extract only the package dir from the tar bar and strip it from the extracted path
187
+ await execaCommand(`tar -xzf thegetty-quire-11ty-${quireVersion}.tgz -C ${tempDir} --strip-components=1 package/`)
188
+ }
240
189
 
241
- // Copy all files installed in `.temp` to projectPath
242
- fs.copySync(path.join(projectPath, '.temp'), projectPath)
190
+ // Copy `.temp` to projectPath
191
+ fs.copySync(tempDir, projectPath)
243
192
 
244
193
  console.debug('[CLI:quire] installing dev dependencies into quire project')
245
194
  /**
@@ -257,7 +206,7 @@ async function installInProject(projectPath, quireVersion, options = {}) {
257
206
  }
258
207
 
259
208
  const eleventyFilesToCommit = fs
260
- .readdirSync(path.join(projectPath, temp11tyDirectory))
209
+ .readdirSync(tempDir)
261
210
  .filter((filePath) => filePath !== 'node_modules')
262
211
 
263
212
  eleventyFilesToCommit.push('package-lock.json')
@@ -379,19 +328,6 @@ function symlinkLatest() {
379
328
  return fs.symlinkSync(target, source, type)
380
329
  }
381
330
 
382
- /**
383
- * Tests if a `quire-11ty` version is already installed
384
- * and installs the version if it is not already installed.
385
- *
386
- * @param {String} version `quire-11ty` semantic version
387
- */
388
- function testVersion(version) {
389
- version ||= getVersion()
390
- if (!versions.includes(version)) {
391
- install(version)
392
- }
393
- }
394
-
395
331
  /**
396
332
  * Get an array of published `quire-11ty` package versions
397
333
  *
@@ -405,12 +341,10 @@ export const quire = {
405
341
  getPath,
406
342
  getVersion,
407
343
  initStarter,
408
- install,
409
344
  installInProject,
410
345
  latest,
411
346
  list,
412
347
  remove,
413
348
  setVersion,
414
- testVersion,
415
349
  versions,
416
350
  }