rip-lang 3.13.122 → 3.13.123

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.123-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 });
package/docs/dist/rip.js CHANGED
@@ -9945,8 +9945,8 @@ globalThis.zip ??= (...a) => a[0].map((_, i) => a.map(b => b[i]));
9945
9945
  return new CodeGenerator({}).getComponentRuntime();
9946
9946
  }
9947
9947
  // src/browser.js
9948
- var VERSION = "3.13.122";
9949
- var BUILD_DATE = "2026-03-17@21:09:52GMT";
9948
+ var VERSION = "3.13.123";
9949
+ var BUILD_DATE = "2026-03-18@04:49:31GMT";
9950
9950
  if (typeof globalThis !== "undefined") {
9951
9951
  if (!globalThis.__rip)
9952
9952
  new Function(getReactiveRuntime())();
@@ -731,7 +731,7 @@ globalThis.sleep ??= (ms) => new Promise(r => setTimeout(r, ms));
731
731
  globalThis.todo ??= (msg) => { throw new Error(msg || "Not implemented"); };
732
732
  globalThis.warn ??= console.warn;
733
733
  globalThis.zip ??= (...a) => a[0].map((_, i) => a.map(b => b[i]));
734
- `}function L1(){return new $1({}).getReactiveRuntime()}function N1(){return new $1({}).getComponentRuntime()}var c2="3.13.122",j2="2026-03-17@21:09:52GMT";if(typeof globalThis<"u"){if(!globalThis.__rip)Function(L1())();if(!globalThis.__ripComponent)Function(N1())()}var H7=(f)=>{let w=f.match(/^[ \t]*(?=\S)/gm),A=Math.min(...(w||[]).map((_)=>_.length));return f.replace(RegExp(`^[ ]{${A}}`,"gm"),"").trim()};async function y2(){let f=[],w=document.querySelector('script[src$="rip.min.js"], script[src$="rip.js"]'),A=w?.getAttribute("data-src");if(A){for(let _ of A.trim().split(/\s+/))if(_)f.push({url:_})}for(let _ of document.querySelectorAll('script[type="text/rip"]'))if(_.src)f.push({url:_.src});else{let u=H7(_.textContent);if(u)f.push({code:u})}if(f.length>0){let _=await Promise.allSettled(f.map(async(W)=>{if(!W.url)return;let Z=await fetch(W.url);if(!Z.ok)throw Error(`${W.url} (${Z.status})`);if(W.url.endsWith(".rip"))W.code=await Z.text();else{let Y=await Z.json();W.bundle=Y}}));for(let W of _)if(W.status==="rejected")console.warn("Rip: fetch failed:",W.reason.message);let u=[],$=[];for(let W of f)if(W.bundle)u.push(W.bundle);else if(W.code)$.push(W);let F=w?.getAttribute("data-router");if(F!=null&&u.length>0){let W={skipRuntimes:!0,skipExports:!0,skipImports:!0};if($.length>0){let Y="";for(let R of $)try{Y+=W1(R.code,W)+`
734
+ `}function L1(){return new $1({}).getReactiveRuntime()}function N1(){return new $1({}).getComponentRuntime()}var c2="3.13.123",j2="2026-03-18@04:49:31GMT";if(typeof globalThis<"u"){if(!globalThis.__rip)Function(L1())();if(!globalThis.__ripComponent)Function(N1())()}var H7=(f)=>{let w=f.match(/^[ \t]*(?=\S)/gm),A=Math.min(...(w||[]).map((_)=>_.length));return f.replace(RegExp(`^[ ]{${A}}`,"gm"),"").trim()};async function y2(){let f=[],w=document.querySelector('script[src$="rip.min.js"], script[src$="rip.js"]'),A=w?.getAttribute("data-src");if(A){for(let _ of A.trim().split(/\s+/))if(_)f.push({url:_})}for(let _ of document.querySelectorAll('script[type="text/rip"]'))if(_.src)f.push({url:_.src});else{let u=H7(_.textContent);if(u)f.push({code:u})}if(f.length>0){let _=await Promise.allSettled(f.map(async(W)=>{if(!W.url)return;let Z=await fetch(W.url);if(!Z.ok)throw Error(`${W.url} (${Z.status})`);if(W.url.endsWith(".rip"))W.code=await Z.text();else{let Y=await Z.json();W.bundle=Y}}));for(let W of _)if(W.status==="rejected")console.warn("Rip: fetch failed:",W.reason.message);let u=[],$=[];for(let W of f)if(W.bundle)u.push(W.bundle);else if(W.code)$.push(W);let F=w?.getAttribute("data-router");if(F!=null&&u.length>0){let W={skipRuntimes:!0,skipExports:!0,skipImports:!0};if($.length>0){let Y="";for(let R of $)try{Y+=W1(R.code,W)+`
735
735
  `}catch(z){console.error(`Rip compile error in ${R.url||"inline"}:`,z.message)}if(Y)try{await(0,eval)(`(async()=>{
736
736
  ${Y}
737
737
  })()`)}catch(R){console.error("Rip runtime error:",R)}}let Z=D1.modules?.["ui.rip"];if(Z?.launch){let Y=u[u.length-1],R=w.getAttribute("data-persist"),z={bundle:Y,hash:F==="hash"};if(R!=null)z.persist=R==="local"?"local":!0;await Z.launch("",z)}}else{let W=[];for(let R of u){for(let[z,Q]of Object.entries(R.components||{}))W.push({code:Q,url:z});if(R.data){let z=w?.getAttribute("data-state"),Q={};if(z)try{Q=JSON.parse(z)}catch{}Object.assign(Q,R.data),w?.setAttribute("data-state",JSON.stringify(Q))}}W.push(...$);let Z={skipRuntimes:!0,skipExports:!0,skipImports:!0},Y=[];for(let R of W){if(!R.code)continue;try{let z=W1(R.code,Z);Y.push({js:z,url:R.url||"inline"})}catch(z){console.error(`Rip compile error in ${R.url||"inline"}:`,z.message)}}if(!globalThis.__ripApp&&w){let R=globalThis.stash;if(R){let z={},Q=w.getAttribute("data-state");if(Q)try{z=JSON.parse(Q)}catch(O){console.error("Rip: invalid data-state JSON:",O.message)}let K=R({data:z});if(globalThis.__ripApp=K,typeof window<"u")window.app=K;let J=w.getAttribute("data-persist");if(J!=null&&globalThis.persistStash)globalThis.persistStash(K,{local:J==="local"})}}if(Y.length>0){let R=Y.map((Q)=>Q.js).join(`
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rip-lang",
3
- "version": "3.13.122",
3
+ "version": "3.13.123",
4
4
  "description": "A modern language that compiles to JavaScript",
5
5
  "type": "module",
6
6
  "main": "src/compiler.js",