rip-lang 3.13.8 → 3.13.10
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/docs/dist/rip.min.js +76 -76
- package/docs/dist/rip.min.js.br +0 -0
- package/docs/index.html +4 -4
- package/package.json +1 -1
- package/src/app.rip +5 -1
- package/src/browser.js +7 -5
package/docs/dist/rip.min.js.br
CHANGED
|
Binary file
|
package/docs/index.html
CHANGED
|
@@ -495,7 +495,7 @@
|
|
|
495
495
|
body.light .repl-prompt-text { color: #007acc; }
|
|
496
496
|
</style>
|
|
497
497
|
<link rel="preload" href="https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs/loader.js" as="script">
|
|
498
|
-
<script type="module" src="dist/rip.min.js"
|
|
498
|
+
<script type="module" src="dist/rip.min.js"></script>
|
|
499
499
|
</head>
|
|
500
500
|
<body>
|
|
501
501
|
|
|
@@ -1307,7 +1307,7 @@
|
|
|
1307
1307
|
|
|
1308
1308
|
{ success: true, value: evalResult, result }
|
|
1309
1309
|
catch error
|
|
1310
|
-
{ success: false, error: error
|
|
1310
|
+
{ success: false, error: error?.message or String(error or 'Unknown error') }
|
|
1311
1311
|
|
|
1312
1312
|
# --- REPL Commands ---
|
|
1313
1313
|
|
|
@@ -1403,7 +1403,7 @@
|
|
|
1403
1403
|
replBuffer = if replBuffer then replBuffer + "\n" + line else line
|
|
1404
1404
|
|
|
1405
1405
|
# Try to evaluate
|
|
1406
|
-
evalResult = evaluateRip replBuffer
|
|
1406
|
+
evalResult = evaluateRip! replBuffer
|
|
1407
1407
|
|
|
1408
1408
|
if evalResult.success
|
|
1409
1409
|
# Show debug info if enabled
|
|
@@ -1426,7 +1426,7 @@
|
|
|
1426
1426
|
replBuffer = ''
|
|
1427
1427
|
promptSpan.textContent = 'rip>'
|
|
1428
1428
|
|
|
1429
|
-
else if evalResult.error
|
|
1429
|
+
else if evalResult.error?.includes 'Unexpected end'
|
|
1430
1430
|
# Incomplete input — wait for more
|
|
1431
1431
|
promptSpan.textContent = '....>'
|
|
1432
1432
|
|
package/package.json
CHANGED
package/src/app.rip
CHANGED
|
@@ -908,9 +908,13 @@ export launch = (appBase = '', opts = {}) ->
|
|
|
908
908
|
el.id = target.replace(/^#/, '')
|
|
909
909
|
document.body.prepend el
|
|
910
910
|
|
|
911
|
-
# Get the app bundle — explicit, static files, inline DOM, or server fetch
|
|
911
|
+
# Get the app bundle — explicit object, literal URL, static files, inline DOM, or server fetch
|
|
912
912
|
if opts.bundle
|
|
913
913
|
bundle = opts.bundle
|
|
914
|
+
else if opts.bundleUrl
|
|
915
|
+
res = await fetch(opts.bundleUrl, cache: 'no-cache')
|
|
916
|
+
throw new Error "launch: #{opts.bundleUrl} (#{res.status})" unless res.ok
|
|
917
|
+
bundle = res.json!
|
|
914
918
|
else if opts.components and Array.isArray(opts.components)
|
|
915
919
|
components = {}
|
|
916
920
|
for url in opts.components
|
package/src/browser.js
CHANGED
|
@@ -134,18 +134,20 @@ if (typeof globalThis !== 'undefined') {
|
|
|
134
134
|
globalThis.__ripExports = { compile, compileToJS, formatSExpr, getStdlibCode, VERSION, BUILD_DATE, getReactiveRuntime, getComponentRuntime };
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
// Auto-launch:
|
|
138
|
-
//
|
|
139
|
-
// Hash routing defaults to true (opt out with data-hash="false").
|
|
137
|
+
// Auto-launch: requires data-url or inline data-name scripts.
|
|
138
|
+
// data-url is the literal fetch URL for the component bundle.
|
|
140
139
|
async function autoLaunch() {
|
|
141
140
|
if (globalThis.__ripLaunched) return;
|
|
142
141
|
const ui = importRip.modules?.['app.rip'];
|
|
143
142
|
if (!ui?.launch) return;
|
|
144
|
-
const cfg = document.querySelector('script[data-
|
|
143
|
+
const cfg = document.querySelector('script[data-url], script[data-hash]');
|
|
144
|
+
const tag = document.querySelectorAll('script[type="text/rip"][data-name]').length > 0;
|
|
145
|
+
if (!cfg && !tag) return;
|
|
145
146
|
const url = cfg?.getAttribute('data-url') || '';
|
|
146
147
|
const hash = cfg?.getAttribute('data-hash');
|
|
147
148
|
const opts = { hash: hash !== 'false' };
|
|
148
|
-
|
|
149
|
+
if (url) opts.bundleUrl = url;
|
|
150
|
+
await ui.launch('', opts);
|
|
149
151
|
}
|
|
150
152
|
|
|
151
153
|
// Auto-process <script type="text/rip"> blocks, then auto-launch if applicable.
|