Skip to content

Commit

Permalink
Don't copy package-lock.json if it does not exist (#89)
Browse files Browse the repository at this point in the history
* Update writer.jl

* Copy from template not docs

* Bump version
  • Loading branch information
asinghvi17 committed Mar 31, 2024
1 parent 19335ea commit d596246
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
@@ -1,7 +1,7 @@
name = "DocumenterVitepress"
uuid = "4710194d-e776-4893-9690-8d956a29c365"
authors = ["Lazaro Alonso <lazarus.alon@gmail.com>", "Anshul Singhvi <as6208@columbia.edu>"]
version = "0.0.14"
version = "0.0.15"

[deps]
ANSIColoredPrinters = "a4c015fc-c6ff-483c-b24f-f7ea428134e9"
Expand Down
5 changes: 2 additions & 3 deletions src/writer.jl
Expand Up @@ -172,16 +172,15 @@ function render(doc::Documenter.Document, settings::MarkdownVitepress=MarkdownVi
try
if !isfile(joinpath(dirname(builddir), "package.json"))
@warn "DocumenterVitepress: Did not find `docs/package.json` in your repository. Substituting default for now."
cp(joinpath(dirname(@__DIR__), "docs", "package.json"), joinpath(dirname(builddir), "package.json"))
cp(joinpath(dirname(@__DIR__), "docs", "package-lock.json"), joinpath(dirname(builddir), "package-lock.json"))
cp(joinpath(dirname(@__DIR__), "template", "package.json"), joinpath(dirname(builddir), "package.json"))
should_remove_package_json = true
end

cd(dirname(builddir)) do
if settings.install_npm || should_remove_package_json
if !isfile(joinpath(dirname(builddir), "package.json"))
cp(joinpath(dirname(@__DIR__), "template", "package.json"), joinpath(dirname(builddir), "package.json"))
should_remove_package_json == true
should_remove_package_json = true
end
run(`$(npm) install`)
end
Expand Down

2 comments on commit d596246

@asinghvi17
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/103972

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.0.15 -m "<description of version>" d596246ddf115fac93b8ea0cf9267ffd2e02cc46
git push origin v0.0.15

Please sign in to comment.