Skip to content

Commit

Permalink
fix: correct global Ace version (#226)
Browse files Browse the repository at this point in the history
A consistent Ace version is now provided via the command line, in the verbose logger, and into the generated JSON/HTML reports. The new `ace-meta` package is the authoritative source of truth for versioning information.

PR closes #198
  • Loading branch information
danielweck authored Apr 30, 2019
1 parent 773ff26 commit 822469f
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.2.1
- export PATH="$HOME/.yarn/bin:$PATH"
script:
- yarn snyk test
# - yarn snyk test
- xvfb-run yarn test --runInBand
branches:
only:
Expand Down
4 changes: 3 additions & 1 deletion packages/ace-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-cli",
"version": "1.0.2",
"version": "1.0.3",
"description": "Ace by DAISY, an Accessibility Checker for EPUB",
"author": {
"name": "DAISY developers",
Expand All @@ -18,8 +18,10 @@
"main": "lib/index.js",
"bin": "bin/ace.js",
"dependencies": {
"@daisy/ace-config": "^1.0.0",
"@daisy/ace-core": "^1.0.2",
"@daisy/ace-logger": "^1.0.1",
"@daisy/ace-meta": "^1.0.3",
"meow": "^3.7.0",
"winston": "^2.4.0"
},
Expand Down
10 changes: 8 additions & 2 deletions packages/ace-cli/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ const { config, paths } = require('@daisy/ace-config');
const defaults = require('./defaults');
const cliConfig = config.get('cli', defaults.cli);

const pkg = require('@daisy/ace-meta/package');

const cli = meow(`
const cli = meow({
help:
`
Usage: ace [options] <input>
Options:
Expand All @@ -31,7 +34,10 @@ const cli = meow(`
Examples
$ ace -o out ~/Documents/book.epub
`, {
`,
// autoVersion: false,
version: pkg.version
}, {
alias: {
f: 'force',
h: 'help',
Expand Down
3 changes: 2 additions & 1 deletion packages/ace-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-core",
"version": "1.0.2",
"version": "1.0.3",
"description": "Core library for Ace",
"author": {
"name": "DAISY developers",
Expand All @@ -17,6 +17,7 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@daisy/ace-meta": "^1.0.3",
"@daisy/ace-report": "^1.0.1",
"@daisy/ace-report-axe": "^1.0.1",
"@daisy/epub-utils": "^1.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/ace-core/src/core/ace.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path');
const tmp = require('tmp');
const winston = require('winston');
const os = require('os');
const pkg = require('../../package');
const pkg = require('@daisy/ace-meta/package');

const EPUB = require('@daisy/epub-utils').EPUB;
const Report = require('@daisy/ace-report').Report;
Expand Down
5 changes: 4 additions & 1 deletion packages/ace-http/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-http",
"version": "1.0.0",
"version": "1.0.1",
"description": "HTTP API for Ace",
"author": {
"name": "DAISY developers",
Expand All @@ -18,6 +18,9 @@
"main": "lib/index.js",
"bin": "bin/ace-http.js",
"dependencies": {
"@daisy/ace-core": "^1.0.2",
"@daisy/ace-logger": "^1.0.1",
"@daisy/ace-meta": "^1.0.3",
"express": "^4.15.5",
"express-easy-zip": "^1.1.4",
"meow": "^3.7.0",
Expand Down
11 changes: 9 additions & 2 deletions packages/ace-http/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const meow = require('meow');
const ace = require('@daisy/ace-core');
const logger = require('@daisy/ace-logger');

const pkg = require('@daisy/ace-meta/package');

const UPLOADS = tmp.dirSync({ unsafeCleanup: true }).name;
const DEFAULTPORT = 8000;
const DEFAULTHOST = "localhost";
Expand All @@ -21,7 +23,9 @@ var upload = multer({dest: UPLOADS});
var joblist = [];
var baseurl = "";

const cli = meow(`
const cli = meow({
help:
`
Usage: ace-http [options]
Options:
Expand All @@ -37,7 +41,10 @@ const cli = meow(`
Examples
$ ace-http -p 3000
`, {
`,
// autoVersion: false,
version: pkg.version
}, {
alias: {
h: 'help',
s: 'silent',
Expand Down
21 changes: 21 additions & 0 deletions packages/ace-meta/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@daisy/ace-meta",
"version": "1.0.3",
"description": "Meta version information for Ace",
"author": {
"name": "DAISY developers",
"organization": "DAISY Consortium",
"url": "http://www.daisy.org/"
},
"repository": {
"type": "git",
"url": "https://github.com/daisy/ace"
},
"bugs": {
"url": "https://github.com/daisy/ace/issues"
},
"license": "MIT",
"publishConfig": {
"access": "public"
}
}
3 changes: 2 additions & 1 deletion packages/ace-report-axe/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-report-axe",
"version": "1.0.1",
"version": "1.0.2",
"description": "Ace report adapter for aXe",
"author": {
"name": "DAISY developers",
Expand All @@ -17,6 +17,7 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@daisy/ace-report": "^1.0.1",
"fs-extra": "^6.0.1",
"winston": "^2.4.0"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/ace-report/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-report",
"version": "1.0.1",
"version": "1.0.2",
"description": "Reporting utilities for Ace",
"author": {
"name": "DAISY developers",
Expand All @@ -17,6 +17,8 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@daisy/ace-config": "^1.0.0",
"@daisy/ace-meta": "^1.0.3",
"escape-html": "^1.0.3",
"fs-extra": "^6.0.1",
"handlebars": "^4.0.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/ace-report/src/report-builders.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

'use strict';

const pkg = require('../package');
const pkg = require('@daisy/ace-meta/package');

const { config, paths } = require('@daisy/ace-config');
const defaults = require('./defaults');
Expand Down
2 changes: 1 addition & 1 deletion packages/ace-report/src/report-builders.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const builders = require('./report-builders');
const pkg = require('../package');
const pkg = require('@daisy/ace-meta/package');

describe('report builder', () => {
let report;
Expand Down
3 changes: 1 addition & 2 deletions tests/__tests__/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ const path = require('path');
const stripAnsi = require('strip-ansi');

const ace = require('../runAceCLI');
const pkg = require('../../packages/ace-core/package');

const pkg = require('@daisy/ace-meta/package');

describe('Running the CLI', () => {
test('with no input should fail', () => {
Expand Down

0 comments on commit 822469f

Please sign in to comment.