@vlandoss/localproxy 0.2.1 → 0.2.2-git-53b6b02.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/run.mjs +4 -3
- package/package.json +2 -2
- package/src/run.ts +4 -3
- package/src/types.ts +2 -2
package/dist/run.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { homedir } from "node:os";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { createPkg, createShellService, dirnameOf, palette } from "@vlandoss/clibuddy";
|
|
4
4
|
import { createCommand } from "commander";
|
|
5
5
|
import * as fs$2 from "node:fs";
|
|
6
6
|
import { createLoggy } from "@vlandoss/loggy";
|
|
@@ -385,7 +385,7 @@ const CREDITS_TEXT = `\nAcknowledgment:
|
|
|
385
385
|
const BIN_DIR = path.dirname(dirnameOf(import.meta));
|
|
386
386
|
const INSTALL_DIR = path.join(homedir(), ".localproxy");
|
|
387
387
|
async function createContext({ binDir, installDir }) {
|
|
388
|
-
const binPkg = await
|
|
388
|
+
const binPkg = await createPkg(binDir);
|
|
389
389
|
if (!binPkg) throw new Error("Could not find bin package.json");
|
|
390
390
|
return {
|
|
391
391
|
installDir,
|
|
@@ -396,7 +396,8 @@ async function createContext({ binDir, installDir }) {
|
|
|
396
396
|
}
|
|
397
397
|
async function createProgram(options) {
|
|
398
398
|
const ctx = await createContext(options);
|
|
399
|
-
|
|
399
|
+
const version = ctx.binPkg.version;
|
|
400
|
+
return createCommand("localproxy").alias("localp").version(version, "-v, --version").addHelpText("before", BANNER_TEXT).addHelpText("after", CREDITS_TEXT).addCommand(createSetupCommand(ctx)).addCommand(createStatusCommand(ctx)).addCommand(createStartCommand(ctx)).addCommand(createStopCommand(ctx)).addCommand(createCleanCommand(ctx));
|
|
400
401
|
}
|
|
401
402
|
try {
|
|
402
403
|
await (await createProgram({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vlandoss/localproxy",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2-git-53b6b02.0",
|
|
4
4
|
"description": "Simple local development proxy automation",
|
|
5
5
|
"homepage": "https://github.com/variableland/dx/tree/main/packages/localproxy#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@inquirer/prompts": "8.3.0",
|
|
35
35
|
"commander": "14.0.3",
|
|
36
|
-
"@vlandoss/clibuddy": "0.4.0",
|
|
36
|
+
"@vlandoss/clibuddy": "0.4.1-git-53b6b02.0",
|
|
37
37
|
"@vlandoss/loggy": "0.2.0"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
package/src/run.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { homedir } from "node:os";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { createPkg, dirnameOf } from "@vlandoss/clibuddy";
|
|
4
4
|
import { createCommand } from "commander";
|
|
5
5
|
import { createCleanCommand } from "./commands/clean.ts";
|
|
6
6
|
import { createSetupCommand } from "./commands/setup.ts";
|
|
@@ -15,7 +15,7 @@ const BIN_DIR = path.dirname(dirnameOf(import.meta));
|
|
|
15
15
|
const INSTALL_DIR = path.join(homedir(), ".localproxy");
|
|
16
16
|
|
|
17
17
|
async function createContext({ binDir, installDir }: ProgramOptions) {
|
|
18
|
-
const binPkg = await
|
|
18
|
+
const binPkg = await createPkg(binDir);
|
|
19
19
|
|
|
20
20
|
if (!binPkg) {
|
|
21
21
|
throw new Error("Could not find bin package.json");
|
|
@@ -31,10 +31,11 @@ async function createContext({ binDir, installDir }: ProgramOptions) {
|
|
|
31
31
|
|
|
32
32
|
async function createProgram(options: ProgramOptions) {
|
|
33
33
|
const ctx = await createContext(options);
|
|
34
|
+
const version = ctx.binPkg.version;
|
|
34
35
|
|
|
35
36
|
return createCommand("localproxy")
|
|
36
37
|
.alias("localp")
|
|
37
|
-
.version(
|
|
38
|
+
.version(version, "-v, --version")
|
|
38
39
|
.addHelpText("before", BANNER_TEXT)
|
|
39
40
|
.addHelpText("after", CREDITS_TEXT)
|
|
40
41
|
.addCommand(createSetupCommand(ctx))
|
package/src/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Pkg } from "@vlandoss/clibuddy";
|
|
2
2
|
|
|
3
3
|
export type ProgramOptions = {
|
|
4
4
|
binDir: string;
|
|
@@ -9,5 +9,5 @@ export type Context = {
|
|
|
9
9
|
binDir: string;
|
|
10
10
|
installDir: string;
|
|
11
11
|
caddyfilePath: string;
|
|
12
|
-
binPkg:
|
|
12
|
+
binPkg: Pkg;
|
|
13
13
|
};
|