Commit 34c00383 authored by Dan Allen's avatar Dan Allen

merge !318

resolves #395 use tilde dependency ranges instead of caret dependency ranges
parents 648284e2 7205e4c6
Pipeline #41668770 failed with stages
in 5 minutes and 2 seconds
......@@ -19,7 +19,7 @@
"asciidoctor.js": "1.5.9"
},
"engines": {
"node": ">= 8.0.0"
"node": ">=8.11.0"
},
"files": [
"lib/"
......
......@@ -19,15 +19,15 @@
},
"dependencies": {
"@antora/playbook-builder": "2.0.0",
"commander": "^2.19.0"
"commander": "~2.19"
},
"devDependencies": {
"convict": "^4.4.1",
"fs-extra": "^7.0.1",
"kapok-js": "^0.10.1"
"convict": "~4.4",
"fs-extra": "~7.0",
"kapok-js": "~0.10"
},
"engines": {
"node": ">= 8.0.0"
"node": ">=8.11.0"
},
"files": [
"bin/",
......
......@@ -17,24 +17,24 @@
},
"main": "lib/index.js",
"dependencies": {
"@antora/expand-path-helper": "^1.0.0",
"cache-directory": "^2.0.0",
"fs-extra": "^7.0.1",
"@antora/expand-path-helper": "~1.0",
"cache-directory": "~2.0",
"fs-extra": "~7.0",
"isomorphic-git": "0.47.0",
"js-yaml": "^3.12.0",
"lodash": "^4.17.11",
"matcher": "^1.1.1",
"mime-types": "^2.1.21",
"multi-progress": "^2.0.0",
"through2": "^3.0.0",
"vinyl": "^2.2.0",
"vinyl-fs": "^3.0.3"
"js-yaml": "~3.12",
"lodash": "~4.17",
"matcher": "~1.1",
"mime-types": "~2.1",
"multi-progress": "~2.0",
"through2": "~3.0",
"vinyl": "~2.2",
"vinyl-fs": "~3.0"
},
"devDependencies": {
"deep-freeze": "^0.0.1"
"deep-freeze-node": "~1.1"
},
"engines": {
"node": ">= 8.0.0"
"node": ">=8.11.0"
},
"files": [
"lib/"
......
......@@ -5,7 +5,7 @@ const { deferExceptions, expect, heredoc, removeSyncForce, spy } = require('../.
const aggregateContent = require('@antora/content-aggregator')
const { createHash } = require('crypto')
const deepFreeze = require('deep-freeze')
const freeze = require('deep-freeze-node')
const fs = require('fs-extra')
const getCacheDir = require('cache-directory')
const GitServer = require('node-git-server')
......@@ -562,7 +562,7 @@ describe('aggregateContent()', function () {
.then(() => repoBuilder.open())
.then(() => repoBuilder.close('v3.0'))
playbookSpec.content.sources.push({ url: repoBuilder.url, branches: 'HEAD' })
deepFreeze(playbookSpec)
freeze(playbookSpec)
const aggregate = await aggregateContent(playbookSpec)
expect(aggregate).to.have.lengthOf(1)
expect(aggregate[0]).to.include({ name: 'the-component', version: 'v3.0' })
......@@ -574,7 +574,7 @@ describe('aggregateContent()', function () {
.then(() => repoBuilder.open())
.then(() => repoBuilder.close('v3.0'))
playbookSpec.content.sources.push({ url: repoBuilder.url, branches: '.' })
deepFreeze(playbookSpec)
freeze(playbookSpec)
const aggregate = await aggregateContent(playbookSpec)
expect(aggregate).to.have.lengthOf(1)
expect(aggregate[0]).to.include({ name: 'the-component', version: 'v3.0' })
......@@ -586,7 +586,7 @@ describe('aggregateContent()', function () {
.then(() => repoBuilder.open())
.then(() => repoBuilder.close('v3.0'))
playbookSpec.content.sources.push({ url: repoBuilder.url, branches: ['master', 'HEAD'] })
deepFreeze(playbookSpec)
freeze(playbookSpec)
const aggregate = await aggregateContent(playbookSpec)
expect(aggregate).to.have.lengthOf(2)
expect(aggregate[0]).to.include({ name: 'the-component', version: 'latest-and-greatest' })
......@@ -599,7 +599,7 @@ describe('aggregateContent()', function () {
.then(() => repoBuilder.open())
.then(() => repoBuilder.close('v3.0'))
playbookSpec.content.sources.push({ url: repoBuilder.url, branches: ['master', '.'] })
deepFreeze(playbookSpec)
freeze(playbookSpec)
const aggregate = await aggregateContent(playbookSpec)
expect(aggregate).to.have.lengthOf(2)
expect(aggregate[0]).to.include({ name: 'the-component', version: 'latest-and-greatest' })
......@@ -612,7 +612,7 @@ describe('aggregateContent()', function () {
.then(() => repoBuilder.open())
.then(() => repoBuilder.close('v3.0'))
playbookSpec.content.sources.push({ url: repoBuilder.url, branches: 'master,HEAD' })
deepFreeze(playbookSpec)
freeze(playbookSpec)
const aggregate = await aggregateContent(playbookSpec)
expect(aggregate).to.have.lengthOf(2)
expect(aggregate[0]).to.include({ name: 'the-component', version: 'latest-and-greatest' })
......@@ -625,7 +625,7 @@ describe('aggregateContent()', function () {
.then(() => repoBuilder.open())
.then(() => repoBuilder.close('v3.0'))
playbookSpec.content.sources.push({ url: repoBuilder.url, branches: 'master,.' })
deepFreeze(playbookSpec)
freeze(playbookSpec)
const aggregate = await aggregateContent(playbookSpec)
expect(aggregate).to.have.lengthOf(2)
expect(aggregate[0]).to.include({ name: 'the-component', version: 'latest-and-greatest' })
......@@ -640,7 +640,7 @@ describe('aggregateContent()', function () {
.then(() => repoBuilder.detachHead())
.then(() => repoBuilder.close())
playbookSpec.content.sources.push({ url: repoBuilder.url, branches: ['HEAD', 'v1.0', 'v2.0'] })
deepFreeze(playbookSpec)
freeze(playbookSpec)
const aggregate = await aggregateContent(playbookSpec)
expect(aggregate).to.have.lengthOf(3)
expect(aggregate[0]).to.include({ name: 'the-component', version: 'v1.0' })
......@@ -652,7 +652,7 @@ describe('aggregateContent()', function () {
const repoBuilder = new RepositoryBuilder(CONTENT_REPOS_DIR, FIXTURES_DIR)
await initRepoWithBranches(repoBuilder)
playbookSpec.content.sources.push({ url: repoBuilder.url, branches: ['HEAD', 'master'] })
deepFreeze(playbookSpec)
freeze(playbookSpec)
const aggregate = await aggregateContent(playbookSpec)
expect(aggregate).to.have.lengthOf(1)
expect(aggregate[0]).to.include({ name: 'the-component', version: 'latest-and-greatest' })
......
......@@ -16,14 +16,14 @@
},
"main": "lib/index.js",
"dependencies": {
"lodash": "^4.17.11",
"vinyl": "^2.2.0"
"lodash": "~4.17",
"vinyl": "~2.2"
},
"devDependencies": {
"@antora/content-aggregator": "2.0.0"
},
"engines": {
"node": ">= 8.0.0"
"node": ">=8.11.0"
},
"files": [
"lib/"
......
......@@ -20,7 +20,7 @@
"@antora/asciidoc-loader": "2.0.0"
},
"engines": {
"node": ">= 8.0.0"
"node": ">=8.11.0"
},
"files": [
"lib/"
......
......@@ -18,7 +18,7 @@
"@antora/asciidoc-loader": "2.0.0"
},
"engines": {
"node": ">= 8.0.0"
"node": ">=8.11.0"
},
"files": [
"lib/"
......
......@@ -15,11 +15,11 @@
},
"main": "lib/index.js",
"dependencies": {
"handlebars": "^4.0.12",
"require-from-string": "^2.0.2"
"handlebars": "~4.0",
"require-from-string": "~2.0"
},
"engines": {
"node": ">= 8.0.0"
"node": ">=8.11.0"
},
"files": [
"lib/"
......
......@@ -2,7 +2,7 @@
const camelCaseKeys = require('camelcase-keys')
const convict = require('./solitary-convict')
const deepFreeze = require('deep-freeze')
const freeze = require('deep-freeze-node')
const fs = require('fs')
const ospath = require('path')
......@@ -70,7 +70,7 @@ function exportModel (config) {
}
playbook.dir = playbook.playbook ? ospath.dirname((playbook.file = playbook.playbook)) : process.cwd()
delete playbook.playbook
return deepFreeze(playbook)
return freeze(playbook)
}
module.exports = buildPlaybook
......@@ -16,15 +16,15 @@
},
"main": "lib/index.js",
"dependencies": {
"@iarna/toml": "^2.2.1",
"camelcase-keys": "^5.0.0",
"convict": "^4.4.1",
"deep-freeze": "^0.0.1",
"js-yaml": "^3.12.0",
"json5": "^2.1.0"
"@iarna/toml": "~2.2",
"camelcase-keys": "~5.0",
"convict": "~4.4",
"deep-freeze-node": "~1.1",
"js-yaml": "~3.12",
"json5": "~2.1"
},
"engines": {
"node": ">= 8.0.0"
"node": ">=8.11.0"
},
"files": [
"lib/"
......
......@@ -16,10 +16,10 @@
"main": "lib/index.js",
"dependencies": {
"@antora/asciidoc-loader": "2.0.0",
"vinyl": "^2.2.0"
"vinyl": "~2.2"
},
"engines": {
"node": ">= 8.0.0"
"node": ">=8.11.0"
},
"files": [
"lib/"
......
......@@ -28,10 +28,10 @@
"@antora/ui-loader": "2.0.0"
},
"devDependencies": {
"fs-extra": "^7.0.1"
"fs-extra": "~7.0"
},
"engines": {
"node": ">= 8.0.0"
"node": ">=8.11.0"
},
"files": [
"lib/"
......
......@@ -16,13 +16,13 @@
"main": "lib/index.js",
"dependencies": {
"@antora/content-classifier": "2.0.0",
"vinyl": "^2.2.0"
"vinyl": "~2.2"
},
"devDependencies": {
"xmldom": "^0.1.27"
"xmldom": "0.1.27"
},
"engines": {
"node": ">= 8.0.0"
"node": ">=8.11.0"
},
"files": [
"lib/"
......
......@@ -15,17 +15,14 @@
},
"main": "lib/index.js",
"dependencies": {
"@antora/expand-path-helper": "^1.0.0",
"fs-extra": "^7.0.1",
"gulp-vinyl-zip": "^2.1.2",
"vinyl": "^2.2.0",
"vinyl-fs": "^3.0.3"
},
"devDependencies": {
"gulp-buffer": "^0.0.2"
"@antora/expand-path-helper": "~1.0",
"fs-extra": "~7.0",
"gulp-vinyl-zip": "~2.1 >=2.1.2",
"vinyl": "~2.2",
"vinyl-fs": "~3.0"
},
"engines": {
"node": ">= 8.0.0"
"node": ">=8.11.0"
},
"files": [
"lib/"
......
/* eslint-env mocha */
'use strict'
const { deferExceptions, expect, heredoc, removeSyncForce } = require('../../../test/test-utils')
const { bufferizeContents, deferExceptions, expect, heredoc, removeSyncForce } = require('../../../test/test-utils')
const buffer = require('gulp-buffer')
const File = require('vinyl')
const fs = require('fs-extra')
const os = require('os')
......@@ -45,7 +44,7 @@ describe('publishSite()', () => {
const accum = []
vzip
.src(file)
.pipe(buffer())
.pipe(bufferizeContents())
.on('data', (entry) => accum.push(entry))
.on('error', reject)
.on('end', () => resolve(accum))
......
......@@ -16,22 +16,22 @@
},
"main": "lib/index.js",
"dependencies": {
"@antora/expand-path-helper": "^1.0.0",
"bl": "^2.1.2",
"cache-directory": "^2.0.0",
"camelcase-keys": "^5.0.0",
"fs-extra": "^7.0.1",
"got": "^9.5.0",
"gulp-vinyl-zip": "^2.1.2",
"js-yaml": "^3.12.0",
"lodash": "^4.17.11",
"minimatch-all": "^1.1.0",
"through2": "^3.0.0",
"vinyl": "^2.2.0",
"vinyl-fs": "^3.0.3"
"@antora/expand-path-helper": "~1.0",
"bl": "~2.1",
"cache-directory": "~2.0",
"camelcase-keys": "~5.0",
"fs-extra": "~7.0",
"got": "~9.5",
"gulp-vinyl-zip": "~2.1 >=2.1.2",
"js-yaml": "~3.12",
"lodash": "~4.17",
"minimatch-all": "~1.1",
"through2": "~3.0",
"vinyl": "~2.2",
"vinyl-fs": "~3.0"
},
"engines": {
"node": ">= 8.0.0"
"node": ">=8.11.0"
},
"files": [
"lib/"
......
......@@ -8,8 +8,10 @@ if ('encoding' in String.prototype && String(String.prototype.encoding) !== 'UTF
String.prototype.encoding = Opal.const_get_local(Opal.const_get_qualified('::', 'Encoding'), 'UTF_8') // eslint-disable-line
}
const fs = require('fs-extra')
const chai = require('chai')
const fs = require('fs-extra')
const { obj: map } = require('through2')
chai.use(require('chai-fs'))
chai.use(require('chai-cheerio'))
chai.use(require('chai-spies'))
......@@ -18,6 +20,21 @@ chai.use(require('chai-spies'))
chai.use(require('dirty-chai'))
module.exports = {
bufferizeContents: () => map((file, enc, next) => {
if (file.isStream()) {
const data = []
const readChunk = (chunk) => data.push(chunk)
const stream = file.contents
stream.on('data', readChunk)
stream.once('end', () => {
stream.removeListener('data', readChunk)
file.contents = Buffer.concat(data)
next(null, file)
})
} else {
next(null, file)
}
}),
deferExceptions: async (fn, ...args) => {
let deferredFn
try {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment