Closed alaindresse closed 5 months ago
Changed my code to set version to a short hash of the path of the antora.yml. I was getting issues with duplicate versions for components for which the source was distributed across several folders in the repo.
Use case for the duplication: monorepo with documentation of individual components that I want to consolidate into a single component with appropriate navigation.
According to the documentation the version
is "mandatory" unless inherited from the content source in the playbook. Is that your case?
https://docs.antora.org/antora/latest/component-name-and-version/#antora-yml-requirements
@ggrossetie thanks for taking the time to look into this despite your busy schedule!
Yes, that is exactly the case:
antora.yml
, and should actually be absent for the version in the playbook to work.antora.yml
, before my changes, I have to preview in vscode, even though the antora generation works nicely with no errors or warnings.@alaindresse Left a few comments otherwise 👍🏻
One test is failing because we assert that the version is null
but the value is now a random value:
I don't think we should generate a random value when the version is explicitly null
with the ~
symbol.
The
~
values defines a component version as unversioned
https://docs.antora.org/antora/latest/component-version-key/#key
@ggrossetie thanks for your comments. I believe they are now addressed.
I ran the tests, using npm run test
and saw a message saying that all tests passed, but I also saw:
Failed to load message bundle for file /Users/alaindresse/code/asciidoctor-vscode/dist/src/features/antora/antoraSupport
Failed to load message bundle for file /Users/alaindresse/code/asciidoctor-vscode/dist/src/asciidoctorWebViewConverter
Failed to load message bundle for file /Users/alaindresse/code/asciidoctor-vscode/dist/src/security
Failed to load message bundle for file /Users/alaindresse/code/asciidoctor-vscode/dist/src/features/documentLinkProvider
And did not see any report on the antoraSupport tests.
What is the proper way to run the tests ?
@alaindresse Thanks, could you please run npm i
locally and commit the package-lock.json
. Apart from that 👍🏻
I ran the tests, using npm run test and saw a message saying that all tests passed, but I also saw:
Message bundle does not properly load during tests (or at least I don't know how to make them work in tests) but it does not prevent tests from running. So this messages can be safely ignored 😅
All good 🎉 Thanks!
Resolves #882
Currently, if our antora.yml does not specify a version (required to add a fallback for the version in the antora playbook), it is impossible to preview an asciidoc file.
This pull request extends the approach from @leonardopavanrocha in #871, namely setting the version to an empty string when it is not specified in antora.yml.
Note:: I also had to bumb the vscode engine number to test this.