From d5ea1d5f4c7f9065a651b57d778f45ad0b3120d9 Mon Sep 17 00:00:00 2001 From: Monil Patel Date: Sun, 15 Dec 2024 09:40:49 -0800 Subject: [PATCH 1/7] fix: prevent pnpm lock file from incorrectly being updated on install and add explicit update script to update use w/o frozen lock file option --- .github/workflows/pre-release.yml | 2 +- .github/workflows/release.yaml | 2 +- .gitpod.yml | 4 ++-- Dockerfile | 2 +- package.json | 3 +++ scripts/start.sh | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index e228b9d071e..f980523f167 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -38,7 +38,7 @@ jobs: run: sudo apt-get install -y protobuf-compiler - name: Install dependencies - run: pnpm install + run: pnpm install --frozen-lockfile - name: Build packages run: pnpm run build diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7f9d9e12d65..e1d01a5a6ce 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,7 +35,7 @@ jobs: run: sudo apt-get install -y protobuf-compiler - name: Install dependencies - run: pnpm install + run: pnpm install --frozen-lockfile - name: Build packages run: pnpm run build diff --git a/.gitpod.yml b/.gitpod.yml index f6e6601f437..83ca86daf55 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -4,5 +4,5 @@ tasks: init: | nvm install v23.3.0 git checkout $(git describe --tags --abbrev=0) - command: pnpm install && pnpm run build - + command: pnpm install --frozen-lockfile && pnpm run build + diff --git a/Dockerfile b/Dockerfile index d97ed212cb2..87abc40998d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ COPY scripts ./scripts COPY characters ./characters # Install dependencies and build the project -RUN pnpm install \ +RUN pnpm install --frozen-lockfile \ && pnpm build-docker \ && pnpm prune --prod diff --git a/package.json b/package.json index cb2da2b438a..10e83f008a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,9 @@ { "name": "eliza", "scripts": { + "install": "pnpm i -r --frozen-lockfile", + "i": "pnpm i -r --frozen-lockfile", + "update": "pnpm i -r", "preinstall": "npx only-allow pnpm", "build": "turbo run build --filter=!eliza-docs", "build-docker": "turbo run build", diff --git a/scripts/start.sh b/scripts/start.sh index 808a2c0a31f..58233348782 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -21,7 +21,7 @@ fi # Install dependencies echo -e "\033[1mInstalling dependencies...\033[0m" -if ! pnpm i; then +if ! pnpm i --frozen-lockfile; then echo -e "\033[1;31mFailed to install dependencies\033[0m" exit 1 fi From a09058dfab3cdc29999aa071510ba30b19dafd6c Mon Sep 17 00:00:00 2001 From: Monil Patel Date: Sun, 15 Dec 2024 09:52:25 -0800 Subject: [PATCH 2/7] remove -r --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 10e83f008a6..fab48aee289 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "eliza", "scripts": { - "install": "pnpm i -r --frozen-lockfile", - "i": "pnpm i -r --frozen-lockfile", - "update": "pnpm i -r", + "install": "pnpm i --frozen-lockfile", + "i": "pnpm i --frozen-lockfile", + "update": "pnpm i", "preinstall": "npx only-allow pnpm", "build": "turbo run build --filter=!eliza-docs", "build-docker": "turbo run build", From eff83ec4c7d510517d6de931af363f28fc496b4d Mon Sep 17 00:00:00 2001 From: Monil Patel Date: Sun, 15 Dec 2024 12:35:45 -0800 Subject: [PATCH 3/7] on default don't update pnpm lockfile --- .npmrc | 1 + docs/docs/quickstart.md | 14 ++++++++++++++ package.json | 3 --- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.npmrc b/.npmrc index d67f3748837..0f6a4a767d1 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,2 @@ node-linker=hoisted +frozen-lockfile=true \ No newline at end of file diff --git a/docs/docs/quickstart.md b/docs/docs/quickstart.md index 206e1486025..ff29978f680 100644 --- a/docs/docs/quickstart.md +++ b/docs/docs/quickstart.md @@ -45,6 +45,18 @@ Before getting started with Eliza, ensure you have: pnpm install ``` + # Quickstart Guide Update + +**Important Note on pnpm Lockfile Management** + +By default, the `pnpm` lockfile will not be updated during installations based off of .npmrc frozen-lockfile=true. To update the lockfile, you need to run the command: + +```bash +pnpm i --no-frozen-lockfile +``` + +Please only use this command when you are bumping the version of a package or adding a new package to your package.json. This practice helps maintain consistency in your project's dependencies and prevents unintended changes to the lockfile. + Build the local libraries ```bash @@ -289,6 +301,8 @@ pnpm start --characters="characters/trump.character.json,characters/tate.charact pnpm i ``` + + ## Next Steps Once you have your agent running, explore: diff --git a/package.json b/package.json index fab48aee289..cb2da2b438a 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,6 @@ { "name": "eliza", "scripts": { - "install": "pnpm i --frozen-lockfile", - "i": "pnpm i --frozen-lockfile", - "update": "pnpm i", "preinstall": "npx only-allow pnpm", "build": "turbo run build --filter=!eliza-docs", "build-docker": "turbo run build", From 5f0b1ca1a42f2c6e3c621d67214d5efc541a73d2 Mon Sep 17 00:00:00 2001 From: Monil Patel Date: Sun, 15 Dec 2024 12:38:26 -0800 Subject: [PATCH 4/7] remove space --- docs/docs/quickstart.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/docs/quickstart.md b/docs/docs/quickstart.md index ff29978f680..1a4d173b2c2 100644 --- a/docs/docs/quickstart.md +++ b/docs/docs/quickstart.md @@ -301,8 +301,6 @@ pnpm start --characters="characters/trump.character.json,characters/tate.charact pnpm i ``` - - ## Next Steps Once you have your agent running, explore: From 2afc62127335be3ef44a52fb543e10bed4d3d60e Mon Sep 17 00:00:00 2001 From: Monil Patel Date: Sun, 15 Dec 2024 12:52:40 -0800 Subject: [PATCH 5/7] don't need to explicitly set it with .npmrc in root file --- .github/workflows/ci.yaml | 2 +- .github/workflows/integrationTests.yaml | 2 +- .github/workflows/pre-release.yml | 2 +- .github/workflows/release.yaml | 2 +- .gitpod.yml | 2 +- Dockerfile | 2 +- scripts/smokeTests.sh | 2 +- scripts/start.sh | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 282d2a94283..09649bafaea 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: cache: "pnpm" - name: Install dependencies - run: pnpm install --frozen-lockfile + run: pnpm install - name: Run Prettier run: pnpm run prettier --check . diff --git a/.github/workflows/integrationTests.yaml b/.github/workflows/integrationTests.yaml index 56f86b7bf37..86f1b6f20ec 100644 --- a/.github/workflows/integrationTests.yaml +++ b/.github/workflows/integrationTests.yaml @@ -38,7 +38,7 @@ jobs: cache: "pnpm" - name: Install dependencies - run: pnpm install -r --frozen-lockfile + run: pnpm install -r - name: Build packages run: pnpm build diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index f980523f167..e228b9d071e 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -38,7 +38,7 @@ jobs: run: sudo apt-get install -y protobuf-compiler - name: Install dependencies - run: pnpm install --frozen-lockfile + run: pnpm install - name: Build packages run: pnpm run build diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e1d01a5a6ce..7f9d9e12d65 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,7 +35,7 @@ jobs: run: sudo apt-get install -y protobuf-compiler - name: Install dependencies - run: pnpm install --frozen-lockfile + run: pnpm install - name: Build packages run: pnpm run build diff --git a/.gitpod.yml b/.gitpod.yml index 83ca86daf55..73e474714d2 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -4,5 +4,5 @@ tasks: init: | nvm install v23.3.0 git checkout $(git describe --tags --abbrev=0) - command: pnpm install --frozen-lockfile && pnpm run build + command: pnpm install && pnpm run build diff --git a/Dockerfile b/Dockerfile index 87abc40998d..d97ed212cb2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ COPY scripts ./scripts COPY characters ./characters # Install dependencies and build the project -RUN pnpm install --frozen-lockfile \ +RUN pnpm install \ && pnpm build-docker \ && pnpm prune --prod diff --git a/scripts/smokeTests.sh b/scripts/smokeTests.sh index b60422c3f84..01042981258 100755 --- a/scripts/smokeTests.sh +++ b/scripts/smokeTests.sh @@ -36,7 +36,7 @@ cd "$PROJECT_DIR" cp .env.example .env -pnpm install -r --frozen-lockfile +pnpm install -r pnpm build diff --git a/scripts/start.sh b/scripts/start.sh index 58233348782..86a51a6323d 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -21,7 +21,7 @@ fi # Install dependencies echo -e "\033[1mInstalling dependencies...\033[0m" -if ! pnpm i --frozen-lockfile; then +if ! pnpm i ; then echo -e "\033[1;31mFailed to install dependencies\033[0m" exit 1 fi From d381a57c7274effdba039576ca50822c9b71c8e8 Mon Sep 17 00:00:00 2001 From: Monil Patel Date: Sun, 15 Dec 2024 12:55:13 -0800 Subject: [PATCH 6/7] remove space --- .gitpod.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 73e474714d2..3d243d6e344 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -5,4 +5,3 @@ tasks: nvm install v23.3.0 git checkout $(git describe --tags --abbrev=0) command: pnpm install && pnpm run build - From 39b7394e7aa6d4be723fa45a6e573f8f58954a53 Mon Sep 17 00:00:00 2001 From: Monil Patel Date: Sun, 15 Dec 2024 13:16:07 -0800 Subject: [PATCH 7/7] Update quickstart.md include the scenarios to not freeze the lockfile --- docs/docs/quickstart.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/quickstart.md b/docs/docs/quickstart.md index 1a4d173b2c2..21dc34e9004 100644 --- a/docs/docs/quickstart.md +++ b/docs/docs/quickstart.md @@ -39,10 +39,10 @@ Before getting started with Eliza, ensure you have: git checkout $(git describe --tags --abbrev=0) ``` - Install dependencies + Install dependencies (on initial run) ```bash - pnpm install + pnpm install --no-frozen-lockfile ``` # Quickstart Guide Update @@ -52,10 +52,10 @@ Before getting started with Eliza, ensure you have: By default, the `pnpm` lockfile will not be updated during installations based off of .npmrc frozen-lockfile=true. To update the lockfile, you need to run the command: ```bash -pnpm i --no-frozen-lockfile +pnpm install --no-frozen-lockfile ``` -Please only use this command when you are bumping the version of a package or adding a new package to your package.json. This practice helps maintain consistency in your project's dependencies and prevents unintended changes to the lockfile. +Please only use this command when you initially instantiating the repo or are bumping the version of a package or adding a new package to your package.json. This practice helps maintain consistency in your project's dependencies and prevents unintended changes to the lockfile. Build the local libraries