-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Pros - Much faster installation (On CI, ~2m30s => ~1m or ~30s if cached) - Less disk space usage - No custom installation logic (AKA the repo makes much more sense) - No patch-package needed (pnpm has that support built-in) - `pnpm install` works as expected no matter where you are in the repo ### Cons - New tool that isn't included with node - Custom packaging logic to handle bundled deps (See below) ### What's the hack See [./tools/bump-pack/src/bundle-link.ts](https://github.com/winglang/wing/blob/mark/pnpm-testing/tools/bump-pack/src/bundle-link.ts) In short: We need to add symlinks for all the transitive dependencies of bundled dependencies. This ensures the final package has all the deps it needs to run because pnpm is intentionally not friendly to bundled deps. --- *By submitting this pull request, I confirm that my contribution is made under the terms of the [Monada Contribution License](https://docs.winglang.io/terms-and-policies/contribution-license.html)*.
- Loading branch information
1 parent
b90336f
commit 433654e
Showing
286 changed files
with
30,575 additions
and
166,684 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
{ | ||
"name": "Wing Development", | ||
"image": "mcr.microsoft.com/devcontainers/base:jammy", | ||
"postCreateCommand": "npm install -g [email protected]", | ||
"updateContentCommand": "npm install", | ||
"updateContentCommand": "pnpm install", | ||
"features": { | ||
"ghcr.io/devcontainers/features/node:1": { | ||
"version": "18.16.0" | ||
|
@@ -11,6 +10,9 @@ | |
"ghcr.io/devcontainers/features/terraform:1": {}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
"ghcr.io/devcontainers/features/rust:1": {}, | ||
"ghcr.io/devcontainers-contrib/features/pnpm:2": { | ||
"version": "8.6.5" | ||
} | ||
}, | ||
"hostRequirements": { | ||
"cpus": 4, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ concurrency: | |
env: | ||
RUST_VERSION: "1.67.1" | ||
NODE_VERSION: "18.16.0" | ||
NPM_VERSION: "8.19.3" | ||
PNPM_VERSION: "8.6.3" | ||
|
||
jobs: | ||
build: | ||
|
@@ -42,14 +42,17 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: ${{ env.PNPM_VERSION }} | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: "pnpm" | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Setup NPM | ||
run: npm install -g npm@${{ env.NPM_VERSION }} | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
|
@@ -63,21 +66,21 @@ jobs: | |
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install Dependencies | ||
uses: bahmutov/npm-install@v1 | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Changelog Generation | ||
id: changelog | ||
env: | ||
GENERATE_VERSION: ${{ github.event_name != 'push' || github.repository != 'winglang/wing' }} | ||
run: npm run changelog | ||
run: pnpm changelog | ||
|
||
- name: Build | ||
run: npm run build:ci | ||
run: pnpm build:ci | ||
env: | ||
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }} | ||
|
||
- name: Package | ||
run: npm run package:ci | ||
run: pnpm package:ci | ||
|
||
- name: Upload Wing CLI | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -181,14 +184,17 @@ jobs: | |
with: | ||
fetch-depth: 1 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: ${{ env.PNPM_VERSION }} | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: "pnpm" | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Setup NPM | ||
run: npm install -g npm@${{ env.NPM_VERSION }} | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
|
@@ -202,10 +208,10 @@ jobs: | |
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install Dependencies | ||
uses: bahmutov/npm-install@v1 | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Test | ||
run: npm run test:ci | ||
run: pnpm test:ci | ||
|
||
- name: Create git patch | ||
id: diff | ||
|
@@ -244,26 +250,23 @@ jobs: | |
- name: Download Build Artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: ${{ env.PNPM_VERSION }} | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: "pnpm" | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Setup NPM | ||
run: npm install -g npm@${{ env.NPM_VERSION }} | ||
|
||
- name: Install Dependencies | ||
uses: bahmutov/npm-install@v1 | ||
with: | ||
working-directory: | | ||
tools/hangar | ||
examples/tests/valid | ||
examples/tests/invalid | ||
install-command: npm ci | ||
run: pnpm install --ignore-scripts --frozen-lockfile --filter hangar --filter examples-valid --filter examples-invalid | ||
|
||
- name: Run E2E Benchmarks | ||
working-directory: tools/hangar | ||
run: npm run bench | ||
run: pnpm bench | ||
|
||
- name: Upload Report JSON | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -313,25 +316,25 @@ jobs: | |
with: | ||
path: target | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: ${{ env.PNPM_VERSION }} | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: "pnpm" | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install Dependencies | ||
uses: bahmutov/npm-install@v1 | ||
with: | ||
working-directory: | | ||
tools/hangar | ||
examples/tests/valid | ||
examples/tests/invalid | ||
install-command: npm ci | ||
run: pnpm install --ignore-scripts --frozen-lockfile --filter hangar --filter examples-valid --filter examples-invalid | ||
|
||
- name: Run E2E Tests | ||
working-directory: tools/hangar | ||
run: | | ||
npm run test:generate | ||
npm run test -- --shard=${{ matrix.shard }} --update=${{ matrix.runner == 'ubuntu' && matrix.node == '18' }} | ||
pnpm test:generate | ||
pnpm run test --shard=${{ matrix.shard }} --update=${{ matrix.runner == 'ubuntu' && matrix.node == '18' }} | ||
- name: Create mutation if needed | ||
# we only care about the diff in our standard dev env | ||
|
@@ -405,6 +408,7 @@ jobs: | |
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} | ||
registryUrl: "https://marketplace.visualstudio.com" | ||
extensionFile: "vscode-wing/vscode-wing.vsix" | ||
dependencies: false | ||
|
||
- name: Login to NPM registry | ||
run: npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_PUBLISH_TOKEN }} | ||
|
@@ -427,15 +431,15 @@ jobs: | |
working-directory: wingcompiler | ||
run: npm publish *.tgz --access public | ||
|
||
- name: Check published Wing Console Design System version | ||
id: wingconsoledesignsystem-version | ||
run: echo "version=$(npm view @wingconsole/design-system version)" >> $GITHUB_OUTPUT | ||
|
||
- name: Publish Wing Console Design System | ||
if: ${{ steps.wingconsoledesignsystem-version.outputs.version != needs.build.outputs.version }} | ||
working-directory: wingconsoledesignsystem | ||
run: npm publish *.tgz --access public | ||
|
||
- name: Check published Wing Console Design System version | ||
id: wingconsoledesignsystem-version | ||
run: echo "version=$(npm view @wingconsole/design-system version)" >> $GITHUB_OUTPUT | ||
|
||
- name: Check published Wing Console UI version | ||
id: wingconsoleui-version | ||
run: echo "version=$(npm view @wingconsole/ui version)" >> $GITHUB_OUTPUT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.