@jvittechs/j 1.0.11

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/package.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "name": "@jvittechs/j",
3
+ "version": "1.0.11",
4
+ "description": "A unified CLI tool for JV-IT TECHS developers to manage Jai1 Framework. Supports both `j` and `jai1` commands. Please contact TeamAI for usage instructions.",
5
+ "type": "module",
6
+ "bin": {
7
+ "j": "dist/cli.js",
8
+ "jai1": "dist/cli.js"
9
+ },
10
+ "exports": {
11
+ ".": "./dist/cli.js"
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "redmine.config.example.yaml",
16
+ "scripts/redmine-sync-issue.sh",
17
+ "scripts/postinstall.js"
18
+ ],
19
+ "engines": {
20
+ "node": ">=20"
21
+ },
22
+ "license": "MIT",
23
+ "author": "JVIT <dev@jvit.com>",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/jvittechs/jai.git",
27
+ "directory": "packages/cli"
28
+ },
29
+ "homepage": "https://github.com/jvittechs/jai/tree/main/packages/cli#readme",
30
+ "keywords": [
31
+ "jai1",
32
+ "framework",
33
+ "redmine",
34
+ "cli",
35
+ "markdown",
36
+ "issues",
37
+ "context",
38
+ "agentic",
39
+ "coding"
40
+ ],
41
+ "scripts": {
42
+ "postinstall": "node scripts/postinstall.js",
43
+ "bundle:guide": "node scripts/bundle-guide-content.js",
44
+ "build": "npm run bundle:guide && tsup src/cli.ts --dts --format esm --target node22 --out-dir dist --sourcemap && npm run copy-web-chat",
45
+ "copy-web-chat": "mkdir -p dist/web-chat && cp -r src/web-chat/* dist/web-chat/",
46
+ "dev": "tsx src/cli.ts --help",
47
+ "lint": "eslint .",
48
+ "test": "vitest run",
49
+ "release": "node scripts/release.js",
50
+ "smart-publish": "node scripts/smart-publish.js"
51
+ },
52
+ "dependencies": {
53
+ "@inquirer/prompts": "^8.0.2",
54
+ "adm-zip": "^0.5.16",
55
+ "bcryptjs": "^2.4.3",
56
+ "boxen": "^8.0.1",
57
+ "chalk": "^5.6.2",
58
+ "cli-progress": "^3.12.0",
59
+ "cli-table3": "^0.6.5",
60
+ "clipboardy": "^4.0.0",
61
+ "commander": "^12.1.0",
62
+ "cronstrue": "^2.50.0",
63
+ "execa": "^9.6.1",
64
+ "figlet": "^1.9.4",
65
+ "gradient-string": "^3.0.0",
66
+ "gray-matter": "^4.0.3",
67
+ "ignore": "^7.0.5",
68
+ "ink": "^5.0.1",
69
+ "ink-spinner": "^5.0.0",
70
+ "ink-text-input": "^6.0.0",
71
+ "marked": "^12.0.0",
72
+ "marked-terminal": "^7.0.0",
73
+ "open": "^10.1.0",
74
+ "ora": "^9.0.0",
75
+ "p-limit": "^5.0.0",
76
+ "p-queue": "^7.4.1",
77
+ "p-retry": "^6.2.0",
78
+ "react": "^18.3.1",
79
+ "slugify": "^1.6.6",
80
+ "terminal-image": "^4.1.0",
81
+ "undici": "^6.19.5",
82
+ "yaml": "^2.5.0",
83
+ "zod": "^3.23.8"
84
+ },
85
+ "devDependencies": {
86
+ "@changesets/cli": "^2.27.7",
87
+ "@types/figlet": "^1.7.0",
88
+ "@types/gradient-string": "^1.1.6",
89
+ "@types/node": "^24.10.1",
90
+ "@types/react": "^18.3.12",
91
+ "@typescript-eslint/eslint-plugin": "^8.6.0",
92
+ "@typescript-eslint/parser": "^8.6.0",
93
+ "@vitest/coverage-v8": "^2.1.4",
94
+ "eslint": "^9.9.0",
95
+ "prettier": "^3.3.3",
96
+ "tsup": "^8.1.0",
97
+ "tsx": "^4.19.2",
98
+ "typescript": "^5.6.3",
99
+ "vitest": "^2.1.4"
100
+ }
101
+ }
@@ -0,0 +1,29 @@
1
+ # Example configuration for jvit-redmine-context-cli
2
+ # Copy this file to redmine.config.yaml and update with your settings
3
+
4
+ baseUrl: https://redmine.example.com
5
+ apiAccessToken: YOUR_API_TOKEN_HERE
6
+ project:
7
+ id: 123
8
+ identifier: my-project
9
+ outputDir: .jai1/redmine
10
+ defaults:
11
+ include: [journals, relations, attachments]
12
+ status: '*'
13
+ pageSize: 100
14
+ concurrency: 4
15
+ retry:
16
+ retries: 3
17
+ baseMs: 300
18
+ filename:
19
+ pattern: '{issueId}-{slug}.md'
20
+ slug:
21
+ maxLength: 80
22
+ dedupe: true
23
+ lowercase: true
24
+ renameOnTitleChange: false
25
+ comments:
26
+ anchors:
27
+ start: '<!-- redmine:comments:start -->'
28
+ end: '<!-- redmine:comments:end -->'
29
+ trackBy: journalId
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Postinstall script - Notify users about Node.js version requirements
5
+ * Runs immediately after npm install completes
6
+ */
7
+
8
+ const MIN_NODE_VERSION = '20.12.0';
9
+
10
+ function parseVersion(version) {
11
+ return version.replace(/^v/, '').split('.').map(Number);
12
+ }
13
+
14
+ function compareVersions(a, b) {
15
+ const partsA = parseVersion(a);
16
+ const partsB = parseVersion(b);
17
+
18
+ for (let i = 0; i < Math.max(partsA.length, partsB.length); i++) {
19
+ const numA = partsA[i] || 0;
20
+ const numB = partsB[i] || 0;
21
+
22
+ if (numA < numB) return -1;
23
+ if (numA > numB) return 1;
24
+ }
25
+
26
+ return 0;
27
+ }
28
+
29
+ const currentVersion = process.version;
30
+ const isCompatible = compareVersions(currentVersion, MIN_NODE_VERSION) >= 0;
31
+
32
+ // Use ANSI colors (no dependencies required)
33
+ const colors = {
34
+ reset: '\x1b[0m',
35
+ red: '\x1b[31m',
36
+ green: '\x1b[32m',
37
+ yellow: '\x1b[33m',
38
+ cyan: '\x1b[36m',
39
+ gray: '\x1b[90m',
40
+ bold: '\x1b[1m'
41
+ };
42
+
43
+ console.log('');
44
+ console.log('╔════════════════════════════════════════════════════════════╗');
45
+ console.log('║ ║');
46
+ console.log('║ 🎉 J CLI installed successfully! ║');
47
+ console.log('║ ║');
48
+ console.log('╚════════════════════════════════════════════════════════════╝');
49
+ console.log('');
50
+
51
+ if (isCompatible) {
52
+ console.log(`${colors.green}✅ Node.js version: ${currentVersion}${colors.reset}`);
53
+ console.log(`${colors.gray} Minimum required: >=${MIN_NODE_VERSION}${colors.reset}`);
54
+ console.log('');
55
+ console.log(`${colors.cyan}📚 To get started:${colors.reset}`);
56
+ console.log(`${colors.gray} $ j --help${colors.reset}`);
57
+ console.log(`${colors.gray} $ j auth login${colors.reset}`);
58
+ console.log(`${colors.gray} (or use 'jai1' as alias)${colors.reset}`);
59
+ } else {
60
+ console.log(`${colors.red}❌ WARNING: Incompatible Node.js version!${colors.reset}`);
61
+ console.log('');
62
+ console.log(`${colors.yellow} Current version: ${currentVersion}${colors.reset}`);
63
+ console.log(`${colors.yellow} Required version: >=${MIN_NODE_VERSION}${colors.reset}`);
64
+ console.log('');
65
+ console.log(`${colors.cyan}💡 Please upgrade Node.js to use this tool:${colors.reset}`);
66
+ console.log(`${colors.gray} - Using nvm: ${colors.bold}nvm install 20 && nvm use 20${colors.reset}`);
67
+ console.log(`${colors.gray} - Using fnm: ${colors.bold}fnm install 20 && fnm use 20${colors.reset}`);
68
+ console.log(`${colors.gray} - Download: https://nodejs.org/${colors.reset}`);
69
+ console.log('');
70
+ console.log(`${colors.red}⚠️ The CLI will NOT work until you upgrade Node.js!${colors.reset}`);
71
+ }
72
+
73
+ console.log('');
74
+ console.log('════════════════════════════════════════════════════════════');
75
+ console.log('');
@@ -0,0 +1,35 @@
1
+ #!/bin/bash
2
+
3
+ # JVIT Redmine Context CLI - Issue Sync Script
4
+ # Usage: ./scripts/redmine-sync-issue.sh <id|url>
5
+
6
+ if [ $# -eq 0 ]; then
7
+ echo "Usage: $0 <issue-id|issue-url>"
8
+ echo ""
9
+ echo "Examples:"
10
+ echo " $0 12345"
11
+ echo " $0 https://redmine.example.com/issues/12345"
12
+ exit 1
13
+ fi
14
+
15
+ INPUT="$1"
16
+
17
+ # Check if input is a URL
18
+ if [[ "$INPUT" =~ ^https?:// ]]; then
19
+ # Extract issue ID from URL
20
+ ISSUE_ID=$(echo "$INPUT" | sed -n 's/.*\/issues\/\([0-9]*\).*/\1/p')
21
+ if [ -z "$ISSUE_ID" ]; then
22
+ echo "❌ Could not extract issue ID from URL: $INPUT"
23
+ exit 1
24
+ fi
25
+ echo "🔗 Detected URL, syncing issue ID: $ISSUE_ID"
26
+ node "$(dirname "$0")/../dist/cli.js" sync issue --url "$INPUT"
27
+ else
28
+ # Assume it's an issue ID
29
+ if [[ ! "$INPUT" =~ ^[0-9]+$ ]]; then
30
+ echo "❌ Invalid issue ID: $INPUT (must be a number)"
31
+ exit 1
32
+ fi
33
+ echo "🔢 Detected issue ID: $INPUT"
34
+ node "$(dirname "$0")/../dist/cli.js" sync issue --id "$INPUT"
35
+ fi