From 50ef71eb89ca4087ee183d54d4964a8a4e8a2c6d Mon Sep 17 00:00:00 2001 From: Hexagon Date: Sun, 14 Apr 2024 21:57:33 +0200 Subject: [PATCH] Export plugin entrypoints on jsr.io --- .vscode/settings.json | 2 +- README.md | 2 +- application.meta.ts | 2 +- deno.json | 9 +++-- docs/src/changelog.md | 7 +++- .../src/examples/basic-webinterface/README.md | 2 +- docs/src/examples/basic/pup.jsonc | 2 +- docs/src/index.md | 2 +- docs/src/installation.md | 2 +- lib/core/runner.ts | 35 ++++++++----------- versions.json | 14 ++++++++ 11 files changed, 49 insertions(+), 30 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 2b79568..25121fb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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" } ] } diff --git a/README.md b/README.md index d800b34..5c03040 100644 --- a/README.md +++ b/README.md @@ -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/pup@1.0.0-rc.19 setup --channel prerelease +deno run -Ar jsr:@pup/pup@1.0.0-rc.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 diff --git a/application.meta.ts b/application.meta.ts index 60d32e7..a5587ef 100644 --- a/application.meta.ts +++ b/application.meta.ts @@ -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) */ diff --git a/deno.json b/deno.json index 948158e..e7f964d 100644 --- a/deno.json +++ b/deno.json @@ -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, diff --git a/docs/src/changelog.md b/docs/src/changelog.md index c4f43cc..468e5e6 100644 --- a/docs/src/changelog.md +++ b/docs/src/changelog.md @@ -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 diff --git a/docs/src/examples/basic-webinterface/README.md b/docs/src/examples/basic-webinterface/README.md index b8fc9a4..34786d0 100644 --- a/docs/src/examples/basic-webinterface/README.md +++ b/docs/src/examples/basic-webinterface/README.md @@ -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 } diff --git a/docs/src/examples/basic/pup.jsonc b/docs/src/examples/basic/pup.jsonc index b29f6d8..736ef20 100644 --- a/docs/src/examples/basic/pup.jsonc +++ b/docs/src/examples/basic/pup.jsonc @@ -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": { diff --git a/docs/src/index.md b/docs/src/index.md index 2c5a1c6..e04b65e 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -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/pup@1.0.0-rc.19 setup --channel prerelease +deno run -Ar jsr:@pup/pup@1.0.0-rc.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 diff --git a/docs/src/installation.md b/docs/src/installation.md index b276971..4fb26c4 100644 --- a/docs/src/installation.md +++ b/docs/src/installation.md @@ -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/pup@1.0.0-rc.19 setup --channel prerelease +deno run -Ar jsr:@pup/pup@1.0.0-rc.20 setup --channel prerelease ``` This command downloads the latest version of Pup and installs it on your system. diff --git a/lib/core/runner.ts b/lib/core/runner.ts index 2a4a39a..0df36ab 100644 --- a/lib/core/runner.ts +++ b/lib/core/runner.ts @@ -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. @@ -34,7 +34,6 @@ class Runner extends BaseRunner { } const env = this.createEnvironmentConfig() - console.log(env) const child = this.prepareCommand(env) this.process = child.spawn() @@ -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 } /** diff --git a/versions.json b/versions.json index 7e72a49..cb728f1 100644 --- a/versions.json +++ b/versions.json @@ -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/pup@1.0.0-rc.20", + "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/pup@1.0.0-rc.19",