Skip to content

Commit c6499f5

Browse files
committed
fix(core): Various fixes to log message formatting
1 parent 75ec717 commit c6499f5

9 files changed

Lines changed: 762 additions & 1096 deletions

File tree

devenv.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"devenv": {
44
"locked": {
55
"dir": "src/modules",
6-
"lastModified": 1780614188,
7-
"narHash": "sha256-8uj/ypWoaeeEXnmAlltoC/7SePVWUCxTiTt+6NpMVB0=",
6+
"lastModified": 1780630679,
7+
"narHash": "sha256-hhQyVAYmNKziZ0T+T4Gsk0PYmnz4vdzOzpkJAmDASKM=",
88
"owner": "cachix",
99
"repo": "devenv",
10-
"rev": "21d73ce1e943df373568607d23121a4f286f0ecf",
10+
"rev": "90ed6227ab389dd4e874a69a724f25dba312b754",
1111
"type": "github"
1212
},
1313
"original": {

packages/core/src/components/usage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export function Usage(props: UsageProps) {
5252

5353
return (
5454
<>
55-
{code`$ `}
5655
<Switch>
5756
<Match when={packageManager === "npm"}>{`npx `}</Match>
5857
<Match when={packageManager === "yarn"}>{`yarn exec `}</Match>

packages/core/src/resolver/resolve.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
import { toArray } from "@stryke/convert/to-array";
2727
import { getUnique } from "@stryke/helpers/get-unique";
2828
import { isJsonSchemaObjectType, isJsonSchemaTupleType } from "@stryke/json";
29+
import { replacePath } from "@stryke/path/replace";
2930
import { constantCase } from "@stryke/string-format/constant-case";
3031
import { titleCase } from "@stryke/string-format/title-case";
3132
import { isBoolean } from "@stryke/type-checks/is-boolean";
@@ -380,16 +381,17 @@ async function preprocess<TContext extends Context>(
380381
}
381382

382383
context.debug(
383-
`Adding reflection for CLI command: ${command.id} (file: ${
384-
command.entry.input.file
385-
})`
384+
`Adding reflection for CLI command: ${command.id} (file: ${replacePath(
385+
command.entry.input.file,
386+
context.config.cwd
387+
)})`
386388
);
387389

388390
result.module = await resolveModule<CommandModule>(
389391
context,
390392
command.entry.input,
391393
{
392-
name: command.title || titleCase(command.name),
394+
name: `${command.title || titleCase(command.name)} Command Bundler`,
393395
plugins: [
394396
esbuildPlugin(context, {
395397
reflection: "default",

packages/core/src/types/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ interface BaseOptions {
103103
* Should Shell Shock attempt to automatically assign environment variables to manipulate default values for command options based on the option name?
104104
*
105105
* @remarks
106-
* If set to a string, Shell Shock will use the provided string as an application specific environment variable prefix, convert the option name to {@link https://stringcase.org/cases/constant/ | constant case}, and prepend the provided `string` value to determine the corresponding environment variable name. For example, if an option is named `"configPath"` and the `autoAssignEnv` is `"MY_APP_"`, Shell Shock will look for an environment variable named `"MY_APP_CONFIG_PATH"` and assign its value to the option if it exists. If set to `true`, Shell Shock will use a default environment variable prefix derived from the {@link Options.name | application name}.
106+
* If set to a string, Shell Shock will use the provided string as an application specific environment variable prefix, convert the option name to {@link https://stringcase.org/cases/constant/ | constant case}, and prepend the provided `string` value to determine the corresponding environment variable name. For example, if an option is named `"configPath"` and the `autoAssignEnv` is `"MY_APP"`, Shell Shock will look for an environment variable named `"MY_APP_CONFIG_PATH"` and assign its value to the option if it exists. If set to `true`, Shell Shock will use a default environment variable prefix derived from the {@link Options.name | application name}.
107107
*
108108
* @see https://medium.com/chingu/an-introduction-to-environment-variables-and-how-to-use-them-f602f66d15fa
109109
* @see https://stringcase.org/cases/constant/

packages/nx/powerlines.plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { defineConfig } from "powerlines/config";
2222
export default defineConfig({
2323
skipCache: true,
2424
name: "nx-plugin",
25-
input: ["./src/plugin/index.ts"],
25+
input: ["src/plugin/index.ts"],
2626
plugins: [tsdown()],
2727
platform: "node",
2828
resolve: {

packages/plugin-help/src/components/display.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ export function VirtualCommandHelpDisplay(
489489
child.icon
490490
? `(isUnicodeSupported ? " ${child.icon} " : "") + `
491491
: ""
492-
}\`${child.title} ${child.virtual ? "" : "Command"}${
492+
}\`${child.title}${
493493
child.tags?.length > 0
494494
? ` - ${child.tags
495495
.map(
@@ -566,7 +566,7 @@ export function CommandHelpDisplay(props: CommandHelpDisplayProps) {
566566
child.icon
567567
? `(isUnicodeSupported ? " ${child.icon} " : "") + `
568568
: ""
569-
}\`${child.title} ${child.virtual ? "" : "Command"}${
569+
}\`${child.title}${
570570
child.tags?.length > 0
571571
? ` - ${child.tags
572572
.map(
@@ -591,9 +591,9 @@ export function CommandHelpDisplay(props: CommandHelpDisplayProps) {
591591
</For>
592592
{code`help(\`Running a specific command with the help flag (via: \${inlineCode("${getAppBin(
593593
context
594-
)} ${command.segments.join(
595-
" "
596-
)} <specific command> --help")}) will provide additional information that is specific to that command.\`);
594+
)}${
595+
command.segments.length > 0 ? ` ${command.segments.join(" ")}` : ""
596+
} <specific command> --help")}) will provide additional information that is specific to that command.\`);
597597
writeLine("");`}
598598
</Show>
599599
</>

0 commit comments

Comments
 (0)