rip-lang 3.13.122 → 3.13.124

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/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.122-blue.svg" alt="Version"></a>
12
+ <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.124-blue.svg" alt="Version"></a>
13
13
  <a href="#zero-dependencies"><img src="https://img.shields.io/badge/dependencies-ZERO-brightgreen.svg" alt="Dependencies"></a>
14
14
  <a href="#"><img src="https://img.shields.io/badge/tests-1%2C436%2F1%2C436-brightgreen.svg" alt="Tests"></a>
15
15
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
package/bin/rip CHANGED
@@ -21,6 +21,25 @@ const SUMMARY = packageJson.description;
21
21
 
22
22
  const isFile = (path) => existsSync(path) && statSync(path).isFile();
23
23
 
24
+ function getRepoRoot() {
25
+ try {
26
+ return execSync('git rev-parse --show-toplevel', {
27
+ encoding: 'utf-8',
28
+ stdio: ['pipe', 'pipe', 'pipe']
29
+ }).trim();
30
+ } catch {
31
+ return null;
32
+ }
33
+ }
34
+
35
+ function getWorkspaceServerPath() {
36
+ const repoRoot = getRepoRoot();
37
+ if (!repoRoot) return null;
38
+
39
+ const workspaceServerPath = join(repoRoot, 'packages', 'server', 'server.rip');
40
+ return isFile(workspaceServerPath) ? workspaceServerPath : null;
41
+ }
42
+
24
43
  function printHelp() {
25
44
  console.log(`
26
45
  Rip ${VERSION} - ${SUMMARY}
@@ -136,11 +155,14 @@ async function main() {
136
155
 
137
156
  if (args[0] === 'server') {
138
157
  let serverPath;
139
- try {
140
- serverPath = fileURLToPath(import.meta.resolve('@rip-lang/server/server'));
141
- } catch {
142
- console.error('Error: @rip-lang/server is not installed.\n\n bun add @rip-lang/server\n');
143
- process.exit(1);
158
+ serverPath = getWorkspaceServerPath();
159
+ if (!serverPath) {
160
+ try {
161
+ serverPath = fileURLToPath(import.meta.resolve('@rip-lang/server/server'));
162
+ } catch {
163
+ console.error('Error: @rip-lang/server is not installed.\n\n bun add @rip-lang/server\n');
164
+ process.exit(1);
165
+ }
144
166
  }
145
167
  const result = spawnSync('bun', ['--preload', loaderPath, serverPath, ...args.slice(1)], {
146
168
  stdio: 'inherit',
@@ -238,10 +260,8 @@ async function main() {
238
260
  // Allows `rip migrate --status` to find and run {repo}/bin/migrate
239
261
  if (inputFile && !inputFile.startsWith('-') && !isFile(inputFile)) {
240
262
  try {
241
- const repoRoot = execSync('git rev-parse --show-toplevel', {
242
- encoding: 'utf-8',
243
- stdio: ['pipe', 'pipe', 'pipe']
244
- }).trim();
263
+ const repoRoot = getRepoRoot();
264
+ if (!repoRoot) throw new Error('No git repo root');
245
265
  const binScript = join(repoRoot, 'bin', inputFile);
246
266
  if (existsSync(binScript)) {
247
267
  const r = spawnSync(binScript, scriptArgs, { stdio: 'inherit', env: process.env });