rip-lang 3.14.0 → 3.14.1

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="https://github.com/shreeve/rip-lang/commits/main"><img src="https://img.shields.io/badge/version-3.14.0-blue.svg" alt="Version"></a>
12
+ <a href="https://github.com/shreeve/rip-lang/commits/main"><img src="https://img.shields.io/badge/version-3.14.1-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/docs/dist/rip.js CHANGED
@@ -2141,6 +2141,7 @@ Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
2141
2141
  err.code = "E_SCHEMA";
2142
2142
  return err;
2143
2143
  }
2144
+ var SCHEMA_RUNTIME_ABI_VERSION = 1;
2144
2145
  var SCHEMA_RUNTIME = `
2145
2146
  // ---- Rip Schema Runtime ----------------------------------------------------
2146
2147
  // Four layers, lazy compilation:
@@ -2150,6 +2151,26 @@ Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
2150
2151
  // 3 (validator) compiled validator plan. Built on first .parse.
2151
2152
  // 4a (ORM plan) built on first .find/.create/.save.
2152
2153
  // 4b (DDL plan) built on first .toSQL(). Independent of 4a.
2154
+ //
2155
+ // Instance-singleton model:
2156
+ // The runtime installs itself on globalThis.__ripSchema the first time a
2157
+ // compiled bundle executes. Subsequent bundles that inject the same runtime
2158
+ // template detect the existing installation and bind to it instead of
2159
+ // re-running the body — giving every bundle a single shared registry,
2160
+ // adapter, and class identity. The IIFE wrapper below enforces that.
2161
+
2162
+ var { __schema, SchemaError, __SchemaRegistry, __schemaSetAdapter } = (function() {
2163
+ if (typeof globalThis !== 'undefined' && globalThis.__ripSchema) {
2164
+ if (globalThis.__ripSchema.__version !== ${SCHEMA_RUNTIME_ABI_VERSION}) {
2165
+ throw new Error(
2166
+ "rip-schema runtime version mismatch: loaded runtime is v" +
2167
+ globalThis.__ripSchema.__version +
2168
+ ", but this bundle expects v" + ${SCHEMA_RUNTIME_ABI_VERSION} +
2169
+ ". Two compiled Rip bundles with incompatible schema runtimes are loaded in the same process."
2170
+ );
2171
+ }
2172
+ return globalThis.__ripSchema;
2173
+ }
2153
2174
 
2154
2175
  class SchemaError extends Error {
2155
2176
  constructor(issues, schemaName, schemaKind) {
@@ -2461,13 +2482,12 @@ class __SchemaDef {
2461
2482
  hooks.set(e.name, e.fn);
2462
2483
  break;
2463
2484
  case 'directive': {
2464
- if (e.name === 'mixin') {
2465
- // Deferred to the post-pass so we can dedupe diamond includes
2466
- // and detect cycles with a full expansion stack.
2467
- directives.push({ name: e.name, args: e.args || [] });
2468
- break;
2469
- }
2470
2485
  directives.push({ name: e.name, args: e.args || [] });
2486
+ // @mixin is recorded but further handling is deferred to the
2487
+ // post-pass so we can dedupe diamond includes and detect
2488
+ // cycles with a full expansion stack. All other directives
2489
+ // get their relation / timestamps / softDelete processing now.
2490
+ if (e.name === 'mixin') break;
2471
2491
  if (e.name === 'timestamps') timestamps = true;
2472
2492
  if (e.name === 'softDelete') softDelete = true;
2473
2493
  const rel = __schemaNormalizeDirectiveRelation(e, this.name);
@@ -3373,11 +3393,13 @@ function __schema(descriptor) {
3373
3393
  return def;
3374
3394
  }
3375
3395
 
3376
- if (typeof globalThis !== 'undefined') {
3377
- globalThis.__ripSchema = {
3396
+ const exports = {
3378
3397
  __schema, SchemaError, __SchemaRegistry, __schemaSetAdapter,
3398
+ __version: ${SCHEMA_RUNTIME_ABI_VERSION},
3379
3399
  };
3380
- }
3400
+ if (typeof globalThis !== 'undefined') globalThis.__ripSchema = exports;
3401
+ return exports;
3402
+ })();
3381
3403
 
3382
3404
  // === End Schema Runtime ===
3383
3405
  `;
@@ -13572,8 +13594,8 @@ globalThis.zip ??= (...a) => a[0].map((_, i) => a.map(b => b[i]));
13572
13594
  return new CodeEmitter({}).getComponentRuntime();
13573
13595
  }
13574
13596
  // src/browser.js
13575
- var VERSION = "3.14.0";
13576
- var BUILD_DATE = "2026-04-20@09:13:03GMT";
13597
+ var VERSION = "3.14.1";
13598
+ var BUILD_DATE = "2026-04-20@10:25:54GMT";
13577
13599
  if (typeof globalThis !== "undefined") {
13578
13600
  if (!globalThis.__rip)
13579
13601
  new Function(getReactiveRuntime())();