Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Antora
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
142
Issues
142
List
Boards
Labels
Service Desk
Milestones
Merge Requests
28
Merge Requests
28
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Antora
Antora
Commits
0f91447d
Commit
0f91447d
authored
Dec 05, 2017
by
Dan Allen
Browse files
Options
Browse Files
Download
Plain Diff
merge
!43
resolves
#41
rename component descriptor filename to antora.yml
parents
9cf4dece
b2d3d183
Pipeline
#14727792
passed with stages
in 2 minutes and 34 seconds
Changes
15
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
210 additions
and
202 deletions
+210
-202
packages/content-aggregator/lib/constants.js
packages/content-aggregator/lib/constants.js
+3
-0
packages/content-aggregator/lib/index.js
packages/content-aggregator/lib/index.js
+9
-9
packages/content-aggregator/test/fixtures/docs-component.yml
packages/content-aggregator/test/fixtures/docs-component.yml
+0
-3
packages/content-aggregator/test/fixtures/modules/ROOT/_attributes.adoc
...nt-aggregator/test/fixtures/modules/ROOT/_attributes.adoc
+4
-2
packages/content-aggregator/test/fixtures/modules/ROOT/documents/_attributes.adoc
...tor/test/fixtures/modules/ROOT/documents/_attributes.adoc
+0
-0
packages/content-aggregator/test/fixtures/modules/ROOT/documents/page-one.adoc
...egator/test/fixtures/modules/ROOT/documents/page-one.adoc
+0
-0
packages/content-aggregator/test/fixtures/modules/ROOT/documents/page-two.adoc
...egator/test/fixtures/modules/ROOT/documents/page-two.adoc
+0
-0
packages/content-aggregator/test/fixtures/modules/ROOT/documents/topic-a/_attributes.adoc
.../fixtures/modules/ROOT/documents/topic-a/_attributes.adoc
+2
-0
packages/content-aggregator/test/fixtures/modules/ROOT/documents/topic-a/page-three.adoc
...t/fixtures/modules/ROOT/documents/topic-a/page-three.adoc
+0
-0
packages/content-aggregator/test/fixtures/modules/ROOT/documents/topic-b/_attributes.adoc
.../fixtures/modules/ROOT/documents/topic-b/_attributes.adoc
+2
-0
packages/content-aggregator/test/fixtures/modules/ROOT/documents/topic-b/page-four.adoc
...st/fixtures/modules/ROOT/documents/topic-b/page-four.adoc
+0
-0
packages/content-aggregator/test/index-test.js
packages/content-aggregator/test/index-test.js
+173
-172
packages/content-aggregator/test/repo-utils.js
packages/content-aggregator/test/repo-utils.js
+12
-11
packages/content-classifier/test/index-test.js
packages/content-classifier/test/index-test.js
+5
-4
packages/playbook-builder/test/index-test.js
packages/playbook-builder/test/index-test.js
+0
-1
No files found.
packages/content-aggregator/lib/constants.js
0 → 100644
View file @
0f91447d
module
.
exports
=
Object
.
freeze
({
COMPONENT_DESC_FILENAME
:
'
antora.yml
'
,
})
packages/content-aggregator/lib/index.js
View file @
0f91447d
'
use strict
'
const
path
=
require
(
'
path
'
)
const
fs
=
require
(
'
fs
'
)
const
_
=
require
(
'
lodash
'
)
const
del
=
require
(
'
del
'
)
const
File
=
require
(
'
vinyl
'
)
const
fs
=
require
(
'
fs
'
)
const
git
=
require
(
'
nodegit
'
)
const
isMatch
=
require
(
'
matcher
'
).
isMatch
const
mimeTypes
=
require
(
'
./mime-types-with-asciidoc
'
)
const
path
=
require
(
'
path
'
)
const
streamToArray
=
require
(
'
stream-to-array
'
)
const
vfs
=
require
(
'
vinyl-fs
'
)
const
yaml
=
require
(
'
js-yaml
'
)
const
{
COMPONENT_DESC_FILENAME
}
=
require
(
'
./constants
'
)
const
localCachePath
=
path
.
resolve
(
'
.git-cache
'
)
module
.
exports
=
async
(
playbook
)
=>
{
...
...
@@ -53,7 +53,7 @@ module.exports = async (playbook) => {
return
allRepoComponentVersions
})
return
build
Corpus
(
await
Promise
.
all
(
componentVersions
))
return
build
Aggregate
(
await
Promise
.
all
(
componentVersions
))
}
async
function
openOrCloneRepository
(
repoUrl
)
{
...
...
@@ -144,17 +144,17 @@ function branchMatches (branchName, branchPattern) {
}
function
readComponentDesc
(
files
)
{
const
componentDescFile
=
files
.
find
((
file
)
=>
file
.
relative
===
'
docs-component.yml
'
)
const
componentDescFile
=
files
.
find
((
file
)
=>
file
.
relative
===
COMPONENT_DESC_FILENAME
)
if
(
componentDescFile
==
null
)
{
throw
new
Error
(
'
docs-component.yml
not found
'
)
throw
new
Error
(
COMPONENT_DESC_FILENAME
+
'
not found
'
)
}
const
componentDesc
=
yaml
.
safeLoad
(
componentDescFile
.
contents
.
toString
())
if
(
componentDesc
.
name
==
null
)
{
throw
new
Error
(
'
docs-component.yml
is missing a name
'
)
throw
new
Error
(
COMPONENT_DESC_FILENAME
+
'
is missing a name
'
)
}
if
(
componentDesc
.
version
==
null
)
{
throw
new
Error
(
'
docs-component.yml
is missing a version
'
)
throw
new
Error
(
COMPONENT_DESC_FILENAME
+
'
is missing a version
'
)
}
return
componentDesc
...
...
@@ -222,7 +222,7 @@ function assignFileProperties (file, url, branch, startPath = '/') {
return
file
}
function
build
Corpus
(
componentVersions
)
{
function
build
Aggregate
(
componentVersions
)
{
return
_
(
componentVersions
)
.
flatten
()
.
groupBy
(({
name
,
version
})
=>
`
${
version
}
@
${
name
}
`
)
...
...
packages/content-aggregator/test/fixtures/docs-component.yml
deleted
100644 → 0
View file @
9cf4dece
name
:
title
:
version
:
'
'
packages/content-aggregator/test/fixtures/modules/ROOT/_attributes.adoc
View file @
0f91447d
:moduledir: ..
include::{moduledir}/_attributes.adoc[]
:attachmentsdir: {moduledir}/assets/attachments
:examplesdir: {moduledir}/examples
:imagesdir: {moduledir}/assets/images
:partialsdir: {moduledir}/documents/_partials
packages/content-aggregator/test/fixtures/modules/ROOT/
content
/_attributes.adoc
→
packages/content-aggregator/test/fixtures/modules/ROOT/
documents
/_attributes.adoc
View file @
0f91447d
File moved
packages/content-aggregator/test/fixtures/modules/ROOT/
content
/page-one.adoc
→
packages/content-aggregator/test/fixtures/modules/ROOT/
documents
/page-one.adoc
View file @
0f91447d
File moved
packages/content-aggregator/test/fixtures/modules/ROOT/
content
/page-two.adoc
→
packages/content-aggregator/test/fixtures/modules/ROOT/
documents
/page-two.adoc
View file @
0f91447d
File moved
packages/content-aggregator/test/fixtures/modules/ROOT/documents/topic-a/_attributes.adoc
0 → 100644
View file @
0f91447d
:moduledir: ../..
include::{moduledir}/_attributes.adoc[]
packages/content-aggregator/test/fixtures/modules/ROOT/
content
/topic-a/page-three.adoc
→
packages/content-aggregator/test/fixtures/modules/ROOT/
documents
/topic-a/page-three.adoc
View file @
0f91447d
File moved
packages/content-aggregator/test/fixtures/modules/ROOT/documents/topic-b/_attributes.adoc
0 → 100644
View file @
0f91447d
:moduledir: ../..
include::{moduledir}/_attributes.adoc[]
packages/content-aggregator/test/fixtures/modules/ROOT/
content
/topic-b/page-four.adoc
→
packages/content-aggregator/test/fixtures/modules/ROOT/
documents
/topic-b/page-four.adoc
View file @
0f91447d
File moved
packages/content-aggregator/test/index-test.js
View file @
0f91447d
This diff is collapsed.
Click to expand it.
packages/content-aggregator/test/repo-utils.js
View file @
0f91447d
'
use strict
'
const
path
=
require
(
'
path
'
)
const
git
=
require
(
'
nodegit
'
)
const
fs
=
require
(
'
fs-extra
'
)
const
git
=
require
(
'
nodegit
'
)
const
path
=
require
(
'
path
'
)
const
{
COMPONENT_DESC_FILENAME
}
=
require
(
'
../lib/constants
'
)
const
fixturesPath
=
path
.
resolve
(
__dirname
,
'
fixtures
'
)
const
reposBasePath
=
path
.
resolve
(
__dirname
,
'
repos
'
)
...
...
@@ -64,27 +65,27 @@ class FixtureRepo {
}
async
setDocsComponent
({
name
,
title
,
version
,
nav
,
startPath
=
'
.
'
})
{
const
filepath
=
path
.
join
(
this
.
repoPath
,
startPath
,
'
docs-component.yml
'
)
const
docsComponentY
ml
=
[]
const
filepath
=
path
.
join
(
this
.
repoPath
,
startPath
,
COMPONENT_DESC_FILENAME
)
const
componentDescYa
ml
=
[]
if
(
name
)
{
docsComponentY
ml
.
push
(
`name:
${
name
}
`
)
componentDescYa
ml
.
push
(
`name:
${
name
}
`
)
}
if
(
title
)
{
docsComponentY
ml
.
push
(
`title:
${
title
}
`
)
componentDescYa
ml
.
push
(
`title:
${
title
}
`
)
}
if
(
version
)
{
docsComponentY
ml
.
push
(
`version: '
${
version
}
'`
)
componentDescYa
ml
.
push
(
`version: '
${
version
}
'`
)
}
if
(
nav
)
{
docsComponentY
ml
.
push
(
'
nav:
'
)
componentDescYa
ml
.
push
(
'
nav:
'
)
nav
.
forEach
((
navItem
)
=>
{
docsComponentY
ml
.
push
(
` -
${
navItem
}
`
)
componentDescYa
ml
.
push
(
` -
${
navItem
}
`
)
})
}
if
(
name
!=
null
||
version
!=
null
)
{
await
fs
.
ensureFile
(
filepath
)
await
fs
.
writeFile
(
filepath
,
docsComponentY
ml
.
join
(
'
\n
'
))
await
this
.
commitAll
(
`
Set docs-component
for
${
version
}
`
)
await
fs
.
writeFile
(
filepath
,
componentDescYa
ml
.
join
(
'
\n
'
))
await
this
.
commitAll
(
`
Populate component desc
for
${
version
}
`
)
}
}
...
...
packages/content-classifier/test/index-test.js
View file @
0f91447d
...
...
@@ -5,6 +5,7 @@ const { expect } = require('../../../test/test-utils')
const
classifyContent
=
require
(
'
../lib/index
'
)
const
path
=
require
(
'
path
'
)
const
mimeTypes
=
require
(
'
../../content-aggregator/lib/mime-types-with-asciidoc
'
)
const
{
COMPONENT_DESC_FILENAME
}
=
require
(
'
../../content-aggregator/lib/constants
'
)
const
createFile
=
(
filepath
)
=>
{
const
basename
=
path
.
basename
(
filepath
)
...
...
@@ -118,13 +119,13 @@ describe('classifyContent()', () => {
})
})
it
(
'
should not classify a navigation if not referenced in
docs-component.yml
'
,
()
=>
{
it
(
'
should not classify a navigation if not referenced in
component desc
'
,
()
=>
{
aggregate
[
0
].
files
.
push
(
createFile
(
'
/modules/ROOT/nav.adoc
'
))
const
files
=
classifyContent
(
playbook
,
aggregate
).
getFiles
()
expect
(
files
).
to
.
have
.
lengthOf
(
0
)
})
it
(
'
should classify a navigation if referenced in
docs-component.yml
'
,
()
=>
{
it
(
'
should classify a navigation if referenced in
component desc
'
,
()
=>
{
aggregate
[
0
].
nav
=
[
'
modules/ROOT/nav.adoc
'
]
aggregate
[
0
].
files
.
push
(
createFile
(
'
/modules/ROOT/nav.adoc
'
))
const
files
=
classifyContent
(
playbook
,
aggregate
).
getFiles
()
...
...
@@ -139,7 +140,7 @@ describe('classifyContent()', () => {
})
})
it
(
'
should assign a nav.index on navigation based on order in
docs-component.yml
'
,
()
=>
{
it
(
'
should assign a nav.index on navigation based on order in
component desc
'
,
()
=>
{
aggregate
[
0
].
nav
=
[
'
modules/ROOT/nav.adoc
'
,
'
modules/module-a/nav.adoc
'
,
'
modules/module-b/nav.adoc
'
]
aggregate
[
0
].
files
.
push
(
...[
...
...
@@ -160,7 +161,7 @@ describe('classifyContent()', () => {
it
(
'
should not classify files that do not follow the Antora standard
'
,
()
=>
{
aggregate
[
0
].
files
.
push
(
...[
createFile
(
'
/
docs-component.yml
'
),
createFile
(
'
/
'
+
COMPONENT_DESC_FILENAME
),
createFile
(
'
/README.adoc
'
),
createFile
(
'
/modules/ROOT/_attributes.adoc
'
),
createFile
(
'
/modules/ROOT/assets/bad-file.png
'
),
...
...
packages/playbook-builder/test/index-test.js
View file @
0f91447d
...
...
@@ -3,7 +3,6 @@
const
{
expect
}
=
require
(
'
../../../test/test-utils
'
)
const
buildPlaybook
=
require
(
'
../lib/index
'
)
const
path
=
require
(
'
path
'
)
describe
(
'
buildPlaybook()
'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment