From 0b0a57652f33daade5f7d19e78d258991fbaba3e Mon Sep 17 00:00:00 2001 From: Thibault Le Ouay Date: Thu, 31 Oct 2024 10:35:04 +0100 Subject: [PATCH 1/9] refactor: update imports to use @std and improve Deno version in workflows --- .github/workflows/generate-schema.yaml | 4 +- .github/workflows/release.yaml | 12 +- deno.jsonc | 12 + deno.lock | 329 ++++++++++++------------- src/deps.ts | 21 +- src/lib/source.ts | 2 +- src/lib/utils.ts | 4 +- tests/config.test.ts | 4 +- tests/source.test.ts | 4 +- tests/template.test.ts | 2 +- 10 files changed, 200 insertions(+), 194 deletions(-) diff --git a/.github/workflows/generate-schema.yaml b/.github/workflows/generate-schema.yaml index 62eccfd..7f46c03 100644 --- a/.github/workflows/generate-schema.yaml +++ b/.github/workflows/generate-schema.yaml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - deno-version: [1.41.3] + deno-version: [2.0.4] steps: - name: Checkout @@ -25,7 +25,7 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} - name: Setup Deno ${{ matrix.deno-version }} - uses: denoland/setup-deno@v1 + uses: denoland/setup-deno@v2 with: deno-version: ${{ matrix.deno-version }} - name: Run generate-schema diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 688d482..dba758d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,10 +15,10 @@ env: jobs: release: runs-on: ubuntu-latest - + strategy: matrix: - deno-version: [1.42.1] + deno-version: [2.0.4] steps: - uses: google-github-actions/release-please-action@v3 @@ -34,13 +34,13 @@ jobs: - uses: actions/checkout@v4 if: ${{ steps.release.outputs.release_created }} - + - name: Setup Deno ${{ matrix.deno-version }} if: ${{ steps.release.outputs.release_created }} - uses: denoland/setup-deno@v1 + uses: denoland/setup-deno@v2 with: deno-version: ${{ matrix.deno-version }} - + - name: Deno Compile [windows] if: ${{ steps.release.outputs.release_created }} run: deno task compile-win @@ -59,7 +59,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: gh release upload ${{ steps.release.outputs.tag_name }} ./build/runreal-win-x64.exe ./build/runreal-macos-arm ./build/runreal-linux-x64 schema.json - - name: Cache Deno dependencies + - name: Cache Deno dependencies if: ${{ steps.release.outputs.release_created }} uses: actions/cache@v3 with: diff --git a/deno.jsonc b/deno.jsonc index ca6242d..a785023 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -25,5 +25,17 @@ "singleQuote": true, "proseWrap": "preserve", "semiColons": false + }, + "imports": { + "@cliffy/command": "jsr:@cliffy/command@1.0.0-rc.7", + "@rebeccastevens/deepmerge": "jsr:@rebeccastevens/deepmerge@^7.1.3", + "@std/assert": "jsr:@std/assert@^1.0.6", + "@std/dotenv": "jsr:@std/dotenv@^0.225.2", + "@std/fmt": "jsr:@std/fmt@^1.0.3", + "@std/jsonc": "jsr:@std/jsonc@^1.0.1", + "@std/path": "jsr:@std/path@^1.0.7", + "@std/streams": "jsr:@std/streams@^1.0.7", + "@std/testing": "jsr:@std/testing@^1.0.3", + "xml2js": "npm:xml2js@^0.6.2" } } diff --git a/deno.lock b/deno.lock index ed23020..8c534c2 100644 --- a/deno.lock +++ b/deno.lock @@ -1,25 +1,140 @@ { - "version": "3", - "packages": { - "specifiers": { - "npm:zod-to-json-schema": "npm:zod-to-json-schema@3.22.5_zod@3.22.4" + "version": "4", + "specifiers": { + "jsr:@cliffy/command@1.0.0-rc.7": "1.0.0-rc.7", + "jsr:@cliffy/flags@1.0.0-rc.7": "1.0.0-rc.7", + "jsr:@cliffy/internal@1.0.0-rc.7": "1.0.0-rc.7", + "jsr:@cliffy/table@1.0.0-rc.7": "1.0.0-rc.7", + "jsr:@rebeccastevens/deepmerge@^7.1.3": "7.1.3", + "jsr:@std/assert@^1.0.6": "1.0.6", + "jsr:@std/bytes@^1.0.2": "1.0.2", + "jsr:@std/data-structures@^1.0.4": "1.0.4", + "jsr:@std/dotenv@~0.225.2": "0.225.2", + "jsr:@std/fmt@^1.0.3": "1.0.3", + "jsr:@std/fmt@~1.0.2": "1.0.3", + "jsr:@std/fs@^1.0.4": "1.0.5", + "jsr:@std/internal@^1.0.4": "1.0.4", + "jsr:@std/json@1": "1.0.1", + "jsr:@std/jsonc@^1.0.1": "1.0.1", + "jsr:@std/path@^1.0.6": "1.0.7", + "jsr:@std/path@^1.0.7": "1.0.7", + "jsr:@std/streams@^1.0.7": "1.0.7", + "jsr:@std/testing@^1.0.3": "1.0.3", + "jsr:@std/text@~1.0.7": "1.0.8", + "npm:xml2js@~0.6.2": "0.6.2", + "npm:zod-to-json-schema@*": "3.23.3_zod@3.23.8" + }, + "jsr": { + "@cliffy/command@1.0.0-rc.7": { + "integrity": "1288808d7a3cd18b86c24c2f920e47a6d954b7e23cadc35c8cbd78f8be41f0cd", + "dependencies": [ + "jsr:@cliffy/flags", + "jsr:@cliffy/internal", + "jsr:@cliffy/table", + "jsr:@std/fmt@~1.0.2", + "jsr:@std/text" + ] + }, + "@cliffy/flags@1.0.0-rc.7": { + "integrity": "318d9be98f6a6417b108e03dec427dea96cdd41a15beb21d2554ae6da450a781", + "dependencies": [ + "jsr:@std/text" + ] + }, + "@cliffy/internal@1.0.0-rc.7": { + "integrity": "10412636ab3e67517d448be9eaab1b70c88eba9be22617b5d146257a11cc9b17" + }, + "@cliffy/table@1.0.0-rc.7": { + "integrity": "9fdd9776eda28a0b397981c400eeb1aa36da2371b43eefe12e6ff555290e3180", + "dependencies": [ + "jsr:@std/fmt@~1.0.2" + ] + }, + "@rebeccastevens/deepmerge@7.1.3": { + "integrity": "d9fb8c19fdfba403ffad8cca6a59ec2b399541e33694f2d9d9570179b0b5c155" + }, + "@std/assert@1.0.6": { + "integrity": "1904c05806a25d94fe791d6d883b685c9e2dcd60e4f9fc30f4fc5cf010c72207", + "dependencies": [ + "jsr:@std/internal" + ] + }, + "@std/bytes@1.0.2": { + "integrity": "fbdee322bbd8c599a6af186a1603b3355e59a5fb1baa139f8f4c3c9a1b3e3d57" + }, + "@std/data-structures@1.0.4": { + "integrity": "fa0e20c11eb9ba673417450915c750a0001405a784e2a4e0c3725031681684a0" + }, + "@std/dotenv@0.225.2": { + "integrity": "e2025dce4de6c7bca21dece8baddd4262b09d5187217e231b033e088e0c4dd23" + }, + "@std/fmt@1.0.3": { + "integrity": "97765c16aa32245ff4e2204ecf7d8562496a3cb8592340a80e7e554e0bb9149f" + }, + "@std/fs@1.0.5": { + "integrity": "41806ad6823d0b5f275f9849a2640d87e4ef67c51ee1b8fb02426f55e02fd44e", + "dependencies": [ + "jsr:@std/path@^1.0.7" + ] + }, + "@std/internal@1.0.4": { + "integrity": "62e8e4911527e5e4f307741a795c0b0a9e6958d0b3790716ae71ce085f755422" }, - "npm": { - "zod-to-json-schema@3.22.5_zod@3.22.4": { - "integrity": "sha512-+akaPo6a0zpVCCseDed504KBJUQpEW5QZw7RMneNmKw+fGaML1Z9tUNLnHHAC8x6dzVRO1eB2oEMyZRnuBZg7Q==", - "dependencies": { - "zod": "zod@3.22.4" - } - }, - "zod@3.22.4": { - "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", - "dependencies": {} - } + "@std/json@1.0.1": { + "integrity": "1f0f70737e8827f9acca086282e903677bc1bb0c8ffcd1f21bca60039563049f" + }, + "@std/jsonc@1.0.1": { + "integrity": "6b36956e2a7cbb08ca5ad7fbec72e661e6217c202f348496ea88747636710dda", + "dependencies": [ + "jsr:@std/json" + ] + }, + "@std/path@1.0.7": { + "integrity": "76a689e07f0e15dcc6002ec39d0866797e7156629212b28f27179b8a5c3b33a1" + }, + "@std/streams@1.0.7": { + "integrity": "1a93917ca0c58c01b2bfb93647189229b1702677f169b6fb61ad6241cd2e499b", + "dependencies": [ + "jsr:@std/bytes" + ] + }, + "@std/testing@1.0.3": { + "integrity": "f98c2bee53860a5916727d7e7d3abe920dd6f9edace022e2d059f00d05c2cf42", + "dependencies": [ + "jsr:@std/assert", + "jsr:@std/data-structures", + "jsr:@std/fs", + "jsr:@std/internal", + "jsr:@std/path@^1.0.6" + ] + }, + "@std/text@1.0.8": { + "integrity": "40ba34caa095f393e78796e5eda37b8b4e2cc6cfd6f51f34658ad7487b1451e4" } }, - "redirects": { - "https://deno.land/std/assert/mod.ts": "https://deno.land/std@0.221.0/assert/mod.ts", - "https://deno.land/std/testing/mock.ts": "https://deno.land/std@0.224.0/testing/mock.ts" + "npm": { + "sax@1.4.1": { + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" + }, + "xml2js@0.6.2": { + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "dependencies": [ + "sax", + "xmlbuilder" + ] + }, + "xmlbuilder@11.0.1": { + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" + }, + "zod-to-json-schema@3.23.3_zod@3.23.8": { + "integrity": "sha512-TYWChTxKQbRJp5ST22o/Irt9KC5nj7CdBKYB/AosCRdj/wxEMvv4NNaj9XVUHDOIp53ZxArGhnw5HMZziPFjog==", + "dependencies": [ + "zod" + ] + }, + "zod@3.23.8": { + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==" + } }, "remote": { "https://deno.land/std@0.140.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", @@ -44,144 +159,6 @@ "https://deno.land/std@0.196.0/console/_rle.ts": "56668d5c44f964f1b4ff93f21c9896df42d6ee4394e814db52d6d13f5bb247c7", "https://deno.land/std@0.196.0/console/unicode_width.ts": "10661c0f2eeab802d16b8b85ed8825bbc573991bbfb6affed32dc1ff994f54f9", "https://deno.land/std@0.196.0/fmt/colors.ts": "a7eecffdf3d1d54db890723b303847b6e0a1ab4b528ba6958b8f2e754cf1b3bc", - "https://deno.land/std@0.204.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", - "https://deno.land/std@0.204.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", - "https://deno.land/std@0.204.0/async/deferred.ts": "42790112f36a75a57db4a96d33974a936deb7b04d25c6084a9fa8a49f135def8", - "https://deno.land/std@0.204.0/dotenv/mod.ts": "1da8c6d0e7f7d8a5c2b19400b763bc11739df24acec235dda7ea2cfd3d300057", - "https://deno.land/std@0.204.0/fmt/colors.ts": "c51c4642678eb690dcf5ffee5918b675bf01a33fba82acf303701ae1a4f8c8d9", - "https://deno.land/std@0.204.0/json/common.ts": "ecd5e87d45b5f0df33238ed8b1746e1444da7f5c86ae53d0f0b04280f41a25bb", - "https://deno.land/std@0.204.0/jsonc/parse.ts": "c1096e2b7ffb4996d7ed841dfdb29a4fccc78edcc55299beaa20d6fe5facf7b6", - "https://deno.land/std@0.204.0/streams/merge_readable_streams.ts": "6ec024e26e118a7c7cc5b2a0c062ace693b7d38bbcda5707975ccad423940f1b", - "https://deno.land/std@0.221.0/assert/_constants.ts": "a271e8ef5a573f1df8e822a6eb9d09df064ad66a4390f21b3e31f820a38e0975", - "https://deno.land/std@0.221.0/assert/_diff.ts": "4bf42969aa8b1a33aaf23eb8e478b011bfaa31b82d85d2ff4b5c4662d8780d2b", - "https://deno.land/std@0.221.0/assert/_format.ts": "0ba808961bf678437fb486b56405b6fefad2cf87b5809667c781ddee8c32aff4", - "https://deno.land/std@0.221.0/assert/assert.ts": "bec068b2fccdd434c138a555b19a2c2393b71dfaada02b7d568a01541e67cdc5", - "https://deno.land/std@0.221.0/assert/assert_almost_equals.ts": "8b96b7385cc117668b0720115eb6ee73d04c9bcb2f5d2344d674918c9113688f", - "https://deno.land/std@0.221.0/assert/assert_array_includes.ts": "1688d76317fd45b7e93ef9e2765f112fdf2b7c9821016cdfb380b9445374aed1", - "https://deno.land/std@0.221.0/assert/assert_equals.ts": "4497c56fe7d2993b0d447926702802fc0becb44e319079e8eca39b482ee01b4e", - "https://deno.land/std@0.221.0/assert/assert_exists.ts": "24a7bf965e634f909242cd09fbaf38bde6b791128ece08e33ab08586a7cc55c9", - "https://deno.land/std@0.221.0/assert/assert_false.ts": "6f382568e5128c0f855e5f7dbda8624c1ed9af4fcc33ef4a9afeeedcdce99769", - "https://deno.land/std@0.221.0/assert/assert_greater.ts": "4945cf5729f1a38874d7e589e0fe5cc5cd5abe5573ca2ddca9d3791aa891856c", - "https://deno.land/std@0.221.0/assert/assert_greater_or_equal.ts": "573ed8823283b8d94b7443eb69a849a3c369a8eb9666b2d1db50c33763a5d219", - "https://deno.land/std@0.221.0/assert/assert_instance_of.ts": "72dc1faff1e248692d873c89382fa1579dd7b53b56d52f37f9874a75b11ba444", - "https://deno.land/std@0.221.0/assert/assert_is_error.ts": "6596f2b5ba89ba2fe9b074f75e9318cda97a2381e59d476812e30077fbdb6ed2", - "https://deno.land/std@0.221.0/assert/assert_less.ts": "2b4b3fe7910f65f7be52212f19c3977ecb8ba5b2d6d0a296c83cde42920bb005", - "https://deno.land/std@0.221.0/assert/assert_less_or_equal.ts": "b93d212fe669fbde959e35b3437ac9a4468f2e6b77377e7b6ea2cfdd825d38a0", - "https://deno.land/std@0.221.0/assert/assert_match.ts": "ec2d9680ed3e7b9746ec57ec923a17eef6d476202f339ad91d22277d7f1d16e1", - "https://deno.land/std@0.221.0/assert/assert_not_equals.ts": "ac86413ab70ffb14fdfc41740ba579a983fe355ba0ce4a9ab685e6b8e7f6a250", - "https://deno.land/std@0.221.0/assert/assert_not_instance_of.ts": "8f720d92d83775c40b2542a8d76c60c2d4aeddaf8713c8d11df8984af2604931", - "https://deno.land/std@0.221.0/assert/assert_not_match.ts": "b4b7c77f146963e2b673c1ce4846473703409eb93f5ab0eb60f6e6f8aeffe39f", - "https://deno.land/std@0.221.0/assert/assert_not_strict_equals.ts": "da0b8ab60a45d5a9371088378e5313f624799470c3b54c76e8b8abeec40a77be", - "https://deno.land/std@0.221.0/assert/assert_object_match.ts": "e85e5eef62a56ce364c3afdd27978ccab979288a3e772e6855c270a7b118fa49", - "https://deno.land/std@0.221.0/assert/assert_rejects.ts": "5206ac37d883797d9504e3915a0c7b692df6efcdefff3889cc14bb5a325641dd", - "https://deno.land/std@0.221.0/assert/assert_strict_equals.ts": "0425a98f70badccb151644c902384c12771a93e65f8ff610244b8147b03a2366", - "https://deno.land/std@0.221.0/assert/assert_string_includes.ts": "dfb072a890167146f8e5bdd6fde887ce4657098e9f71f12716ef37f35fb6f4a7", - "https://deno.land/std@0.221.0/assert/assert_throws.ts": "31f3c061338aec2c2c33731973d58ccd4f14e42f355501541409ee958d2eb8e5", - "https://deno.land/std@0.221.0/assert/assertion_error.ts": "9f689a101ee586c4ce92f52fa7ddd362e86434ffdf1f848e45987dc7689976b8", - "https://deno.land/std@0.221.0/assert/equal.ts": "fae5e8a52a11d3ac694bbe1a53e13a7969e3f60791262312e91a3e741ae519e2", - "https://deno.land/std@0.221.0/assert/fail.ts": "f310e51992bac8e54f5fd8e44d098638434b2edb802383690e0d7a9be1979f1c", - "https://deno.land/std@0.221.0/assert/mod.ts": "7e41449e77a31fef91534379716971bebcfc12686e143d38ada5438e04d4a90e", - "https://deno.land/std@0.221.0/assert/unimplemented.ts": "47ca67d1c6dc53abd0bd729b71a31e0825fc452dbcd4fde4ca06789d5644e7fd", - "https://deno.land/std@0.221.0/assert/unreachable.ts": "3670816a4ab3214349acb6730e3e6f5299021234657eefe05b48092f3848c270", - "https://deno.land/std@0.221.0/fmt/colors.ts": "d239d84620b921ea520125d778947881f62c50e78deef2657073840b8af9559a", - "https://deno.land/std@0.222.1/assert/assert.ts": "09d30564c09de846855b7b071e62b5974b001bb72a4b797958fe0660e7849834", - "https://deno.land/std@0.222.1/assert/assertion_error.ts": "ba8752bd27ebc51f723702fac2f54d3e94447598f54264a6653d6413738a8917", - "https://deno.land/std@0.222.1/path/_common/assert_path.ts": "dbdd757a465b690b2cc72fc5fb7698c51507dec6bfafce4ca500c46b76ff7bd8", - "https://deno.land/std@0.222.1/path/_common/basename.ts": "569744855bc8445f3a56087fd2aed56bdad39da971a8d92b138c9913aecc5fa2", - "https://deno.land/std@0.222.1/path/_common/common.ts": "ef73c2860694775fe8ffcbcdd387f9f97c7a656febf0daa8c73b56f4d8a7bd4c", - "https://deno.land/std@0.222.1/path/_common/constants.ts": "dc5f8057159f4b48cd304eb3027e42f1148cf4df1fb4240774d3492b5d12ac0c", - "https://deno.land/std@0.222.1/path/_common/dirname.ts": "684df4aa71a04bbcc346c692c8485594fc8a90b9408dfbc26ff32cf3e0c98cc8", - "https://deno.land/std@0.222.1/path/_common/format.ts": "92500e91ea5de21c97f5fe91e178bae62af524b72d5fcd246d6d60ae4bcada8b", - "https://deno.land/std@0.222.1/path/_common/from_file_url.ts": "d672bdeebc11bf80e99bf266f886c70963107bdd31134c4e249eef51133ceccf", - "https://deno.land/std@0.222.1/path/_common/glob_to_reg_exp.ts": "6cac16d5c2dc23af7d66348a7ce430e5de4e70b0eede074bdbcf4903f4374d8d", - "https://deno.land/std@0.222.1/path/_common/normalize.ts": "684df4aa71a04bbcc346c692c8485594fc8a90b9408dfbc26ff32cf3e0c98cc8", - "https://deno.land/std@0.222.1/path/_common/normalize_string.ts": "33edef773c2a8e242761f731adeb2bd6d683e9c69e4e3d0092985bede74f4ac3", - "https://deno.land/std@0.222.1/path/_common/relative.ts": "faa2753d9b32320ed4ada0733261e3357c186e5705678d9dd08b97527deae607", - "https://deno.land/std@0.222.1/path/_common/strip_trailing_separators.ts": "7024a93447efcdcfeaa9339a98fa63ef9d53de363f1fbe9858970f1bba02655a", - "https://deno.land/std@0.222.1/path/_common/to_file_url.ts": "7f76adbc83ece1bba173e6e98a27c647712cab773d3f8cbe0398b74afc817883", - "https://deno.land/std@0.222.1/path/_interface.ts": "8dfeb930ca4a772c458a8c7bbe1e33216fe91c253411338ad80c5b6fa93ddba0", - "https://deno.land/std@0.222.1/path/_os.ts": "8fb9b90fb6b753bd8c77cfd8a33c2ff6c5f5bc185f50de8ca4ac6a05710b2c15", - "https://deno.land/std@0.222.1/path/basename.ts": "7ee495c2d1ee516ffff48fb9a93267ba928b5a3486b550be73071bc14f8cc63e", - "https://deno.land/std@0.222.1/path/common.ts": "03e52e22882402c986fe97ca3b5bb4263c2aa811c515ce84584b23bac4cc2643", - "https://deno.land/std@0.222.1/path/constants.ts": "0c206169ca104938ede9da48ac952de288f23343304a1c3cb6ec7625e7325f36", - "https://deno.land/std@0.222.1/path/dirname.ts": "85bd955bf31d62c9aafdd7ff561c4b5fb587d11a9a5a45e2b01aedffa4238a7c", - "https://deno.land/std@0.222.1/path/extname.ts": "593303db8ae8c865cbd9ceec6e55d4b9ac5410c1e276bfd3131916591b954441", - "https://deno.land/std@0.222.1/path/format.ts": "6ce1779b0980296cf2bc20d66436b12792102b831fd281ab9eb08fa8a3e6f6ac", - "https://deno.land/std@0.222.1/path/from_file_url.ts": "911833ae4fd10a1c84f6271f36151ab785955849117dc48c6e43b929504ee069", - "https://deno.land/std@0.222.1/path/glob_to_regexp.ts": "7f30f0a21439cadfdae1be1bf370880b415e676097fda584a63ce319053b5972", - "https://deno.land/std@0.222.1/path/is_absolute.ts": "4791afc8bfd0c87f0526eaa616b0d16e7b3ab6a65b62942e50eac68de4ef67d7", - "https://deno.land/std@0.222.1/path/is_glob.ts": "a65f6195d3058c3050ab905705891b412ff942a292bcbaa1a807a74439a14141", - "https://deno.land/std@0.222.1/path/join.ts": "ae2ec5ca44c7e84a235fd532e4a0116bfb1f2368b394db1c4fb75e3c0f26a33a", - "https://deno.land/std@0.222.1/path/join_globs.ts": "5b3bf248b93247194f94fa6947b612ab9d3abd571ca8386cf7789038545e54a0", - "https://deno.land/std@0.222.1/path/mod.ts": "2821a1bb3a4148a0ffe79c92aa41aa9319fef73c6d6f5178f52b2c720d3eb02d", - "https://deno.land/std@0.222.1/path/normalize.ts": "4155743ccceeed319b350c1e62e931600272fad8ad00c417b91df093867a8352", - "https://deno.land/std@0.222.1/path/normalize_glob.ts": "cc89a77a7d3b1d01053b9dcd59462b75482b11e9068ae6c754b5cf5d794b374f", - "https://deno.land/std@0.222.1/path/parse.ts": "3e172974e3c71025f5fbd2bd9db4307acb9cc2de14cf6f4464bf40957663cabe", - "https://deno.land/std@0.222.1/path/posix/_util.ts": "1e3937da30f080bfc99fe45d7ed23c47dd8585c5e473b2d771380d3a6937cf9d", - "https://deno.land/std@0.222.1/path/posix/basename.ts": "d2fa5fbbb1c5a3ab8b9326458a8d4ceac77580961b3739cd5bfd1d3541a3e5f0", - "https://deno.land/std@0.222.1/path/posix/common.ts": "26f60ccc8b2cac3e1613000c23ac5a7d392715d479e5be413473a37903a2b5d4", - "https://deno.land/std@0.222.1/path/posix/constants.ts": "93481efb98cdffa4c719c22a0182b994e5a6aed3047e1962f6c2c75b7592bef1", - "https://deno.land/std@0.222.1/path/posix/dirname.ts": "76cd348ffe92345711409f88d4d8561d8645353ac215c8e9c80140069bf42f00", - "https://deno.land/std@0.222.1/path/posix/extname.ts": "e398c1d9d1908d3756a7ed94199fcd169e79466dd88feffd2f47ce0abf9d61d2", - "https://deno.land/std@0.222.1/path/posix/format.ts": "185e9ee2091a42dd39e2a3b8e4925370ee8407572cee1ae52838aed96310c5c1", - "https://deno.land/std@0.222.1/path/posix/from_file_url.ts": "951aee3a2c46fd0ed488899d024c6352b59154c70552e90885ed0c2ab699bc40", - "https://deno.land/std@0.222.1/path/posix/glob_to_regexp.ts": "76f012fcdb22c04b633f536c0b9644d100861bea36e9da56a94b9c589a742e8f", - "https://deno.land/std@0.222.1/path/posix/is_absolute.ts": "cebe561ad0ae294f0ce0365a1879dcfca8abd872821519b4fcc8d8967f888ede", - "https://deno.land/std@0.222.1/path/posix/is_glob.ts": "8a8b08c08bf731acf2c1232218f1f45a11131bc01de81e5f803450a5914434b9", - "https://deno.land/std@0.222.1/path/posix/join.ts": "7fc2cb3716aa1b863e990baf30b101d768db479e70b7313b4866a088db016f63", - "https://deno.land/std@0.222.1/path/posix/join_globs.ts": "a9475b44645feddceb484ee0498e456f4add112e181cb94042cdc6d47d1cdd25", - "https://deno.land/std@0.222.1/path/posix/mod.ts": "2301fc1c54a28b349e20656f68a85f75befa0ee9b6cd75bfac3da5aca9c3f604", - "https://deno.land/std@0.222.1/path/posix/normalize.ts": "baeb49816a8299f90a0237d214cef46f00ba3e95c0d2ceb74205a6a584b58a91", - "https://deno.land/std@0.222.1/path/posix/normalize_glob.ts": "9c87a829b6c0f445d03b3ecadc14492e2864c3ebb966f4cea41e98326e4435c6", - "https://deno.land/std@0.222.1/path/posix/parse.ts": "0b1fc4cb890dbb699ec1d2c232d274843b4a7142e1ad976b69fe51c954eb6080", - "https://deno.land/std@0.222.1/path/posix/relative.ts": "3907d6eda41f0ff723d336125a1ad4349112cd4d48f693859980314d5b9da31c", - "https://deno.land/std@0.222.1/path/posix/resolve.ts": "08b699cfeee10cb6857ccab38fa4b2ec703b0ea33e8e69964f29d02a2d5257cf", - "https://deno.land/std@0.222.1/path/posix/to_file_url.ts": "7aa752ba66a35049e0e4a4be5a0a31ac6b645257d2e031142abb1854de250aaf", - "https://deno.land/std@0.222.1/path/posix/to_namespaced_path.ts": "28b216b3c76f892a4dca9734ff1cc0045d135532bfd9c435ae4858bfa5a2ebf0", - "https://deno.land/std@0.222.1/path/relative.ts": "ab739d727180ed8727e34ed71d976912461d98e2b76de3d3de834c1066667add", - "https://deno.land/std@0.222.1/path/resolve.ts": "a6f977bdb4272e79d8d0ed4333e3d71367cc3926acf15ac271f1d059c8494d8d", - "https://deno.land/std@0.222.1/path/to_file_url.ts": "88f049b769bce411e2d2db5bd9e6fd9a185a5fbd6b9f5ad8f52bef517c4ece1b", - "https://deno.land/std@0.222.1/path/to_namespaced_path.ts": "b706a4103b104cfadc09600a5f838c2ba94dbcdb642344557122dda444526e40", - "https://deno.land/std@0.222.1/path/windows/_util.ts": "d5f47363e5293fced22c984550d5e70e98e266cc3f31769e1710511803d04808", - "https://deno.land/std@0.222.1/path/windows/basename.ts": "6bbc57bac9df2cec43288c8c5334919418d784243a00bc10de67d392ab36d660", - "https://deno.land/std@0.222.1/path/windows/common.ts": "26f60ccc8b2cac3e1613000c23ac5a7d392715d479e5be413473a37903a2b5d4", - "https://deno.land/std@0.222.1/path/windows/constants.ts": "5afaac0a1f67b68b0a380a4ef391bf59feb55856aa8c60dfc01bd3b6abb813f5", - "https://deno.land/std@0.222.1/path/windows/dirname.ts": "33e421be5a5558a1346a48e74c330b8e560be7424ed7684ea03c12c21b627bc9", - "https://deno.land/std@0.222.1/path/windows/extname.ts": "165a61b00d781257fda1e9606a48c78b06815385e7d703232548dbfc95346bef", - "https://deno.land/std@0.222.1/path/windows/format.ts": "bbb5ecf379305b472b1082cd2fdc010e44a0020030414974d6029be9ad52aeb6", - "https://deno.land/std@0.222.1/path/windows/from_file_url.ts": "ced2d587b6dff18f963f269d745c4a599cf82b0c4007356bd957cb4cb52efc01", - "https://deno.land/std@0.222.1/path/windows/glob_to_regexp.ts": "e45f1f89bf3fc36f94ab7b3b9d0026729829fabc486c77f414caebef3b7304f8", - "https://deno.land/std@0.222.1/path/windows/is_absolute.ts": "4a8f6853f8598cf91a835f41abed42112cebab09478b072e4beb00ec81f8ca8a", - "https://deno.land/std@0.222.1/path/windows/is_glob.ts": "8a8b08c08bf731acf2c1232218f1f45a11131bc01de81e5f803450a5914434b9", - "https://deno.land/std@0.222.1/path/windows/join.ts": "8d03530ab89195185103b7da9dfc6327af13eabdcd44c7c63e42e27808f50ecf", - "https://deno.land/std@0.222.1/path/windows/join_globs.ts": "a9475b44645feddceb484ee0498e456f4add112e181cb94042cdc6d47d1cdd25", - "https://deno.land/std@0.222.1/path/windows/mod.ts": "2301fc1c54a28b349e20656f68a85f75befa0ee9b6cd75bfac3da5aca9c3f604", - "https://deno.land/std@0.222.1/path/windows/normalize.ts": "78126170ab917f0ca355a9af9e65ad6bfa5be14d574c5fb09bb1920f52577780", - "https://deno.land/std@0.222.1/path/windows/normalize_glob.ts": "9c87a829b6c0f445d03b3ecadc14492e2864c3ebb966f4cea41e98326e4435c6", - "https://deno.land/std@0.222.1/path/windows/parse.ts": "dbdfe2bc6db482d755b5f63f7207cd019240fcac02ad2efa582adf67ff10553a", - "https://deno.land/std@0.222.1/path/windows/relative.ts": "3e1abc7977ee6cc0db2730d1f9cb38be87b0ce4806759d271a70e4997fc638d7", - "https://deno.land/std@0.222.1/path/windows/resolve.ts": "8dae1dadfed9d46ff46cc337c9525c0c7d959fb400a6308f34595c45bdca1972", - "https://deno.land/std@0.222.1/path/windows/to_file_url.ts": "40e560ee4854fe5a3d4d12976cef2f4e8914125c81b11f1108e127934ced502e", - "https://deno.land/std@0.222.1/path/windows/to_namespaced_path.ts": "4ffa4fb6fae321448d5fe810b3ca741d84df4d7897e61ee29be961a6aac89a4c", - "https://deno.land/std@0.224.0/assert/_constants.ts": "a271e8ef5a573f1df8e822a6eb9d09df064ad66a4390f21b3e31f820a38e0975", - "https://deno.land/std@0.224.0/assert/assert_equals.ts": "3bbca947d85b9d374a108687b1a8ba3785a7850436b5a8930d81f34a32cb8c74", - "https://deno.land/std@0.224.0/assert/assert_is_error.ts": "f856b3bc978a7aa6a601f3fec6603491ab6255118afa6baa84b04426dd3cc491", - "https://deno.land/std@0.224.0/assert/assert_rejects.ts": "4bee1d6d565a5b623146a14668da8f9eb1f026a4f338bbf92b37e43e0aa53c31", - "https://deno.land/std@0.224.0/assert/assertion_error.ts": "ba8752bd27ebc51f723702fac2f54d3e94447598f54264a6653d6413738a8917", - "https://deno.land/std@0.224.0/assert/equal.ts": "bddf07bb5fc718e10bb72d5dc2c36c1ce5a8bdd3b647069b6319e07af181ac47", - "https://deno.land/std@0.224.0/async/delay.ts": "f90dd685b97c2f142b8069082993e437b1602b8e2561134827eeb7c12b95c499", - "https://deno.land/std@0.224.0/data_structures/_binary_search_node.ts": "ce1da11601fef0638df4d1e53c377f791f96913383277389286b390685d76c07", - "https://deno.land/std@0.224.0/data_structures/_red_black_node.ts": "4af8d3c5ac5f119d8058269259c46ea22ead567246cacde04584a83e43a9d2ea", - "https://deno.land/std@0.224.0/data_structures/binary_search_tree.ts": "2dd43d97ce5f5a4bdba11b075eb458db33e9143f50997b0eebf02912cb44f5d5", - "https://deno.land/std@0.224.0/data_structures/comparators.ts": "17dfa68bf1550edadbfdd453a06f9819290bcb534c9945b5cec4b30242cff475", - "https://deno.land/std@0.224.0/data_structures/red_black_tree.ts": "2222be0c46842fc932e2c8589a66dced9e6eae180914807c5c55d1aa4c8c1b9b", - "https://deno.land/std@0.224.0/fmt/colors.ts": "508563c0659dd7198ba4bbf87e97f654af3c34eb56ba790260f252ad8012e1c5", - "https://deno.land/std@0.224.0/internal/diff.ts": "6234a4b493ebe65dc67a18a0eb97ef683626a1166a1906232ce186ae9f65f4e6", - "https://deno.land/std@0.224.0/internal/format.ts": "0a98ee226fd3d43450245b1844b47003419d34d210fa989900861c79820d21c2", - "https://deno.land/std@0.224.0/internal/mod.ts": "534125398c8e7426183e12dc255bb635d94e06d0f93c60a297723abe69d3b22e", - "https://deno.land/std@0.224.0/testing/_time.ts": "fefd1ff35b50a410db9b0e7227e05163e1b172c88afd0d2071df0125958c3ff3", - "https://deno.land/std@0.224.0/testing/mock.ts": "a963181c2860b6ba3eb60e08b62c164d33cf5da7cd445893499b2efda20074db", - "https://deno.land/std@0.224.0/testing/time.ts": "7119072a198e9913da0d21106b1f05a90a4c05b07075529770ff0e2a9eb5eaba", "https://deno.land/x/cliffy@v1.0.0-rc.3/_utils/distance.ts": "02af166952c7c358ac83beae397aa2fbca4ad630aecfcd38d92edb1ea429f004", "https://deno.land/x/cliffy@v1.0.0-rc.3/command/_argument_types.ts": "ab269dacea2030f865a07c2a1e953ec437a64419a05bad1f1ddaab3f99752ead", "https://deno.land/x/cliffy@v1.0.0-rc.3/command/_errors.ts": "12d513ff401020287a344e0830e1297ce1c80c077ecb91e0ac5db44d04a6019c", @@ -279,18 +256,32 @@ "https://deno.land/x/xml2js@1.0.0/options-helper.ts": "37e04aec6262c01513c885e06bb3e1d2b1e52dce83784b68b099f298c858aefe", "https://deno.land/x/xml2js@1.0.0/options.ts": "5919bb07f3edb4f7ba1fa00a67eaa8075d02bfa767a438d46c8d705be30743d5", "https://deno.land/x/xml2js@1.0.0/xml2js.ts": "d056e5003f03722e0f48e9c871bc5b04447b74f619aa825a951a34a0509883e1", - "https://deno.land/x/zod@v3.22.4/ZodError.ts": "4de18ff525e75a0315f2c12066b77b5c2ae18c7c15ef7df7e165d63536fdf2ea", - "https://deno.land/x/zod@v3.22.4/errors.ts": "5285922d2be9700cc0c70c95e4858952b07ae193aa0224be3cbd5cd5567eabef", - "https://deno.land/x/zod@v3.22.4/external.ts": "a6cfbd61e9e097d5f42f8a7ed6f92f93f51ff927d29c9fbaec04f03cbce130fe", - "https://deno.land/x/zod@v3.22.4/helpers/enumUtil.ts": "54efc393cc9860e687d8b81ff52e980def00fa67377ad0bf8b3104f8a5bf698c", - "https://deno.land/x/zod@v3.22.4/helpers/errorUtil.ts": "7a77328240be7b847af6de9189963bd9f79cab32bbc61502a9db4fe6683e2ea7", - "https://deno.land/x/zod@v3.22.4/helpers/parseUtil.ts": "f791e6e65a0340d85ad37d26cd7a3ba67126cd9957eac2b7163162155283abb1", - "https://deno.land/x/zod@v3.22.4/helpers/partialUtil.ts": "998c2fe79795257d4d1cf10361e74492f3b7d852f61057c7c08ac0a46488b7e7", - "https://deno.land/x/zod@v3.22.4/helpers/typeAliases.ts": "0fda31a063c6736fc3cf9090dd94865c811dfff4f3cb8707b932bf937c6f2c3e", - "https://deno.land/x/zod@v3.22.4/helpers/util.ts": "8baf19b19b2fca8424380367b90364b32503b6b71780269a6e3e67700bb02774", - "https://deno.land/x/zod@v3.22.4/index.ts": "d27aabd973613985574bc31f39e45cb5d856aa122ef094a9f38a463b8ef1a268", - "https://deno.land/x/zod@v3.22.4/locales/en.ts": "a7a25cd23563ccb5e0eed214d9b31846305ddbcdb9c5c8f508b108943366ab4c", - "https://deno.land/x/zod@v3.22.4/mod.ts": "64e55237cb4410e17d968cd08975566059f27638ebb0b86048031b987ba251c4", - "https://deno.land/x/zod@v3.22.4/types.ts": "724185522fafe43ee56a52333958764c8c8cd6ad4effa27b42651df873fc151e" + "https://deno.land/x/zod@v3.23.8/ZodError.ts": "528da200fbe995157b9ae91498b103c4ef482217a5c086249507ac850bd78f52", + "https://deno.land/x/zod@v3.23.8/errors.ts": "5285922d2be9700cc0c70c95e4858952b07ae193aa0224be3cbd5cd5567eabef", + "https://deno.land/x/zod@v3.23.8/external.ts": "a6cfbd61e9e097d5f42f8a7ed6f92f93f51ff927d29c9fbaec04f03cbce130fe", + "https://deno.land/x/zod@v3.23.8/helpers/enumUtil.ts": "54efc393cc9860e687d8b81ff52e980def00fa67377ad0bf8b3104f8a5bf698c", + "https://deno.land/x/zod@v3.23.8/helpers/errorUtil.ts": "7a77328240be7b847af6de9189963bd9f79cab32bbc61502a9db4fe6683e2ea7", + "https://deno.land/x/zod@v3.23.8/helpers/parseUtil.ts": "c14814d167cc286972b6e094df88d7d982572a08424b7cd50f862036b6fcaa77", + "https://deno.land/x/zod@v3.23.8/helpers/partialUtil.ts": "998c2fe79795257d4d1cf10361e74492f3b7d852f61057c7c08ac0a46488b7e7", + "https://deno.land/x/zod@v3.23.8/helpers/typeAliases.ts": "0fda31a063c6736fc3cf9090dd94865c811dfff4f3cb8707b932bf937c6f2c3e", + "https://deno.land/x/zod@v3.23.8/helpers/util.ts": "30c273131661ca5dc973f2cfb196fa23caf3a43e224cdde7a683b72e101a31fc", + "https://deno.land/x/zod@v3.23.8/index.ts": "d27aabd973613985574bc31f39e45cb5d856aa122ef094a9f38a463b8ef1a268", + "https://deno.land/x/zod@v3.23.8/locales/en.ts": "a7a25cd23563ccb5e0eed214d9b31846305ddbcdb9c5c8f508b108943366ab4c", + "https://deno.land/x/zod@v3.23.8/mod.ts": "ec6e2b1255c1a350b80188f97bd0a6bac45801bb46fc48f50b9763aa66046039", + "https://deno.land/x/zod@v3.23.8/types.ts": "1b172c90782b1eaa837100ebb6abd726d79d6c1ec336350c8e851e0fd706bf5c" + }, + "workspace": { + "dependencies": [ + "jsr:@cliffy/command@1.0.0-rc.7", + "jsr:@rebeccastevens/deepmerge@^7.1.3", + "jsr:@std/assert@^1.0.6", + "jsr:@std/dotenv@~0.225.2", + "jsr:@std/fmt@^1.0.3", + "jsr:@std/jsonc@^1.0.1", + "jsr:@std/path@^1.0.7", + "jsr:@std/streams@^1.0.7", + "jsr:@std/testing@^1.0.3", + "npm:xml2js@~0.6.2" + ] } } diff --git a/src/deps.ts b/src/deps.ts index 5c53542..70be3d1 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -1,18 +1,21 @@ -export * as path from 'https://deno.land/std@0.222.1/path/mod.ts' -export { mergeReadableStreams } from 'https://deno.land/std@0.204.0/streams/merge_readable_streams.ts' -export * as fmt from 'https://deno.land/std@0.204.0/fmt/colors.ts' -export * as dotenv from 'https://deno.land/std@0.204.0/dotenv/mod.ts' -export { parse } from 'https://deno.land/std@0.204.0/jsonc/parse.ts' +export * as path from "@std/path"; +export { mergeReadableStreams } from "@std/streams"; -export { xml2js } from 'https://deno.land/x/xml2js@1.0.0/mod.ts' -export { Command, EnumType, ValidationError } from 'https://deno.land/x/cliffy@v1.0.0-rc.3/command/mod.ts' -export { deepmerge } from 'https://deno.land/x/deepmergets@v5.1.0/dist/deno/index.ts' +export * as dotenv from "@std/dotenv"; +export * as fmt from "@std/fmt/colors"; + +export { parse } from "@std/jsonc"; +// Maybe use npm specifier + +export { xml2js } from 'xml2js' +export { Command, EnumType, ValidationError } from '@cliffy/command' +export { deepmerge } from '@rebeccastevens/deepmerge' export { readNdjson } from 'https://deno.land/x/ndjson@1.1.0/mod.ts' import { monotonicFactory } from 'https://deno.land/x/ulid@v0.3.0/mod.ts' const ulid = monotonicFactory() export { ulid } -export { z } from 'https://deno.land/x/zod@v3.22.4/mod.ts' +export { z } from 'https://deno.land/x/zod@v3.23.8/mod.ts' export { globber } from 'https://deno.land/x/globber@0.1.0/mod.ts' export { zodToJsonSchema } from 'npm:zod-to-json-schema' diff --git a/src/lib/source.ts b/src/lib/source.ts index 025a4c2..85843eb 100644 --- a/src/lib/source.ts +++ b/src/lib/source.ts @@ -65,7 +65,7 @@ export class Perforce extends Base { } return parts.join('/') } - safeRef(): string { + override safeRef(): string { return this.changelist() } safeFullRef(): string { diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 4caec5c..f5d8a7e 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,4 +1,4 @@ -import { mergeReadableStreams, path, xml2js } from '../deps.ts' +import { xml2js, mergeReadableStreams, path } from '../deps.ts' import { createEngine, EngineConfiguration, EnginePlatform, EngineTarget } from './engine.ts' import { GitIgnoreFiles, UeDepsManifest } from './types.ts' @@ -351,7 +351,7 @@ export class DefaultMap extends Map { super(entries) } - get(key: K): V { + override get(key: K): V { if (!super.has(key)) { super.set(key, this.defaultFn(key)) } diff --git a/tests/config.test.ts b/tests/config.test.ts index 719ddf9..5b4bdb9 100644 --- a/tests/config.test.ts +++ b/tests/config.test.ts @@ -1,8 +1,8 @@ -import { assert, assertEquals } from 'https://deno.land/std/assert/mod.ts' +import { assert, assertEquals } from '@std/assert' import { Config } from '../src/lib/config.ts' import { path, ulid } from '../src/deps.ts' import { CliOptions } from '../src/lib/types.ts' -import { FakeTime } from 'https://deno.land/std@0.224.0/testing/time.ts' +import { FakeTime } from '@std/testing/time' Deno.test('Config.create should initialize with default values', async () => { using time = new FakeTime() diff --git a/tests/source.test.ts b/tests/source.test.ts index 9353f95..0895e6a 100644 --- a/tests/source.test.ts +++ b/tests/source.test.ts @@ -1,5 +1,5 @@ -import { assertEquals } from 'https://deno.land/std/assert/mod.ts' -import { returnsNext, stub } from 'https://deno.land/std/testing/mock.ts' +import { assertEquals } from '@std/assert' +import { returnsNext, stub } from '@std/testing/mock' import { Perforce, Source } from '../src/lib/source.ts' Deno.test('source git', () => { diff --git a/tests/template.test.ts b/tests/template.test.ts index 28f1a1b..93fb4bf 100644 --- a/tests/template.test.ts +++ b/tests/template.test.ts @@ -1,4 +1,4 @@ -import { assertEquals } from 'https://deno.land/std/assert/mod.ts' +import { assertEquals } from '@std/assert' import { getSubstitutions, normalizePaths, render, renderConfig } from '../src/lib/template.ts' import { RunrealConfig } from '../src/lib/types.ts' From a7ea3a2f6a255498147927b8cfd940ce7ec3edcd Mon Sep 17 00:00:00 2001 From: Thibault Le Ouay Date: Thu, 31 Oct 2024 10:58:55 +0100 Subject: [PATCH 2/9] fix: remove xml2js npm dependency and update to Deno URL import --- deno.jsonc | 1 - deno.lock | 1 + src/commands/workflow/exec.ts | 7 +++++-- src/deps.ts | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/deno.jsonc b/deno.jsonc index a785023..10be63a 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -36,6 +36,5 @@ "@std/path": "jsr:@std/path@^1.0.7", "@std/streams": "jsr:@std/streams@^1.0.7", "@std/testing": "jsr:@std/testing@^1.0.3", - "xml2js": "npm:xml2js@^0.6.2" } } diff --git a/deno.lock b/deno.lock index 8c534c2..52e60cc 100644 --- a/deno.lock +++ b/deno.lock @@ -21,6 +21,7 @@ "jsr:@std/streams@^1.0.7": "1.0.7", "jsr:@std/testing@^1.0.3": "1.0.3", "jsr:@std/text@~1.0.7": "1.0.8", + "npm:xml2js@*": "0.6.2", "npm:xml2js@~0.6.2": "0.6.2", "npm:zod-to-json-schema@*": "3.23.3_zod@3.23.8" }, diff --git a/src/commands/workflow/exec.ts b/src/commands/workflow/exec.ts index d68e7f2..2a7f0cd 100644 --- a/src/commands/workflow/exec.ts +++ b/src/commands/workflow/exec.ts @@ -24,7 +24,10 @@ async function executeCommand(step: { command: string; args: string[] }) { await execCmd(baseCmd, [...step.command.split(' ').slice(1), ...step.args]) } } catch (e) { + if (e instanceof Error) { + console.log(`[error] failed to exec :runreal ${step.command} ${step.args.join(' ')}: => ${e.message}`) + } throw e } } @@ -46,11 +49,11 @@ async function buildkiteExecutor(steps: { command: string; args: string[] }[]) { export const exec = new Command() .option('-d, --dry-run', 'Dry run') .type('mode', new EnumType(Mode)) - .option('-m, --mode ', 'Execution mode', { default: Mode.Local }) + .option('-m, --mode ', 'Execution mode') .description('run') .arguments('') .action(async (options, workflow) => { - const { dryRun, mode } = options as ExecOptions + const { dryRun, mode } = options const cfg = config.get(options as CliOptions) as any const run = cfg.workflows.find((w: any) => w.name === workflow) diff --git a/src/deps.ts b/src/deps.ts index 70be3d1..2e7d988 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -7,7 +7,7 @@ export * as fmt from "@std/fmt/colors"; export { parse } from "@std/jsonc"; // Maybe use npm specifier -export { xml2js } from 'xml2js' +export { xml2js } from 'https://deno.land/x/xml2js@1.0.0/mod.ts' export { Command, EnumType, ValidationError } from '@cliffy/command' export { deepmerge } from '@rebeccastevens/deepmerge' export { readNdjson } from 'https://deno.land/x/ndjson@1.1.0/mod.ts' From b08a8b9a61252aedd0327acafccb1d4d5139b123 Mon Sep 17 00:00:00 2001 From: Thibault Le Ouay Date: Thu, 31 Oct 2024 11:02:29 +0100 Subject: [PATCH 3/9] fix: buildkite pipeline --- .buildkite/pipeline.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index b6577ce..d188e26 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -2,7 +2,7 @@ common: - deno_matrix: &deno_matrix matrix: # - "ubuntu" - - "ubuntu-1.42.1" + - "ubuntu-2.0.4" plugins: - docker#v5.10.0: image: "denoland/deno:{{matrix}}" @@ -51,14 +51,14 @@ steps: label: ":godmode: test project minimal" build: message: "test runreal ${BUILDKITE_BRANCH}-${BUILDKITE_COMMIT}" - env: + env: RUNREAL_FROM_SOURCE: true RUNREAL_FROM_REF: $BUILDKITE_COMMIT - trigger: "test-project-minimal-p4" label: ":godmode: test project minimal [p4]" build: message: "test runreal ${BUILDKITE_BRANCH}-${BUILDKITE_COMMIT}" - env: + env: RUNREAL_FROM_SOURCE: true RUNREAL_FROM_REF: $BUILDKITE_COMMIT @@ -71,13 +71,13 @@ steps: label: ":goberserk: test project full" build: message: "test runreal ${BUILDKITE_BRANCH}-${BUILDKITE_COMMIT}" - env: + env: RUNREAL_FROM_SOURCE: true RUNREAL_FROM_REF: $BUILDKITE_COMMIT - trigger: "test-project-full-p4" label: ":goberserk: test project full [p4]" build: message: "test runreal ${BUILDKITE_BRANCH}-${BUILDKITE_COMMIT}" - env: + env: RUNREAL_FROM_SOURCE: true RUNREAL_FROM_REF: $BUILDKITE_COMMIT From 2463cc98fd8e29ecd20ed00a4e6cd79ba561e095 Mon Sep 17 00:00:00 2001 From: Thibault Le Ouay Date: Thu, 31 Oct 2024 11:35:59 +0100 Subject: [PATCH 4/9] chore: fmt --- src/commands/workflow/exec.ts | 3 +-- src/deps.ts | 10 +++++----- src/lib/utils.ts | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/commands/workflow/exec.ts b/src/commands/workflow/exec.ts index 2a7f0cd..f45c91b 100644 --- a/src/commands/workflow/exec.ts +++ b/src/commands/workflow/exec.ts @@ -25,8 +25,7 @@ async function executeCommand(step: { command: string; args: string[] }) { } } catch (e) { if (e instanceof Error) { - - console.log(`[error] failed to exec :runreal ${step.command} ${step.args.join(' ')}: => ${e.message}`) + console.log(`[error] failed to exec :runreal ${step.command} ${step.args.join(' ')}: => ${e.message}`) } throw e } diff --git a/src/deps.ts b/src/deps.ts index 2e7d988..91cdca9 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -1,10 +1,10 @@ -export * as path from "@std/path"; -export { mergeReadableStreams } from "@std/streams"; +export * as path from '@std/path' +export { mergeReadableStreams } from '@std/streams' -export * as dotenv from "@std/dotenv"; -export * as fmt from "@std/fmt/colors"; +export * as dotenv from '@std/dotenv' +export * as fmt from '@std/fmt/colors' -export { parse } from "@std/jsonc"; +export { parse } from '@std/jsonc' // Maybe use npm specifier export { xml2js } from 'https://deno.land/x/xml2js@1.0.0/mod.ts' diff --git a/src/lib/utils.ts b/src/lib/utils.ts index f5d8a7e..c36a801 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,4 +1,4 @@ -import { xml2js, mergeReadableStreams, path } from '../deps.ts' +import { mergeReadableStreams, path, xml2js } from '../deps.ts' import { createEngine, EngineConfiguration, EnginePlatform, EngineTarget } from './engine.ts' import { GitIgnoreFiles, UeDepsManifest } from './types.ts' From b0a1540d6d109bf7fbd98b8d34e5971e59d18dc5 Mon Sep 17 00:00:00 2001 From: Thibault Le Ouay Date: Thu, 31 Oct 2024 11:44:07 +0100 Subject: [PATCH 5/9] fix: buildkite pipeline --- src/deps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/deps.ts b/src/deps.ts index 91cdca9..b4e3440 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -9,7 +9,7 @@ export { parse } from '@std/jsonc' export { xml2js } from 'https://deno.land/x/xml2js@1.0.0/mod.ts' export { Command, EnumType, ValidationError } from '@cliffy/command' -export { deepmerge } from '@rebeccastevens/deepmerge' +export { deepmerge } from 'jsr:@rebeccastevens/deepmerge' export { readNdjson } from 'https://deno.land/x/ndjson@1.1.0/mod.ts' import { monotonicFactory } from 'https://deno.land/x/ulid@v0.3.0/mod.ts' From 030369fe5c6d7fa7952dd894b4f90efe47d68d6e Mon Sep 17 00:00:00 2001 From: Thibault Le Ouay Date: Thu, 31 Oct 2024 11:45:54 +0100 Subject: [PATCH 6/9] fix: buildkite pipeline --- src/deps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/deps.ts b/src/deps.ts index b4e3440..b263cd3 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -8,7 +8,7 @@ export { parse } from '@std/jsonc' // Maybe use npm specifier export { xml2js } from 'https://deno.land/x/xml2js@1.0.0/mod.ts' -export { Command, EnumType, ValidationError } from '@cliffy/command' +export { Command, EnumType, ValidationError } from 'jsr:@cliffy/command@1.0.0-rc.7' export { deepmerge } from 'jsr:@rebeccastevens/deepmerge' export { readNdjson } from 'https://deno.land/x/ndjson@1.1.0/mod.ts' From 82e0b019e199f070c1678f9299fd878053766fdf Mon Sep 17 00:00:00 2001 From: Thibault Le Ouay Date: Thu, 31 Oct 2024 11:57:43 +0100 Subject: [PATCH 7/9] fix: buildkite pipeline --- src/deps.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/deps.ts b/src/deps.ts index b263cd3..81677d5 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -1,10 +1,10 @@ -export * as path from '@std/path' -export { mergeReadableStreams } from '@std/streams' +export * as path from 'jsr:@std/path' +export { mergeReadableStreams } from 'jsr:@std/streams' -export * as dotenv from '@std/dotenv' -export * as fmt from '@std/fmt/colors' +export * as dotenv from 'jsr:@std/dotenv' +export * as fmt from 'jsr:@std/fmt/colors' -export { parse } from '@std/jsonc' +export { parse } from 'jsr:@std/jsonc' // Maybe use npm specifier export { xml2js } from 'https://deno.land/x/xml2js@1.0.0/mod.ts' From c405c4a958950e3cbc79fdf39566ae4add37ae76 Mon Sep 17 00:00:00 2001 From: Thibault Le Ouay Date: Thu, 31 Oct 2024 13:45:23 +0100 Subject: [PATCH 8/9] feat: add workflow ID support --- deno.lock | 29 ++++++++++++----------------- schema.json | 5 +++++ src/commands/workflow/exec.ts | 10 +++++++--- src/lib/schema.ts | 1 + tests/fixtures/test.config.json | 5 +++++ tests/template.test.ts | 3 +++ 6 files changed, 33 insertions(+), 20 deletions(-) diff --git a/deno.lock b/deno.lock index 52e60cc..b56946a 100644 --- a/deno.lock +++ b/deno.lock @@ -5,24 +5,29 @@ "jsr:@cliffy/flags@1.0.0-rc.7": "1.0.0-rc.7", "jsr:@cliffy/internal@1.0.0-rc.7": "1.0.0-rc.7", "jsr:@cliffy/table@1.0.0-rc.7": "1.0.0-rc.7", + "jsr:@rebeccastevens/deepmerge@*": "7.1.3", "jsr:@rebeccastevens/deepmerge@^7.1.3": "7.1.3", "jsr:@std/assert@^1.0.6": "1.0.6", + "jsr:@std/async@^1.0.5": "1.0.7", "jsr:@std/bytes@^1.0.2": "1.0.2", "jsr:@std/data-structures@^1.0.4": "1.0.4", + "jsr:@std/dotenv@*": "0.225.2", "jsr:@std/dotenv@~0.225.2": "0.225.2", + "jsr:@std/fmt@*": "1.0.3", "jsr:@std/fmt@^1.0.3": "1.0.3", "jsr:@std/fmt@~1.0.2": "1.0.3", "jsr:@std/fs@^1.0.4": "1.0.5", "jsr:@std/internal@^1.0.4": "1.0.4", "jsr:@std/json@1": "1.0.1", + "jsr:@std/jsonc@*": "1.0.1", "jsr:@std/jsonc@^1.0.1": "1.0.1", + "jsr:@std/path@*": "1.0.7", "jsr:@std/path@^1.0.6": "1.0.7", "jsr:@std/path@^1.0.7": "1.0.7", + "jsr:@std/streams@*": "1.0.7", "jsr:@std/streams@^1.0.7": "1.0.7", "jsr:@std/testing@^1.0.3": "1.0.3", "jsr:@std/text@~1.0.7": "1.0.8", - "npm:xml2js@*": "0.6.2", - "npm:xml2js@~0.6.2": "0.6.2", "npm:zod-to-json-schema@*": "3.23.3_zod@3.23.8" }, "jsr": { @@ -60,6 +65,9 @@ "jsr:@std/internal" ] }, + "@std/async@1.0.7": { + "integrity": "f4fadc0124432e37cba11e8b3880164661a664de00a65118d976848f32f96290" + }, "@std/bytes@1.0.2": { "integrity": "fbdee322bbd8c599a6af186a1603b3355e59a5fb1baa139f8f4c3c9a1b3e3d57" }, @@ -103,6 +111,7 @@ "integrity": "f98c2bee53860a5916727d7e7d3abe920dd6f9edace022e2d059f00d05c2cf42", "dependencies": [ "jsr:@std/assert", + "jsr:@std/async", "jsr:@std/data-structures", "jsr:@std/fs", "jsr:@std/internal", @@ -114,19 +123,6 @@ } }, "npm": { - "sax@1.4.1": { - "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" - }, - "xml2js@0.6.2": { - "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", - "dependencies": [ - "sax", - "xmlbuilder" - ] - }, - "xmlbuilder@11.0.1": { - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" - }, "zod-to-json-schema@3.23.3_zod@3.23.8": { "integrity": "sha512-TYWChTxKQbRJp5ST22o/Irt9KC5nj7CdBKYB/AosCRdj/wxEMvv4NNaj9XVUHDOIp53ZxArGhnw5HMZziPFjog==", "dependencies": [ @@ -281,8 +277,7 @@ "jsr:@std/jsonc@^1.0.1", "jsr:@std/path@^1.0.7", "jsr:@std/streams@^1.0.7", - "jsr:@std/testing@^1.0.3", - "npm:xml2js@~0.6.2" + "jsr:@std/testing@^1.0.3" ] } } diff --git a/schema.json b/schema.json index 91e1472..fa4d0a4 100644 --- a/schema.json +++ b/schema.json @@ -73,6 +73,11 @@ "items": { "type": "object", "properties": { + "id": { + "type": "string", + "pattern": "^[a-zA-Z0-9][w+\\-]*$", + "description": "Workflow id" + }, "name": { "type": "string", "description": "Workflow name" diff --git a/src/commands/workflow/exec.ts b/src/commands/workflow/exec.ts index f45c91b..0ef41c9 100644 --- a/src/commands/workflow/exec.ts +++ b/src/commands/workflow/exec.ts @@ -48,14 +48,18 @@ async function buildkiteExecutor(steps: { command: string; args: string[] }[]) { export const exec = new Command() .option('-d, --dry-run', 'Dry run') .type('mode', new EnumType(Mode)) - .option('-m, --mode ', 'Execution mode') + .option('-m, --mode ', 'Execution mode', { default: Mode.Local }) .description('run') .arguments('') .action(async (options, workflow) => { const { dryRun, mode } = options - const cfg = config.get(options as CliOptions) as any + const cfg = config.get(options as CliOptions) - const run = cfg.workflows.find((w: any) => w.name === workflow) + if (!cfg.workflows) { + throw new ValidationError('No workflows defined in config') + } + + const run = cfg.workflows.find((w) => w.id === workflow || w.name === workflow) if (!run) { throw new ValidationError(`Workflow ${workflow} not found`) } diff --git a/src/lib/schema.ts b/src/lib/schema.ts index bf18c4f..71f01a9 100644 --- a/src/lib/schema.ts +++ b/src/lib/schema.ts @@ -46,6 +46,7 @@ export const ConfigSchema = z.object({ }), workflows: z.array( z.object({ + id: z.string().regex(new RegExp('^[a-zA-Z0-9][a-zA-Z0-9\\-]*$')).optional().describe('Workflow id'), name: z.string().describe('Workflow name'), steps: z.array( z.object({ diff --git a/tests/fixtures/test.config.json b/tests/fixtures/test.config.json index 51284d8..e60ef82 100644 --- a/tests/fixtures/test.config.json +++ b/tests/fixtures/test.config.json @@ -11,6 +11,7 @@ }, "workflows": [ { + "id": "compile-client", "name": "compile client", "steps": [ { @@ -27,6 +28,7 @@ ] }, { + "id": "compile-server", "name": "compile server", "steps": [ { @@ -43,6 +45,7 @@ ] }, { + "id": "cook-all", "name": "cook all", "steps": [ { @@ -59,6 +62,7 @@ ] }, { + "id": "package-client", "name": "package client", "steps": [ { @@ -79,6 +83,7 @@ ] }, { + "id": "package-server", "name": "package server", "steps": [ { diff --git a/tests/template.test.ts b/tests/template.test.ts index 93fb4bf..ac14ce8 100644 --- a/tests/template.test.ts +++ b/tests/template.test.ts @@ -88,6 +88,7 @@ Deno.test('renderConfig should deeply replace all placeholders in config object' metadata: { ts: '2024-02-29T12:34:56Z' }, workflows: [ { + id: 'compile', name: 'compile', steps: [ { @@ -109,6 +110,7 @@ Deno.test('renderConfig should deeply replace all placeholders in config object' metadata: { ts: '2024-02-29T12:34:56Z' }, workflows: [ { + id: 'compile', name: 'compile', steps: [ { @@ -135,6 +137,7 @@ Deno.test('replace paths in template', () => { metadata: { ts: '2024-02-29T12:34:56Z' }, workflows: [ { + id: 'compile', name: 'compile', steps: [ { From e5fa77b0ea452d48465e4a464d9505805eff4d5e Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 31 Oct 2024 12:45:59 +0000 Subject: [PATCH 9/9] chore(schema): generate --- schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema.json b/schema.json index fa4d0a4..a9e582f 100644 --- a/schema.json +++ b/schema.json @@ -75,7 +75,7 @@ "properties": { "id": { "type": "string", - "pattern": "^[a-zA-Z0-9][w+\\-]*$", + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-]*$", "description": "Workflow id" }, "name": {