-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Second attempt at #3187 ### What's new? The big workaround before was to make sure that all bundled dependencies and their dependencies were symlinked to node_modules. This was great and made it work locally and via file:tgz installs (when all packages are installed directly). However, the final tarballs were not actually correct. For each bundled dep, if it had any bundled deps of its own, those were missing. npm normally includes these, but apparently if the bundled dep is a symlink then it doesn't do it 😢 . So, the [main change](https://github.com/winglang/wing/blob/mark/pnpm-take-2/tools/bump-pack/src/pack.ts) here is that the packaging process creates a completely separate copy of the package. In that copy, we convert the necessary symlinks into copies. Then we package. These packages look almost identical to the ones we publish now. I think the only way I could possibly test this with enough accuracy is to set up verdaccio, but I'm more confident that this iteration should work. Not sure I want to block this further by taking the time to go back to verdaccio. Misc: - Updated nx to latest with a patch to make sure our workflow of using `--` still works. I created a PR upstream in nx to maybe fix the issue. I did this update for two reasons: - We are very out of date on nx - Theres an old nx bug on linux causing it to watch/search node_modules. This hurts perf and caused nx to try to discover nx projects in node_modules. The update fixed this.
- Loading branch information
1 parent
38adc5b
commit 8042879
Showing
303 changed files
with
31,334 additions
and
167,351 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 |
---|---|---|
|
@@ -20,7 +20,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: | ||
|
@@ -41,14 +41,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: | ||
|
@@ -62,21 +65,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 | ||
|
@@ -180,14 +183,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: | ||
|
@@ -201,14 +207,14 @@ jobs: | |
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install Dependencies | ||
uses: bahmutov/npm-install@v1 | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps | ||
working-directory: apps/wing-console/console/app | ||
|
||
- name: Test | ||
run: npm run test:ci | ||
run: pnpm test:ci | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
|
@@ -254,26 +260,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 | ||
|
@@ -323,25 +326,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 | ||
|
@@ -415,6 +418,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 }} | ||
|
@@ -437,15 +441,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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
**/package.json | ||
package.json | ||
package.json |
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.