From 0eb155fb50647ac28a330ae2814d221336627fa7 Mon Sep 17 00:00:00 2001 From: zemnmez Date: Fri, 5 Aug 2022 15:48:52 -0700 Subject: [PATCH 01/15] enable swc --- package.json | 5 +- ts/rules.bzl | 13 +++--- yarn.lock | 130 ++++++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 132 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 78da741129..8c776114e8 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,8 @@ "@pulumi/aws": "^4.0.0", "@pulumi/awsx": "^0.32.0", "@pulumi/pulumi": "^3.37.2", + "@swc/cli": "^0.1.57", + "@swc/core": "^1.2.223", "@testing-library/react": "^13.3.0", "@types/cross-spawn": "^6.0.2", "@types/d3-axis": "^3.0.1", @@ -89,6 +91,5 @@ "fix": "yarn run bazelisk run //:fix", "dev": "yarn run ibazel --run_output --run_output_interactive=false test //...", "pr": "gh pr create -f; gh pr merge -md --auto" - }, - "dependencies": {} + } } diff --git a/ts/rules.bzl b/ts/rules.bzl index 235fb33cfc..56ac6c1dc7 100644 --- a/ts/rules.bzl +++ b/ts/rules.bzl @@ -35,13 +35,12 @@ def ts_project(name, visibility = None, deps = [], ignores_lint = [], resolve_js srcs = srcs, tsconfig = tsconfig, # swc injects this - # uncomment these one day - #deps = deps + ["@npm//regenerator-runtime"], - #transpiler = partial.make( - # swc_transpiler, - # swcrc = "//:swcrc", - #), - deps = deps, + deps = deps + ["@npm//regenerator-runtime"], + transpiler = partial.make( + swc_transpiler, + swcrc = "//:swcrc", + source_maps = "true", + ), preserve_jsx = preserve_jsx, resolve_json_module = resolve_json_module, root_dir = root_dir, diff --git a/yarn.lock b/yarn.lock index 860f8e3e9c..4bb36b2c99 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1375,6 +1375,122 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@swc/cli@^0.1.57": + version "0.1.57" + resolved "https://registry.yarnpkg.com/@swc/cli/-/cli-0.1.57.tgz#a9c424de5a217ec20a4b7c2c0e5c343980537e83" + integrity sha512-HxM8TqYHhAg+zp7+RdTU69bnkl4MWdt1ygyp6BDIPjTiaJVH6Dizn2ezbgDS8mnFZI1FyhKvxU/bbaUs8XhzQg== + dependencies: + commander "^7.1.0" + fast-glob "^3.2.5" + slash "3.0.0" + source-map "^0.7.3" + +"@swc/core-android-arm-eabi@1.2.223": + version "1.2.223" + resolved "https://registry.yarnpkg.com/@swc/core-android-arm-eabi/-/core-android-arm-eabi-1.2.223.tgz#5d5ae572c90eb2e19f46c1ef56aab2e3fa7101fe" + integrity sha512-Hy/ya4oy80Ay70H9vhA8W0/FU9aQ/oQjvZ/on+wcNMATAiU9tk47i73LtPM01GruNiYJOwFcf2XWjlTpq5a0BQ== + dependencies: + "@swc/wasm" "1.2.122" + +"@swc/core-android-arm64@1.2.223": + version "1.2.223" + resolved "https://registry.yarnpkg.com/@swc/core-android-arm64/-/core-android-arm64-1.2.223.tgz#13c1751f9af36525adbb420098a4c74765afa7c4" + integrity sha512-qujrIXDBMWcPcdtTG/r+RNVBU5rg2Sk9Vg+U4FybX3c34rIyX2QYu5sxwM/HIGfd6wCbt5lyFZOvgSY000MTNw== + dependencies: + "@swc/wasm" "1.2.130" + +"@swc/core-darwin-arm64@1.2.223": + version "1.2.223" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.2.223.tgz#44ee2d1fbf9350c6aeda1983a384514272a9b2b7" + integrity sha512-CX32sRhAnFj3fJI6V4vdu5IUV5frEZNZM6hIPUs1UuVpxyuto9IZwd2y7/ACItB5RipA3VDL/c7jrFdSmfrgzg== + +"@swc/core-darwin-x64@1.2.223": + version "1.2.223" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.2.223.tgz#a157820e158d22c9b443821d15258bc58978e154" + integrity sha512-5FVQgWtqMmpOtky0JLTIF4a1WiAkuDOe5mwgzpi8nZ7nCxNo/DNThBbnIDlNhrR4M/1M6wzPshn1wNivvD7MQw== + +"@swc/core-freebsd-x64@1.2.223": + version "1.2.223" + resolved "https://registry.yarnpkg.com/@swc/core-freebsd-x64/-/core-freebsd-x64-1.2.223.tgz#ec9b300860f378aeb183084d89ba65009910d9f9" + integrity sha512-5oumS+YZyOMMKc5D3Bvf/541SF8n4b8LQ5x4WFA2CdAzD/jCgphE0IoAZ0u3bHz9S6Tl6Emu11V+/ALHE1oUew== + dependencies: + "@swc/wasm" "1.2.130" + +"@swc/core-linux-arm-gnueabihf@1.2.223": + version "1.2.223" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.2.223.tgz#3403de3c9402e1eeca68b1c134ea574739c7c49c" + integrity sha512-osYjVijq101xZjwPUKR6AUib1LZU9laaM3aEOyElAi8cHolsZEp8D9ynr7cSWFUZJuzpTlY7iuJeY3FszdWrJA== + dependencies: + "@swc/wasm" "1.2.130" + +"@swc/core-linux-arm64-gnu@1.2.223": + version "1.2.223" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.2.223.tgz#d0a2d5dd01c5744950e57ec59aa4696bbabf02e4" + integrity sha512-JZdPZIZzkJ6R+XB0lCnL0eD9VK/JfpZgKBqR3Gur9Fxs8Ea9p1HhZHSEAJ2T2YwV629dYjXwKqraOkLQrEMzCg== + +"@swc/core-linux-arm64-musl@1.2.223": + version "1.2.223" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.2.223.tgz#667bd6583f93909736600acdd9d5cc4c6141d577" + integrity sha512-9BVDH5Cq+VlAuJrshCgxWgziLEGzShZ2OVZ7SEA/+md1y69x2VdMR9lMSfD/EXqb6AJAaFODRe20Irtppeqr2Q== + +"@swc/core-linux-x64-gnu@1.2.223": + version "1.2.223" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.2.223.tgz#c29788110fe1aa7fb86332178dcd1606368fd2c2" + integrity sha512-Z+KAxSpUDNEPfjOKX/tZk67StvzIyAhTc5FPWoVhx5CBlkGQaDBRl1TNmb1wdne/WF9xVkx6wz22pvNevX5fig== + +"@swc/core-linux-x64-musl@1.2.223": + version "1.2.223" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.2.223.tgz#24b7001530d4e09d7bae58c704ac79a6593bb9c1" + integrity sha512-3EkAOA0KQdm7Rw/0L5odtDKAtmzhgF7FKTL+zZb+s0ju5oMwFGN+XIIwUQdPSf11Ej3ezjHjHTFTlv0xqutfuA== + +"@swc/core-win32-arm64-msvc@1.2.223": + version "1.2.223" + resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.2.223.tgz#8902c20d3d7ed2c9741ff0e227581d26ce8e0497" + integrity sha512-n8LWkej30hvfvazrJgwS6kwBZXMFCevLiRsZmP8O4hpC9b1wfAa+KLm4nHOR+J8jwF7LEjiERdU6tbIWZz0Tnw== + dependencies: + "@swc/wasm" "1.2.130" + +"@swc/core-win32-ia32-msvc@1.2.223": + version "1.2.223" + resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.2.223.tgz#591405f9fa07915e9d0b94a4174a5745621fe580" + integrity sha512-kEDGFFUC6xPqCom03QtR+76Ptwtf8RABI4FqRdvrvbasw9zj0xkuLSDCvqL72zdOZCWRciiFijQVHfndLByMAQ== + dependencies: + "@swc/wasm" "1.2.130" + +"@swc/core-win32-x64-msvc@1.2.223": + version "1.2.223" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.223.tgz#7a4549cedb7c0e7a3d4861c2b5230224194e0f04" + integrity sha512-nzL8rwzMFA9cBK2s+QBMPcNnoGSPMfgY9ypRw/nTp0hQDgdLOXHy9moGFJg8dbdQD39kC5s8yQ0BmyKvePILgg== + +"@swc/core@^1.2.223": + version "1.2.223" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.2.223.tgz#e44a3f6971a1f5c22d1037cf60510ef32c93d2a5" + integrity sha512-LcKX1frJ1iJDSYlY9Bg0vm0rYsXloITh6PdEYM5amT73J9mC1c2YpWLnWQiH2QpcyblyMhX1pk1eZ2JZjaynrQ== + optionalDependencies: + "@swc/core-android-arm-eabi" "1.2.223" + "@swc/core-android-arm64" "1.2.223" + "@swc/core-darwin-arm64" "1.2.223" + "@swc/core-darwin-x64" "1.2.223" + "@swc/core-freebsd-x64" "1.2.223" + "@swc/core-linux-arm-gnueabihf" "1.2.223" + "@swc/core-linux-arm64-gnu" "1.2.223" + "@swc/core-linux-arm64-musl" "1.2.223" + "@swc/core-linux-x64-gnu" "1.2.223" + "@swc/core-linux-x64-musl" "1.2.223" + "@swc/core-win32-arm64-msvc" "1.2.223" + "@swc/core-win32-ia32-msvc" "1.2.223" + "@swc/core-win32-x64-msvc" "1.2.223" + +"@swc/wasm@1.2.122": + version "1.2.122" + resolved "https://registry.yarnpkg.com/@swc/wasm/-/wasm-1.2.122.tgz#87a5e654b26a71b2e84b801f41e45f823b856639" + integrity sha512-sM1VCWQxmNhFtdxME+8UXNyPNhxNu7zdb6ikWpz0YKAQQFRGT5ThZgJrubEpah335SUToNg8pkdDF7ibVCjxbQ== + +"@swc/wasm@1.2.130": + version "1.2.130" + resolved "https://registry.yarnpkg.com/@swc/wasm/-/wasm-1.2.130.tgz#88ac26433335d1f957162a9a92f1450b73c176a0" + integrity sha512-rNcJsBxS70+pv8YUWwf5fRlWX6JoY/HJc25HD/F8m6Kv7XhJdqPPMhyX6TKkUBPAG7TWlZYoxa+rHAjPy4Cj3Q== + "@testing-library/dom@^8.5.0": version "8.13.0" resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.13.0.tgz#bc00bdd64c7d8b40841e27a70211399ad3af46f5" @@ -2357,7 +2473,7 @@ commander@^2.20.3: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^7.2.0: +commander@^7.1.0, commander@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== @@ -3402,7 +3518,7 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== -fast-glob@^3.2.11, fast-glob@^3.2.9: +fast-glob@^3.2.11, fast-glob@^3.2.5, fast-glob@^3.2.9: version "3.2.11" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== @@ -6428,16 +6544,16 @@ sisteransi@^1.0.5: resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== +slash@3.0.0, slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - slice-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" From 5a426e63a3b4b73c6a9b8030e966ccf0136fe585 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 01:35:30 +0000 Subject: [PATCH 02/15] Bump postcss from 8.4.14 to 8.4.16 Bumps [postcss](https://github.com/postcss/postcss) from 8.4.14 to 8.4.16. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.14...8.4.16) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index af2d061145..e9a6afa07b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5868,9 +5868,9 @@ postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== postcss@^8.4.12, postcss@^8.4.14: - version "8.4.14" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" - integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== + version "8.4.16" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.16.tgz#33a1d675fac39941f5f445db0de4db2b6e01d43c" + integrity sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ== dependencies: nanoid "^3.3.4" picocolors "^1.0.0" From ce9c6ce912a6c6631254c5b8cbd4b9cc767aec8d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 01:50:26 +0000 Subject: [PATCH 03/15] Bump actions/cache from 3.0.5 to 3.0.6 Bumps [actions/cache](https://github.com/actions/cache) from 3.0.5 to 3.0.6. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3.0.5...v3.0.6) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 4 ++-- .github/workflows/versioning.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02d59cac58..e990b2d7ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: with: node-version: '16' - name: Restore bazel cache - uses: actions/cache@v3.0.5 + uses: actions/cache@v3.0.6 env: cache-name: bazel-cache with: @@ -79,7 +79,7 @@ jobs: registry-url: 'https://registry.npmjs.org' node-version: '16' - name: Restore bazel cache - uses: actions/cache@v3.0.5 + uses: actions/cache@v3.0.6 env: cache-name: bazel-cache with: diff --git a/.github/workflows/versioning.yml b/.github/workflows/versioning.yml index 466dfe71f1..662b39a5be 100644 --- a/.github/workflows/versioning.yml +++ b/.github/workflows/versioning.yml @@ -24,7 +24,7 @@ jobs: with: node-version: '16' - name: Restore bazel cache - uses: actions/cache@v3.0.5 + uses: actions/cache@v3.0.6 env: cache-name: bazel-cache with: @@ -45,7 +45,7 @@ jobs: # Needed to allow an action to trigger another action. token: ${{ secrets.GH_PAT }} - name: Restore bazel cache - uses: actions/cache@v3.0.5 + uses: actions/cache@v3.0.6 env: cache-name: bazel-cache with: From 09df57a91ee85ac19686a495314343e83410858d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 02:03:10 +0000 Subject: [PATCH 04/15] Bump portfinder from 1.0.28 to 1.0.29 Bumps [portfinder](https://github.com/http-party/node-portfinder) from 1.0.28 to 1.0.29. - [Release notes](https://github.com/http-party/node-portfinder/releases) - [Commits](https://github.com/http-party/node-portfinder/compare/v1.0.28...v1.0.29) --- updated-dependencies: - dependency-name: portfinder dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index e9a6afa07b..8da920e8b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1979,7 +1979,7 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -async@^2.6.2: +async@^2.6.4: version "2.6.4" resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== @@ -2624,7 +2624,7 @@ debug@^2.6.9: dependencies: ms "2.0.0" -debug@^3.1.1, debug@^3.2.7: +debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== @@ -5303,7 +5303,7 @@ mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== -mkdirp@^0.5.1, mkdirp@^0.5.5: +mkdirp@^0.5.1, mkdirp@^0.5.6: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== @@ -5789,13 +5789,13 @@ pkg-dir@4.2.0, pkg-dir@^4.2.0: find-up "^4.0.0" portfinder@^1.0.28: - version "1.0.28" - resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778" - integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA== + version "1.0.29" + resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.29.tgz#d06ff886f4ff91274ed3e25c7e6b0c68d2a0735a" + integrity sha512-Z5+DarHWCKlufshB9Z1pN95oLtANoY5Wn9X3JGELGyQ6VhEcBfT2t+1fGUBq7MwUant6g/mqowH+4HifByPbiQ== dependencies: - async "^2.6.2" - debug "^3.1.1" - mkdirp "^0.5.5" + async "^2.6.4" + debug "^3.2.7" + mkdirp "^0.5.6" postcss-media-query-parser@^0.2.3: version "0.2.3" From 2526f4c81574adbb14c9fd1c13c499c4223f234f Mon Sep 17 00:00:00 2001 From: zemnmez Date: Sun, 7 Aug 2022 19:11:52 -0700 Subject: [PATCH 05/15] almost get it working --- .swcrc => .swcrc.json | 12 ++++-------- BUILD.bazel | 3 +-- js/npm/package_json/BUILD | 1 + js/npm/package_json/gen_pkgjson.ts | 14 ++++++++------ package.json | 1 + ts/cmd/svgshot/BUILD | 2 +- ts/do-sync/testing/BUILD | 3 +-- ts/json.ts | 7 +++++++ tsconfig.json | 6 +++++- yarn.lock | 5 +++++ 10 files changed, 34 insertions(+), 20 deletions(-) rename .swcrc => .swcrc.json (67%) create mode 100644 ts/json.ts diff --git a/.swcrc b/.swcrc.json similarity index 67% rename from .swcrc rename to .swcrc.json index d75356216d..35a822260c 100644 --- a/.swcrc +++ b/.swcrc.json @@ -1,15 +1,11 @@ { + "$schema": "https://json.schemastore.org/swcrc.json", "jsc": { + "target": "es2022", "parser": { + "tsx": true, "syntax": "typescript", - "jsx": true, - "numericSeparator": false, - "classPrivateProperty": false, - "privateMethod": false, - "classProperty": false, - "functionBind": false, - "decorators": false, - "decoratorsBeforeExport": false + "decorators": false }, "transform": { "react": { diff --git a/BUILD.bazel b/BUILD.bazel index 53a0b36157..c9da1e49a3 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -42,7 +42,6 @@ exports_files( ".eslintrc.json", "css_loader.d.ts", "yarn.lock", - ".swcrc", ], visibility = ["//visibility:public"], ) @@ -57,5 +56,5 @@ esbuild_config( copy_to_bin( name = "swcrc", - srcs = [".swcrc"], + srcs = [".swcrc.json"], ) diff --git a/js/npm/package_json/BUILD b/js/npm/package_json/BUILD index 19db65049c..53a18513ee 100644 --- a/js/npm/package_json/BUILD +++ b/js/npm/package_json/BUILD @@ -9,6 +9,7 @@ ts_project( deps = [ "@npm//@bazel/runfiles", "@npm//@types/node", + "@npm//@schemastore/package", "@npm//commander", ], ) diff --git a/js/npm/package_json/gen_pkgjson.ts b/js/npm/package_json/gen_pkgjson.ts index 74bed19cc6..389c219a63 100644 --- a/js/npm/package_json/gen_pkgjson.ts +++ b/js/npm/package_json/gen_pkgjson.ts @@ -1,11 +1,14 @@ import fs from 'fs/promises'; import { Command } from 'commander'; +import { JSONSchemaForNPMPackageJsonFiles as packageJson } from '@schemastore/package'; + const depTypes = { skip: (v: string) => v === '@bazel/runfiles', isDev: (v: string) => v.startsWith('@types'), }; + const labelToNpmPackage = (label: string): string => { /* Eventually, I should actually test this, @@ -65,14 +68,13 @@ const main = async () => { ); const pkg_json_buf = await fs.readFile(opts.base); - const pkg_json: { - devDependencies: Record; - dependencies: Record; - } = JSON.parse(pkg_json_buf.toString()); + + // this could be less strict, but it resulted in crashes + const pkg_json: packageJson = JSON.parse(pkg_json_buf.toString()); const all_deps = new Map([ - ...Object.entries(pkg_json.dependencies), - ...Object.entries(pkg_json.devDependencies), + ...Object.entries(pkg_json.dependencies ?? []), + ...Object.entries(pkg_json.devDependencies ?? []), ]); const our_deps = [...all_deps] diff --git a/package.json b/package.json index 8c776114e8..467226c35f 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "@pulumi/aws": "^4.0.0", "@pulumi/awsx": "^0.32.0", "@pulumi/pulumi": "^3.37.2", + "@schemastore/package": "^0.0.6", "@swc/cli": "^0.1.57", "@swc/core": "^1.2.223", "@testing-library/react": "^13.3.0", diff --git a/ts/cmd/svgshot/BUILD b/ts/cmd/svgshot/BUILD index b6b3fc0fb9..2b64ed17db 100644 --- a/ts/cmd/svgshot/BUILD +++ b/ts/cmd/svgshot/BUILD @@ -13,7 +13,7 @@ ts_project( srcs = [ "index.ts", "lib.ts", - "run.ts" + "run.ts", ], deps = [ "@npm//@types/node", diff --git a/ts/do-sync/testing/BUILD b/ts/do-sync/testing/BUILD index 49a68fd2a2..a43a7d0972 100644 --- a/ts/do-sync/testing/BUILD +++ b/ts/do-sync/testing/BUILD @@ -10,14 +10,13 @@ ts_project( name = "project", srcs = glob(["**/*.ts"]), deps = [ + "//ts/do-sync", "@npm//@types/jest", "@npm//@types/sharp", "@npm//sharp", - "//ts/do-sync" ], ) - jest_test( name = "tests", srcs = ["doSync_test.js"], diff --git a/ts/json.ts b/ts/json.ts new file mode 100644 index 0000000000..46e8b012ed --- /dev/null +++ b/ts/json.ts @@ -0,0 +1,7 @@ +export type Primitive = string | number | boolean | null | undefined; + +export type Value = Object | Array | Primitive; + +export interface Object extends Record {} + +export type Array = Value[]; diff --git a/tsconfig.json b/tsconfig.json index 16a7496c3e..e20d35b3bc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,7 +23,11 @@ "baseUrl": "./", "rootDirs": ["bazel-out/k8-fastbuild/bin"], "paths": { - "monorepo/*": ["./monorepo/*", "bazel-out/k8-fastbuild/bin/monorepo/*"] + "monorepo/*": [ + "./*", + "./monorepo/*", + "bazel-out/k8-fastbuild/bin/monorepo/*" + ] } }, "exclude": ["node_modules", "dist", "external"] diff --git a/yarn.lock b/yarn.lock index 4bb36b2c99..292ac4e2ba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1356,6 +1356,11 @@ colors "~1.2.1" string-argv "~0.3.1" +"@schemastore/package@^0.0.6": + version "0.0.6" + resolved "https://registry.yarnpkg.com/@schemastore/package/-/package-0.0.6.tgz#9a76713da1c7551293b7e72e4f387f802bfd5d81" + integrity sha512-uNloNHoyHttSSdeuEkkSC+mdxJXMKlcUPOMb//qhQbIQijXg8x54VmAw3jm6GJZQ5DBtIqGBd66zEQCDCChQVA== + "@sinclair/typebox@^0.23.3": version "0.23.5" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.23.5.tgz#93f7b9f4e3285a7a9ade7557d9a8d36809cbc47d" From 604469c98266b280b4ce5574fe4e865a530ed111 Mon Sep 17 00:00:00 2001 From: zemnmez Date: Sun, 7 Aug 2022 19:13:04 -0700 Subject: [PATCH 06/15] upgrade bazel --- .bazelversion | 2 +- WORKSPACE | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.bazelversion b/.bazelversion index 16729bcb0f..4a53118fb3 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1,2 +1,2 @@ -5.0.0-pre.20210913.1 +6.0.0-pre.20220720.3 diff --git a/WORKSPACE b/WORKSPACE index c0505e2c56..f8d46143e3 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -11,9 +11,6 @@ bind( workspace( # How this workspace would be referenced with absolute labels from another workspace name = "monorepo", - # Map the @npm bazel workspace to the node_modules directory. - # This lets Bazel use the same node_modules as other local tooling. - managed_directories = {"@npm": ["node_modules"]}, ) load("//bzl:deps.bzl", "fetch_dependencies") From 65b067ef275383b86d448538b607fee3c5332060 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 02:15:29 +0000 Subject: [PATCH 07/15] Bump object.assign from 4.1.2 to 4.1.3 Bumps [object.assign](https://github.com/ljharb/object.assign) from 4.1.2 to 4.1.3. - [Release notes](https://github.com/ljharb/object.assign/releases) - [Changelog](https://github.com/ljharb/object.assign/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/object.assign/compare/v4.1.2...v4.1.3) --- updated-dependencies: - dependency-name: object.assign dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8da920e8b0..71dd456e32 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3867,7 +3867,7 @@ has-property-descriptors@^1.0.0: dependencies: get-intrinsic "^1.1.1" -has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: +has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== @@ -5452,13 +5452,13 @@ object-keys@^1.1.1: integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== object.assign@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" - integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== + version "4.1.3" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.3.tgz#d36b7700ddf0019abb6b1df1bb13f6445f79051f" + integrity sha512-ZFJnX3zltyjcYJL0RoCJuzb+11zWGyaDbjgxZbdV7rFEcHQuYxrZqhow67aA7xpes6LhojyFDaBKAFfogQrikA== dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - has-symbols "^1.0.1" + call-bind "^1.0.2" + define-properties "^1.1.4" + has-symbols "^1.0.3" object-keys "^1.1.1" object.defaults@^1.1.0: From 1e1122b6d542dd7e29a9c7c587804bdf610932d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 02:28:17 +0000 Subject: [PATCH 08/15] Bump setuptools from 63.4.1 to 63.4.2 Bumps [setuptools](https://github.com/pypa/setuptools) from 63.4.1 to 63.4.2. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/CHANGES.rst) - [Commits](https://github.com/pypa/setuptools/compare/v63.4.1...v63.4.2) --- updated-dependencies: - dependency-name: setuptools dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d09058d55b..e17e3c1a38 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,5 +12,5 @@ yamllint==1.27.1 # via -r requirements.in # The following packages are considered to be unsafe in a requirements file: -setuptools==63.4.1 +setuptools==63.4.2 # via yamllint From 457db8a830d62921e368f09dc6cb03b735822bee Mon Sep 17 00:00:00 2001 From: zemnmez Date: Sun, 7 Aug 2022 19:35:13 -0700 Subject: [PATCH 09/15] it finally works. --- js/npm/rules.bzl | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/js/npm/rules.bzl b/js/npm/rules.bzl index f6f117361b..2fbb548132 100644 --- a/js/npm/rules.bzl +++ b/js/npm/rules.bzl @@ -5,6 +5,20 @@ load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm") load("//js/api-extractor:rules.bzl", "api_extractor") load("//js/npm/package_json:rules.bzl", "package_json") +def _exclude_all_external_rule(ctx): + + return DefaultInfo(files = depset([ + file for file in ctx.files.srcs + if file.owner.workspace_name == "monorepo" + ])) + +exclude_all_external_rule = rule( + implementation = _exclude_all_external_rule, + attrs = { + "srcs": attr.label_list(allow_files = True) + } +) + def npm_pkg( name, package_name, @@ -76,11 +90,16 @@ def npm_pkg( visibility = visibility, ) + exclude_all_external_rule( + name = "version_lock_files", + srcs = pkg_srcs + pkg_deps, + ) + # Test that ensures at least a minor bump happens when # a change in files occurs. bump_on_change_test( name = "version_lock", - srcs = pkg_srcs + pkg_deps, + srcs = [ ":version_lock_files" ], version = minor_version, run_on_main = test_version_on_main, version_lock = version_lock, From c22877f51cc538399a77c2251dfc53e07efcad3b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 02:42:24 +0000 Subject: [PATCH 10/15] Bump puppeteer from 16.0.0 to 16.1.0 Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 16.0.0 to 16.1.0. - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md) - [Commits](https://github.com/puppeteer/puppeteer/compare/v16.0.0...v16.1.0) --- updated-dependencies: - dependency-name: puppeteer dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9df76cad53..34b65fa067 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "module-alias": "^2.2.2", "patch-package": "^6.4.7", "prettier": "^2.7.1", - "puppeteer": "^16.0.0", + "puppeteer": "^16.1.0", "react": "18.2.0", "react-dom": "^18.2.0", "react-router": "^6.3.0", diff --git a/yarn.lock b/yarn.lock index 71dd456e32..bf7f640c56 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5985,10 +5985,10 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -puppeteer@^16.0.0: - version "16.0.0" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-16.0.0.tgz#9efb6cdb57e3e51cf060a33f6289e88200dd4672" - integrity sha512-FgSe21IHNHkqv1SiJiob4ANsxVujcINa4p3MaDEMyoZsocbgSgwYE0c9lnF8eoinw4id3vx4DOXwhFdOOwVlDg== +puppeteer@^16.1.0: + version "16.1.0" + resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-16.1.0.tgz#06a32dc347c94642601017fbf83e1d37379b9651" + integrity sha512-lhykJLbH2bbBaP3NfYI2Vj0T4ctrdfVdEVf8glZITPnLfqrJ0nfUzAYuIz5YcA79k5lmFKANIhEXex+jQChU3g== dependencies: cross-fetch "3.1.5" debug "4.3.4" From c1e0c9cd2f19598c354e4bd6eea6290a59013b1e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 02:57:02 +0000 Subject: [PATCH 11/15] Bump @types/sharp from 0.30.4 to 0.30.5 Bumps [@types/sharp](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sharp) from 0.30.4 to 0.30.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sharp) --- updated-dependencies: - dependency-name: "@types/sharp" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 34b65fa067..35902e968f 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@types/node": "^18.6.4", "@types/react": "18.0.15", "@types/react-dom": "^18.0.6", - "@types/sharp": "^0.30.4", + "@types/sharp": "^0.30.5", "@types/svgo": "^2.6.3", "@types/tmp": "^0.2.3", "@types/uuid": "^8.3.4", diff --git a/yarn.lock b/yarn.lock index bf7f640c56..66e41efc14 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1630,10 +1630,10 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== -"@types/sharp@^0.30.4": - version "0.30.4" - resolved "https://registry.yarnpkg.com/@types/sharp/-/sharp-0.30.4.tgz#7430b5fcf37f35dd860112c4cf6dcd6a1ba0011b" - integrity sha512-6oJEzKt7wZeS7e+6x9QFEOWGs0T/6of00+0onZGN1zSmcSjcTDZKgIGZ6YWJnHowpaKUCFBPH52mYljWqU32Eg== +"@types/sharp@^0.30.5": + version "0.30.5" + resolved "https://registry.yarnpkg.com/@types/sharp/-/sharp-0.30.5.tgz#d75d91f7acf5260525aeae229845046dcff6d17a" + integrity sha512-EhO29617AIBqxoVtpd1qdBanWpspk/kD2B6qTFRJ31Q23Rdf+DNU1xlHSwtqvwq1vgOqBwq1i38SX+HGCymIQg== dependencies: "@types/node" "*" From bbc0b343992d89feb67b952f7ab06ada0ec2b3de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 03:12:37 +0000 Subject: [PATCH 12/15] Bump @types/react from 18.0.15 to 18.0.16 Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.0.15 to 18.0.16. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) --- updated-dependencies: - dependency-name: "@types/react" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 35902e968f..4dc83ddfa6 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "@types/jest": "^28.1.6", "@types/mime": "^3.0.1", "@types/node": "^18.6.4", - "@types/react": "18.0.15", + "@types/react": "18.0.16", "@types/react-dom": "^18.0.6", "@types/sharp": "^0.30.5", "@types/svgo": "^2.6.3", diff --git a/yarn.lock b/yarn.lock index 66e41efc14..f976edd3f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1616,10 +1616,10 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@18.0.15": - version "18.0.15" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" - integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow== +"@types/react@*", "@types/react@18.0.16": + version "18.0.16" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.16.tgz#8de9bf7feebfa520777e8d30815070b39cb663c0" + integrity sha512-3vX1dzVucqc2nhXtzyaParTIIRZeNbisRqLE7QdeLomVybEyeiuAouzZXgz71P+2kbJOqj3dy0fzoATg2I06GQ== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" From d83109a4be7fb59dc91aa428a8c06901a74dd8fc Mon Sep 17 00:00:00 2001 From: zemnmez Date: Sun, 7 Aug 2022 20:12:37 -0700 Subject: [PATCH 13/15] fix some stuff that broke --- js/npm/package_json/BUILD | 2 +- js/npm/package_json/gen_pkgjson.ts | 4 +--- js/npm/rules.bzl | 10 +++++----- ts/json.ts | 7 ------- ts/math/vec.ts | 9 +++------ tsconfig.json | 5 ++++- 6 files changed, 14 insertions(+), 23 deletions(-) delete mode 100644 ts/json.ts diff --git a/js/npm/package_json/BUILD b/js/npm/package_json/BUILD index 53a18513ee..7babe5b959 100644 --- a/js/npm/package_json/BUILD +++ b/js/npm/package_json/BUILD @@ -8,8 +8,8 @@ ts_project( visibility = ["//:__subpackages__"], deps = [ "@npm//@bazel/runfiles", - "@npm//@types/node", "@npm//@schemastore/package", + "@npm//@types/node", "@npm//commander", ], ) diff --git a/js/npm/package_json/gen_pkgjson.ts b/js/npm/package_json/gen_pkgjson.ts index 389c219a63..933c8bdfa9 100644 --- a/js/npm/package_json/gen_pkgjson.ts +++ b/js/npm/package_json/gen_pkgjson.ts @@ -2,13 +2,11 @@ import fs from 'fs/promises'; import { Command } from 'commander'; import { JSONSchemaForNPMPackageJsonFiles as packageJson } from '@schemastore/package'; - const depTypes = { skip: (v: string) => v === '@bazel/runfiles', isDev: (v: string) => v.startsWith('@types'), }; - const labelToNpmPackage = (label: string): string => { /* Eventually, I should actually test this, @@ -68,7 +66,7 @@ const main = async () => { ); const pkg_json_buf = await fs.readFile(opts.base); - + // this could be less strict, but it resulted in crashes const pkg_json: packageJson = JSON.parse(pkg_json_buf.toString()); diff --git a/js/npm/rules.bzl b/js/npm/rules.bzl index ba6158636d..1584d74412 100644 --- a/js/npm/rules.bzl +++ b/js/npm/rules.bzl @@ -7,17 +7,17 @@ load("//js/api-extractor:rules.bzl", "api_extractor") load("//js/npm/package_json:rules.bzl", "package_json") def _exclude_all_external_rule(ctx): - return DefaultInfo(files = depset([ - file for file in ctx.files.srcs + file + for file in ctx.files.srcs if file.owner.workspace_name == "monorepo" ])) exclude_all_external_rule = rule( implementation = _exclude_all_external_rule, attrs = { - "srcs": attr.label_list(allow_files = True) - } + "srcs": attr.label_list(allow_files = True), + }, ) def npm_pkg( @@ -107,7 +107,7 @@ def npm_pkg( # a change in files occurs. bump_on_change_test( name = "version_lock", - srcs = [ ":version_lock_files" ], + srcs = [":version_lock_files"], version = minor_version, run_on_main = test_version_on_main, version_lock = version_lock, diff --git a/ts/json.ts b/ts/json.ts deleted file mode 100644 index 46e8b012ed..0000000000 --- a/ts/json.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type Primitive = string | number | boolean | null | undefined; - -export type Value = Object | Array | Primitive; - -export interface Object extends Record {} - -export type Array = Value[]; diff --git a/ts/math/vec.ts b/ts/math/vec.ts index 116b1b4c9e..02da93ffd9 100644 --- a/ts/math/vec.ts +++ b/ts/math/vec.ts @@ -7,19 +7,16 @@ export interface Vector length: I; } -type mapFn = ( - callbackFn: (value: T, index: number, array: Vector) => U, - thisArg?: unknown -) => Vector; - /** * Map a Vector, returning a new Vector. */ export const map: ( vec: Vector, callbackFn: (value: T, index: number, array: Vector) => U +) => Vector = (vec, c) => { /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ -) => Vector = (vec, c) => (vec.map as mapFn)(c); + return vec.map(c as any) as any; +}; /** * Map an Iterable, returning a new Iterable. diff --git a/tsconfig.json b/tsconfig.json index d46251542b..e20d35b3bc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -24,7 +24,10 @@ "rootDirs": ["bazel-out/k8-fastbuild/bin"], "paths": { "monorepo/*": [ - "./*", "./monorepo/*", "bazel-out/k8-fastbuild/bin/monorepo/*"] + "./*", + "./monorepo/*", + "bazel-out/k8-fastbuild/bin/monorepo/*" + ] } }, "exclude": ["node_modules", "dist", "external"] From 84f178afaa5ab1983a86005ab3165f7cc6652a9d Mon Sep 17 00:00:00 2001 From: zemnmez Date: Sun, 7 Aug 2022 20:32:20 -0700 Subject: [PATCH 14/15] remove unneeded deps --- package.json | 1 - yarn.lock | 106 --------------------------------------------------- 2 files changed, 107 deletions(-) diff --git a/package.json b/package.json index c0a24a99d8..0fd1ce17ce 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ "@pulumi/pulumi": "^3.37.2", "@schemastore/package": "^0.0.6", "@swc/cli": "^0.1.57", - "@swc/core": "^1.2.223", "@testing-library/react": "^13.3.0", "@types/cross-spawn": "^6.0.2", "@types/d3-axis": "^3.0.1", diff --git a/yarn.lock b/yarn.lock index 45d1946fb7..2183904866 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1403,112 +1403,6 @@ slash "3.0.0" source-map "^0.7.3" -"@swc/core-android-arm-eabi@1.2.223": - version "1.2.223" - resolved "https://registry.yarnpkg.com/@swc/core-android-arm-eabi/-/core-android-arm-eabi-1.2.223.tgz#5d5ae572c90eb2e19f46c1ef56aab2e3fa7101fe" - integrity sha512-Hy/ya4oy80Ay70H9vhA8W0/FU9aQ/oQjvZ/on+wcNMATAiU9tk47i73LtPM01GruNiYJOwFcf2XWjlTpq5a0BQ== - dependencies: - "@swc/wasm" "1.2.122" - -"@swc/core-android-arm64@1.2.223": - version "1.2.223" - resolved "https://registry.yarnpkg.com/@swc/core-android-arm64/-/core-android-arm64-1.2.223.tgz#13c1751f9af36525adbb420098a4c74765afa7c4" - integrity sha512-qujrIXDBMWcPcdtTG/r+RNVBU5rg2Sk9Vg+U4FybX3c34rIyX2QYu5sxwM/HIGfd6wCbt5lyFZOvgSY000MTNw== - dependencies: - "@swc/wasm" "1.2.130" - -"@swc/core-darwin-arm64@1.2.223": - version "1.2.223" - resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.2.223.tgz#44ee2d1fbf9350c6aeda1983a384514272a9b2b7" - integrity sha512-CX32sRhAnFj3fJI6V4vdu5IUV5frEZNZM6hIPUs1UuVpxyuto9IZwd2y7/ACItB5RipA3VDL/c7jrFdSmfrgzg== - -"@swc/core-darwin-x64@1.2.223": - version "1.2.223" - resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.2.223.tgz#a157820e158d22c9b443821d15258bc58978e154" - integrity sha512-5FVQgWtqMmpOtky0JLTIF4a1WiAkuDOe5mwgzpi8nZ7nCxNo/DNThBbnIDlNhrR4M/1M6wzPshn1wNivvD7MQw== - -"@swc/core-freebsd-x64@1.2.223": - version "1.2.223" - resolved "https://registry.yarnpkg.com/@swc/core-freebsd-x64/-/core-freebsd-x64-1.2.223.tgz#ec9b300860f378aeb183084d89ba65009910d9f9" - integrity sha512-5oumS+YZyOMMKc5D3Bvf/541SF8n4b8LQ5x4WFA2CdAzD/jCgphE0IoAZ0u3bHz9S6Tl6Emu11V+/ALHE1oUew== - dependencies: - "@swc/wasm" "1.2.130" - -"@swc/core-linux-arm-gnueabihf@1.2.223": - version "1.2.223" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.2.223.tgz#3403de3c9402e1eeca68b1c134ea574739c7c49c" - integrity sha512-osYjVijq101xZjwPUKR6AUib1LZU9laaM3aEOyElAi8cHolsZEp8D9ynr7cSWFUZJuzpTlY7iuJeY3FszdWrJA== - dependencies: - "@swc/wasm" "1.2.130" - -"@swc/core-linux-arm64-gnu@1.2.223": - version "1.2.223" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.2.223.tgz#d0a2d5dd01c5744950e57ec59aa4696bbabf02e4" - integrity sha512-JZdPZIZzkJ6R+XB0lCnL0eD9VK/JfpZgKBqR3Gur9Fxs8Ea9p1HhZHSEAJ2T2YwV629dYjXwKqraOkLQrEMzCg== - -"@swc/core-linux-arm64-musl@1.2.223": - version "1.2.223" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.2.223.tgz#667bd6583f93909736600acdd9d5cc4c6141d577" - integrity sha512-9BVDH5Cq+VlAuJrshCgxWgziLEGzShZ2OVZ7SEA/+md1y69x2VdMR9lMSfD/EXqb6AJAaFODRe20Irtppeqr2Q== - -"@swc/core-linux-x64-gnu@1.2.223": - version "1.2.223" - resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.2.223.tgz#c29788110fe1aa7fb86332178dcd1606368fd2c2" - integrity sha512-Z+KAxSpUDNEPfjOKX/tZk67StvzIyAhTc5FPWoVhx5CBlkGQaDBRl1TNmb1wdne/WF9xVkx6wz22pvNevX5fig== - -"@swc/core-linux-x64-musl@1.2.223": - version "1.2.223" - resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.2.223.tgz#24b7001530d4e09d7bae58c704ac79a6593bb9c1" - integrity sha512-3EkAOA0KQdm7Rw/0L5odtDKAtmzhgF7FKTL+zZb+s0ju5oMwFGN+XIIwUQdPSf11Ej3ezjHjHTFTlv0xqutfuA== - -"@swc/core-win32-arm64-msvc@1.2.223": - version "1.2.223" - resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.2.223.tgz#8902c20d3d7ed2c9741ff0e227581d26ce8e0497" - integrity sha512-n8LWkej30hvfvazrJgwS6kwBZXMFCevLiRsZmP8O4hpC9b1wfAa+KLm4nHOR+J8jwF7LEjiERdU6tbIWZz0Tnw== - dependencies: - "@swc/wasm" "1.2.130" - -"@swc/core-win32-ia32-msvc@1.2.223": - version "1.2.223" - resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.2.223.tgz#591405f9fa07915e9d0b94a4174a5745621fe580" - integrity sha512-kEDGFFUC6xPqCom03QtR+76Ptwtf8RABI4FqRdvrvbasw9zj0xkuLSDCvqL72zdOZCWRciiFijQVHfndLByMAQ== - dependencies: - "@swc/wasm" "1.2.130" - -"@swc/core-win32-x64-msvc@1.2.223": - version "1.2.223" - resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.223.tgz#7a4549cedb7c0e7a3d4861c2b5230224194e0f04" - integrity sha512-nzL8rwzMFA9cBK2s+QBMPcNnoGSPMfgY9ypRw/nTp0hQDgdLOXHy9moGFJg8dbdQD39kC5s8yQ0BmyKvePILgg== - -"@swc/core@^1.2.223": - version "1.2.223" - resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.2.223.tgz#e44a3f6971a1f5c22d1037cf60510ef32c93d2a5" - integrity sha512-LcKX1frJ1iJDSYlY9Bg0vm0rYsXloITh6PdEYM5amT73J9mC1c2YpWLnWQiH2QpcyblyMhX1pk1eZ2JZjaynrQ== - optionalDependencies: - "@swc/core-android-arm-eabi" "1.2.223" - "@swc/core-android-arm64" "1.2.223" - "@swc/core-darwin-arm64" "1.2.223" - "@swc/core-darwin-x64" "1.2.223" - "@swc/core-freebsd-x64" "1.2.223" - "@swc/core-linux-arm-gnueabihf" "1.2.223" - "@swc/core-linux-arm64-gnu" "1.2.223" - "@swc/core-linux-arm64-musl" "1.2.223" - "@swc/core-linux-x64-gnu" "1.2.223" - "@swc/core-linux-x64-musl" "1.2.223" - "@swc/core-win32-arm64-msvc" "1.2.223" - "@swc/core-win32-ia32-msvc" "1.2.223" - "@swc/core-win32-x64-msvc" "1.2.223" - -"@swc/wasm@1.2.122": - version "1.2.122" - resolved "https://registry.yarnpkg.com/@swc/wasm/-/wasm-1.2.122.tgz#87a5e654b26a71b2e84b801f41e45f823b856639" - integrity sha512-sM1VCWQxmNhFtdxME+8UXNyPNhxNu7zdb6ikWpz0YKAQQFRGT5ThZgJrubEpah335SUToNg8pkdDF7ibVCjxbQ== - -"@swc/wasm@1.2.130": - version "1.2.130" - resolved "https://registry.yarnpkg.com/@swc/wasm/-/wasm-1.2.130.tgz#88ac26433335d1f957162a9a92f1450b73c176a0" - integrity sha512-rNcJsBxS70+pv8YUWwf5fRlWX6JoY/HJc25HD/F8m6Kv7XhJdqPPMhyX6TKkUBPAG7TWlZYoxa+rHAjPy4Cj3Q== - "@testing-library/dom@^8.5.0": version "8.13.0" resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.13.0.tgz#bc00bdd64c7d8b40841e27a70211399ad3af46f5" From 58714c3bb7328d47ae305e49ac93149bb388a8d4 Mon Sep 17 00:00:00 2001 From: zemnmez Date: Sun, 7 Aug 2022 20:40:04 -0700 Subject: [PATCH 15/15] oops! got to make sure the lockfile actually generates something! --- js/npm/rules.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/npm/rules.bzl b/js/npm/rules.bzl index 1584d74412..fff7569ece 100644 --- a/js/npm/rules.bzl +++ b/js/npm/rules.bzl @@ -10,7 +10,7 @@ def _exclude_all_external_rule(ctx): return DefaultInfo(files = depset([ file for file in ctx.files.srcs - if file.owner.workspace_name == "monorepo" + if file.owner.workspace_name == "" ])) exclude_all_external_rule = rule(