Skip to content

Commit

Permalink
Updated pkg to most recent version and updated Windows contributing i…
Browse files Browse the repository at this point in the history
…nstructions (#13875)

* chore: updated pkg to newest version, updated CONTRIBUING.md for windows

* chore: removed unnecessary comment

* chore: fixed precommit hook for windows

* chore: code reinstated to run yarn in scripts folder for windows

* chore: cd .. added to build_windows.yml after yarn is installed in /scripts

* chore: bump pkg-fetch using resolution override

* chore: remove unused cache

---------

Co-authored-by: Vieltojarvi <[email protected]>
Co-authored-by: Armando Luja <[email protected]>
  • Loading branch information
3 people authored Aug 5, 2024
1 parent 6bee1f0 commit 1bb48f9
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 31 deletions.
3 changes: 1 addition & 2 deletions .github/actions/run-smoke-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ runs:
echo "AMPLIFY_PATH=$AMPLIFY_PATH"
$AMPLIFY_PATH version
- name: Remove Pkg Fetch Checksum on Windows
- name: Yarn build on Windows
shell: bash
if: runner.os == 'Windows'
run: |
cd scripts
yarn
yarn ts-node remove-pkg-fetch-checksum.ts
- name: Install Dependencies
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NC='\033[0m' # No color

echo "${GREEN}Running pre-commit hook${NC}"
echo "${CYAN}Running yarn prettier staged files${NC}"
git diff --name-only --cached --diff-filter=ACM | grep -E '\.(js|jsx|ts|tsx)$' | xargs yarn prettier --write
git diff --name-only --cached --diff-filter=ACM | grep -E '\.(js|jsx|ts|tsx)$' | xargs --no-run-if-empty yarn prettier --write
echo "${CYAN}Running yarn lint-staged${NC}"
yarn lint-fix
echo "${CYAN}Running yarn stage prettified files${NC}"
Expand Down
12 changes: 11 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,19 @@ This section should get you running with **Amplify CLI** and get you familiar wi

# Windows
yarn && yarn setup-dev-win
## Must be run in Powershell
## Preferably run in Git Bash
```

### Additional Instructions for Windows Users:

Prior to running the `setup-dev` script:

1. Install the Visual C++ Build Environment by installing Visual Studio Community Edition. When selecting options, only 'Desktop Development for C++' needs to be added.
2. Open a terminal window/command prompt and run `npm config edit` and add or modify `msvs_version` setting to be your version of Visual Studio (e.g. `msvs_version=22`)
3. If you run into the build error 'MSB8040: Spectre-mitigated libraries are required for this project' open the Visual Studio installer, press the 'Modify' button for your version of Visual Studio, then navigate to the 'Individual Components' and search for 'Spectre'. Install options that look like "MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs (Latest)", you should only need the x86-64 version, but can optionally install versions for ARM and ARM64/ARM64EC.
4. Go back to the terminal window/command prompt and navigate to the 'amplify-cli' folder and run `yarn clean cache --all`
5. You should now be ready to run the `setup-dev` script

> NOTE: Make sure to always [sync your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) with _dev_ branch of amplify-cli
### Architecture of the codebase
Expand Down
1 change: 0 additions & 1 deletion codebuild_specs/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ phases:
commands:
- cd scripts
- yarn
- yarn ts-node remove-pkg-fetch-checksum.ts
- cd ..
- yarn --immutable
- yarn production-build
Expand Down
1 change: 0 additions & 1 deletion codebuild_specs/scripts-windows/load-e2e-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ source ./codebuild_specs/scripts-windows/shared-scripts-windows.sh

# export CODEBUILD_SOURCE_VERSION=e1dce3fd6083503048f8d6eec3c09cf1b5d8a007
loadCache repo-windows $CODEBUILD_SRC_DIR
loadCache .cache-windows $HOME/AppData/Local/Yarn/Cache/v6

loadCache verdaccio-cache $CODEBUILD_SRC_DIR/../verdaccio-cache
loadCache all-binaries $CODEBUILD_SRC_DIR/out
Expand Down
1 change: 0 additions & 1 deletion codebuild_specs/scripts-windows/shared-scripts-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ function _build {
function _saveBuild {
_lsOut
storeCache $CODEBUILD_SRC_DIR repo-windows
storeCache $HOME/AppData/Local/Yarn/Cache/v6 .cache-windows
}
function _install_packaged_cli_win {
echo Install Amplify Packaged CLI to PATH
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@
"json5": "^2.2.3",
"mysql2": "^3.9.8",
"nth-check": "^2.0.1",
"pkg-fetch": "^3.5.2",
"undici": "^5.28.3",
"pkg-fetch": "https://github.com/aws-amplify/pkg-fetch#ad4a21feb533d338bf951e7ba28cea7256aedeff",
"tough-cookie": "^4.1.3",
"semver": "^7.5.4",
"word-wrap": "^1.2.4",
Expand Down
19 changes: 0 additions & 19 deletions scripts/remove-pkg-fetch-checksum.ts

This file was deleted.

8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26681,9 +26681,9 @@ node-pty@beta:
languageName: node
linkType: hard

"pkg-fetch@https://github.com/aws-amplify/pkg-fetch#ad4a21feb533d338bf951e7ba28cea7256aedeff":
version: 3.4.2
resolution: "pkg-fetch@https://github.com/aws-amplify/pkg-fetch.git#commit=ad4a21feb533d338bf951e7ba28cea7256aedeff"
"pkg-fetch@npm:^3.5.2":
version: 3.5.2
resolution: "pkg-fetch@npm:3.5.2"
dependencies:
chalk: ^4.1.2
fs-extra: ^9.1.0
Expand All @@ -26695,7 +26695,7 @@ node-pty@beta:
yargs: ^16.2.0
bin:
pkg-fetch: lib-es5/bin.js
checksum: 24e2b385b6510538b4253aba62f243f7a1783fa544970c0712bcc3dd3c10159f7eab741f8dfaf409afed5ed8e0c334ea2c046ffbd11b93901c41847142a34b5e
checksum: 8105cf28178e0b325417a9dee6ec0f0f124ba7fe3608d8ad86628ef2f2a12d1490550a007d5be42e34f0c8573dcb9655737b4d07a177ce4ee278e762ccb42b9e
languageName: node
linkType: hard

Expand Down

0 comments on commit 1bb48f9

Please sign in to comment.