From c59de9cc5b98578828db3717bb8e7af32d4648f0 Mon Sep 17 00:00:00 2001 From: Ben C Date: Wed, 3 Jul 2024 12:46:12 -0400 Subject: [PATCH] [META] Remove all references of pnpm --- .github/workflows/nightly_build.yml | 24 ++---------------------- .github/workflows/release_gui.yml | 22 +--------------------- .vscode/launch.json | 2 +- CONTRIBUTING.md | 2 +- nix/shell.nix | 1 - owmods_gui/CONTRIBUTING.md | 18 +++++++++--------- owmods_gui/README.md | 5 +++-- owmods_gui/frontend/.prettierignore | 1 + 8 files changed, 18 insertions(+), 57 deletions(-) diff --git a/.github/workflows/nightly_build.yml b/.github/workflows/nightly_build.yml index 94954835..71dcc2b3 100644 --- a/.github/workflows/nightly_build.yml +++ b/.github/workflows/nightly_build.yml @@ -43,32 +43,12 @@ jobs: with: node-version: 20 - - name: Setup pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - - name: Get pnpm store directory - id: pnpm-cache - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - - uses: actions/cache@v4 - name: Setup pnpm cache - with: - path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - key: ${{ matrix.platform }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ matrix.platform }}-pnpm-store- - - name: Install Frontend Dependencies working-directory: owmods_gui/frontend - run: pnpm install + run: npm install - name: Install Tauri CLI - run: pnpm add -g @tauri-apps/cli + run: npm add -g @tauri-apps/cli - name: Build GUI run: tauri build --ci -b $([[ ${{ matrix.platform }} = 'windows-latest' ]] && echo 'msi nsis' || echo 'appimage deb') diff --git a/.github/workflows/release_gui.yml b/.github/workflows/release_gui.yml index 6c6f33de..b9c09fbc 100644 --- a/.github/workflows/release_gui.yml +++ b/.github/workflows/release_gui.yml @@ -38,29 +38,9 @@ jobs: with: node-version: 20 - - name: Setup pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - - name: Get pnpm store directory - id: pnpm-cache - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - - uses: actions/cache@v4 - name: Setup pnpm cache - with: - path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - key: ${{ matrix.platform }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ matrix.platform }}-pnpm-store- - - name: Install Frontend Dependencies working-directory: owmods_gui/frontend - run: pnpm install + run: npm install - name: Build GUI uses: tauri-apps/tauri-action@dev diff --git a/.vscode/launch.json b/.vscode/launch.json index 9cfd594f..85838d19 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,7 +12,7 @@ "type": "node-terminal", "request": "launch", "cwd": "${workspaceFolder}/owmods_gui/frontend", - "command": "pnpm dev" + "command": "npm run dev" } ] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5983b500..bb256cf6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -74,7 +74,7 @@ I tried to automate this process in a way that makes sense but it still needs so 3. `owmods_gui/backend/Cargo.toml` - **also update the reference to owmods_core if it was updated** 4. `nix/owmods-cli.nix` 5. `nix/owmods-gui.nix` - 6. `owmods_gui/frontend/package.json` - used by `pnpm2nix` to generate a derivation for the frontend + 6. `owmods_gui/frontend/package.json` 7. `xtask/Cargo.toml` - not the end of the world if you don't update this, determines the version shown in man pages for the CLI 2. Merge `dev` to `main` (assuming you have a PR going) 3. Run the "Create Core Release" action diff --git a/nix/shell.nix b/nix/shell.nix index df45a49c..95a8f1be 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -9,7 +9,6 @@ pkgs.mkShell { rustfmt nodejs openssl - nodePackages.pnpm gcc webkitgtk glib-networking diff --git a/owmods_gui/CONTRIBUTING.md b/owmods_gui/CONTRIBUTING.md index 2ab50c2b..d0b5f0c9 100644 --- a/owmods_gui/CONTRIBUTING.md +++ b/owmods_gui/CONTRIBUTING.md @@ -1,10 +1,10 @@ # Contributing -To build this project you'll need rust, cargo, and pnpm. +To build this project you'll need rust, cargo, and node/npm. This package is called `owmods_gui` so anytime you want to perform cargo commands on it **do not do it in this folder**, do it from the root of the repo and add `-p owmods_gui` to your cargo command. -Ex: `cargo add tokio` should become `cargo add clap -p owmods_gui`. +Ex: `cargo add tokio` should become `cargo add tokio -p owmods_gui`. ## Setup on Linux @@ -18,9 +18,9 @@ Run the `shell.nix` file. Allow insecure is needed for OpenSSL 1.1.1 support. NIX_ALLOW_INSECURE=1 nix-shell shell.nix --impure ``` -## pnpm +## npm -The frontend for this package is made with TS so you need to install related dependencies. First cd in to `owmods_gui/frontend`, then run `pnpm i` +The frontend for this package is made with TS so you need to install related dependencies. First cd in to `owmods_gui/frontend`, then run `npm i` ## Typeshare @@ -32,11 +32,11 @@ To do this, you need to install the typeshare cli: cargo install typeshare-cli ``` -Then run the `gen-types` pnpm command: +Then run the `gen-types` npm command: ```sh cd owmods_gui/frontend -pnpm gen-types +npm run gen-types ``` This will generate `types.d.ts` in `owmods_gui/frontend/src/types.d.ts`. @@ -54,8 +54,8 @@ And lint and format the frontend as well: ```sh cd owmods_gui/frontend -pnpm lint -pnpm prettify +npm run lint +npm run prettify ``` Git hooks are setup to run clippy on every commit, meaning they may take longer. @@ -71,7 +71,7 @@ This is a result of your OS falsely thinking the dev version of the manager shou Events are used to communicate between the frontend and backend. They are defined in `owmods_gui/src/events.rs`. The events are then synced via typeshare to the frontend, where they are defined in `owmods_gui/frontend/src/types.d.ts`. -To use an event, you must first define it in `owmods_gui/src/events.rs` and then sync it to the frontend by running `pnpm gen-types` in `owmods_gui/frontend`. +To use an event, you must first define it in `owmods_gui/src/events.rs` and then sync it to the frontend by running `npm gen-types` in `owmods_gui/frontend`. Then, you can use the event in the frontend by importing `emit` or `listen` from `owmods_gui/frontend/events.ts` and using it like so: diff --git a/owmods_gui/README.md b/owmods_gui/README.md index bc0c197f..298165bf 100644 --- a/owmods_gui/README.md +++ b/owmods_gui/README.md @@ -36,7 +36,8 @@ Prerequisites: - rust - cargo -- pnpm +- node +- npm You'll need the tauri CLI installed, so run: @@ -53,7 +54,7 @@ git clone https://github.com/ow-mods/ow-mod-man/ Go into `owmods_gui/frontend` and run: ```sh -pnpm i +npm i ``` To install dependencies, then go back to the root of the repo. diff --git a/owmods_gui/frontend/.prettierignore b/owmods_gui/frontend/.prettierignore index 75ac83a3..bb2c5f6a 100644 --- a/owmods_gui/frontend/.prettierignore +++ b/owmods_gui/frontend/.prettierignore @@ -3,4 +3,5 @@ src-tauri/target stats.html !.vscode pnpm-lock.yaml +package-lock.json src/tests/TODO.md