From 6de15a378017e91212bf65ab4a48e723fafea8d5 Mon Sep 17 00:00:00 2001 From: Whitigol Date: Wed, 30 Aug 2023 10:58:49 -0400 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=A7=B9=20pnpm=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/partials/requirements.html | 4 ++-- src/scripts/utils/api/api.ts | 8 +++---- src/scripts/utils/requirements.ts | 36 +++++++------------------------ 3 files changed, 14 insertions(+), 34 deletions(-) diff --git a/src/partials/requirements.html b/src/partials/requirements.html index 7e688b2..9b2b0ad 100644 --- a/src/partials/requirements.html +++ b/src/partials/requirements.html @@ -8,8 +8,8 @@ diff --git a/src/scripts/utils/api/api.ts b/src/scripts/utils/api/api.ts index 13c7804..88b24c6 100644 --- a/src/scripts/utils/api/api.ts +++ b/src/scripts/utils/api/api.ts @@ -45,13 +45,13 @@ appAPI.post('/start', async (req: any, res: any) => { if (keys.shift) { cadProcess = spawn( - `yarn run concurrently "yarn workspace @snailycad/client start" "yarn workspace @snailycad/api generate && yarn workspace @snailycad/api start"`, + `pnpm run concurrently "pnpm workspace @snailycad/client start" "pnpm workspace @snailycad/api generate && pnpm workspace @snailycad/api start"`, [], { shell: true, cwd: storage('cadDir').read() } ); } else { cadProcess = spawn( - `node scripts/copy-env.mjs --client --api && yarn turbo run build --filter=@snailycad/client && yarn run concurrently "yarn workspace @snailycad/client start" "yarn workspace @snailycad/api generate && yarn workspace @snailycad/api start"`, + `node scripts/copy-env.mjs --client --api && pnpm turbo run build --filter=@snailycad/client && pnpm run concurrently "pnpm workspace @snailycad/client start" "pnpm workspace @snailycad/api generate && pnpm workspace @snailycad/api start"`, [], { shell: true, cwd: storage('cadDir').read() } ); @@ -109,7 +109,7 @@ appAPI.post('/install', (req: any, res: any) => { message: 'Starting Installation', }); const installScript = spawn( - 'echo Downloading Repository && git clone https://github.com/SnailyCAD/snaily-cadv4.git && echo Opening Directory && cd snaily-cadv4 && echo Installing Dependencies (This may take a while) && yarn && echo Copying ENV && copy .env.example .env && echo Moving ENV && node scripts/copy-env.mjs --client --api && echo Building CAD (This might take a while) && yarn turbo run build --filter="{packages/**/**}" && yarn turbo run build --filter="{apps/**/**}" && echo Installation Complete', + 'echo Downloading Repository && git clone https://github.com/SnailyCAD/snaily-cadv4.git && echo Opening Directory && cd snaily-cadv4 && echo Installing Dependencies (This may take a while) && pnpm && echo Copying ENV && copy .env.example .env && echo Moving ENV && node scripts/copy-env.mjs --client --api && echo Building CAD (This might take a while) && pnpm turbo run build --filter="{packages/**/**}" && pnpm turbo run build --filter="{apps/**/**}" && echo Installation Complete', [], { shell: true, @@ -227,7 +227,7 @@ appAPI.post('/update', (req: any, res: any) => { appAPI.post('/reset', (req: any, res: any) => { const resetScript = spawn( - 'echo Resetting Node Modules && rmdir /s /q "node_modules" && echo Installing Dependencies (This may take a while) && yarn && echo Node Modules Reset', + 'echo Resetting Node Modules && rmdir /s /q "node_modules" && echo Installing Dependencies (This may take a while) && pnpm && echo Node Modules Reset', [], { shell: true, diff --git a/src/scripts/utils/requirements.ts b/src/scripts/utils/requirements.ts index 8d89f05..7d387bd 100644 --- a/src/scripts/utils/requirements.ts +++ b/src/scripts/utils/requirements.ts @@ -1,18 +1,13 @@ let requirements = { git: false, node: false, - yarn: false, + pnpm: false, psql: false, complete: false, }; const checkComplete = setInterval(async () => { - if ( - requirements.git && - requirements.node && - requirements.yarn && - requirements.psql - ) { + if (requirements.git && requirements.node && requirements.pnpm) { clearInterval(checkComplete); requirements.complete = true; @@ -71,35 +66,20 @@ const checkRequirements = async () => { .css('color', 'orange'); log('Requirement NODE Failed', 'warning'); }); - await commandExists('yarn', (err: string, exists: boolean) => { + await commandExists('pnpm', (err: string, exists: boolean) => { if (err) throw new Error(err); if (exists) { - $('.rqYarn') + $('.rqPnpm') .text('PASSED') .attr('aria-busy', 'false') .css('color', 'lime'); - log('Requirement Yarn Passed', 'success'); - return (requirements.yarn = true); + log('Requirement pnpm Passed', 'success'); + return (requirements.pnpm = true); } - $('.rqYarn') + $('.rqPnpm') .text('FAILED') .attr('aria-busy', 'false') .css('color', 'orange'); - log('Requirement YARN Failed', 'warning'); - }); - await isPostgres((db: any) => { - if (db.running) { - $('.rqPsql') - .text('PASSED') - .attr('aria-busy', 'false') - .css('color', 'lime'); - log('Requirement PSQL Passed', 'success'); - return (requirements.psql = true); - } - $('.rqPsql') - .text('FAILED (Verify that Postgres is running)') - .attr('aria-busy', 'false') - .css('color', 'orange'); - log('Requirement PSQL Failed', 'warning'); + log('Requirement pnpm Failed', 'warning'); }); }; From d8d703fc12b553d5d26ba4095a597c0753fb6a9f Mon Sep 17 00:00:00 2001 From: Whitigol <36452182+WhitigolProd@users.noreply.github.com> Date: Wed, 30 Aug 2023 16:09:35 -0400 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=A7=B9=20pnpm=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Casper Iversen <53900565+casperiv0@users.noreply.github.com> --- src/scripts/utils/api/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/utils/api/api.ts b/src/scripts/utils/api/api.ts index 88b24c6..8101af0 100644 --- a/src/scripts/utils/api/api.ts +++ b/src/scripts/utils/api/api.ts @@ -227,7 +227,7 @@ appAPI.post('/update', (req: any, res: any) => { appAPI.post('/reset', (req: any, res: any) => { const resetScript = spawn( - 'echo Resetting Node Modules && rmdir /s /q "node_modules" && echo Installing Dependencies (This may take a while) && pnpm && echo Node Modules Reset', + 'echo Resetting Node Modules && rmdir /s /q "node_modules" && echo Installing Dependencies (This may take a while) && pnpm install && echo Node Modules Reset', [], { shell: true, From 1d2a8c2023d7cc5853a9d03924d81e3462299e44 Mon Sep 17 00:00:00 2001 From: Whitigol <36452182+WhitigolProd@users.noreply.github.com> Date: Wed, 30 Aug 2023 16:09:52 -0400 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=A7=B9=20pnpm=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Casper Iversen <53900565+casperiv0@users.noreply.github.com> --- src/scripts/utils/api/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/utils/api/api.ts b/src/scripts/utils/api/api.ts index 8101af0..11df70d 100644 --- a/src/scripts/utils/api/api.ts +++ b/src/scripts/utils/api/api.ts @@ -45,7 +45,7 @@ appAPI.post('/start', async (req: any, res: any) => { if (keys.shift) { cadProcess = spawn( - `pnpm run concurrently "pnpm workspace @snailycad/client start" "pnpm workspace @snailycad/api generate && pnpm workspace @snailycad/api start"`, + "pnpm run start", [], { shell: true, cwd: storage('cadDir').read() } ); From 4261af7b48c72856be233214ee372f72c6e76b3f Mon Sep 17 00:00:00 2001 From: Whitigol <36452182+WhitigolProd@users.noreply.github.com> Date: Wed, 30 Aug 2023 16:10:04 -0400 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=A7=B9=20pnpm=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Casper Iversen <53900565+casperiv0@users.noreply.github.com> --- src/scripts/utils/api/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/utils/api/api.ts b/src/scripts/utils/api/api.ts index 11df70d..342727b 100644 --- a/src/scripts/utils/api/api.ts +++ b/src/scripts/utils/api/api.ts @@ -109,7 +109,7 @@ appAPI.post('/install', (req: any, res: any) => { message: 'Starting Installation', }); const installScript = spawn( - 'echo Downloading Repository && git clone https://github.com/SnailyCAD/snaily-cadv4.git && echo Opening Directory && cd snaily-cadv4 && echo Installing Dependencies (This may take a while) && pnpm && echo Copying ENV && copy .env.example .env && echo Moving ENV && node scripts/copy-env.mjs --client --api && echo Building CAD (This might take a while) && pnpm turbo run build --filter="{packages/**/**}" && pnpm turbo run build --filter="{apps/**/**}" && echo Installation Complete', + 'echo Downloading Repository && git clone https://github.com/SnailyCAD/snaily-cadv4.git && echo Opening Directory && cd snaily-cadv4 && echo Installing Dependencies (This may take a while) && pnpm install && echo Copying ENV && copy .env.example .env && echo Moving ENV && node scripts/copy-env.mjs --client --api && echo Building CAD (This might take a while) && pnpm turbo run build --filter="{packages/**/**}" && pnpm turbo run build --filter="{apps/**/**}" && echo Installation Complete', [], { shell: true, From 272d275f0c09e63bfc8f3f101ad682fb5b98c119 Mon Sep 17 00:00:00 2001 From: Whitigol <36452182+WhitigolProd@users.noreply.github.com> Date: Wed, 30 Aug 2023 16:10:28 -0400 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=A7=B9=20pnpm=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Casper Iversen <53900565+casperiv0@users.noreply.github.com> --- src/scripts/utils/api/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/utils/api/api.ts b/src/scripts/utils/api/api.ts index 342727b..036de9b 100644 --- a/src/scripts/utils/api/api.ts +++ b/src/scripts/utils/api/api.ts @@ -51,7 +51,7 @@ appAPI.post('/start', async (req: any, res: any) => { ); } else { cadProcess = spawn( - `node scripts/copy-env.mjs --client --api && pnpm turbo run build --filter=@snailycad/client && pnpm run concurrently "pnpm workspace @snailycad/client start" "pnpm workspace @snailycad/api generate && pnpm workspace @snailycad/api start"`, + `node scripts/copy-env.mjs --client --api && pnpm turbo run build --filter=@snailycad/client && pnpm run start`, [], { shell: true, cwd: storage('cadDir').read() } );