Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[joss][package structure][nice to have] Refactor into src-like directory structure? #21

Open
sneakers-the-rat opened this issue Feb 20, 2024 · 4 comments

Comments

@sneakers-the-rat
Copy link

Part of: openjournals/joss-reviews#6336

Not a requirement of the review, but a nice-to-have:

Currently the project is structured s.t. the public assets/pages/etc. are in the same top-level directory as the tests and package metadata. Would be nice to make a clearer distinction between what is intended to be deployed on a web server/run locally vs. what is intended to be used as support. this is partially cosmetic, but would also be important for extensibility/maintainability later, as eg. adding more test cases that an http server would be serving could be undesirable if they exposed some vulnerability to the host machine.

So that would look something like

.eslintignore
.eslintrc.js
.gitignore
Contributing.md
LICENSE
package.json
...
src
  index.html
  thresholdmann.css
  thresholdmann.js
  ...
  img/
  render3D/
tests
  test.mjs
  fixtures.mjs
  data/
  ...
@sneakers-the-rat sneakers-the-rat changed the title [joss][package structure][nice to have] Refactor into src-like directoy structure? [joss][package structure][nice to have] Refactor into src-like directory structure? Feb 20, 2024
@katjaq
Copy link
Member

katjaq commented Mar 21, 2024

Thank you for pointing this out and your suggestion. We were actually happy to do this at first, but then we realised it is maybe better in our case to keep it this way, and should not be too problematic?
We're currently serving thresholdmann from /(root). Checking the Github Pages settings, there doesn't seem to be an option to serve the website from a folder that wouldn't be either /(root) or /docs. We could keep only index.html at /(root), all the website files at /src, and all the test files at /tests. That would work around this issue, but defeat the purpose of the restructuring. 🙈 We also would like to avoid links to our tool such as https://neuroanatomy.github.io/thresholdmann/src/. So, weighting the benefits and possible implications, being happy with serving from Github pages, we would prefer to keep the current structure of the code. Does it sound reasonable @sneakers-the-rat ?

@sneakers-the-rat
Copy link
Author

ooh yes! this is another thing that the webpack stuff can help with - since gh pages are just gh actions now, you can make an action that builds the site to a branch and then deploys from there so you have more control over the structure of your source directory.

We also would like to avoid links to our tool such as https://neuroanatomy.github.io/thresholdmann/src/.

most definitely a higher priority!!!!

this was mostly just a "would this be nice for y'all?" issue, so no worries about keeping it this way.

here's a super trivial example of building something with sphinx and deploying to gh pages - https://github.com/p2p-ld/docs/blob/main/.github/workflows/sphinx.yml

yours would be even simpler since it's ready-to-roll JS

name: Deploy
on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write  # To push a branch 
    steps:
      - uses: actions/checkout@v3
      - name: deploy to gh-pages
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          folder: src

but again only do that if it's easier for you to tend to your code!

@katjaq
Copy link
Member

katjaq commented Apr 9, 2024

Thank you very much @sneakers-the-rat . This sounds good. For the moment, we would like to keep things as they are, and once we will look into the PR that you so kindly drafted for starting the packaging, moving to actions here will become interesting.

@sneakers-the-rat
Copy link
Author

Up to you, feel free to close this if youd like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants