feat: unified package #962

Open
opened 2025-10-14 18:13:05 -06:00 by navan · 0 comments
Owner

Originally created by @wommy on 11/22/2024

Brief summary

unified client/package.json into root package.json

Which issue is fixed?

no specific issue,

but because there arent two package.json's anymore,
everything can just be ran from rootDir
eliminates the need for two npm ci's
simplifies the install and generation of the app

in the migration from nuxt 2 to 3, 3 comes with a /server/ directory
https://nuxt.com/docs/guide/directory-structure/server

tho i will still have to migrate all the logic from express into nitro and h3
https://h3.unjs.io/examples/from-expressjs-to-h3

i think it will be well worth it: removing dozens of outdate dependencies and boilerplate code, while simplifying logic and getting a nice speed increase

ill post a nice chatgpt analysis of that whenever my credits refill tomorrow

In-depth Description

  • cd client
  • git mv assets components layouts middleware mixins pages players plugins store strings cypress cypress.config.js nuxt.config.js tailwind.config.js ..
  • mv dist public static .nuxt ..
  • cd ..
  • here i copied the scripts, dependencies: deps, dev, and optional, from client/package.json into package.json, plus a few other misc edits, check the file
  • git rm -r client/
  • changed the line in server/Server.js from /client/dist/ to /dist/
  • changed the .gitignore
  • ran npm install so npmci would work
  • also ran npm audit fix to fix the fixable npm errors 59 => 42 cli link
  • and ran npm dedupe to remove ~75 duplicated packages from node_modules cli link

How have you tested this?

yes of course,

  • rm -rf node_modules
  • npm run client ; npm start
  • hit localhost:3333

and everything was perfectly there

i only have an epub and an audiobook, but they both played perfectly,

i navigated to each different view they all work normally,
which tracks because i didnt edit anything on the server
other than removing the /client prefix from the static app directory

Screenshots

no client changes


Additional - Left Undone - Unsure How to Proceed

i didnt edit a few misc files, ill split them into categories

simple

  • .devcontainer/post-create.sh, .vscode/launch.json, .vscode/tasks.json
    • need slight tweaks
  • .dockerignore
    • seems like the same few line changes from .gitignore

medium

  • Dockerfile
    • dunno how STAGE 0 WORKDIR works, looks simple tho
    • probs similar to the next one

harder

  • .github/workflows
    • probs just swap /client w/ assets components layouts middleware mixins pages players plugins static store strings cypress cypress.config.js nuxt.config.js tailwind.config.js
*Originally created by @wommy on 11/22/2024* <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary <!-- Please provide a brief summary of what your PR attempts to achieve. --> unified `client/package.json` into root `package.json` ## Which issue is fixed? <!-- Which issue number does this PR fix? Ex: "Fixes #1234" --> no specific issue, but because there arent two `package.json`'s anymore, everything can just be ran from rootDir eliminates the need for two `npm ci`'s simplifies the install and generation of the app in the migration from nuxt 2 to 3, 3 comes with a `/server/` directory https://nuxt.com/docs/guide/directory-structure/server tho i will still have to migrate all the logic from express into nitro and h3 https://h3.unjs.io/examples/from-expressjs-to-h3 i think it will be well worth it: removing dozens of outdate dependencies and boilerplate code, while simplifying logic and getting a nice speed increase ill post a nice chatgpt analysis of that whenever my credits refill tomorrow ## In-depth Description <!-- Describe your solution in more depth. How does it work? Why is this the best solution? Does it solve a problem that affects multiple users or is this an edge case for your setup? --> - `cd client` - `git mv assets components layouts middleware mixins pages players plugins store strings cypress cypress.config.js nuxt.config.js tailwind.config.js ..` - `mv dist public static .nuxt ..` - `cd ..` - here i copied the `scripts`, dependencies: `deps`, `dev`, and `optional`, from `client/package.json` into `package.json`, plus a few other misc edits, check the file - `git rm -r client/` - changed the line in `server/Server.js` from `/client/dist/` to `/dist/` - changed the `.gitignore` - ran `npm install` so `npmci` would work - also ran `npm audit fix` to fix the fixable npm errors 59 => 42 [cli link](https://docs.npmjs.com/cli/v10/commands/npm-audit) - and ran `npm dedupe` to remove ~75 duplicated packages from `node_modules` [cli link](https://docs.npmjs.com/cli/v10/commands/npm-dedupe) ## How have you tested this? <!-- Please describe in detail with reproducible steps how you tested your changes. --> yes of course, - `rm -rf node_modules` - `npm run client ; npm start` - hit `localhost:3333` and everything was perfectly there i only have an epub and an audiobook, but they both played perfectly, i navigated to each different view they all work normally, which tracks because i didnt edit anything on the server other than removing the `/client` prefix from the static app directory ## Screenshots <!-- If your PR includes any changes to the web client, please include screenshots or a short video from before and after your changes. --> no client changes --- ### Additional - Left Undone - Unsure How to Proceed i didnt edit a few misc files, ill split them into categories #### simple - `.devcontainer/post-create.sh`, `.vscode/launch.json`, `.vscode/tasks.json` - need slight tweaks - `.dockerignore` - seems like the same few line changes from `.gitignore` #### medium - `Dockerfile` - dunno how `STAGE 0 WORKDIR` works, looks simple tho - probs similar to the next one #### harder - `.github/workflows` - probs just swap `/client` w/ `assets components layouts middleware mixins pages players plugins static store strings cypress cypress.config.js nuxt.config.js tailwind.config.js`
Sign in to join this conversation.
No labels
authentication
awaiting release
awaiting release
awaiting release
awaiting release
backlog
backlog
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
chapter editor
chapter editor
chapter editor
chapter editor
chapter editor
ebooks
ebooks
ebooks
ebooks
ebooks
ebooks
ebooks
ebooks
ebooks
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
possible plugin
progress sync
sorting/filtering/searching
sorting/filtering/searching
sorting/filtering/searching
sorting/filtering/searching
sorting/filtering/searching
sorting/filtering/searching
sorting/filtering/searching
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
upload
users & permissions
users & permissions
users & permissions
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/audiobookshelf#962
No description provided.