Skip to content

Commit

Permalink
Export plugin entrypoints on jsr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Apr 14, 2024
1 parent 97c9356 commit 50ef71e
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"/pup.json",
"/pup.jsonc"
],
"url": "https://jsr.io/@pup/pup/1.0.0-rc.19/docs/pup.schema.json"
"url": "https://jsr.io/@pup/pup/1.0.0-rc.20/docs/pup.schema.json"
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ _For detailed documentation, visit [pup.56k.guru](https://pup.56k.guru)._
To install Pup, open your terminal and execute the following command:

```bash
deno run -Ar jsr:@pup/[email protected].19 setup --channel prerelease
deno run -Ar jsr:@pup/[email protected].20 setup --channel prerelease
```

This command downloads the latest version of Pup and installs it on your system. The `--channel prerelease` option is included as there is no stable version of Pup yet. Read more abour release
Expand Down
2 changes: 1 addition & 1 deletion application.meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

const Application = {
name: "pup",
version: "1.0.0-rc.19",
version: "1.0.0-rc.20",
url: "jsr:@pup/pup@$VERSION",
canary_url: "https://raw.githubusercontent.com/Hexagon/pup/main/pup.ts",
deno: null, /* Minimum stable version of Deno required to run Pup (without --unstable-* flags) */
Expand Down
9 changes: 7 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"name": "@pup/pup",
"version": "1.0.0-rc.19",
"exports": "./pup.ts",
"version": "1.0.0-rc.20",
"exports": {
".": "./pup.ts",
"./mod.ts": "./mod.ts",
"./plugins/web-interface/mod.ts": "./plugins/web-interface/mod.ts",
"./plugins/splunk-hec/mod.ts": "./plugins/splunk-hec/mod.ts"
},

"fmt": {
"lineWidth": 200,
Expand Down
7 changes: 6 additions & 1 deletion docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ nav_order: 13

All notable changes to this project will be documented in this section.

## [1.0.0-rc.20] - 2024-04-14

- fix(plugins): Export plugin entrypoints on jsr.io
- fix(core): Fix issue with PATH variable in process runner.

## [1.0.0-rc.19] - 2024-04-14

- fix(core): Fix issue with PATH variable in process runner.
- chore(core): Make code related to environment variables cross-runtime.
- change(cli): Revert cli command `foreground` to `run`

## [1.0.0-rc.19] - 2024-04-14
## [1.0.0-rc.18] - 2024-04-14

- fix(packaging): Fix regression bug in upgrader after moving to jsr.io

Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples/basic-webinterface/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To activate the web interface plugin, set up the `plugins:`-section of your `pup
"processes": [/* ... */],
"plugins": [
{
"url": "jsr:@pup/pup/$VERSION/plugins/web-interface/mod.ts",
"url": "jsr:@pup/pup@$VERSION/plugins/web-interface/mod.ts",
"options": {
"port": 5000
}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples/basic/pup.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
// Completely optional: Include $schema to get auto completion in VS Code etc...
"$schema": "https://jsr.io/@pup/pup/1.0.0-rc.19/docs/pup.schema.json",
"$schema": "https://jsr.io/@pup/pup/1.0.0-rc.20/docs/pup.schema.json",

// Global logger configuration, all options can be ovverridden per process
"logger": {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Pup is centered on a single configuration file, `pup.json`, which manages all as
To install Pup, open your terminal and execute the following command:

```bash
deno run -Ar jsr:@pup/[email protected].19 setup --channel prerelease
deno run -Ar jsr:@pup/[email protected].20 setup --channel prerelease
```

This command downloads the latest version of Pup and installs it on your system. The `--channel prerelease` option is included as there is no stable version of Pup yet. Read more abour release
Expand Down
2 changes: 1 addition & 1 deletion docs/src/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Before proceeding with the installation, ensure that you have the following inst
To install Pup, open your terminal and execute the following command:

```bash
deno run -Ar jsr:@pup/[email protected].19 setup --channel prerelease
deno run -Ar jsr:@pup/[email protected].20 setup --channel prerelease
```

This command downloads the latest version of Pup and installs it on your system.
Expand Down
35 changes: 15 additions & 20 deletions lib/core/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { ProcessConfiguration, Pup } from "./pup.ts"
import { readLines, StringReader } from "@std/io"
import { BaseRunner, type RunnerCallback, type RunnerResult } from "../types/runner.ts"
import { $, type CommandChild } from "dax-sh"
import { getEnv, setEnv } from "@cross/env"
import { getEnv } from "@cross/env"

/**
* Represents a task runner that executes tasks as regular processes.
Expand All @@ -34,7 +34,6 @@ class Runner extends BaseRunner {
}

const env = this.createEnvironmentConfig()
console.log(env)
const child = this.prepareCommand(env)

this.process = child.spawn()
Expand Down Expand Up @@ -108,29 +107,25 @@ class Runner extends BaseRunner {
if (this.pup.temporaryStoragePath) env.PUP_TEMP_STORAGE = this.pup.temporaryStoragePath
if (this.pup.persistentStoragePath) env.PUP_DATA_STORAGE = this.pup.persistentStoragePath

this.extendPath()

return env
}

/**
* Extends the PATH environment variable with the path specified in the process configuration.
*/
private extendPath() {
const targetPaths: string[] = []

const pathEnv = getEnv("PATH")
if (pathEnv !== undefined) {
targetPaths.push(pathEnv)
// Transfer real path
if (getEnv("PATH")) {
if (env.PATH) {
env.PATH = getEnv("PATH") + ":" + env.PATH
} else {
env.PATH = getEnv("PATH")!
}
}

// Transfer specified path
if (this.processConfig.path) {
targetPaths.push(this.processConfig.path)
if (env.PATH) {
env.PATH = this.processConfig.path + ":" + env.PATH
} else {
env.PATH = this.processConfig.path
}
}

if (targetPaths.length > 0) {
setEnv("PATH", targetPaths.join(":"))
}
return env
}

/**
Expand Down
14 changes: 14 additions & 0 deletions versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
"canary_url": "https://raw.githubusercontent.com/Hexagon/pup/main/pup.ts",
"stable": [],
"prerelease": [
{
"version": "1.0.0-rc.20",
"url": "jsr:@pup/[email protected]",
"deno": null,
"deno_unstable": "1.42.0",
"default_permissions": [
"--allow-env",
"--allow-read",
"--allow-write",
"--allow-sys=loadavg,systemMemoryInfo,osUptime,osRelease",
"--allow-net",
"--allow-run"
]
},
{
"version": "1.0.0-rc.19",
"url": "jsr:@pup/[email protected]",
Expand Down

0 comments on commit 50ef71e

Please sign in to comment.