prompt-language-shell 0.0.2 → 0.0.4

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/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { readFileSync } from 'fs';
3
+ import { readFileSync, existsSync } from 'fs';
4
4
  import { fileURLToPath } from 'url';
5
5
  import { dirname, join } from 'path';
6
6
  import { render } from 'ink';
@@ -11,7 +11,10 @@ const __dirname = dirname(__filename);
11
11
  const packageJsonPath = join(__dirname, '../package.json');
12
12
  const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
13
13
  // Check if running from development (symlinked) or production
14
- const isDev = process.argv[1]?.includes('/node_modules/.bin/') === false;
14
+ // In dev, package.json is directly in parent dir and src/ exists
15
+ // In production, we're in node_modules and src/ doesn't exist alongside
16
+ const srcPath = join(__dirname, '../src');
17
+ const isDev = existsSync(srcPath);
15
18
  const appInfo = {
16
19
  name: packageJson.name,
17
20
  version: packageJson.version,
@@ -5,5 +5,9 @@ export function Welcome({ info: app }) {
5
5
  .split('. ')
6
6
  .map((line) => line.replace(/\.$/, ''))
7
7
  .filter(Boolean);
8
- return (_jsx(Box, { alignSelf: "flex-start", marginTop: 1, children: _jsxs(Box, { borderStyle: "round", borderColor: "green", paddingX: 3, paddingY: 1, marginBottom: 1, flexDirection: "column", children: [_jsx(Box, { flexDirection: "column", children: _jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { bold: true, children: "Please... " }), _jsx(Text, { color: "grey", children: "( " }), _jsx(Text, { color: "greenBright", bold: true, children: "pls" }), _jsxs(Text, { children: [" v", app.version] }), app.isDev && _jsx(Text, { color: "yellowBright", children: " dev" }), _jsx(Text, { color: "grey", children: " )" })] }) }), _jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: "greenBright", children: "Prompt Language Shell " }), _jsx(Text, { children: "interface" })] }), descriptionLines.map((line, index) => (_jsx(Box, { children: _jsxs(Text, { dimColor: true, children: [line, "."] }) }, index)))] }) }));
8
+ // Transform package name: "prompt-language-shell" -> "Prompt Language Shell"
9
+ const words = app.name
10
+ .split('-')
11
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1));
12
+ return (_jsx(Box, { alignSelf: "flex-start", marginTop: 1, children: _jsxs(Box, { borderStyle: "round", borderColor: "green", paddingX: 3, paddingY: 1, marginBottom: 1, flexDirection: "column", children: [_jsx(Box, { flexDirection: "column", children: _jsxs(Box, { marginBottom: 1, gap: 1, children: [_jsx(Text, { color: "whiteBright", dimColor: true, children: ">" }), _jsx(Text, { children: "please" }), _jsx(Text, { color: "whiteBright", dimColor: true, children: "(" }), _jsx(Text, { color: "greenBright", bold: true, children: "pls" }), _jsx(Text, { color: "whiteBright", dimColor: true, children: ")" }), _jsx(Text, { children: "do stuff" })] }) }), _jsxs(Box, { marginBottom: 1, gap: 1, children: [words.map((word, index) => (_jsx(Text, { color: "greenBright", children: word }, index))), _jsxs(Text, { color: "whiteBright", dimColor: true, children: ["v", app.version] }), app.isDev && _jsx(Text, { color: "yellowBright", children: "dev" })] }), descriptionLines.map((line, index) => (_jsx(Box, { children: _jsxs(Text, { color: "whiteBright", dimColor: true, children: [line, "."] }) }, index)))] }) }));
9
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prompt-language-shell",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Your personal command-line concierge. Ask politely, and it gets things done.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",