plainscript-lang 1.0.361 → 1.0.362

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.
Files changed (76) hide show
  1. package/README.md +4 -4
  2. package/compiler/cli.js +3 -3
  3. package/compiler/generator.js +54 -24
  4. package/compiler/parser.js +7 -7
  5. package/compiler/version.js +1 -1
  6. package/docs/CAPABILITY_GAP_AUDIT.md +2 -2
  7. package/docs/GAME-PROMPT.md +3 -3
  8. package/docs/PLAINSCRIPT-SPEC.md +1 -1
  9. package/docs/index.html +5 -5
  10. package/examples/ai-providers.pln +1 -1
  11. package/examples/arrays.pln +1 -1
  12. package/examples/async-errors.pln +1 -1
  13. package/examples/auth-api.pln +1 -1
  14. package/examples/auth-sessions.pln +1 -1
  15. package/examples/basics.pln +1 -1
  16. package/examples/bots.pln +1 -1
  17. package/examples/browser-interactive/README.md +1 -1
  18. package/examples/browser-interactive/src/interactive.pln +1 -1
  19. package/examples/cache-and-jobs.pln +1 -1
  20. package/examples/cache-schedule.pln +1 -1
  21. package/examples/canvas-game/README.md +1 -1
  22. package/examples/canvas-game/src/game.pln +1 -1
  23. package/examples/collections.pln +1 -1
  24. package/examples/concurrency.pln +1 -1
  25. package/examples/conditions.pln +1 -1
  26. package/examples/database.pln +1 -1
  27. package/examples/day2.pln +1 -1
  28. package/examples/day3.pln +1 -1
  29. package/examples/deployment.pln +1 -1
  30. package/examples/email-send.pln +1 -1
  31. package/examples/error-handling.pln +1 -1
  32. package/examples/expressions.pln +1 -1
  33. package/examples/file-uploads.pln +1 -1
  34. package/examples/files-and-config.pln +1 -1
  35. package/examples/files.pln +1 -1
  36. package/examples/football-backend/app.pln +1 -1
  37. package/examples/functions.pln +1 -1
  38. package/examples/hello.pln +1 -1
  39. package/examples/http-client.pln +1 -1
  40. package/examples/http.pln +1 -1
  41. package/examples/id-verification/app.pln +1 -1
  42. package/examples/javascript-library/README.md +1 -1
  43. package/examples/javascript-library/src/interop.pln +1 -1
  44. package/examples/json.pln +1 -1
  45. package/examples/loops.pln +1 -1
  46. package/examples/modules/app.pln +1 -1
  47. package/examples/modules/main.pln +1 -1
  48. package/examples/modules/math.pln +1 -1
  49. package/examples/mongo.pln +1 -1
  50. package/examples/objects.pln +1 -1
  51. package/examples/ocr.pln +1 -1
  52. package/examples/packages.pln +1 -1
  53. package/examples/record-kinds.pln +1 -1
  54. package/examples/records.pln +1 -1
  55. package/examples/rest-api-fetch.pln +1 -1
  56. package/examples/rest-api.pln +1 -1
  57. package/examples/scheduled-tasks.pln +1 -1
  58. package/examples/search-and-filter.pln +1 -1
  59. package/examples/server.pln +1 -1
  60. package/examples/sessions-and-cookies.pln +1 -1
  61. package/examples/sqlite.pln +1 -1
  62. package/examples/start.pln +1 -1
  63. package/examples/stdlib.pln +1 -1
  64. package/examples/string-verbs.pln +1 -1
  65. package/examples/telegram-ai-bot.pln +1 -1
  66. package/examples/telegram-bot.pln +1 -1
  67. package/examples/testing.pln +1 -1
  68. package/examples/three-dimensional/README.md +1 -1
  69. package/examples/three-dimensional/src/scene.pln +1 -1
  70. package/examples/web-api.pln +1 -1
  71. package/examples/web-app.pln +1 -1
  72. package/examples/websocket-server.pln +1 -1
  73. package/examples/websocket.pln +1 -1
  74. package/examples/whatsapp-bot/pairing.pln +1 -1
  75. package/examples/whatsapp-bot/qr.pln +1 -1
  76. package/package.json +7 -6
package/README.md CHANGED
@@ -122,7 +122,7 @@ done
122
122
  </tr>
123
123
  </table>
124
124
 
125
- **Current version:** `v1.0.361` - the `plainscript-lang` npm package, with a TypeScript-style production build (`plainscript build` → `dist/`, source names and structure preserved).
125
+ **Current version:** `v1.0.362` - the `plainscript-lang` npm package, with a TypeScript-style production build (`plainscript build` → `dist/`, source names and structure preserved).
126
126
 
127
127
  ---
128
128
 
@@ -237,7 +237,7 @@ For projects that need custom output or source directories, add a `plainscript.c
237
237
  "build": "plainscript build",
238
238
  "prepare": "plainscript build"
239
239
  },
240
- "devDependencies": { "plainscript-lang": "^1.0.361" }
240
+ "devDependencies": { "plainscript-lang": "^1.0.362" }
241
241
  }
242
242
  ```
243
243
 
@@ -628,7 +628,7 @@ Portable databases (SQLite native or WebAssembly):
628
628
  database "app.db" // probes better-sqlite3, falls back to sql.js
629
629
  ```
630
630
 
631
- `plainscript install` verifies that `better-sqlite3` actually loads. If the native module cannot be used, PlainScript warns and continues on the pure-JavaScript WebAssembly engine (`sql.js`) - the same program runs unchanged. An engine can be forced explicitly:
631
+ `plainscript install` verifies that `better-sqlite3` actually loads. Since 1.0.362 the native engine ships as an **optional dependency**: installing `plainscript-lang` can never fail because a native binary is missing for the platform (e.g. Android/Termux), and programs that never open a database start without it. If the native module cannot be used, PlainScript warns and continues on the pure-JavaScript WebAssembly engine (`sql.js`) - the same program runs unchanged. An engine can be forced explicitly:
632
632
 
633
633
  ```
634
634
  database "app.db" using "native" // hard requirement: better-sqlite3
@@ -1097,7 +1097,7 @@ See [`examples/whatsapp-bot/`](./examples/whatsapp-bot/) for ready-to-link progr
1097
1097
  | PlainScript | Compiles to |
1098
1098
  |---|---|
1099
1099
  | `use express` | `const express = require('express');` |
1100
- | `use sqlite` | `const Database = require('better-sqlite3');` |
1100
+ | `use sqlite` | `let Database; … require('better-sqlite3')` (lazily loaded - the native engine is an optional backend) |
1101
1101
  | `use fs` | `const fs = require('fs');` |
1102
1102
  | `use path` | `const path = require('path');` |
1103
1103
 
package/compiler/cli.js CHANGED
@@ -506,7 +506,7 @@ function buildOne(filePath, srcDir, outDir, options = {}) {
506
506
 
507
507
  // `plainscript build <file.pln> -o <out.js>` - compile one entry to an explicit
508
508
  // output path (same compilation pipeline as buildOne, including source maps
509
- // when requested). Valuable for browser payloads such as the v1.0.361
509
+ // when requested). Valuable for browser payloads such as the v1.0.362
510
510
  // requestAnimationFrame / addEventListener helpers, which are meant to run as
511
511
  // a single script tag.
512
512
  function writeOneFile(filePath, outputFile) {
@@ -631,7 +631,7 @@ done
631
631
  route get "/api/status"
632
632
  reply json
633
633
  status is "ok"
634
- version is "1.0.361"
634
+ version is "1.0.362"
635
635
  done
636
636
  done
637
637
 
@@ -1014,7 +1014,7 @@ async function main() {
1014
1014
  switch (command) {
1015
1015
  case 'run': await cmdRun(fileArg, positional.slice(2)); break;
1016
1016
  case 'build': {
1017
- // v1.0.361 - optional -o/--output <path>. "-o" is a single-dash flag, so
1017
+ // v1.0.362 - optional -o/--output <path>. "-o" is a single-dash flag, so
1018
1018
  // it survives the "--filtered" positional list; pull it out here before
1019
1019
  // building the positional file argument for cmdBuild.
1020
1020
  let outputPath = null;
@@ -6,7 +6,15 @@ const { SourceMapGenerator } = require('./sourcemap');
6
6
  // Known runtime packages and their require() statements.
7
7
  const KNOWN_PACKAGES = {
8
8
  express: `const express = require('express');`,
9
- sqlite: `const Database = require('better-sqlite3');`,
9
+ // v1.0.362 - better-sqlite3 is an OPTIONAL runtime backend. The require
10
+ // must not run at module load: on platforms without a usable native
11
+ // binary (e.g. Android/Termux) `plainscript` must still compile and run
12
+ // programs that never touch SQLite. `Database` is resolved lazily and only
13
+ // errors with a teaching message when a program actually constructs a
14
+ // native database.
15
+ sqlite: `let Database;
16
+ try { Database = require('better-sqlite3'); }
17
+ catch (__e) { Database = function () { throw new Error('PlainScript: the native SQLite engine (better-sqlite3) is not usable on this machine (' + (__e && __e.message ? __e.message : __e) + ').\\nInstall it with: npm install better-sqlite3\\nOr use the portable engine instead: database "' + (arguments[0] || ':memory:') + '" using "wasm"'); }; }`,
10
18
  fs: `const fs = require('fs');`,
11
19
  path: `const path = require('path');`,
12
20
  axios: `const axios = require('axios');`,
@@ -88,7 +96,7 @@ const BUILTIN_DECLARATIONS = {
88
96
  ` }`,
89
97
  `}`,
90
98
  ].join('\n'),
91
- // v1.0.361 - DOM browser runtime (select/selectAll/parseHTML). Browser
99
+ // v1.0.362 - DOM browser runtime (select/selectAll/parseHTML). Browser
92
100
  // globals are guarded so the generated JS explains the problem when it is
93
101
  // run under Node instead of failing with a ReferenceError midpoint.
94
102
  dom: [
@@ -107,7 +115,7 @@ const BUILTIN_DECLARATIONS = {
107
115
  ` return template.content;`,
108
116
  `}`,
109
117
  ].join('\n'),
110
- // v1.0.361 - input runtime: pointer coordinates, gamepads, dropped files.
118
+ // v1.0.362 - input runtime: pointer coordinates, gamepads, dropped files.
111
119
  input: [
112
120
  `function __localPoint(e, canvas) {`,
113
121
  ` if (typeof document === 'undefined') throw new Error('localPoint(...) needs a browser (document is not defined in Node).');`,
@@ -125,7 +133,7 @@ const BUILTIN_DECLARATIONS = {
125
133
  ` return [...(event && event.dataTransfer ? event.dataTransfer.files : [])];`,
126
134
  `}`,
127
135
  ].join('\n'),
128
- // v1.0.361 - asset-loading runtime (images, JSON, bytes, data URLs). All
136
+ // v1.0.362 - asset-loading runtime (images, JSON, bytes, data URLs). All
129
137
  // helpers return promises; the STDLIB entries await them.
130
138
  assets: [
131
139
  `function __loadImage(url) {`,
@@ -162,7 +170,7 @@ const BUILTIN_DECLARATIONS = {
162
170
  ` });`,
163
171
  `}`,
164
172
  ].join('\n'),
165
- // v1.0.361 - Web Audio runtime. The AudioContext is created once and shared
173
+ // v1.0.362 - Web Audio runtime. The AudioContext is created once and shared
166
174
  // (browsers cap the number), and resumed on demand because autoplay policies
167
175
  // start it suspended.
168
176
  audio: [
@@ -205,7 +213,7 @@ const BUILTIN_DECLARATIONS = {
205
213
  ` });`,
206
214
  `}`,
207
215
  ].join('\n'),
208
- // v1.0.361 - WebGL runtime: context selection plus the three compile/link/
216
+ // v1.0.362 - WebGL runtime: context selection plus the three compile/link/
209
217
  // buffer helpers behind the gl* stdlib entries.
210
218
  gl: [
211
219
  `function __glContext(canvas) {`,
@@ -1345,7 +1353,12 @@ const BUILTIN_DECLARATIONS = {
1345
1353
  ` }`,
1346
1354
  ` console.error('PlainScript: native SQLite unavailable (' + __sqliteNativeReason + '); using the WebAssembly engine instead.');`,
1347
1355
  ` }`,
1348
- ` const initSqlJs = require('sql.js');`,
1356
+ ` let initSqlJs;`,
1357
+ ` try {`,
1358
+ ` initSqlJs = require('sql.js');`,
1359
+ ` } catch (__e) {`,
1360
+ ` throw new Error('Database: SQLite is not available on this machine. The native engine (better-sqlite3) could not be loaded and the WebAssembly engine (sql.js) is not installed.\\nInstall them with: npm install better-sqlite3 sql.js');`,
1361
+ ` }`,
1349
1362
  ` const SQL = await initSqlJs();`,
1350
1363
  ` let raw;`,
1351
1364
  ` try {`,
@@ -1379,8 +1392,14 @@ const BUILTIN_DECLARATIONS = {
1379
1392
  ` };`,
1380
1393
  `}`,
1381
1394
  `function __sqliteWrapWasm(db, file) {`,
1395
+ ` // v1.0.362 - sql.js's export() ends an open transaction, so persisting`,
1396
+ ` // mid-transaction would break the explicit COMMIT that follows. While a`,
1397
+ ` // transaction is active, writes are only flushed to disk once, after the`,
1398
+ ` // COMMIT succeeds (the wrapper's own persist at that point covers it).`,
1399
+ ` let __sqliteTxn = 0;`,
1382
1400
  ` const persist = () => {`,
1383
1401
  ` if (file === ':memory:') return;`,
1402
+ ` if (__sqliteTxn > 0) return;`,
1384
1403
  ` try {`,
1385
1404
  ` require('fs').writeFileSync(file, Buffer.from(db.export()));`,
1386
1405
  ` } catch (error) {`,
@@ -1420,15 +1439,19 @@ const BUILTIN_DECLARATIONS = {
1420
1439
  ` transaction(fn) {`,
1421
1440
  ` return () => {`,
1422
1441
  ` db.run('BEGIN');`,
1442
+ ` __sqliteTxn++;`,
1443
+ ` let out;`,
1423
1444
  ` try {`,
1424
- ` const out = fn();`,
1445
+ ` out = fn();`,
1425
1446
  ` db.run('COMMIT');`,
1426
- ` persist();`,
1427
- ` return out;`,
1428
1447
  ` } catch (error) {`,
1429
1448
  ` try { db.run('ROLLBACK'); } catch (_) {}`,
1430
1449
  ` throw error;`,
1450
+ ` } finally {`,
1451
+ ` __sqliteTxn--;`,
1431
1452
  ` }`,
1453
+ ` persist();`,
1454
+ ` return out;`,
1432
1455
  ` };`,
1433
1456
  ` },`,
1434
1457
  ` };`,
@@ -2664,7 +2687,7 @@ const BUILTIN_DECLARATIONS = {
2664
2687
  file: (args, context) => `new File(${args.map(a => generateExpr(a, context)).join(', ')})`,
2665
2688
  formData: (_args) => `new FormData()`,
2666
2689
 
2667
- // ── v1.0.361 - browser DOM (IOPL-native). All helpers guard their browser
2690
+ // ── v1.0.362 - browser DOM (IOPL-native). All helpers guard their browser
2668
2691
  // global, so the generated output throws a clear teaching error under Node.
2669
2692
  select: (args, context) => {
2670
2693
  ensureBuiltin(context, 'dom');
@@ -2682,7 +2705,7 @@ const BUILTIN_DECLARATIONS = {
2682
2705
  return `__parseHTML(${generateExpr(args[0], context)})`;
2683
2706
  },
2684
2707
 
2685
- // ── v1.0.361 - browser input (IOPL-native).
2708
+ // ── v1.0.362 - browser input (IOPL-native).
2686
2709
  localPoint: (args, context) => {
2687
2710
  ensureBuiltin(context, 'input');
2688
2711
  requireArgs('localPoint', args, 2, 'localPoint(event, canvas)');
@@ -2698,7 +2721,7 @@ const BUILTIN_DECLARATIONS = {
2698
2721
  return `__droppedFiles(${generateExpr(args[0], context)})`;
2699
2722
  },
2700
2723
 
2701
- // ── v1.0.361 - browser assets (IOPL-native). Each awaitable helper is
2724
+ // ── v1.0.362 - browser assets (IOPL-native). Each awaitable helper is
2702
2725
  // awaited here, so the surrounding function/handler is marked async.
2703
2726
  loadImage: (args, context) => {
2704
2727
  ensureBuiltin(context, 'assets');
@@ -2731,7 +2754,7 @@ const BUILTIN_DECLARATIONS = {
2731
2754
  return `(await __readDataUrl(${generateExpr(args[0], context)}))`;
2732
2755
  },
2733
2756
 
2734
- // ── v1.0.361 - Web Audio (IOPL-native).
2757
+ // ── v1.0.362 - Web Audio (IOPL-native).
2735
2758
  audioContext: (_args, context) => {
2736
2759
  ensureBuiltin(context, 'audio');
2737
2760
  return `__audioContext()`;
@@ -2742,7 +2765,7 @@ const BUILTIN_DECLARATIONS = {
2742
2765
  return `__audioTone(${args.map(a => generateExpr(a, context)).join(', ')})`;
2743
2766
  },
2744
2767
 
2745
- // ── v1.0.361 - WebSocket send helper (works with any WebSocket-like object,
2768
+ // ── v1.0.362 - WebSocket send helper (works with any WebSocket-like object,
2746
2769
  // browser or Node): strings go through verbatim, everything else is JSON.
2747
2770
  webSocketSend: (args, context) => {
2748
2771
  requireArgs('webSocketSend', args, 2, 'webSocketSend(socket, { type: "move", x: 10 })');
@@ -2751,7 +2774,7 @@ const BUILTIN_DECLARATIONS = {
2751
2774
  return `${ws}.send(typeof (${value}) === 'string' ? (${value}) : JSON.stringify(${value}))`;
2752
2775
  },
2753
2776
 
2754
- // ── v1.0.361 - WebGL (IOPL-native).
2777
+ // ── v1.0.362 - WebGL (IOPL-native).
2755
2778
  webglContext: (args, context) => {
2756
2779
  ensureBuiltin(context, 'gl');
2757
2780
  requireOneArg('webglContext', args);
@@ -2956,12 +2979,19 @@ function emitRequire(context, moduleName, alias) {
2956
2979
  }
2957
2980
  const known = KNOWN_PACKAGES[bareName];
2958
2981
  if (known) {
2959
- const boundAs = known.match(/const (\w+)/)[1];
2982
+ const boundAs = known.match(/(?:const|let) (\w+)/)[1];
2960
2983
  if (alias !== boundAs) {
2961
2984
  throw new Error(
2962
2985
  `"${bareName}" is part of PlainScript's built-in runtime and is already available as "${boundAs}". Remove "as ${alias}".`
2963
2986
  );
2964
2987
  }
2988
+ const key = `${npmName}\0${alias}`;
2989
+ if (context.requires.has(key)) return '';
2990
+ context.requires.add(key);
2991
+ // Canonical binding, e.g. express to express, sqlite to Database. Using
2992
+ // the KNOWN entry keeps sqlite's lazy loader (better-sqlite3 is an
2993
+ // optional backend) instead of emitting a fresh eager require.
2994
+ return known;
2965
2995
  }
2966
2996
  const key = `${npmName}\0${alias}`;
2967
2997
  if (context.requires.has(key)) return '';
@@ -3880,16 +3910,16 @@ function generateStatement(node, indent = '', context = createGenerationContext(
3880
3910
  // v2.2.0 - mongo "<connection>" [db "<name>"]: MongoDB client bound to "db".
3881
3911
  // Uses the mongodb driver; subsequent query/insert/update/delete/execute
3882
3912
  // statements compile to MongoDB collection operations.
3913
+ // v1.0.362 - mongodb is an optional backend: the require lives inside
3914
+ // __mongoOpen (it is only evaluated when a database is actually opened),
3915
+ // so programs that never use it start without needing the module.
3883
3916
  case 'MongoStatement': {
3884
3917
  _sqlDriver = 'mongo';
3885
3918
  _sqlClientVar = 'db';
3886
3919
  markAsync(context);
3887
3920
  ensureBuiltin(context, 'mongodb');
3888
3921
  const dbArg = node.dbName ? `, ${generateExpr(node.dbName, context)}` : '';
3889
- return [
3890
- emitRequire(context, 'mongodb'),
3891
- `${indent}const db = await __mongoOpen(${generateExpr(node.connection, context)}${dbArg});`,
3892
- ].filter(Boolean).map(line => line.startsWith('const ') ? `${indent}${line}` : line).join('\n');
3922
+ return `${indent}const db = await __mongoOpen(${generateExpr(node.connection, context)}${dbArg});`;
3893
3923
  }
3894
3924
 
3895
3925
  case 'QueryStatement':
@@ -4136,7 +4166,7 @@ function generateStatement(node, indent = '', context = createGenerationContext(
4136
4166
  ].join('\n');
4137
4167
  }
4138
4168
 
4139
- // v1.0.361 - every frame … done: one requestAnimationFrame loop. The next
4169
+ // v1.0.362 - every frame … done: one requestAnimationFrame loop. The next
4140
4170
  // frame is scheduled after the body so the body always runs once per
4141
4171
  // frame; an awaiting body makes the callback async automatically.
4142
4172
  case 'EveryFrameStatement': {
@@ -4153,7 +4183,7 @@ function generateStatement(node, indent = '', context = createGenerationContext(
4153
4183
  ].join('\n');
4154
4184
  }
4155
4185
 
4156
- // v1.0.361 - after <n> <unit> … done: one-shot setTimeout. The delay is an
4186
+ // v1.0.362 - after <n> <unit> … done: one-shot setTimeout. The delay is an
4157
4187
  // expression scaled by the unit; an awaiting body makes the callback async.
4158
4188
  case 'AfterStatement': {
4159
4189
  const delay = generateExpr(node.delay, context);
@@ -4290,7 +4320,7 @@ function generateStatement(node, indent = '', context = createGenerationContext(
4290
4320
  return `${indent}__emitter.on(${event}, (${node.paramName}) => {\n${body}\n${indent}});`;
4291
4321
  }
4292
4322
 
4293
- // v1.0.361 - when <target> "<event>" happens [as <name>] … done: DOM event
4323
+ // v1.0.362 - when <target> "<event>" happens [as <name>] … done: DOM event
4294
4324
  // listener. The handler param defaults to "event"; an awaiting body makes
4295
4325
  // the callback async automatically.
4296
4326
  case 'WhenTargetedStatement': {
@@ -545,7 +545,7 @@ function parse(tokens) {
545
545
  peekAt(2).type === TOKEN.IDENTIFIER && TIME_UNITS[peekAt(2).value]) {
546
546
  return parseEvery();
547
547
  }
548
- // v1.0.361 - every frame … done: requestAnimationFrame loop. "every" lexes
548
+ // v1.0.362 - every frame … done: requestAnimationFrame loop. "every" lexes
549
549
  // as TOKEN.EACH; guard on the following "frame" identifier ("for every
550
550
  // item in list" is intercepted by TOKEN.FOR above).
551
551
  if (token.type === TOKEN.EACH && peekAt(1).type === TOKEN.IDENTIFIER &&
@@ -797,14 +797,14 @@ function parse(tokens) {
797
797
  return parseEvery();
798
798
  }
799
799
 
800
- // v1.0.361 - every frame … done: requestAnimationFrame loop. Identifier
800
+ // v1.0.362 - every frame … done: requestAnimationFrame loop. Identifier
801
801
  // mirror of the EACH dispatch above.
802
802
  if (token.value === 'every' && peekAt(1).type === TOKEN.IDENTIFIER &&
803
803
  peekAt(1).value === 'frame') {
804
804
  return parseEveryFrame();
805
805
  }
806
806
 
807
- // v1.0.361 - after <n> <unit>s … done: one-shot delayed execution.
807
+ // v1.0.362 - after <n> <unit>s … done: one-shot delayed execution.
808
808
  // Contextual like "retry": "after becomes 5" and after(...) keep their
809
809
  // ordinary meanings.
810
810
  if (token.value === 'after' &&
@@ -2106,7 +2106,7 @@ function parseAsk() {
2106
2106
  (nextToken.type === TOKEN.IDENTIFIER && (nextToken.value === 'nothing' || nextToken.value === 'socket'));
2107
2107
 
2108
2108
  if (!isEventWhen) {
2109
- // v1.0.361 - when <target> "<event>" happens [as <name>] … done binds a
2109
+ // v1.0.362 - when <target> "<event>" happens [as <name>] … done binds a
2110
2110
  // DOM event listener: when button "click" happens => addEventListener.
2111
2111
  // Detection probes the target expression and commits only when a string
2112
2112
  // followed by "happens" is next; otherwise the tokens are replayed and
@@ -3325,7 +3325,7 @@ function parseAsk() {
3325
3325
 
3326
3326
  const item = tryParseItemExpression();
3327
3327
  if (item) return item;
3328
- // v1.0.361 - `new` works anywhere an expression is parsed (assignment
3328
+ // v1.0.362 - `new` works anywhere an expression is parsed (assignment
3329
3329
  // targets, call arguments, member chains). "new" is not a keyword, so this
3330
3330
  // identifier must be intercepted here; parseAtom would read it as a plain
3331
3331
  // Identifier and turn "new THREE.Scene()" into "new.THREE.Scene()".
@@ -3816,7 +3816,7 @@ function parseAsk() {
3816
3816
  return { type: 'EveryStatement', count, unit, body };
3817
3817
  }
3818
3818
 
3819
- // v1.0.361 - every frame … done: a requestAnimationFrame loop whose body runs
3819
+ // v1.0.362 - every frame … done: a requestAnimationFrame loop whose body runs
3820
3820
  // once per animation frame. The next frame is scheduled after the body so it
3821
3821
  // always runs (t is the frame timestamp, like the DOM's rAF callback).
3822
3822
  function parseEveryFrame() {
@@ -3826,7 +3826,7 @@ function parseAsk() {
3826
3826
  return { type: 'EveryFrameStatement', body };
3827
3827
  }
3828
3828
 
3829
- // v1.0.361 - after <n> <unit>s … done: run work once after a delay.
3829
+ // v1.0.362 - after <n> <unit>s … done: run work once after a delay.
3830
3830
  // after 5 seconds
3831
3831
  // show "butter!" ... done
3832
3832
  // The delay is a number expression ("after count seconds"); the unit is
@@ -1,6 +1,6 @@
1
1
  // Single source of truth for the compiler version.
2
2
  // Consumed by cli.js help/version output.
3
3
 
4
- const VERSION = '1.0.361';
4
+ const VERSION = '1.0.362';
5
5
 
6
6
  module.exports = { VERSION };
@@ -1,4 +1,4 @@
1
- # PlainScript 1.0.361 Capability Audit
1
+ # PlainScript 1.0.362 Capability Audit
2
2
 
3
3
  This audit is based on what the compiler actually supports right now.
4
4
  If `plainscript check` validates it, it's listed here.
@@ -126,6 +126,6 @@ find examples -name '*.pln' -exec node compiler/cli.js check {} \;
126
126
 
127
127
  ## Version Info
128
128
 
129
- The release label for this repo is `1.0.361`. It covers the compiler,
129
+ The release label for this repo is `1.0.362`. It covers the compiler,
130
130
  package metadata, website, editor tooling, and browser/game documentation.
131
131
  Third-party dependency versions are not tied to this label.
@@ -1,4 +1,4 @@
1
- # PlainScript Game Development Prompt Guide (v1.0.361)
1
+ # PlainScript Game Development Prompt Guide (v1.0.362)
2
2
 
3
3
  The standing instruction sheet for AI agents asked to build games and
4
4
  interactive browser apps in PlainScript.
@@ -29,7 +29,7 @@ Every PlainScript block you show a user must compile - check it first.
29
29
 
30
30
  PlainScript is intent-oriented: you describe *what* the game should do and the
31
31
  compiler generates JavaScript. One hard rule - **game logic lives in
32
- PlainScript**. v1.0.361 reaches into any JS API from `.pln`, which makes
32
+ PlainScript**. v1.0.362 reaches into any JS API from `.pln`, which makes
33
33
  dropping to JS tempting; do not. Every browser capability below stays
34
34
  reachable without leaving PlainScript.
35
35
 
@@ -237,7 +237,7 @@ done
237
237
  requestAnimationFrame(loop)
238
238
  ```
239
239
 
240
- v1.0.361 adds hex literals (`0xRRGGBB`): numeric colors use `0xffffff` instead
240
+ v1.0.362 adds hex literals (`0xRRGGBB`): numeric colors use `0xffffff` instead
241
241
  of magic decimals, and a `"#ffffff"` string works too - THREE accepts all
242
242
  three.
243
243
 
@@ -1,4 +1,4 @@
1
- # PlainScript 1.0.361 language specification
1
+ # PlainScript 1.0.362 language specification
2
2
 
3
3
  This reference covers the syntax implemented by `compiler/lexer.js` and
4
4
  `compiler/parser.js`. The runtime it generates lives in
package/docs/index.html CHANGED
@@ -3,9 +3,9 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <meta name="description" content="PlainScript 1.0.361 language reference and examples">
6
+ <meta name="description" content="PlainScript 1.0.362 language reference and examples">
7
7
  <meta name="theme-color" content="#070c16">
8
- <title>PlainScript 1.0.361</title>
8
+ <title>PlainScript 1.0.362</title>
9
9
 
10
10
  <link rel="preconnect" href="https://fonts.googleapis.com">
11
11
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@@ -21,7 +21,7 @@
21
21
  <a class="nav-logo" href="#">
22
22
  <img class="nav-logo-image" src="logo-pln.jpg" alt="">
23
23
  <span>PlainScript</span>
24
- <span class="logo-ver">1.0.361</span>
24
+ <span class="logo-ver">1.0.362</span>
25
25
  </a>
26
26
  <button class="nav-toggle" id="nav-toggle" aria-label="Toggle navigation" aria-expanded="false" aria-controls="nav-links">
27
27
  <span class="nav-toggle-bar"></span>
@@ -117,7 +117,7 @@ npm start</code></pre>
117
117
  <div class="container">
118
118
  <p class="section-tag" data-reveal>Feature library</p>
119
119
  <h2 class="section-title" data-reveal>Examples you can try today.</h2>
120
- <p class="section-lead">These snippets use the PlainScript 1.0.361 grammar.</p>
120
+ <p class="section-lead">These snippets use the PlainScript 1.0.362 grammar.</p>
121
121
  <div class="library-toolbar" data-reveal>
122
122
  <label class="sr-only" for="lib-search">Search examples</label>
123
123
  <input id="lib-search" class="lib-search-input" type="search" placeholder="Search examples">
@@ -146,7 +146,7 @@ npm start</code></pre>
146
146
  </main>
147
147
 
148
148
  <footer class="site-footer">
149
- <div class="container footer-bottom"><span>PlainScript</span><span>1.0.361</span></div>
149
+ <div class="container footer-bottom"><span>PlainScript</span><span>1.0.362</span></div>
150
150
  </footer>
151
151
 
152
152
  <script src="https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.min.js"></script>
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: provider-backed AI works in ordinary programs.
1
+ // PlainScript 1.0.362: provider-backed AI works in ordinary programs.
2
2
 
3
3
  remember answer as chatWith("groq", "llama-3.3-70b-versatile", "Explain PlainScript in one sentence")
4
4
  show answer
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: array literals and indexing.
1
+ // PlainScript 1.0.362: array literals and indexing.
2
2
  remember values as [1, 2, 3]
3
3
  show values[0]
4
4
  show length(values)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: asynchronous work and error recovery.
1
+ // PlainScript 1.0.362: asynchronous work and error recovery.
2
2
 
3
3
  make loadProfile(id)
4
4
  wait for sleep(10)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: protected API route.
1
+ // PlainScript 1.0.362: protected API route.
2
2
  web app
3
3
  require api key from env("API_KEY")
4
4
  route get "/private"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: API keys, sessions, cookies, and auth helpers.
1
+ // PlainScript 1.0.362: API keys, sessions, cookies, and auth helpers.
2
2
 
3
3
  web app
4
4
  enable sessions "development-only-session-secret"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: variables, values, and output.
1
+ // PlainScript 1.0.362: variables, values, and output.
2
2
 
3
3
  remember name as "Ada"
4
4
  remember visitCount as 3
package/examples/bots.pln CHANGED
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: Telegram bot handlers.
1
+ // PlainScript 1.0.362: Telegram bot handlers.
2
2
 
3
3
  bot env("TELEGRAM_BOT_TOKEN")
4
4
 
@@ -5,7 +5,7 @@ no canvas, no library, no bundler. Click **+10 points** and the score span
5
5
  updates; click **Log entry** to append a line to the run log; press **R** to
6
6
  reset both.
7
7
 
8
- It demonstrates the v1.0.361 browser API:
8
+ It demonstrates the v1.0.362 browser API:
9
9
 
10
10
  - `document.querySelector` + `.innerHTML becomes` / `.textContent becomes`.
11
11
  - `when clickButton "click" happens` DOM event handlers.
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: a DOM-first clicker with a run log.
1
+ // PlainScript 1.0.362: a DOM-first clicker with a run log.
2
2
 
3
3
  remember scoreEl as document.querySelector("#score")
4
4
  remember historyEl as document.querySelector("#history")
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: cache and background work.
1
+ // PlainScript 1.0.362: cache and background work.
2
2
  cache env("REDIS_URL")
3
3
  cacheSet("status", "ready", 60)
4
4
  remember status as cacheGet("status")
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: cache values and scheduled work.
1
+ // PlainScript 1.0.362: cache values and scheduled work.
2
2
 
3
3
  cache "redis://localhost:6379"
4
4
 
@@ -5,7 +5,7 @@ arrow keys while red blocks fall from the top. Score a point for every block
5
5
  that drifts past you; lose a life when one collides with you. Run out of lives
6
6
  and the game freezes until you press Restart.
7
7
 
8
- It demonstrates the v1.0.361 browser API:
8
+ It demonstrates the v1.0.362 browser API:
9
9
 
10
10
  - `when document "keydown"/"keyup" happens` handlers that set flags on a
11
11
  `keys{}` map - the game loop reads the map, the event handlers never move the
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: a self-contained canvas 2D dodge mini-game.
1
+ // PlainScript 1.0.362: a self-contained canvas 2D dodge mini-game.
2
2
 
3
3
  define a kind called "Enemy" with
4
4
  x is 0
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: lists, objects, and collection helpers.
1
+ // PlainScript 1.0.362: lists, objects, and collection helpers.
2
2
 
3
3
  remember numbers as list with 4, 7, 2, 9
4
4
  gather each number in numbers giving number * 2
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: parallel operations and timeouts.
1
+ // PlainScript 1.0.362: parallel operations and timeouts.
2
2
 
3
3
  make firstJob()
4
4
  wait for sleep(10)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: conditions and string predicates.
1
+ // PlainScript 1.0.362: conditions and string predicates.
2
2
 
3
3
  remember score as 87
4
4
  remember label as "PlainScript"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: SQLite database.
1
+ // PlainScript 1.0.362: SQLite database.
2
2
  database "app.db" using "wasm"
3
3
  execute
4
4
  CREATE TABLE IF NOT EXISTS notes (body TEXT)
package/examples/day2.pln CHANGED
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: conditional blocks.
1
+ // PlainScript 1.0.362: conditional blocks.
2
2
  remember age as 21
3
3
  if age is at least 18
4
4
  show "adult"
package/examples/day3.pln CHANGED
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: functions.
1
+ // PlainScript 1.0.362: functions.
2
2
  make greet(name)
3
3
  give `Hello, ${name}!`
4
4
  done
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: production-shaped web entry point.
1
+ // PlainScript 1.0.362: production-shaped web entry point.
2
2
  web app
3
3
  route get "/health"
4
4
  reply "ok"
@@ -1,3 +1,3 @@
1
- // PlainScript 1.0.361: email application placeholder.
1
+ // PlainScript 1.0.362: email application placeholder.
2
2
  remember recipient as "team@example.com"
3
3
  show `mail queued for ${recipient}`
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: recovery and cleanup.
1
+ // PlainScript 1.0.362: recovery and cleanup.
2
2
  try
3
3
  show "work"
4
4
  recover as error
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: expression operators.
1
+ // PlainScript 1.0.362: expression operators.
2
2
  remember sumValue as (2 + 3) * 4
3
3
  if sumValue is 20
4
4
  show "exact"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: upload route.
1
+ // PlainScript 1.0.362: upload route.
2
2
  web app
3
3
  accept uploads limit "5 MB" allow list with "image/png" folder "uploads"
4
4
  route post "/upload"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: files and environment configuration.
1
+ // PlainScript 1.0.362: files and environment configuration.
2
2
  remember filename as env("CONFIG_FILE")
3
3
  if filename is null
4
4
  remember filename as "config.json"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: file and path operations.
1
+ // PlainScript 1.0.362: file and path operations.
2
2
 
3
3
  remember report as readFile("README.md")
4
4
  show length(report)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: a complete authenticated SQLite API.
1
+ // PlainScript 1.0.362: a complete authenticated SQLite API.
2
2
 
3
3
  web app
4
4
  database ":memory:" using "wasm"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: functions, defaults, and returns.
1
+ // PlainScript 1.0.362: functions, defaults, and returns.
2
2
 
3
3
  make greet(name)
4
4
  give `Hello, ${name}!`
@@ -1,2 +1,2 @@
1
- // PlainScript 1.0.361: hello world.
1
+ // PlainScript 1.0.362: hello world.
2
2
  show "Hello, PlainScript!"
@@ -1,3 +1,3 @@
1
- // PlainScript 1.0.361: HTTP client request.
1
+ // PlainScript 1.0.362: HTTP client request.
2
2
  remember response as get "https://example.com" timeout 5000
3
3
  show response.status
package/examples/http.pln CHANGED
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: HTTP client requests.
1
+ // PlainScript 1.0.362: HTTP client requests.
2
2
 
3
3
  remember response as get "https://example.com/api/items" timeout 5000
4
4
  if response.ok is true
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: upload and OCR verification service.
1
+ // PlainScript 1.0.362: upload and OCR verification service.
2
2
 
3
3
  web app
4
4
  accept uploads limit "5 MB" allow list with "image/png", "image/jpeg" folder "uploads"
@@ -11,7 +11,7 @@ What the script exercises:
11
11
  - `bring THREE from "three"` emits `require('three')` at the top of the build.
12
12
  - `new THREE.Scene()`, `new THREE.WebGLRenderer()`, `new THREE.SphereGeometry(...)`
13
13
  and `new THREE.Mesh(geo, mat)` fill a starfield of 150 primitives. Colors use
14
- v1.0.361 hex literals (`0x40c463`), so the palette is legible at a glance.
14
+ v1.0.362 hex literals (`0x40c463`), so the palette is legible at a glance.
15
15
  - A resize callback `make fitWindow() ... done` passed straight to
16
16
  `window.addEventListener("resize", fitWindow)`.
17
17
  - `fetchJson("config.json")` (auto-awaiting) reads `{stars, color}` out of a
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: drop into an npm library via import, callbacks, and fetch.
1
+ // PlainScript 1.0.362: drop into an npm library via import, callbacks, and fetch.
2
2
 
3
3
  bring THREE from "three"
4
4
 
package/examples/json.pln CHANGED
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: JSON values and transformations.
1
+ // PlainScript 1.0.362: JSON values and transformations.
2
2
 
3
3
  remember person as record with name "Ada" and role "engineer" done
4
4
 
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: collection and numeric loops.
1
+ // PlainScript 1.0.362: collection and numeric loops.
2
2
 
3
3
  remember colors as list with "red", "green", "blue"
4
4
 
@@ -1,3 +1,3 @@
1
- // PlainScript 1.0.361: module entry point.
1
+ // PlainScript 1.0.362: module entry point.
2
2
  import { circleArea } from "./math.pln"
3
3
  show circleArea(2)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: named imports.
1
+ // PlainScript 1.0.362: named imports.
2
2
 
3
3
  import { circleArea } from "./math.pln"
4
4
  show circleArea(2)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: an imported module.
1
+ // PlainScript 1.0.362: an imported module.
2
2
 
3
3
  remember PI as 3.14159
4
4
 
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: MongoDB.
1
+ // PlainScript 1.0.362: MongoDB.
2
2
  //
3
3
  // The `mongo` statement binds a connection to a MongoDB instance using the
4
4
  // official `mongodb` driver. Give it a connection string and an optional
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: object literals and member access.
1
+ // PlainScript 1.0.362: object literals and member access.
2
2
  remember user as {name: "Ada", active: true}
3
3
  show user.name
4
4
  user.active becomes false
package/examples/ocr.pln CHANGED
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: upload handling and OCR.
1
+ // PlainScript 1.0.362: upload handling and OCR.
2
2
 
3
3
  web app
4
4
  accept uploads limit "5 MB" allow list with "image/png", "image/jpeg" folder "uploads"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: importing npm packages.
1
+ // PlainScript 1.0.362: importing npm packages.
2
2
 
3
3
  use express
4
4
 
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: record kind construction.
1
+ // PlainScript 1.0.362: record kind construction.
2
2
  define a kind called "Player" with
3
3
  name is ""
4
4
  goals is 0
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: record kinds and record values.
1
+ // PlainScript 1.0.362: record kinds and record values.
2
2
 
3
3
  define a kind called "Player" with
4
4
  name is ""
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: fetch an upstream API from a route.
1
+ // PlainScript 1.0.362: fetch an upstream API from a route.
2
2
  web app
3
3
  route get "/proxy"
4
4
  remember upstream as get "https://example.com/data" timeout 5000
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: JSON REST route.
1
+ // PlainScript 1.0.362: JSON REST route.
2
2
  web app
3
3
  route get "/api/status"
4
4
  reply json
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: recurring task.
1
+ // PlainScript 1.0.362: recurring task.
2
2
  schedule "0 * * * *"
3
3
  show "hourly task"
4
4
  done
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: collection filtering.
1
+ // PlainScript 1.0.362: collection filtering.
2
2
  remember values as list with 1, 2, 3
3
3
  remember found as first item from values
4
4
  show found
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: minimal server.
1
+ // PlainScript 1.0.362: minimal server.
2
2
  web app
3
3
  route get "/"
4
4
  reply "Hello from PlainScript"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: sessions and cookies.
1
+ // PlainScript 1.0.362: sessions and cookies.
2
2
  web app
3
3
  enable sessions "session-secret"
4
4
  route get "/"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: SQLite, SQL blocks, parameters, and transactions.
1
+ // PlainScript 1.0.362: SQLite, SQL blocks, parameters, and transactions.
2
2
 
3
3
  database "plain-script-demo.db" using "wasm"
4
4
  remember personName as "Ada"
@@ -1,2 +1,2 @@
1
- // PlainScript 1.0.361: start command entry point.
1
+ // PlainScript 1.0.362: start command entry point.
2
2
  show "PlainScript started"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: standard library helpers.
1
+ // PlainScript 1.0.362: standard library helpers.
2
2
  remember text as trim(" PlainScript ")
3
3
  remember digest as sha256(text)
4
4
  show digest
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: natural string verbs - transform a variable in place.
1
+ // PlainScript 1.0.362: natural string verbs - transform a variable in place.
2
2
 
3
3
  make capitalize(title)
4
4
  lowercase title
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: fixed and provider-backed Telegram replies.
1
+ // PlainScript 1.0.362: fixed and provider-backed Telegram replies.
2
2
 
3
3
  bot env("TELEGRAM_BOT_TOKEN")
4
4
 
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: Telegram bot.
1
+ // PlainScript 1.0.362: Telegram bot.
2
2
  bot env("TELEGRAM_BOT_TOKEN")
3
3
  when someone sends "/start"
4
4
  reply "Welcome"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: the native test DSL.
1
+ // PlainScript 1.0.362: the native test DSL.
2
2
 
3
3
  make add(a, b)
4
4
  give a + b
@@ -11,7 +11,7 @@ What the script exercises:
11
11
  - `remember scene as new THREE.Scene()`, `new THREE.PerspectiveCamera(...)`,
12
12
  `new THREE.WebGLRenderer()` and `renderer.setSize(...)`.
13
13
  - `new THREE.BoxGeometry(...)`, `new THREE.MeshStandardMaterial({ color: 0x40c463 })`
14
- and `new THREE.Mesh(geo, mat)` - v1.0.361 hex literals (`0xRRGGBB`) keep the
14
+ and `new THREE.Mesh(geo, mat)` - v1.0.362 hex literals (`0xRRGGBB`) keep the
15
15
  palette legible; the lights use `0xffffff`.
16
16
  - A light rig with `new THREE.AmbientLight(...)` + `new THREE.DirectionalLight(...)`.
17
17
  - `document.body.append(renderer.domElement)` mounts the WebGL canvas.
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: a WebGL 3D scene using the global THREE object.
1
+ // PlainScript 1.0.362: a WebGL 3D scene using the global THREE object.
2
2
 
3
3
  remember scene as new THREE.Scene()
4
4
  remember camera as new THREE.PerspectiveCamera(75, 640 / 480, 0.1, 1000)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: web apps, routes, JSON, and status codes.
1
+ // PlainScript 1.0.362: web apps, routes, JSON, and status codes.
2
2
 
3
3
  web app
4
4
  allow cors
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: web application.
1
+ // PlainScript 1.0.362: web application.
2
2
  web app
3
3
  route get "/health"
4
4
  reply json
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: WebSocket server.
1
+ // PlainScript 1.0.362: WebSocket server.
2
2
  websocket server on 8080
3
3
  when socket connects
4
4
  send socket "connected"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: WebSocket server handlers.
1
+ // PlainScript 1.0.362: WebSocket server handlers.
2
2
 
3
3
  websocket server on 8080
4
4
  when socket connects
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: WhatsApp pairing login.
1
+ // PlainScript 1.0.362: WhatsApp pairing login.
2
2
  // Showcases `use baileys`, message.type branching, media downloads,
3
3
  // and button/list reply handling.
4
4
 
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.361: WhatsApp QR login.
1
+ // PlainScript 1.0.362: WhatsApp QR login.
2
2
  // Showcases `use baileys`, message.type branching, media downloads,
3
3
  // and button handling.
4
4
 
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "plainscript-lang",
3
- "version": "1.0.361",
3
+ "version": "1.0.362",
4
4
  "description": "PlainScript - an Intent-Oriented Programming Language. When even a simple sentence can be code.",
5
5
  "main": "compiler/cli.js",
6
6
  "bin": {
7
7
  "plainscript": "./compiler/cli.js"
8
8
  },
9
9
  "scripts": {
10
- "test": "node tests/compiler.test.js && node tests/build.test.js && node tests/telegram.test.js && node tests/ocr.test.js && node tests/nesting.test.js && node tests/backend.test.js && node tests/runtime.test.js && node tests/browser.test.js && node tests/acceptance.test.js && node tests/whatsapp.test.js && node tests/audit.test.js && node tests/sourcemap.test.js && node tests/modules.test.js && node tests/repeat.test.js && node tests/datastructures.test.js && node tests/kernel.test.js && node tests/docs.test.js && node tests/compat/browser-interop.test.js && node tests/compat/language.test.js && node tests/compat/node.test.js && node tests/compat/binary.test.js && node tests/compat/errors.test.js && node tests/compat/async.test.js && node tests/compat/modules.test.js && node tests/compat/npm.test.js && node tests/compat/web.test.js && node tests/compat/real-world.test.js"
10
+ "test": "node tests/compiler.test.js && node tests/build.test.js && node tests/telegram.test.js && node tests/ocr.test.js && node tests/nesting.test.js && node tests/backend.test.js && node tests/runtime.test.js && node tests/browser.test.js && node tests/acceptance.test.js && node tests/whatsapp.test.js && node tests/audit.test.js && node tests/sourcemap.test.js && node tests/modules.test.js && node tests/repeat.test.js && node tests/datastructures.test.js && node tests/kernel.test.js && node tests/docs.test.js && node tests/compat/browser-interop.test.js && node tests/compat/language.test.js && node tests/compat/node.test.js && node tests/compat/binary.test.js && node tests/compat/errors.test.js && node tests/compat/async.test.js && node tests/compat/modules.test.js && node tests/compat/npm.test.js && node tests/compat/web.test.js && node tests/compat/real-world.test.js && node tests/packaging.test.js"
11
11
  },
12
12
  "files": [
13
13
  "compiler",
@@ -39,10 +39,11 @@
39
39
  "sql.js": "^1.13.0",
40
40
  "ws": "^8.21.3"
41
41
  },
42
- "dependencies": {
42
+ "dependencies": {},
43
+ "optionalDependencies": {
44
+ "better-sqlite3": "^11.10.0",
43
45
  "mongodb": "^6.20.0",
44
- "tesseract.js": "^7.0.0",
45
- "better-sqlite3": "^9.0.0",
46
- "three": "^0.185.1"
46
+ "sql.js": "^1.13.0",
47
+ "tesseract.js": "^7.0.0"
47
48
  }
48
49
  }