From f40d10c279b6577a7643ac398e0e32b69c72969c Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 25 Sep 2024 08:06:02 -0400 Subject: [PATCH 1/5] Bump to libpkgx 0.19.1 --- deno.jsonc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deno.jsonc b/deno.jsonc index b70a86ce..59040f6e 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -30,8 +30,8 @@ }, "imports": { "is-what": "https://deno.land/x/is_what@v4.1.15/src/index.ts", - "pkgx": "https://deno.land/x/libpkgx@v0.19.0/mod.ts", - "pkgx/": "https://deno.land/x/libpkgx@v0.19.0/src/", + "pkgx": "https://deno.land/x/libpkgx@v0.19.1/mod.ts", + "pkgx/": "https://deno.land/x/libpkgx@v0.19.1/src/", "outdent": "https://deno.land/x/outdent@v0.8.0/mod.ts", "cliffy/": "https://deno.land/x/cliffy@v1.0.0-rc.4/", "deno/": "https://deno.land/std@0.224.0/" From a4941fceb0e7c28272ed4cb4c49ab17ec3cfa66b Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 25 Sep 2024 11:11:33 -0400 Subject: [PATCH 2/5] No need to show empty env if `--sync` --- src/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index dfcb3eab..f5f74b2b 100644 --- a/src/app.ts +++ b/src/app.ts @@ -115,7 +115,7 @@ export default async function({ flags, ...opts }: Args, logger_prefix?: string) const out = await env({pkgs, update, logger}) if (out.trim()) { console.log(out) - } else { + } else if (!flags.sync) { console.error("empty env, try `pkgx --help`") } } break From 7d807ae304da1137ebad962bcf8abdbf9dd1afcd Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 23 Oct 2024 15:53:34 -0400 Subject: [PATCH 3/5] deno^2 (#1045) --- .github/workflows/cd.yml | 2 +- .github/workflows/ci.shellcode.yml | 2 +- .github/workflows/ci.yml | 6 +- deno.jsonc | 30 ++--- deno.lock | 180 +++++++++++++++++++++++++--- entrypoint.ts | 2 +- src/app.ts | 2 +- src/err-handler.ts | 6 +- src/modes/env.test.ts | 4 +- src/modes/install.ts | 2 +- src/modes/integrate.test.ts | 6 +- src/modes/integrate.ts | 6 +- src/modes/internal.activate.test.ts | 4 +- src/modes/internal.use.test.ts | 2 +- src/modes/repl.ts | 2 +- src/modes/run.test.ts | 4 +- src/modes/run.ts | 2 +- src/modes/x.test.ts | 4 +- src/parse-args.test.ts | 2 +- src/prefab/construct-env.test.ts | 4 +- src/prefab/failsafe.test.ts | 6 +- src/prefab/install.test.ts | 4 +- src/prefab/parse-pkg-str.test.ts | 4 +- src/prefab/resolve-arg0.test.ts | 4 +- src/utils/Logger.ts | 4 +- src/utils/color.test.ts | 2 +- src/utils/color.ts | 2 +- src/utils/devenv.test.ts | 4 +- src/utils/devenv.ts | 6 +- src/utils/execve.test.ts | 4 +- src/utils/execve.ts | 1 + src/utils/get-shebang.test.ts | 2 +- src/utils/get-shebang.ts | 2 +- src/utils/sh-escape.test.ts | 2 +- 34 files changed, 238 insertions(+), 81 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c57473e1..2dc7d5e2 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -86,7 +86,7 @@ jobs: # - uses: pkgxdev/dev@v0 - uses: denoland/setup-deno@v1 with: - deno-version: ~1.45 + deno-version: ^2.0.2 - run: deno task compile diff --git a/.github/workflows/ci.shellcode.yml b/.github/workflows/ci.shellcode.yml index bae4eb0b..1f473d7d 100644 --- a/.github/workflows/ci.shellcode.yml +++ b/.github/workflows/ci.shellcode.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: denoland/setup-deno@v1 with: - deno-version: ~1.45 + deno-version: ^2.0.2 - uses: actions/checkout@v4 - run: deno task compile - uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2de07feb..c94e32e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: - uses: actions/checkout@v4 - uses: denoland/setup-deno@v1 # using ourself to install deno could compromise the tests with: - deno-version: ~1.45 + deno-version: ^2.0.2 - run: deno cache **/*.test.ts - run: deno task test --coverage=cov_profile --no-check - run: deno coverage cov_profile --lcov --exclude=tests/ --output=cov_profile.lcov @@ -59,7 +59,7 @@ jobs: - uses: actions/checkout@v4 - uses: denoland/setup-deno@v1 # using ourself to install deno could compromise the tests with: - deno-version: ~1.45 + deno-version: ^2.0.2 - run: deno lint typecheck: @@ -68,5 +68,5 @@ jobs: - uses: actions/checkout@v4 - uses: denoland/setup-deno@v1 with: - deno-version: ~1.45 + deno-version: ^2.0.2 - run: deno task typecheck diff --git a/deno.jsonc b/deno.jsonc index 59040f6e..eb324004 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -1,17 +1,13 @@ { "compilerOptions": { - "allowJs": false, "strict": true }, "tasks": { // runs this source checkout, args will be passed - "run": "deno run --unstable-fs --unstable-ffi --unstable-process -A ./entrypoint.ts", + "run": "deno run --allow-all ./entrypoint.ts", // you can specify paths to specific tests if you need - // follows is the ideal permissions lines, unfortunately deno considers making symlinks to require full read/write permissions for fuck knows why reasons - //"test": "deno test --allow-read=$PWD,$TMPDIR,$HOME,/ --allow-env --allow-write=$TMPDIR --allow-ffi --unstable", - "test": "deno test --unstable-ffi --allow-ffi --allow-read --allow-env --allow-write", - // ^^ ffi & unstable needed for execve.ts + "test": "deno test --allow-all", // installs to /usr/local/bin/pkgx "install": "deno task compile && ./pkgx +gnu.org/coreutils /usr/bin/sudo install -D ./pkgx /usr/local/bin/pkgx", @@ -19,21 +15,27 @@ //--------------------------------------- ci/cd/admin "coverage": "scripts/run-coverage.sh", "typecheck": "deno check ./entrypoint.ts", - "compile": "deno compile --lock=deno.lock --allow-read --allow-write --allow-net --allow-run --allow-env --allow-ffi --unstable-ffi --unstable-fs --unstable-process --output \"$INIT_CWD/pkgx\" ./entrypoint.ts" + "compile": "deno compile --lock=deno.lock --allow-all --output \"$INIT_CWD/pkgx\" ./entrypoint.ts" }, - "pkgx": "deno~1.45", + "pkgx": "deno~2.0", "lint": { "exclude": ["src/**/*.test.ts"] }, "fmt": { - "semiColons": false + "semiColons": false }, "imports": { + "@cliffy/ansi": "jsr:@cliffy/ansi@^1.0.0-rc.7", + "@std/assert": "jsr:@std/assert@^1.0.6", + "@std/fmt": "jsr:@std/fmt@^1.0.2", + "@std/io": "jsr:@std/io@^0.225.0", + "@std/jsonc": "jsr:@std/jsonc@^1.0.1", + "@std/path": "jsr:@std/path@^1.0.6", + "@std/testing": "jsr:@std/testing@^1.0.3", + "@std/yaml": "jsr:@std/yaml@^1.0.5", "is-what": "https://deno.land/x/is_what@v4.1.15/src/index.ts", - "pkgx": "https://deno.land/x/libpkgx@v0.19.1/mod.ts", - "pkgx/": "https://deno.land/x/libpkgx@v0.19.1/src/", - "outdent": "https://deno.land/x/outdent@v0.8.0/mod.ts", - "cliffy/": "https://deno.land/x/cliffy@v1.0.0-rc.4/", - "deno/": "https://deno.land/std@0.224.0/" + "outdent": "jsr:@cspotcode/outdent@^0.8", + "pkgx": "https://deno.land/x/libpkgx@v0.20.0/mod.ts", + "pkgx/": "https://deno.land/x/libpkgx@v0.20.0/src/" } } diff --git a/deno.lock b/deno.lock index 670deef8..ad6a6f73 100644 --- a/deno.lock +++ b/deno.lock @@ -1,19 +1,122 @@ { - "version": "3", - "packages": { - "specifiers": { - "npm:@faker-js/faker": "npm:@faker-js/faker@8.1.0", - "npm:@types/node": "npm:@types/node@18.16.19" + "version": "4", + "specifiers": { + "jsr:@cliffy/ansi@^1.0.0-rc.7": "1.0.0-rc.7", + "jsr:@cliffy/internal@1.0.0-rc.7": "1.0.0-rc.7", + "jsr:@cspotcode/outdent@0.8": "0.8.0", + "jsr:@std/assert@*": "1.0.6", + "jsr:@std/assert@^1.0.6": "1.0.6", + "jsr:@std/bytes@*": "1.0.2", + "jsr:@std/bytes@^1.0.2": "1.0.2", + "jsr:@std/crypto@1": "1.0.3", + "jsr:@std/data-structures@^1.0.4": "1.0.4", + "jsr:@std/encoding@*": "1.0.5", + "jsr:@std/encoding@1": "1.0.5", + "jsr:@std/encoding@~1.0.5": "1.0.5", + "jsr:@std/fmt@*": "1.0.2", + "jsr:@std/fmt@^1.0.2": "1.0.2", + "jsr:@std/fs@1": "1.0.4", + "jsr:@std/fs@^1.0.4": "1.0.4", + "jsr:@std/internal@^1.0.4": "1.0.4", + "jsr:@std/io@*": "0.225.0", + "jsr:@std/io@0.225": "0.225.0", + "jsr:@std/io@0.225.0": "0.225.0", + "jsr:@std/json@1": "1.0.0", + "jsr:@std/jsonc@*": "1.0.1", + "jsr:@std/jsonc@^1.0.1": "1.0.1", + "jsr:@std/path@*": "1.0.6", + "jsr:@std/path@1": "1.0.6", + "jsr:@std/path@^1.0.6": "1.0.6", + "jsr:@std/testing@*": "1.0.3", + "jsr:@std/testing@^1.0.3": "1.0.3", + "jsr:@std/yaml@*": "1.0.5", + "jsr:@std/yaml@1": "1.0.5", + "jsr:@std/yaml@^1.0.5": "1.0.5", + "npm:@faker-js/faker@*": "8.1.0", + "npm:@types/node@*": "18.16.19" + }, + "jsr": { + "@cliffy/ansi@1.0.0-rc.7": { + "integrity": "f71c921cce224c13d322e5cedba4f38e8f7354c7d855c9cb22729362a53f25aa", + "dependencies": [ + "jsr:@cliffy/internal", + "jsr:@std/encoding@~1.0.5" + ] + }, + "@cliffy/internal@1.0.0-rc.7": { + "integrity": "10412636ab3e67517d448be9eaab1b70c88eba9be22617b5d146257a11cc9b17" + }, + "@cspotcode/outdent@0.8.0": { + "integrity": "bbb3dea1443b4191a091644dfeaf3f182cca83e9003d211c50786c21792695f6" + }, + "@std/assert@1.0.6": { + "integrity": "1904c05806a25d94fe791d6d883b685c9e2dcd60e4f9fc30f4fc5cf010c72207", + "dependencies": [ + "jsr:@std/internal" + ] + }, + "@std/bytes@1.0.2": { + "integrity": "fbdee322bbd8c599a6af186a1603b3355e59a5fb1baa139f8f4c3c9a1b3e3d57" + }, + "@std/crypto@1.0.3": { + "integrity": "a2a32f51ddef632d299e3879cd027c630dcd4d1d9a5285d6e6788072f4e51e7f" + }, + "@std/data-structures@1.0.4": { + "integrity": "fa0e20c11eb9ba673417450915c750a0001405a784e2a4e0c3725031681684a0" + }, + "@std/encoding@1.0.5": { + "integrity": "ecf363d4fc25bd85bd915ff6733a7e79b67e0e7806334af15f4645c569fefc04" + }, + "@std/fmt@1.0.2": { + "integrity": "87e9dfcdd3ca7c066e0c3c657c1f987c82888eb8103a3a3baa62684ffeb0f7a7" + }, + "@std/fs@1.0.4": { + "integrity": "2907d32d8d1d9e540588fd5fe0ec21ee638134bd51df327ad4e443aaef07123c", + "dependencies": [ + "jsr:@std/path@^1.0.6" + ] }, - "npm": { - "@faker-js/faker@8.1.0": { - "integrity": "sha512-38DT60rumHfBYynif3lmtxMqMqmsOQIxQgEuPZxCk2yUYN0eqWpTACgxi0VpidvsJB8CRxCpvP7B3anK85FjtQ==", - "dependencies": {} - }, - "@types/node@18.16.19": { - "integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==", - "dependencies": {} - } + "@std/internal@1.0.4": { + "integrity": "62e8e4911527e5e4f307741a795c0b0a9e6958d0b3790716ae71ce085f755422" + }, + "@std/io@0.225.0": { + "integrity": "c1db7c5e5a231629b32d64b9a53139445b2ca640d828c26bf23e1c55f8c079b3", + "dependencies": [ + "jsr:@std/bytes@^1.0.2" + ] + }, + "@std/json@1.0.0": { + "integrity": "985c1e544918d42e4e84072fc739ac4a19c3a5093292c99742ffcdd03fb6a268" + }, + "@std/jsonc@1.0.1": { + "integrity": "6b36956e2a7cbb08ca5ad7fbec72e661e6217c202f348496ea88747636710dda", + "dependencies": [ + "jsr:@std/json" + ] + }, + "@std/path@1.0.6": { + "integrity": "ab2c55f902b380cf28e0eec501b4906e4c1960d13f00e11cfbcd21de15f18fed" + }, + "@std/testing@1.0.3": { + "integrity": "f98c2bee53860a5916727d7e7d3abe920dd6f9edace022e2d059f00d05c2cf42", + "dependencies": [ + "jsr:@std/assert@^1.0.6", + "jsr:@std/data-structures", + "jsr:@std/fs@^1.0.4", + "jsr:@std/internal", + "jsr:@std/path@^1.0.6" + ] + }, + "@std/yaml@1.0.5": { + "integrity": "71ba3d334305ee2149391931508b2c293a8490f94a337eef3a09cade1a2a2742" + } + }, + "npm": { + "@faker-js/faker@8.1.0": { + "integrity": "sha512-38DT60rumHfBYynif3lmtxMqMqmsOQIxQgEuPZxCk2yUYN0eqWpTACgxi0VpidvsJB8CRxCpvP7B3anK85FjtQ==" + }, + "@types/node@18.16.19": { + "integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==" } }, "redirects": { @@ -835,6 +938,42 @@ "https://deno.land/x/libpkgx@v0.19.0/vendor/sqlite3@0.10.0/src/ffi.ts": "ddffcee178b3e72c45be385efd8b4434f7196cafe45a0046ae68df9af307c7f3", "https://deno.land/x/libpkgx@v0.19.0/vendor/sqlite3@0.10.0/src/statement.ts": "2be7ffebbb72a031899dbf189972c5596aa73eabfc8a382a1bac9c5c111b0026", "https://deno.land/x/libpkgx@v0.19.0/vendor/sqlite3@0.10.0/src/util.ts": "49a936fd7c0483c4baca9d7d7442351931888010af2f4b8de6e95eee29788f98", + "https://deno.land/x/libpkgx@v0.20.0/mod.ts": "14a69905ffad8064444c02d146008efeb6a0ddf0fe543483839af18e01684f5a", + "https://deno.land/x/libpkgx@v0.20.0/src/deps.ts": "4135fc00efbacb68e3700a5498d236f2a70a5e36284954d87aa5d7becc62282d", + "https://deno.land/x/libpkgx@v0.20.0/src/hooks/useCache.ts": "9f3cc576fabae2caa6aedbf00ab12a59c732be1315471e5a475fef496c1e35ae", + "https://deno.land/x/libpkgx@v0.20.0/src/hooks/useCellar.ts": "c1e264fcb732423734f8c113fc7cb80c97befe8f13ed9d24906328bc5526c72d", + "https://deno.land/x/libpkgx@v0.20.0/src/hooks/useConfig.ts": "d5a02ee7a191fb4a2c3cd1721690ab6cf0338c9680847a9e9c4a6c9ea94df025", + "https://deno.land/x/libpkgx@v0.20.0/src/hooks/useDownload.ts": "3f9133486008146809508783b977e3480d0a43238ace27f78565fb9679aa9906", + "https://deno.land/x/libpkgx@v0.20.0/src/hooks/useFetch.ts": "ecf29342210b8eceed216e3bb73fcc7ea5b3ea5059686cf344ed190ca42ff682", + "https://deno.land/x/libpkgx@v0.20.0/src/hooks/useInventory.ts": "f459d819ab676a7e3786522d856b7670e994e4a755b0d1609b53c8b4ebe0c959", + "https://deno.land/x/libpkgx@v0.20.0/src/hooks/useMoustaches.ts": "e9166ddace759315782be0f570a4cd63c78e3b85592d59b75ddd33a0e401aa6b", + "https://deno.land/x/libpkgx@v0.20.0/src/hooks/useOffLicense.ts": "1c41ef6882512b67a47fcd1d1c0ce459906d6981a59f6be86d982594a7c26058", + "https://deno.land/x/libpkgx@v0.20.0/src/hooks/usePantry.ts": "5e9f6dae8042b2b7635a1e7e4492f15b576d7a735eec7604bb824f7676d14d95", + "https://deno.land/x/libpkgx@v0.20.0/src/hooks/useShellEnv.ts": "ae2388d3f15d2e03435df23a8392ace21d3d4f0c83b2575a9670ab7badc389c3", + "https://deno.land/x/libpkgx@v0.20.0/src/hooks/useSync.ts": "ea605a0eaa43ab9988d36dd6150e16dd911c4be45b7b0f2add6b236636bd517c", + "https://deno.land/x/libpkgx@v0.20.0/src/hooks/useSyncCache.ts": "85375b787fbdd15aa86f3cc6cc12e730869cc475a95d48ea50e69b3b24bb0a04", + "https://deno.land/x/libpkgx@v0.20.0/src/plumbing/hydrate.ts": "c75f151ed307532ce9c2bf62c61e6478bb1132f95a11b848e02ea2dec08c2ff3", + "https://deno.land/x/libpkgx@v0.20.0/src/plumbing/install.ts": "2a4e19fae70fef7ba0be454fd5b7efed4d7d19a5141d26d3b26124ab792007ed", + "https://deno.land/x/libpkgx@v0.20.0/src/plumbing/link.ts": "0ed6198de737ebeab1704d375c732c9264fb0cfa7f2aedddb90f51d100174a73", + "https://deno.land/x/libpkgx@v0.20.0/src/plumbing/resolve.ts": "9425e0d201ee440a8dc011940046f0bb6d94aa29cd738e1a8c39ca86e55aad41", + "https://deno.land/x/libpkgx@v0.20.0/src/plumbing/which.ts": "f918211e561e56aabf6909e06fa10fa3be06ffebd9e7cc28ce57efef4faff27d", + "https://deno.land/x/libpkgx@v0.20.0/src/porcelain/install.ts": "85caffe3842ab63bf6d59c6c5c9fb93fbc95a0d5652488d93b95d865722b67b9", + "https://deno.land/x/libpkgx@v0.20.0/src/porcelain/run.ts": "55cc9124dca732e2f5557a8c451daebecb109c86b2f4347fa1e433aedf35ab5a", + "https://deno.land/x/libpkgx@v0.20.0/src/types.ts": "dc1a4e6458d11454282f832909838c56f786a26eed54fb8ab5675d6691ebf534", + "https://deno.land/x/libpkgx@v0.20.0/src/utils/Path.ts": "45303993a377363277e6c201160f36f1f9a5997632db03f473b618968d568e58", + "https://deno.land/x/libpkgx@v0.20.0/src/utils/error.ts": "b0d3130f5cdfc0cc8ea10f93fea0e7e97d4473ddc9bc527156b0fcf24c7b939c", + "https://deno.land/x/libpkgx@v0.20.0/src/utils/flock.ts": "5fd77f6b53c3a90888cf20a7726e9047aad2c766e4ec2fbf7cf2f916b98d99a4", + "https://deno.land/x/libpkgx@v0.20.0/src/utils/host.ts": "3b9e0d4cb05f9bde0ee8bcb0f8557b0a339f6ef56dfb1f08b2cfa63b44db91ee", + "https://deno.land/x/libpkgx@v0.20.0/src/utils/misc.ts": "a4d7944da07066e5dd2ef289af436dc7f1032aed4272811e9b19ceeed60b8491", + "https://deno.land/x/libpkgx@v0.20.0/src/utils/pkg.ts": "e737cc9a98cd6a2797668c6ef856128692290256a521cc3906bd538410925451", + "https://deno.land/x/libpkgx@v0.20.0/src/utils/read-lines.ts": "6d947ccd5f8e48701ed9c5402b6ac5144df3fce60d666f19b6506edbc36c8367", + "https://deno.land/x/libpkgx@v0.20.0/src/utils/semver.ts": "da22a0e0cf74de792cc4d44c01ec5b767463816c8abb4b5fb86583ccda573298", + "https://deno.land/x/libpkgx@v0.20.0/vendor/sqlite3@0.10.0/mod.ts": "7ce0a19f9cea3475cc94750ece61c20d857f1c3a279ad38cd029a3f8d9b7b03e", + "https://deno.land/x/libpkgx@v0.20.0/vendor/sqlite3@0.10.0/src/constants.ts": "85fd27aa6e199093f25f5f437052e16fd0e0870b96ca9b24a98e04ddc8b7d006", + "https://deno.land/x/libpkgx@v0.20.0/vendor/sqlite3@0.10.0/src/database.ts": "49569b0f279cfc3e42730002ae789a2694da74deb212e63a4b4e6640dc4d70ba", + "https://deno.land/x/libpkgx@v0.20.0/vendor/sqlite3@0.10.0/src/ffi.ts": "ddffcee178b3e72c45be385efd8b4434f7196cafe45a0046ae68df9af307c7f3", + "https://deno.land/x/libpkgx@v0.20.0/vendor/sqlite3@0.10.0/src/statement.ts": "2be7ffebbb72a031899dbf189972c5596aa73eabfc8a382a1bac9c5c111b0026", + "https://deno.land/x/libpkgx@v0.20.0/vendor/sqlite3@0.10.0/src/util.ts": "19815a492dd8f4c684587238dc20066de11782137de549cd4c9709d1b548247e", "https://deno.land/x/outdent@v0.8.0/mod.ts": "72630e680dcc36d5ae556fbff6900b12706c81a6fd592345fc98bcc0878fb3ca", "https://deno.land/x/outdent@v0.8.0/src/index.ts": "6dc3df4108d5d6fedcdb974844d321037ca81eaaa16be6073235ff3268841a22", "https://deno.land/x/plug@1.0.1/deps.ts": "35ea2acd5e3e11846817a429b7ef4bec47b80f2d988f5d63797147134cbd35c2", @@ -880,5 +1019,18 @@ "https://raw.githubusercontent.com/pkgxdev/libpkgx/v0.14.0/src/utils/misc.ts": "a4d7944da07066e5dd2ef289af436dc7f1032aed4272811e9b19ceeed60b8491", "https://raw.githubusercontent.com/pkgxdev/libpkgx/v0.14.0/src/utils/pkg.ts": "5ef9cc1955a5067489ac4d2af8615652505cb17a48745e811cb786ab89377547", "https://raw.githubusercontent.com/pkgxdev/libpkgx/v0.14.0/src/utils/semver.ts": "eb67414471e209c7fb179365b5d446227119ecbb63e4004c9045a90b5a16329a" + }, + "workspace": { + "dependencies": [ + "jsr:@cliffy/ansi@^1.0.0-rc.7", + "jsr:@cspotcode/outdent@0.8", + "jsr:@std/assert@^1.0.6", + "jsr:@std/fmt@^1.0.2", + "jsr:@std/io@0.225", + "jsr:@std/jsonc@^1.0.1", + "jsr:@std/path@^1.0.6", + "jsr:@std/testing@^1.0.3", + "jsr:@std/yaml@^1.0.5" + ] } } diff --git a/entrypoint.ts b/entrypoint.ts index b434849b..fe6ffcba 100644 --- a/entrypoint.ts +++ b/entrypoint.ts @@ -4,7 +4,7 @@ */ import { render as perror } from "./src/err-handler.ts" -import { setColorEnabled } from "deno/fmt/colors.ts" +import { setColorEnabled } from "@std/fmt/colors" import clicolor from "./src/utils/clicolor.ts" setColorEnabled(clicolor(Deno.stderr)) diff --git a/src/app.ts b/src/app.ts index f5f74b2b..2e43cf14 100644 --- a/src/app.ts +++ b/src/app.ts @@ -4,9 +4,9 @@ import internal_activate from "./modes/internal.activate.ts" import shell_completion from "./modes/shell-completion.ts" import parse_pkg_str from "./prefab/parse-pkg-str.ts" import InstallLogger from "./utils/InstallLogger.ts" -import { setColorEnabled } from "deno/fmt/colors.ts" import internal_use from "./modes/internal.use.ts" import { Args as BaseArgs } from "./parse-args.ts" +import { setColorEnabled } from "@std/fmt/colors" import { AmbiguityError } from "./utils/error.ts" import integrate from "./modes/integrate.ts" import uninstall from "./modes/uninstall.ts" diff --git a/src/err-handler.ts b/src/err-handler.ts index 1dd9d8c4..7cc38cca 100644 --- a/src/err-handler.ts +++ b/src/err-handler.ts @@ -3,7 +3,7 @@ import { AmbiguityError, ProgrammerError, ProvidesError } from "./utils/error.ts import announce from "./utils/announce.ts" import { red } from "./utils/color.ts" -export default function(err: Error) { +export default function(err: unknown) { if (err instanceof InstallationNotFoundError) { const subtitle = utils.pkg.str(err.pkg) render("not cached", subtitle, [], 'pkg-not-cached') @@ -48,10 +48,12 @@ export default function(err: Error) { render('programmer error', undefined, [['this is a bug, please report it']], 'https://github.com/pkgxdev/pkgx/issues/new') } else if (err instanceof PkgxError) { console.error('%c × %s', 'color: red', err.message) - } else { + } else if (err instanceof Error) { const title = 'unexpected error' const ctx = err.stack?.split('\n').map(x => [x]) ?? [['no stack trace']] render(title, err.message, ctx, 'https://github.com/pkgxdev/pkgx/issues/new') + } else { + render('unknown error', `${err}`, [['no context']], 'https://github.com/pkgxdev/pkgx/issues/new') } return 1 } diff --git a/src/modes/env.test.ts b/src/modes/env.test.ts index 1295fae4..d3178dad 100644 --- a/src/modes/env.test.ts +++ b/src/modes/env.test.ts @@ -1,7 +1,7 @@ import { null_logger as logger } from "../utils/test-utils.ts" -import { assertEquals } from "deno/assert/mod.ts" import specimen, { _internals } from "./env.ts" -import * as mock from "deno/testing/mock.ts" +import { assertEquals } from "@std/assert" +import * as mock from "@std/testing/mock" import { semver } from "pkgx" import undent from "outdent" diff --git a/src/modes/install.ts b/src/modes/install.ts index a9fb31f9..162c846b 100644 --- a/src/modes/install.ts +++ b/src/modes/install.ts @@ -90,7 +90,7 @@ export default async function(pkgs: PackageRequirement[], unsafe: boolean) { rm -f ${programs.map(p => `'${p}'`).join(' ')} && echo "uninstalled: ${pkgstr}" >&2 fi` } - + const f = dst.mkdir('p').join(program) if (f.exists()) { diff --git a/src/modes/integrate.test.ts b/src/modes/integrate.test.ts index 15a30984..1b9ef79d 100644 --- a/src/modes/integrate.test.ts +++ b/src/modes/integrate.test.ts @@ -1,8 +1,8 @@ // deno-lint-ignore-file no-explicit-any -import { afterEach, beforeEach, describe, afterAll, it } from "deno/testing/bdd.ts" +import { afterEach, beforeEach, describe, afterAll, it } from "@std/testing/bdd" import specimen0, { _internals } from "./integrate.ts" -import { assertRejects } from "deno/assert/mod.ts" -import * as mock from "deno/testing/mock.ts" +import { assertRejects } from "@std/assert" +import * as mock from "@std/testing/mock" import { isString } from "is-what" import { Path } from "pkgx" diff --git a/src/modes/integrate.ts b/src/modes/integrate.ts index 639ea023..18421fb3 100644 --- a/src/modes/integrate.ts +++ b/src/modes/integrate.ts @@ -1,9 +1,9 @@ -import { writeAll } from "deno/io/write_all.ts" -import { readAll } from "deno/io/read_all.ts" -import { readLines } from "deno/io/read_lines.ts" +import readLines from "pkgx/utils/read-lines.ts" import { Path, PkgxError, utils } from "pkgx" import announce from "../utils/announce.ts" import shellcode from "./shellcode.ts" +import { writeAll } from "@std/io" +import { readAll } from "@std/io" const { flatmap, host } = utils //TODO could be a fun efficiency excercise to maintain a separate write file-pointer diff --git a/src/modes/internal.activate.test.ts b/src/modes/internal.activate.test.ts index eecfa129..b164b641 100644 --- a/src/modes/internal.activate.test.ts +++ b/src/modes/internal.activate.test.ts @@ -2,8 +2,8 @@ import { fixturesd, null_logger as logger } from "../utils/test-utils.ts" import { _internals as _devenv_internals } from "../utils/devenv.ts" import specimen0, { _internals } from "./internal.activate.ts" -import { assertEquals, assertRejects } from "deno/assert/mod.ts" -import * as mock from "deno/testing/mock.ts" +import { assertEquals, assertRejects } from "@std/assert" +import * as mock from "@std/testing/mock" import { SemVer, Path, utils, semver } from "pkgx" Deno.test("internal.activate.ts", async runner => { diff --git a/src/modes/internal.use.test.ts b/src/modes/internal.use.test.ts index f4d65743..bc009700 100644 --- a/src/modes/internal.use.test.ts +++ b/src/modes/internal.use.test.ts @@ -2,7 +2,7 @@ import { semver, SemVer, Path, Installation, utils } from "pkgx" import { null_logger as logger } from "../utils/test-utils.ts" import specimen0, { _internals } from "./internal.use.ts" -import * as mock from "deno/testing/mock.ts" +import * as mock from "@std/testing/mock" Deno.test("internal.use.ts", async runner => { diff --git a/src/modes/repl.ts b/src/modes/repl.ts index c7b01937..d342d783 100644 --- a/src/modes/repl.ts +++ b/src/modes/repl.ts @@ -1,7 +1,7 @@ import construct_env from "../prefab/construct-env.ts" import install, { Logger } from "../prefab/install.ts" import { PackageRequirement, Path, PkgxError, utils } from "pkgx" -import { basename } from "deno/path/mod.ts" +import { basename } from "@std/path" import { dim } from "../utils/color.ts" import exec from "../utils/execve.ts" diff --git a/src/modes/run.test.ts b/src/modes/run.test.ts index 01bad512..29afb12a 100644 --- a/src/modes/run.test.ts +++ b/src/modes/run.test.ts @@ -1,9 +1,9 @@ // deno-lint-ignore-file require-await -import { assertEquals, assertRejects, assertThrows } from "deno/assert/mod.ts" +import { assertEquals, assertRejects, assertThrows } from "@std/assert" import specimen, { NoEntrypointError, _internals } from "./run.ts" import { Path, SemVer, semver, hooks } from "pkgx" import { faker_args } from "../utils/test-utils.ts" -import * as mock from "deno/testing/mock.ts" +import * as mock from "@std/testing/mock" Deno.test("run.ts", async runner => { const opts = { pkgs: [], update: false, logger: { replace: () => {}, clear: () => {}, upgrade: () => null as any } } diff --git a/src/modes/run.ts b/src/modes/run.ts index 95d499dc..c0e73ed8 100644 --- a/src/modes/run.ts +++ b/src/modes/run.ts @@ -1,9 +1,9 @@ import { PackageRequirement, PkgxError, hooks } from "pkgx" import parse_pkg_str from "../prefab/parse-pkg-str.ts" import construct_env from "../prefab/construct-env.ts" -import { isString } from "deno/yaml/_utils.ts" import install, { Logger } from "../prefab/install.ts" import execve from "../utils/execve.ts" +import { isString } from "is-what" export default async function(args: string[], opts: { update: boolean | Set, diff --git a/src/modes/x.test.ts b/src/modes/x.test.ts index 52db9393..568ddaee 100644 --- a/src/modes/x.test.ts +++ b/src/modes/x.test.ts @@ -1,10 +1,10 @@ // deno-lint-ignore-file require-await no-explicit-any -import { assertEquals, assertRejects, fail } from "deno/assert/mod.ts" +import { assertEquals, assertRejects, fail } from "@std/assert" import { Path, SemVer, PkgxError, semver } from "pkgx" import { faker_args } from "../utils/test-utils.ts" import { ProvidesError } from "../utils/error.ts" import specimen, { _internals } from "./x.ts" -import * as mock from "deno/testing/mock.ts" +import * as mock from "@std/testing/mock" //TODO use a testLib thing (libpkgx provides this) //TODO add faker methods for more of what we hardcode here diff --git a/src/parse-args.test.ts b/src/parse-args.test.ts index 82bd0b3c..c6a02b1d 100644 --- a/src/parse-args.test.ts +++ b/src/parse-args.test.ts @@ -1,4 +1,4 @@ -import { assert, assertEquals, assertThrows, fail } from "deno/assert/mod.ts" +import { assert, assertEquals, assertThrows, fail } from "@std/assert" import { faker_args } from "./utils/test-utils.ts" import parse_args from "./parse-args.ts" import { UsageError } from "./utils/error.ts"; diff --git a/src/prefab/construct-env.test.ts b/src/prefab/construct-env.test.ts index 96019816..09b43a90 100644 --- a/src/prefab/construct-env.test.ts +++ b/src/prefab/construct-env.test.ts @@ -1,7 +1,7 @@ -import { assertEquals, assertThrows } from "deno/assert/mod.ts" +import { assertEquals, assertThrows } from "@std/assert" import specimen, { _internals } from "./construct-env.ts" import { Path, SemVer, semver, hooks } from "pkgx" -import * as mock from "deno/testing/mock.ts" +import * as mock from "@std/testing/mock" Deno.test({ name: "construct_env.ts", diff --git a/src/prefab/failsafe.test.ts b/src/prefab/failsafe.test.ts index e8104e60..a7d52d78 100644 --- a/src/prefab/failsafe.test.ts +++ b/src/prefab/failsafe.test.ts @@ -1,8 +1,8 @@ // deno-lint-ignore-file require-await -import { assertEquals } from "deno/assert/assert_equals.ts" +import { assertEquals } from "@std/assert" import specimen, { _internals } from "./failsafe.ts" -import { assertRejects } from "deno/assert/mod.ts" -import * as mock from "deno/testing/mock.ts" +import { assertRejects } from "@std/assert" +import * as mock from "@std/testing/mock" import { PackageNotFoundError } from "pkgx" Deno.test("failsafe.ts", async runner => { diff --git a/src/prefab/install.test.ts b/src/prefab/install.test.ts index 0bdb5367..b24710f3 100644 --- a/src/prefab/install.test.ts +++ b/src/prefab/install.test.ts @@ -1,9 +1,9 @@ // deno-lint-ignore-file no-explicit-any require-await -import { assert, assertEquals, assertFalse } from "deno/assert/mod.ts" +import { assert, assertEquals, assertFalse } from "@std/assert" import { null_logger as logger } from "../utils/test-utils.ts" import specimen, { _internals } from "./install.ts" import hydrate from "pkgx/plumbing/hydrate.ts" -import * as mock from "deno/testing/mock.ts" +import * as mock from "@std/testing/mock" import { Path, SemVer, semver } from "pkgx" Deno.test("install.ts", () => { diff --git a/src/prefab/parse-pkg-str.test.ts b/src/prefab/parse-pkg-str.test.ts index 81e8563b..ca2fa5fa 100644 --- a/src/prefab/parse-pkg-str.test.ts +++ b/src/prefab/parse-pkg-str.test.ts @@ -1,8 +1,8 @@ // deno-lint-ignore-file no-explicit-any import { ProvidesError, AmbiguityError } from "../utils/error.ts" -import { assertRejects, assertEquals } from "deno/assert/mod.ts" +import { assertRejects, assertEquals } from "@std/assert" import specimen, { _internals } from "./parse-pkg-str.ts" -import * as mock from "deno/testing/mock.ts" +import * as mock from "@std/testing/mock" Deno.test("parse-pkg-str.ts", async runner => { diff --git a/src/prefab/resolve-arg0.test.ts b/src/prefab/resolve-arg0.test.ts index 5896aab3..cc49a5ac 100644 --- a/src/prefab/resolve-arg0.test.ts +++ b/src/prefab/resolve-arg0.test.ts @@ -1,9 +1,9 @@ // deno-lint-ignore-file no-explicit-any -import { assertRejects, assertEquals } from "deno/assert/mod.ts" +import { assertRejects, assertEquals } from "@std/assert" import specimen, { _internals } from "./resolve-arg0.ts" import { AmbiguityError } from "../utils/error.ts" import { faker_args } from "../utils/test-utils.ts" -import * as mock from "deno/testing/mock.ts" +import * as mock from "@std/testing/mock" import { Path, semver, SemVer } from "pkgx" Deno.test("resolve-arg0.ts", async runner => { diff --git a/src/utils/Logger.ts b/src/utils/Logger.ts index b5f8b5c1..3daac5b9 100644 --- a/src/utils/Logger.ts +++ b/src/utils/Logger.ts @@ -1,5 +1,5 @@ -import { stripAnsiCode } from "https://deno.land/std@0.213.0/fmt/colors.ts" -import { ansi } from "cliffy/ansi/ansi.ts" +import { stripAnsiCode } from "@std/fmt/colors" +import { ansi } from "@cliffy/ansi" import { dim } from "./color.ts" export default class Logger { diff --git a/src/utils/color.test.ts b/src/utils/color.test.ts index 6e76cd0c..60ede233 100644 --- a/src/utils/color.test.ts +++ b/src/utils/color.test.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "deno/assert/mod.ts"; +import { assertEquals } from "@std/assert"; import { blurple, dim, inverse_blurple } from "./color.ts"; Deno.test("color", async runner => { diff --git a/src/utils/color.ts b/src/utils/color.ts index be1bf799..55691b0a 100644 --- a/src/utils/color.ts +++ b/src/utils/color.ts @@ -1,4 +1,4 @@ -import { dim, rgb8, bgRgb8, red } from "deno/fmt/colors.ts" +import { dim, rgb8, bgRgb8, red } from "@std/fmt/colors" export const blurple = (x: string) => rgb8(x, 63) export { dim, red } diff --git a/src/utils/devenv.test.ts b/src/utils/devenv.test.ts index 89386138..06df67c3 100644 --- a/src/utils/devenv.test.ts +++ b/src/utils/devenv.test.ts @@ -1,7 +1,7 @@ // deno-lint-ignore-file require-await -import { assert, assertEquals, assertRejects, assertThrows } from "deno/assert/mod.ts" +import { assert, assertEquals, assertRejects, assertThrows } from "@std/assert" import specimen, { _internals } from "./devenv.ts" -import * as mock from "deno/testing/mock.ts" +import * as mock from "@std/testing/mock" import { fixturesd } from "./test-utils.ts" import { Path, utils } from "pkgx" diff --git a/src/utils/devenv.ts b/src/utils/devenv.ts index 5e34bf36..f39681a5 100644 --- a/src/utils/devenv.ts +++ b/src/utils/devenv.ts @@ -1,11 +1,11 @@ import { PlainObject, isArray, isNumber, isPlainObject, isString } from "is-what" import { PackageRequirement, Path, semver, hooks, utils } from "pkgx" import { validatePackageRequirement } from "pkgx/hooks/usePantry.ts" -import { parse as parseYaml } from "deno/yaml/parse.ts" import parse_pkg_str from "../prefab/parse-pkg-str.ts" -import { readLines } from "deno/io/read_lines.ts" +import readLines from "pkgx/utils/read-lines.ts" +import { parse as parseYaml } from "@std/yaml" import { ProgrammerError } from "./error.ts" -import * as JSONC from "deno/jsonc/mod.ts" +import * as JSONC from "@std/jsonc" const { useMoustaches } = hooks export default async function(dir: Path) { diff --git a/src/utils/execve.test.ts b/src/utils/execve.test.ts index 408846fd..b1b6e38c 100644 --- a/src/utils/execve.test.ts +++ b/src/utils/execve.test.ts @@ -1,7 +1,7 @@ -import { assertThrows } from "deno/assert/assert_throws.ts" +import { assertThrows } from "@std/assert" import execve, { _internals } from "./execve.ts" import faker, { faker_args } from "./test-utils.ts" -import * as mock from "deno/testing/mock.ts" +import * as mock from "@std/testing/mock" import { Path } from "pkgx" Deno.test("execve.ts", async runner => { diff --git a/src/utils/execve.ts b/src/utils/execve.ts index 72702941..517ac148 100644 --- a/src/utils/execve.ts +++ b/src/utils/execve.ts @@ -32,6 +32,7 @@ export default function({cmd: args, env}: {cmd: string[], env: Record { From 68ef9fbf38b7da3479a1d107b699924a9b6ca5df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 19:54:38 +0000 Subject: [PATCH 4/5] Bump denoland/setup-deno from 1 to 2 Bumps [denoland/setup-deno](https://github.com/denoland/setup-deno) from 1 to 2. - [Release notes](https://github.com/denoland/setup-deno/releases) - [Commits](https://github.com/denoland/setup-deno/compare/v1...v2) --- updated-dependencies: - dependency-name: denoland/setup-deno dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/cd.yml | 2 +- .github/workflows/ci.shellcode.yml | 2 +- .github/workflows/ci.yml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 2dc7d5e2..b3792b3b 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -84,7 +84,7 @@ jobs: # we would prefer this, but our pkging is not stable enough :/ # - uses: pkgxdev/dev@v0 - - uses: denoland/setup-deno@v1 + - uses: denoland/setup-deno@v2 with: deno-version: ^2.0.2 diff --git a/.github/workflows/ci.shellcode.yml b/.github/workflows/ci.shellcode.yml index 1f473d7d..f265d43b 100644 --- a/.github/workflows/ci.shellcode.yml +++ b/.github/workflows/ci.shellcode.yml @@ -17,7 +17,7 @@ jobs: compile: runs-on: ubuntu-latest steps: - - uses: denoland/setup-deno@v1 + - uses: denoland/setup-deno@v2 with: deno-version: ^2.0.2 - uses: actions/checkout@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c94e32e6..579c5e5f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' }} - uses: actions/checkout@v4 - - uses: denoland/setup-deno@v1 # using ourself to install deno could compromise the tests + - uses: denoland/setup-deno@v2 # using ourself to install deno could compromise the tests with: deno-version: ^2.0.2 - run: deno cache **/*.test.ts @@ -57,7 +57,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: denoland/setup-deno@v1 # using ourself to install deno could compromise the tests + - uses: denoland/setup-deno@v2 # using ourself to install deno could compromise the tests with: deno-version: ^2.0.2 - run: deno lint @@ -66,7 +66,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: denoland/setup-deno@v1 + - uses: denoland/setup-deno@v2 with: deno-version: ^2.0.2 - run: deno task typecheck From f28d9311eac07c0dd0b4c3900eab2420199b6604 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sat, 23 Nov 2024 10:21:04 -0500 Subject: [PATCH 5/5] bump libpkgx --- deno.jsonc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deno.jsonc b/deno.jsonc index eb324004..7f9c67d0 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -35,7 +35,7 @@ "@std/yaml": "jsr:@std/yaml@^1.0.5", "is-what": "https://deno.land/x/is_what@v4.1.15/src/index.ts", "outdent": "jsr:@cspotcode/outdent@^0.8", - "pkgx": "https://deno.land/x/libpkgx@v0.20.0/mod.ts", - "pkgx/": "https://deno.land/x/libpkgx@v0.20.0/src/" + "pkgx": "https://deno.land/x/libpkgx@v0.20.1/mod.ts", + "pkgx/": "https://deno.land/x/libpkgx@v0.20.1/src/" } }