@crossdelta/platform-sdk 0.13.2 → 0.13.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossdelta/platform-sdk",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
4
4
  "description": "Platform toolkit for event-driven microservices — keeping code and infrastructure in lockstep.",
5
5
  "keywords": [
6
6
  "cli",
@@ -32,6 +32,7 @@
32
32
  "bin/**/*.json",
33
33
  "!bin/**/*.map",
34
34
  "dist/",
35
+ "scripts/postinstall.js",
35
36
  "README.md",
36
37
  "logo.png",
37
38
  "schemas",
@@ -80,6 +81,7 @@
80
81
  }
81
82
  },
82
83
  "scripts": {
84
+ "postinstall": "node scripts/postinstall.js",
83
85
  "start:dev": "node esbuild.config.mjs --watch",
84
86
  "build:cli": "node esbuild.config.mjs",
85
87
  "build:cli:copy": "cp cli/integration.collection.json bin/integration.collection.json && rm -rf bin/templates && mkdir -p bin/templates && cp -r cli/src/commands/create/workspace/templates bin/templates/workspace && cp -r cli/src/commands/create/hono-microservice/templates bin/templates/hono-microservice && cp -r cli/src/commands/create/nest-microservice/templates bin/templates/nest-microservice && mkdir -p bin/docs/generators && cp -r docs/generators/* bin/docs/generators/",
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Post-install message for global installations.
4
+ * Reminds users to add Bun/npm/pnpm/yarn bin directory to PATH.
5
+ */
6
+
7
+ const os = require('node:os')
8
+ const path = require('node:path')
9
+ const fs = require('node:fs')
10
+
11
+ // Check if this is a global installation
12
+ // For npm/pnpm/yarn: npm_config_global or npm_config_prefix
13
+ // For Bun: Check if we're in ~/.bun/install/global/
14
+ const isGlobal = process.env.npm_config_global === 'true' ||
15
+ process.env.npm_config_prefix !== undefined ||
16
+ __dirname.includes('.bun/install/global')
17
+
18
+ if (!isGlobal) {
19
+ // Local installation - no message needed
20
+ process.exit(0)
21
+ }
22
+
23
+ const homeDir = os.homedir()
24
+ let binPath = ''
25
+ let shellConfig = ''
26
+
27
+ // Detect package manager and shell
28
+ if (process.env.BUN_INSTALL) {
29
+ binPath = path.join(process.env.BUN_INSTALL, 'bin')
30
+ shellConfig = process.env.SHELL?.includes('zsh') ? '~/.zshrc' : '~/.bashrc'
31
+ } else if (process.env.npm_config_prefix) {
32
+ binPath = path.join(process.env.npm_config_prefix, 'bin')
33
+ shellConfig = process.env.SHELL?.includes('zsh') ? '~/.zshrc' : '~/.bashrc'
34
+ } else {
35
+ binPath = path.join(homeDir, '.bun', 'bin')
36
+ shellConfig = process.env.SHELL?.includes('zsh') ? '~/.zshrc' : '~/.bashrc'
37
+ }
38
+
39
+ // Check if binPath is in PATH
40
+ const pathDirs = (process.env.PATH || '').split(':')
41
+ if (pathDirs.includes(binPath)) {
42
+ // Already in PATH - success message only
43
+ console.log('\n✅ @crossdelta/platform-sdk installed successfully!')
44
+ console.log('\nRun: \x1b[36mpf --help\x1b[0m')
45
+ process.exit(0)
46
+ }
47
+
48
+ // Not in PATH - show instructions
49
+ console.log('\n\x1b[33m⚠️ One more step!\x1b[0m')
50
+ console.log('\nTo use the \x1b[36mpf\x1b[0m command, add this to your \x1b[36m' + shellConfig + '\x1b[0m:\n')
51
+ console.log(' \x1b[32mexport PATH="' + binPath + ':$PATH"\x1b[0m\n')
52
+ console.log('Then reload your shell:')
53
+ console.log(' \x1b[32msource ' + shellConfig + '\x1b[0m\n')