From 00cc54f997abf81d2c23affa2176d6357d1a353c Mon Sep 17 00:00:00 2001 From: Mark McCulloh Date: Mon, 21 Aug 2023 10:25:24 -0400 Subject: [PATCH 01/10] init --- apps/vscode-wing/.projen/tasks.json | 2 +- apps/vscode-wing/.projenrc.ts | 4 +++- apps/vscode-wing/turbo.json | 2 +- libs/wingcompiler/package.json | 2 +- libs/wingcompiler/turbo.json | 2 +- package.json | 2 +- tools/hangar/turbo.json | 2 +- turbo.json | 34 ++++++++++++++++++++++++----- 8 files changed, 37 insertions(+), 13 deletions(-) diff --git a/apps/vscode-wing/.projen/tasks.json b/apps/vscode-wing/.projen/tasks.json index 3f734dbdf18..acba9e455ff 100644 --- a/apps/vscode-wing/.projen/tasks.json +++ b/apps/vscode-wing/.projen/tasks.json @@ -129,7 +129,7 @@ "exec": "pnpm version ${PROJEN_BUMP_VERSION:-0.0.0} --allow-same-version" }, { - "exec": "vsce package --no-dependencies -o vscode-wing.vsix" + "exec": "vsce package --no-dependencies -o ../../dist/vscode-wing.vsix" } ] }, diff --git a/apps/vscode-wing/.projenrc.ts b/apps/vscode-wing/.projenrc.ts index 881625f2ea3..153c2c3c3e8 100644 --- a/apps/vscode-wing/.projenrc.ts +++ b/apps/vscode-wing/.projenrc.ts @@ -237,7 +237,9 @@ project.watchTask.reset("tsup --watch"); project.packageTask.reset( "pnpm version ${PROJEN_BUMP_VERSION:-0.0.0} --allow-same-version" ); -project.packageTask.exec("vsce package --no-dependencies -o vscode-wing.vsix"); +project.packageTask.exec( + "vsce package --no-dependencies -o ../../dist/vscode-wing.vsix" +); project.addFields({ volta: { diff --git a/apps/vscode-wing/turbo.json b/apps/vscode-wing/turbo.json index 111f4fe2ca0..1dd1dd3b453 100644 --- a/apps/vscode-wing/turbo.json +++ b/apps/vscode-wing/turbo.json @@ -12,7 +12,7 @@ }, "package": { "inputs": ["syntaxes/**", "resources/**"], - "outputs": ["vscode-wing.vsix"] + "outputs": ["../../dist/vscode-wing.vsix"] } } } diff --git a/libs/wingcompiler/package.json b/libs/wingcompiler/package.json index 8ea275f9938..469da4c9287 100644 --- a/libs/wingcompiler/package.json +++ b/libs/wingcompiler/package.json @@ -17,7 +17,7 @@ "url": "git+https://github.com/winglang/wing.git" }, "scripts": { - "compile:copy-wingc-wasm": "cp ../../target/wasm32-wasi/release/wingc.wasm .", + "compile:copy-wingc-wasm": "cp ../../target/wasm32-wasi/release/wingc.wasm . && cp wingc.wasm ../../dist/wingc.wasm", "compile": "tsup-node", "watch": "tsup-node --watch", "test": "vitest run --passWithNoTests", diff --git a/libs/wingcompiler/turbo.json b/libs/wingcompiler/turbo.json index 6462c27523c..12f565675f4 100644 --- a/libs/wingcompiler/turbo.json +++ b/libs/wingcompiler/turbo.json @@ -4,7 +4,7 @@ "pipeline": { "compile:copy-wingc-wasm": { "dependsOn": ["^compile"], - "outputs": ["wingc.wasm"] + "outputs": ["wingc.wasm", "../../dist/wingc.wasm"] }, "compile": { "dependsOn": ["compile:copy-wingc-wasm"], diff --git a/package.json b/package.json index 87a67f463a9..ae8c658877a 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "compile": "turbo compile", "test": "turbo lint eslint test", "package": "turbo package", - "package:ci": "turbo package --color", + "package:ci": "turbo package --color && tar -czvf dist/docs.tgz docs/*", "test:ci": "turbo default --color --concurrency 1 && turbo compile post-compile lint eslint test test:playwright --color --filter=!hangar", "docs": "./scripts/docsite.sh", "changelog": "bump-pack", diff --git a/tools/hangar/turbo.json b/tools/hangar/turbo.json index 0e927ec36c4..75aa33465b1 100644 --- a/tools/hangar/turbo.json +++ b/tools/hangar/turbo.json @@ -19,7 +19,7 @@ }, "test": { "dependsOn": ["^package", "test:generate"], - "inputs": ["src/**", "../../examples/tests/**/*.w"] + "inputs": ["src/**"] }, "bench": { "dependsOn": ["^package", "examples-valid#topo"], diff --git a/turbo.json b/turbo.json index 590f63de4d3..33b90e050c1 100644 --- a/turbo.json +++ b/turbo.json @@ -1,6 +1,14 @@ { "$schema": "https://turborepo.org/schema.json", - "globalDependencies": ["*.json", "*.toml", ".node-version", "insta.yaml"], + "globalDependencies": [ + "*.json", + "*.toml", + ".node-version", + "insta.yaml", + ".github/workflows/build.yml", + "scripts/*", + "patches/*" + ], "pipeline": { "default": { "inputs": ["*.json", ".projenrc.ts"] @@ -15,7 +23,9 @@ "*.json", "*.toml", "*.lock", - "src/**" + "src/**/*.rs", + "!src/**/*.test.ts", + "src/**/*.ts" ] }, "test": { @@ -27,7 +37,9 @@ "*.json", "*.toml", "*.lock", - "src/**", + "src/**/*.rs", + "src/**/*.ts", + "src/**/*.test.ts", "test/**" ] }, @@ -45,6 +57,7 @@ ] }, "post-compile": { + "inputs": [""], "dependsOn": ["compile"] }, "lint": { @@ -55,7 +68,8 @@ "*.json", "*.toml", "*.lock", - "src/**", + "src/**/*.rs", + "src/**/*.ts", "test/**" ] }, @@ -67,13 +81,18 @@ "*.json", "*.toml", "*.lock", - "src/**", + "src/**/*.rs", + "src/**/*.ts", "test/**" ] }, "package": { "dependsOn": ["compile", "post-compile"], - "env": ["PROJEN_BUMP_VERSION"] + "env": ["PROJEN_BUMP_VERSION"], + "inputs": [""] + }, + "hangar": { + "dependsOn": ["hangar#test"] }, "topo": { "dependsOn": ["^topo"] @@ -85,6 +104,9 @@ "!examples/tests/valid/**/node_modules/**", "!examples/tests/valid/**/target/**" ] + }, + "test:generate": { + "dependsOn": ["topo"] } } } From 7c0947e919af322a12ba92d1bf59404fe7341cd8 Mon Sep 17 00:00:00 2001 From: Mark McCulloh Date: Mon, 21 Aug 2023 10:25:49 -0400 Subject: [PATCH 02/10] packaging change --- tools/hangar/src/package.setup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/hangar/src/package.setup.ts b/tools/hangar/src/package.setup.ts index a1b96b319fa..c2e17cd6360 100644 --- a/tools/hangar/src/package.setup.ts +++ b/tools/hangar/src/package.setup.ts @@ -22,7 +22,7 @@ const getInstallArgs = async () => { if (process.env.CI) { const tarballsDir = path.resolve(`${__dirname}/../../../dist`); const tarballs = (await fs.readdir(tarballsDir)) - .filter((filename) => filename.endsWith(".tgz")) + .filter((filename) => /^.+-\d+\.\d+\.\d+\.tgz$/.test(filename)) .map((tarball) => `file:${tarballsDir}/${tarball}`); return [ "install", From 1c95d69e4fc69d8beb9ae057ffca742a2107a8ba Mon Sep 17 00:00:00 2001 From: Mark McCulloh Date: Mon, 21 Aug 2023 10:52:22 -0400 Subject: [PATCH 03/10] fix workflow --- .github/workflows/build.yml | 74 ++++++++++++------------------------- 1 file changed, 23 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 272376e4abc..5e039093ea8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,16 +22,15 @@ env: RUST_VERSION: "1.67.1" NODE_VERSION: "18.16.0" PNPM_VERSION: "8.6.3" + CARGO_TERM_COLOR: always + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ vars.TURBO_TEAM }} jobs: build: name: "Build" timeout-minutes: 30 runs-on: ubuntu-latest - env: - CARGO_TERM_COLOR: always - TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} - TURBO_TEAM: ${{ vars.TURBO_TEAM }} outputs: version: ${{ fromJson(steps.changelog.outputs.data).newVersion }} last-version: ${{ fromJson(steps.changelog.outputs.data).lastVersion }} @@ -66,6 +65,9 @@ jobs: - name: Setup Cargo Cache uses: Swatinem/rust-cache@v2 + with: + # Don't save cache here, to avoid thrashing with test job + save-if: false - name: Install Dependencies run: pnpm install --frozen-lockfile @@ -81,18 +83,6 @@ jobs: env: SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }} - - name: Upload Artifacts - uses: actions/upload-artifact@v3 - with: - name: dist - path: dist/*.tgz - - - name: Upload WingC WASM - uses: actions/upload-artifact@v3 - with: - name: wingc - path: libs/wingcompiler/wingc.wasm - - name: Derive appropriate SHAs for base and head id: setSHAs uses: nrwl/nx-set-shas@v3 @@ -106,35 +96,19 @@ jobs: echo "diff=true" >> "$GITHUB_OUTPUT" fi - - name: Upload Extension - uses: actions/upload-artifact@v3 - with: - name: vscode-wing - path: apps/vscode-wing/vscode-wing.vsix - - - name: Compress Docs - run: tar -czvf docs.tgz docs/* - - - name: Upload Docs + - name: Upload Artifacts uses: actions/upload-artifact@v3 with: - name: docs - path: docs.tgz + name: dist + path: dist/* test: name: Test timeout-minutes: 30 runs-on: ubuntu-latest - env: - CARGO_TERM_COLOR: always - TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} - TURBO_TEAM: ${{ vars.TURBO_TEAM }} - steps: - name: Checkout uses: actions/checkout@v3 - with: - fetch-depth: 1 - name: Setup pnpm uses: pnpm/action-setup@v2.2.4 @@ -227,7 +201,7 @@ jobs: path: tools/hangar/results/report.json - name: Create Markdown report - run: node scripts/benchmark_json_to_table.mjs + run: scripts/benchmark_json_to_table.mjs e2e-test: name: "E2E / ${{ matrix.runner }} + Node${{ matrix.node }} [${{ matrix.shard }}]" @@ -254,8 +228,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - with: - fetch-depth: 1 - name: Setup pnpm uses: pnpm/action-setup@v2.2.4 @@ -349,6 +321,19 @@ jobs: repo-token: "${{ secrets.PROJEN_GITHUB_TOKEN }}" tag: "v${{ needs.build.outputs.version }}" + - name: Login to NPM registry + run: npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_PUBLISH_TOKEN }} + + - name: Publish npm packages + working-directory: dist + env: + PACKAGE_VERSION: ${{ needs.build.outputs.version }} + run: | + PACKAGES="winglang-sdk", "winglang-compiler", "wingconsole-design-system", "wingconsole-ui", "wingconsole-server", "wingconsole-app" + for PACKAGE in $PACKAGES; do + npm publish "$PACKAGE-$PACKAGE_VERSION.tgz" --access public + done + - name: Publish Extension to Visual Studio Marketplace if: needs.build.outputs.vscode-wing-changed == 'true' uses: "HaaLeo/publish-vscode-extension@v1" @@ -358,16 +343,6 @@ jobs: extensionFile: "vscode-wing/vscode-wing.vsix" dependencies: false - - name: Login to NPM registry - run: npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_PUBLISH_TOKEN }} - - - name: Publish npm packages - run: | - for file in *.tgz; do - npm publish "$file" --access public - done - working-directory: dist - - name: Write Changelog uses: DamianReeves/write-file-action@v1.2 with: @@ -377,9 +352,6 @@ jobs: - name: Compute Checksums run: | - mv ./docs/*.tgz ./dist - mv ./*/*.vsix ./dist - mv ./*/*.wasm ./dist mv ./benchmarks/* ./dist cd dist From 06e772bc19c1b8267514f2d169f27cdda27de07e Mon Sep 17 00:00:00 2001 From: Mark McCulloh Date: Mon, 21 Aug 2023 10:58:54 -0400 Subject: [PATCH 04/10] fix --- apps/jsii-docgen/{LICENSE.md => LICENSE} | 0 apps/wing-api-checker/.projenrc.ts | 4 ++-- .../LICENSE.md => wing-api-checker/LICENSE} | 0 apps/wing-api-checker/LICENSE.md | 19 ------------------- apps/wing-api-checker/package.json | 2 +- libs/wingsdk/LICENSE.md | 19 ------------------- 6 files changed, 3 insertions(+), 41 deletions(-) rename apps/jsii-docgen/{LICENSE.md => LICENSE} (100%) rename apps/{vscode-wing/LICENSE.md => wing-api-checker/LICENSE} (100%) delete mode 100644 apps/wing-api-checker/LICENSE.md delete mode 100644 libs/wingsdk/LICENSE.md diff --git a/apps/jsii-docgen/LICENSE.md b/apps/jsii-docgen/LICENSE similarity index 100% rename from apps/jsii-docgen/LICENSE.md rename to apps/jsii-docgen/LICENSE diff --git a/apps/wing-api-checker/.projenrc.ts b/apps/wing-api-checker/.projenrc.ts index 899a96c7905..3e0268cd960 100644 --- a/apps/wing-api-checker/.projenrc.ts +++ b/apps/wing-api-checker/.projenrc.ts @@ -8,8 +8,8 @@ const project = new typescript.TypeScriptProject({ "wing-api-check": "bin/wing-api-check", }, license: "MIT", - authorName: "Monada", - authorEmail: "ping@monada.co", + authorName: "Wing Cloud", + authorEmail: "ping@wing.cloud", authorOrganization: true, authorUrl: "https://wing.cloud", repository: "https://github.com/winglang/wing.git", diff --git a/apps/vscode-wing/LICENSE.md b/apps/wing-api-checker/LICENSE similarity index 100% rename from apps/vscode-wing/LICENSE.md rename to apps/wing-api-checker/LICENSE diff --git a/apps/wing-api-checker/LICENSE.md b/apps/wing-api-checker/LICENSE.md deleted file mode 100644 index 7265dc9aa7b..00000000000 --- a/apps/wing-api-checker/LICENSE.md +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2023 Wing Cloud, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/apps/wing-api-checker/package.json b/apps/wing-api-checker/package.json index db2ada7b39c..3920459a1b4 100644 --- a/apps/wing-api-checker/package.json +++ b/apps/wing-api-checker/package.json @@ -29,7 +29,7 @@ }, "author": { "name": "Wing Cloud", - "email": "ping@monada.co", + "email": "ping@wing.cloud", "url": "https://wing.cloud", "organization": true }, diff --git a/libs/wingsdk/LICENSE.md b/libs/wingsdk/LICENSE.md deleted file mode 100644 index 7265dc9aa7b..00000000000 --- a/libs/wingsdk/LICENSE.md +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2023 Wing Cloud, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. From 3e5bb6b9fb078128faf286c57a81ca780e6df85f Mon Sep 17 00:00:00 2001 From: Mark McCulloh Date: Mon, 21 Aug 2023 11:01:31 -0400 Subject: [PATCH 05/10] wrong vsix path --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e039093ea8..45d85dd2ad5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -340,7 +340,7 @@ jobs: with: pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} registryUrl: "https://marketplace.visualstudio.com" - extensionFile: "vscode-wing/vscode-wing.vsix" + extensionFile: "dist/vscode-wing.vsix" dependencies: false - name: Write Changelog From ef4541a37ba7200f2bf9eabcb9abdf57f7c39b54 Mon Sep 17 00:00:00 2001 From: Mark McCulloh Date: Mon, 21 Aug 2023 11:08:21 -0400 Subject: [PATCH 06/10] remove root hangar thing --- turbo.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/turbo.json b/turbo.json index 33b90e050c1..fd7e601c74d 100644 --- a/turbo.json +++ b/turbo.json @@ -91,9 +91,6 @@ "env": ["PROJEN_BUMP_VERSION"], "inputs": [""] }, - "hangar": { - "dependsOn": ["hangar#test"] - }, "topo": { "dependsOn": ["^topo"] }, From e2e899968d05637e88ae75124598ea1b5e61f928 Mon Sep 17 00:00:00 2001 From: Mark McCulloh Date: Mon, 21 Aug 2023 11:10:12 -0400 Subject: [PATCH 07/10] no need for root generate thing --- turbo.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/turbo.json b/turbo.json index fd7e601c74d..3b44dbfbd0f 100644 --- a/turbo.json +++ b/turbo.json @@ -101,9 +101,6 @@ "!examples/tests/valid/**/node_modules/**", "!examples/tests/valid/**/target/**" ] - }, - "test:generate": { - "dependsOn": ["topo"] } } } From 6308243b6d5fdefefdc4638df1c09a5dfde04d16 Mon Sep 17 00:00:00 2001 From: Mark McCulloh Date: Mon, 21 Aug 2023 11:10:48 -0400 Subject: [PATCH 08/10] wasn't doing anything --- turbo.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/turbo.json b/turbo.json index 3b44dbfbd0f..c3b9cb72e0f 100644 --- a/turbo.json +++ b/turbo.json @@ -93,14 +93,6 @@ }, "topo": { "dependsOn": ["^topo"] - }, - "examples-tests": { - "dependsOn": ["topo"], - "inputs": [ - "examples/tests/**", - "!examples/tests/valid/**/node_modules/**", - "!examples/tests/valid/**/target/**" - ] } } } From 753e49af74abc9ad447a4dc878ac7f892fae6984 Mon Sep 17 00:00:00 2001 From: Mark McCulloh Date: Mon, 21 Aug 2023 11:19:34 -0400 Subject: [PATCH 09/10] bad bash --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45d85dd2ad5..fba976ef276 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -329,7 +329,7 @@ jobs: env: PACKAGE_VERSION: ${{ needs.build.outputs.version }} run: | - PACKAGES="winglang-sdk", "winglang-compiler", "wingconsole-design-system", "wingconsole-ui", "wingconsole-server", "wingconsole-app" + PACKAGES=("winglang-sdk" "winglang-compiler" "wingconsole-design-system" "wingconsole-ui" "wingconsole-server" "wingconsole-app") for PACKAGE in $PACKAGES; do npm publish "$PACKAGE-$PACKAGE_VERSION.tgz" --access public done From 6bafe6b2a7e1baf1f6cd5351693a88c7c30697a1 Mon Sep 17 00:00:00 2001 From: Mark McCulloh Date: Tue, 22 Aug 2023 10:46:28 -0400 Subject: [PATCH 10/10] include snapshots as outputs --- turbo.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/turbo.json b/turbo.json index c3b9cb72e0f..29cb9ec5149 100644 --- a/turbo.json +++ b/turbo.json @@ -41,7 +41,8 @@ "src/**/*.ts", "src/**/*.test.ts", "test/**" - ] + ], + "outputs": ["**/__snapshots__/**", "**/*.snap"] }, "test:playwright": { "dependsOn": ["compile"],