diff options
author | Balaji Vijayakumar <kuttibalaji.v6@gmail.com> | 2022-12-09 12:59:26 +0530 |
---|---|---|
committer | Vijay Aravamudhan <vraravam@users.noreply.github.com> | 2022-12-09 13:51:05 +0530 |
commit | acb0a6f117987e44b91eda1be9ad44d70238b8fc (patch) | |
tree | c2a1fff569df611ddfd2310bdefe45f912e4b736 /scripts/build-windows.ps1 | |
parent | Fix logic used to check if there were local changes in docker builds (diff) | |
download | ferdium-server-acb0a6f117987e44b91eda1be9ad44d70238b8fc.tar.gz ferdium-server-acb0a6f117987e44b91eda1be9ad44d70238b8fc.tar.zst ferdium-server-acb0a6f117987e44b91eda1be9ad44d70238b8fc.zip |
migrate npm to pnpm for build
Diffstat (limited to 'scripts/build-windows.ps1')
-rw-r--r-- | scripts/build-windows.ps1 | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/scripts/build-windows.ps1 b/scripts/build-windows.ps1 index 4026aa5..5af7392 100644 --- a/scripts/build-windows.ps1 +++ b/scripts/build-windows.ps1 | |||
@@ -132,19 +132,6 @@ if((-not $NPM_CONFIG_MSVS_VERSION) -or -not ($EXPECTED_MSVST_VERSION -contains $ | |||
132 | npm config set msvs_version $ACTUAL_MSVST_VERSION | 132 | npm config set msvs_version $ACTUAL_MSVST_VERSION |
133 | } | 133 | } |
134 | 134 | ||
135 | # ----------------------------------------------------------------------------- | ||
136 | # Ensure that the system dependencies are at the correct version - recover if not | ||
137 | # Check npm version | ||
138 | $EXPECTED_NPM_VERSION = (Get-Content package.json | ConvertFrom-Json).engines.npm | ||
139 | $ACTUAL_NPM_VERSION = (npm -v) | ||
140 | if ($EXPECTED_NPM_VERSION -ne $ACTUAL_NPM_VERSION) { | ||
141 | Write-Host "You are not running the expected version of npm! | ||
142 | expected: [$EXPECTED_NPM_VERSION] | ||
143 | actual : [$ACTUAL_NPM_VERSION]" | ||
144 | Write-Host "Changing version of npm to [$EXPECTED_NPM_VERSION]" | ||
145 | npm i -gf npm@$EXPECTED_NPM_VERSION | ||
146 | } | ||
147 | |||
148 | # Check pnpm version | 135 | # Check pnpm version |
149 | $EXPECTED_PNPM_VERSION = (Get-Content .\recipes\package.json | ConvertFrom-Json).engines.pnpm | 136 | $EXPECTED_PNPM_VERSION = (Get-Content .\recipes\package.json | ConvertFrom-Json).engines.pnpm |
150 | $ACTUAL_PNPM_VERSION = Get-Command pnpm --version -ErrorAction SilentlyContinue # in case the pnpm executable itself is not present | 137 | $ACTUAL_PNPM_VERSION = Get-Command pnpm --version -ErrorAction SilentlyContinue # in case the pnpm executable itself is not present |
@@ -152,17 +139,6 @@ if ($ACTUAL_PNPM_VERSION -ne $EXPECTED_PNPM_VERSION) { | |||
152 | npm i -gf pnpm@$EXPECTED_PNPM_VERSION | 139 | npm i -gf pnpm@$EXPECTED_PNPM_VERSION |
153 | } | 140 | } |
154 | 141 | ||
155 | # ----------------------------------------------------------------------------- | ||
156 | # This is useful if we move from 'npm' to 'pnpm' for the main repo as well | ||
157 | if ((Test-Path -Path ".\pnpm-lock.yaml") -and (Get-Command -ErrorAction Ignore -Type Application pnpm)) | ||
158 | { | ||
159 | $BASE_CMD="pnpm" | ||
160 | } | ||
161 | else | ||
162 | { | ||
163 | $BASE_CMD="npm" | ||
164 | } | ||
165 | |||
166 | $ENV_FILE = ".env" | 142 | $ENV_FILE = ".env" |
167 | if (-not (Test-Path -Path $ENV_FILE)) { | 143 | if (-not (Test-Path -Path $ENV_FILE)) { |
168 | Copy-Item .env.example -Destination $ENV_FILE | 144 | Copy-Item .env.example -Destination $ENV_FILE |
@@ -177,18 +153,17 @@ if (-not (Test-Path -Path "data")) { | |||
177 | 153 | ||
178 | # ----------------------------------------------------------------------------- | 154 | # ----------------------------------------------------------------------------- |
179 | Write-Host "*************** Building recipes ***************" | 155 | Write-Host "*************** Building recipes ***************" |
180 | # Note: 'recipes' is already using only pnpm - can switch to $BASE_CMD AFTER both repos are using pnpm | ||
181 | Push-Location recipes | 156 | Push-Location recipes |
182 | pnpm i | 157 | pnpm i |
183 | pnpm package | 158 | pnpm package |
184 | Pop-Location | 159 | Pop-Location |
185 | 160 | ||
186 | # Now the meat..... | 161 | # Now the meat..... |
187 | & $BASE_CMD i | 162 | & pnpm i |
188 | & node ace migration:refresh | 163 | & node ace migration:refresh |
189 | 164 | ||
190 | # ----------------------------------------------------------------------------- | 165 | # ----------------------------------------------------------------------------- |
191 | Write-Host "*************** Starting app ***************" | 166 | Write-Host "*************** Starting app ***************" |
192 | & $BASE_CMD start --dev | 167 | & pnpm start --dev |
193 | 168 | ||
194 | Write-Host "*************** App successfully stopped! ***************" | 169 | Write-Host "*************** App successfully stopped! ***************" |