Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/pkgxdev/pkgx into deno-1.41
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs committed Feb 22, 2024
2 parents 67f53e2 + 104affb commit 3fbb7c5
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 445 deletions.
2 changes: 1 addition & 1 deletion .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM debian:buster-slim as stage0
COPY ./products/* /pkgx/
RUN cp /pkgx/$(uname -m) /usr/local/bin/pkgx
RUN echo 'export PS1="\\[\\033[38;5;63m\\]pkgx\\[\\033[0m\\] $ "' >> /root/.bashrc
RUN echo 'export PS1="\\[\\033[38;5;63m\\]pkgx\\[\\033[0m\\]\\w $ "' >> /root/.bashrc
RUN pkgx integrate

FROM debian:buster-slim as stage1
Expand Down
4 changes: 2 additions & 2 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
},
"imports": {
"is-what": "https://deno.land/x/[email protected]/src/index.ts",
"pkgx": "https://deno.land/x/libpkgx@v0.17.0/mod.ts",
"pkgx/": "https://deno.land/x/libpkgx@v0.17.0/src/",
"pkgx": "https://deno.land/x/libpkgx@v0.18.1/mod.ts",
"pkgx/": "https://deno.land/x/libpkgx@v0.18.1/src/",
"outdent": "https://deno.land/x/[email protected]/mod.ts",
"cliffy/": "https://deno.land/x/[email protected]/",
"deno/": "https://deno.land/[email protected]/" // cliffy is on 196 so we standardized on it
Expand Down
464 changes: 39 additions & 425 deletions deno.lock

Large diffs are not rendered by default.

31 changes: 21 additions & 10 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

## How do I run the latest version of `pkgx`?

pkgx is just another pkg so:
Typically you want to upgrade `pkgx` so either:

1. `brew upgrade pkgx`; or
2. `curl -LSsf pkgx.sh | sh`

> [!NOTE]
> Indeed! Our installer installs and upgrades too.
OTOH, `pkgx` packages itself so:

```sh
pkgx@latest npx@latest cowsay@latest 'fancy a cuppa?'
```

Is a valid command, provided you have shell integration.

If you are looking to upgrade the “installed” `pkgx` version then use
`brew upgrade pkgx`, re-run the installer (it upgrades itself) or repeat
your installation method.

A self-upgrade feature is coming soon.


## How do I run the latest version of a specific pkg?

Expand All @@ -27,6 +29,13 @@ cached, but after that updates will only be fetched if requested.
pkgx deno@latest
```

For us neophiliacs we have written a [`mash`] script to check for newer
versions of what you have cached and fetch them:

```sh
pkgx mash pkgx/cache upgrade
```

> [OSS.app](https://pkgx.app) can automatically install updates.

Expand Down Expand Up @@ -87,11 +96,10 @@ additional commands then those commands are invoked in that environment.

## How do I list what packages are cached?

We have created a [`mash`](https://mash/pkgx.sh) script to list cached
packages:
We have created a [`mash`] script to list cached packages:

```sh
pkgx mash pkgx/ls
pkgx mash pkgx/cache ls
```

All packages are encapsulated in individual, versioned folders in
Expand Down Expand Up @@ -293,3 +301,6 @@ pkgx +foo -- man foo
## I have another question

[Support](support.md)


[`mash`](https://mash/pkgx.sh)
8 changes: 8 additions & 0 deletions docs/run/anywhere/terminals.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ If you download manually you’ll need to move the binary somewhere in
your `PATH`.
{% endhint %}

4. If you're on Arch Linux (or any of it's derivatives) you can also use the [`pkgx` AUR] (latest released version) or [`pkgx-git` AUR] (latest development version, might not be stable).

{% hint style='warning' %}
The AURs are community-maintained and might be out-of-date. Use them with caution.
{% endhint %}


[`brew`]: https://brew.sh
[GitHub Releases]: https://github.com/pkgxdev/pkgx/releases
[installer]: https://github.com/pkgxdev/setup/blob/main/installer.sh
[`pkgx` AUR]: https://aur.archlinux.org/packages/pkgx
[`pkgx-git` AUR]: https://aur.archlinux.org/packages/pkgx-git
2 changes: 1 addition & 1 deletion fixtures/package.json/arr/package.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"pkgx": ["zlib.net^1.2"]
"pkgx": ["zlib.net^1.2", "[email protected]"]
}
4 changes: 2 additions & 2 deletions src/modes/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ Deno.test("run.ts", async runner => {
}
})

await runner.step("coverage++", () => {
await runner.step("coverage++", async () => {
if (hooks.usePantry().missing()) {
assertThrows(() => _internals.get_entrypoint({project: "github.com/ggerganov/llama.cpp"}))
} else {
_internals.get_entrypoint({project: "github.com/ggerganov/llama.cpp"})
await _internals.get_entrypoint({project: "github.com/ggerganov/llama.cpp"})
}
})
})
Expand Down
14 changes: 10 additions & 4 deletions src/prefab/construct-env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import specimen, { _internals } from "./construct-env.ts"
import { Path, SemVer, semver, hooks } from "pkgx"
import * as mock from "deno/testing/mock.ts"

Deno.test("construct_env.ts", async runner => {
Deno.test({
name: "construct_env.ts",
// libpkgx loads sqlite3 dynamically during this test
// libpkgx considers this a global resource that is acceptable to leak
// we would prefer it didn't, certainly this test doesn't need to by using a real pantry or pantry-cache
sanitizeResources: false,
async fn(runner) {
const pkg1 = { project: 'foo', constraint: new semver.Range("^2")}
const pkg2 = { project: 'bar', constraint: new semver.Range("~3.1")}

Expand Down Expand Up @@ -34,12 +40,12 @@ Deno.test("construct_env.ts", async runner => {
}
})

await runner.step("coverage++", () => {
await runner.step("coverage++", async () => {
const pkg = { project: "bytereef.org/mpdecimal", version: new SemVer("2.1.2") }
if (hooks.usePantry().missing()) {
assertThrows(() => _internals.runtime_env(pkg, []))
} else {
_internals.runtime_env(pkg, [])
await _internals.runtime_env(pkg, [])
}
})
})
}})
8 changes: 8 additions & 0 deletions tea.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# https://tea.xyz/what-is-this-file
---
version: 1.0.0
codeOwners:
- '0x5E2DE4A68df811AAAD32d71fb065e6946fA5C8d9' #mxcl
- '0x2faad60792b0594fB37592BA25Bd7387Fbd35191' #thomas-borrel
- '0xAb9A89fA4Bbd04Fc37116F0d7766866D001EA704' #jhheider
quorum: 1

0 comments on commit 3fbb7c5

Please sign in to comment.