plainscript-lang 1.0.3 → 1.0.35

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 (74) hide show
  1. package/README.md +29 -0
  2. package/compiler/cli.js +1 -1
  3. package/compiler/dependency-detector.js +6 -2
  4. package/compiler/generator.js +422 -51
  5. package/compiler/parser.js +40 -2
  6. package/compiler/version.js +1 -1
  7. package/docs/CAPABILITY_GAP_AUDIT.md +9 -3
  8. package/docs/PLAINSCRIPT-SPEC.md +135 -3
  9. package/docs/index.html +27 -26
  10. package/docs/logo-pln.jpg +0 -0
  11. package/docs/visualization-example.svg +32 -0
  12. package/docs/website/script.js +130 -1
  13. package/docs/website/style.css +211 -47
  14. package/examples/ai-providers.pln +1 -1
  15. package/examples/arrays.pln +1 -1
  16. package/examples/async-errors.pln +1 -1
  17. package/examples/auth-api.pln +1 -1
  18. package/examples/auth-sessions.pln +1 -1
  19. package/examples/basics.pln +1 -1
  20. package/examples/bots.pln +1 -1
  21. package/examples/cache-and-jobs.pln +1 -1
  22. package/examples/cache-schedule.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/json.pln +1 -1
  43. package/examples/loops.pln +1 -1
  44. package/examples/modules/app.pln +1 -1
  45. package/examples/modules/main.pln +1 -1
  46. package/examples/modules/math.pln +1 -1
  47. package/examples/mongo.pln +1 -1
  48. package/examples/objects.pln +1 -1
  49. package/examples/ocr.pln +1 -1
  50. package/examples/packages.pln +1 -1
  51. package/examples/record-kinds.pln +1 -1
  52. package/examples/records.pln +1 -1
  53. package/examples/rest-api-fetch.pln +1 -1
  54. package/examples/rest-api.pln +1 -1
  55. package/examples/scheduled-tasks.pln +1 -1
  56. package/examples/search-and-filter.pln +1 -1
  57. package/examples/server.pln +1 -1
  58. package/examples/sessions-and-cookies.pln +1 -1
  59. package/examples/sqlite.pln +1 -1
  60. package/examples/start.pln +1 -1
  61. package/examples/stdlib.pln +1 -1
  62. package/examples/string-verbs.pln +1 -1
  63. package/examples/telegram-ai-bot.pln +1 -1
  64. package/examples/telegram-bot.pln +1 -1
  65. package/examples/testing.pln +1 -1
  66. package/examples/visualization.pln +12 -0
  67. package/examples/web-api.pln +1 -1
  68. package/examples/web-app.pln +1 -1
  69. package/examples/websocket-server.pln +1 -1
  70. package/examples/websocket.pln +1 -1
  71. package/examples/whatsapp-bot/pairing.pln +24 -2
  72. package/examples/whatsapp-bot/qr.pln +18 -2
  73. package/package.json +2 -1
  74. package/docs/logo.jpg +0 -0
@@ -1,16 +1,17 @@
1
1
  :root {
2
- --bg: #070c16;
3
- --bg-elev: #0b1220;
4
- --panel: rgba(18, 26, 42, .78);
5
- --panel-solid: #101828;
6
- --line: rgba(120, 160, 230, .16);
7
- --line-strong: rgba(120, 160, 230, .3);
8
- --text: #e6edf7;
9
- --muted: #8fa0b8;
10
- --accent: #46e6b4;
11
- --accent-glow: rgba(70, 230, 180, .35);
12
- --accent-dim: #1f3d3a;
13
- --haze: rgba(70, 230, 180, .07);
2
+ --bg: #031004;
3
+ --bg-elev: #061b08;
4
+ --panel: rgba(8, 31, 11, .9);
5
+ --panel-solid: #0a260e;
6
+ --line: rgba(122, 190, 127, .18);
7
+ --line-strong: rgba(153, 213, 157, .36);
8
+ --text: #ebf5eb;
9
+ --muted: #a0b7a2;
10
+ --accent: #32ad3c;
11
+ --accent-bright: #4fc458;
12
+ --accent-glow: rgba(50, 173, 60, .2);
13
+ --accent-dim: #103b16;
14
+ --haze: rgba(50, 173, 60, .07);
14
15
  --radius: 14px;
15
16
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
16
17
  color: var(--text);
@@ -18,12 +19,12 @@
18
19
  }
19
20
 
20
21
  * { box-sizing: border-box; }
21
- html { scroll-behavior: smooth; }
22
+ html { scroll-behavior: smooth; overflow-x: hidden; }
22
23
  body { margin: 0; line-height: 1.6; overflow-x: hidden; }
23
24
  a { color: var(--accent); }
24
- a:hover { color: #9ff2da; }
25
- code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace; }
26
- code { font-size: .92em; color: #bfe9ff; }
25
+ a:hover { color: #79d77f; }
26
+ code, pre { font-family: "Roboto Mono", "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace; }
27
+ code { font-size: .92em; color: #b6e0ba; }
27
28
 
28
29
  .container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
29
30
 
@@ -37,11 +38,10 @@ code { font-size: .92em; color: #bfe9ff; }
37
38
  .bg-scrim {
38
39
  z-index: -2;
39
40
  background:
40
- radial-gradient(1100px 640px at 78% -10%, rgba(70, 230, 180, .14), transparent 62%),
41
- radial-gradient(900px 560px at 6% 28%, rgba(60, 110, 240, .12), transparent 60%),
42
- linear-gradient(180deg, #070c16 0%, #0a1120 55%, #070c16 100%);
41
+ radial-gradient(900px 520px at 82% -12%, rgba(50, 173, 60, .08), transparent 64%),
42
+ linear-gradient(180deg, #031004 0%, #061b08 55%, #031004 100%);
43
43
  }
44
- #bg-canvas { z-index: -1; opacity: .85; }
44
+ #bg-canvas { z-index: -1; opacity: .22; }
45
45
 
46
46
  /* Nav */
47
47
  .site-nav {
@@ -49,31 +49,56 @@ code { font-size: .92em; color: #bfe9ff; }
49
49
  top: 0;
50
50
  z-index: 6;
51
51
  border-bottom: 1px solid transparent;
52
- background: rgba(7, 12, 22, .55);
53
- backdrop-filter: blur(14px);
52
+ background: rgba(3, 16, 4, .9);
53
+ backdrop-filter: blur(8px);
54
54
  transition: background .3s ease, border-color .3s ease;
55
55
  }
56
- .site-nav.is-scrolled { background: rgba(7, 12, 22, .85); border-color: var(--line); }
56
+ .site-nav.is-scrolled { background: rgba(3, 16, 4, .96); border-color: var(--line); }
57
57
  .nav-inner, .nav-logo, .nav-links, .hero-actions, .footer-bottom, .library-toolbar { display: flex; align-items: center; }
58
58
  .nav-inner { min-height: 72px; justify-content: space-between; gap: 24px; }
59
59
  .nav-logo { gap: 10px; color: var(--text); font-weight: 800; text-decoration: none; letter-spacing: -.01em; }
60
- .nav-logo-mark {
60
+ .nav-logo-image {
61
61
  display: inline-grid;
62
62
  place-items: center;
63
63
  width: 30px;
64
64
  height: 30px;
65
65
  border-radius: 8px;
66
- color: #04140f;
67
- background: var(--accent);
68
- font-size: .82rem;
69
- font-weight: 900;
70
- box-shadow: 0 0 18px var(--accent-glow);
66
+ object-fit: cover;
67
+ box-shadow: 0 3px 10px rgba(0, 0, 0, .28);
71
68
  }
72
69
  .logo-ver { padding: 3px 8px; border-radius: 99px; color: var(--accent); border: 1px solid var(--line-strong); background: var(--accent-dim); font-size: .72rem; font-weight: 600; }
73
70
  .nav-links { gap: 22px; }
74
71
  .nav-links a { color: var(--muted); font-size: .9rem; text-decoration: none; transition: color .2s; }
75
72
  .nav-links a:hover { color: var(--accent); }
76
73
 
74
+ /* Hamburger toggle — hidden on desktop */
75
+ .nav-toggle {
76
+ display: none;
77
+ flex-direction: column;
78
+ justify-content: center;
79
+ gap: 5px;
80
+ width: 44px;
81
+ height: 44px;
82
+ padding: 10px;
83
+ border: none;
84
+ border-radius: 8px;
85
+ background: transparent;
86
+ cursor: pointer;
87
+ -webkit-tap-highlight-color: transparent;
88
+ }
89
+ .nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
90
+ .nav-toggle-bar {
91
+ display: block;
92
+ width: 100%;
93
+ height: 2px;
94
+ border-radius: 2px;
95
+ background: var(--text);
96
+ transition: transform .3s ease, opacity .3s ease;
97
+ }
98
+ .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
99
+ .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
100
+ .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
101
+
77
102
  /* Hero */
78
103
  .hero { position: relative; padding: 108px 0 92px; }
79
104
  .hero-content { max-width: 840px; position: relative; z-index: 1; }
@@ -91,22 +116,37 @@ code { font-size: .92em; color: #bfe9ff; }
91
116
  .hero-lead { max-width: 660px; color: var(--muted); font-size: 1.2rem; }
92
117
  .hero-actions { gap: 12px; margin: 30px 0; flex-wrap: wrap; }
93
118
  .button { display: inline-block; padding: 11px 18px; border-radius: 9px; font-weight: 750; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
94
- .button-primary { color: #04140f; background: var(--accent); box-shadow: 0 8px 26px var(--accent-glow); }
95
- .button-primary:hover { color: #04140f; background: #7bf0cd; transform: translateY(-2px); box-shadow: 0 12px 32px var(--accent-glow); }
119
+ .button-primary { color: #031004; background: var(--accent); }
120
+ .button-primary:hover { color: #031004; background: var(--accent-bright); transform: translateY(-2px); }
96
121
  .button-secondary { color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); backdrop-filter: blur(8px); }
97
122
  .button-secondary:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
123
+ .reference-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0; }
124
+ .button-reference {
125
+ color: var(--text);
126
+ border: 1px solid var(--line-strong);
127
+ background: var(--accent-dim);
128
+ }
129
+ .button-reference:hover {
130
+ color: var(--text);
131
+ border-color: var(--accent-bright);
132
+ background: #17551d;
133
+ transform: translateY(-2px);
134
+ }
98
135
 
99
136
  /* Code windows */
100
137
  .code-window {
101
138
  position: relative;
102
- overflow: auto;
139
+ width: 100%;
140
+ max-width: 100%;
141
+ min-width: 0;
142
+ overflow: hidden;
103
143
  margin: 28px 0 0;
104
144
  padding: 26px 24px 24px;
105
145
  border: 1px solid var(--line-strong);
106
146
  border-radius: var(--radius);
107
- color: #d7f6ea;
108
- background: linear-gradient(180deg, #0c1524, #0a101d);
109
- box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
147
+ color: #d6ead7;
148
+ background: #061b08;
149
+ box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
110
150
  }
111
151
  .code-window::before {
112
152
  content: "";
@@ -118,6 +158,57 @@ code { font-size: .92em; color: #bfe9ff; }
118
158
  background: var(--line-strong);
119
159
  }
120
160
  .code-window code { color: inherit; }
161
+ pre code {
162
+ display: block;
163
+ max-width: 100%;
164
+ color: #d6ead7;
165
+ font-size: .86rem;
166
+ font-weight: 500;
167
+ letter-spacing: -.012em;
168
+ line-height: 1.7;
169
+ white-space: pre-wrap;
170
+ overflow-wrap: anywhere;
171
+ word-break: break-word;
172
+ }
173
+ .code-token--keyword { color: #C678DD; font-weight: 500; }
174
+ .code-token--declaration { color: #C678DD; font-weight: 600; font-style: italic; }
175
+ .code-token--comparison,
176
+ .code-token--operator { color: #56B6C2; }
177
+ .code-token--assignment,
178
+ .code-token--web,
179
+ .code-token--error { color: #E06C75; }
180
+ .code-token--string,
181
+ .code-token--template,
182
+ .code-token--test { color: #98C379; }
183
+ .code-token--number,
184
+ .code-token--constant { color: #D19E66; }
185
+ .code-token--comment { color: #5C6370; font-style: italic; }
186
+ .code-token--function { color: #61AFEF; font-weight: 600; }
187
+ .code-token--builtin,
188
+ .code-token--database { color: #E5C07B; }
189
+ .copy-button {
190
+ position: absolute;
191
+ top: 10px;
192
+ right: 10px;
193
+ min-height: 30px;
194
+ padding: 4px 9px;
195
+ border: 1px solid var(--line-strong);
196
+ border-radius: 6px;
197
+ color: var(--muted);
198
+ background: rgba(3, 16, 4, .92);
199
+ cursor: pointer;
200
+ font: inherit;
201
+ font-size: .72rem;
202
+ line-height: 1.2;
203
+ transition: color .2s, border-color .2s, background .2s;
204
+ }
205
+ .copy-button:hover, .copy-button:focus-visible {
206
+ color: var(--accent);
207
+ border-color: var(--accent);
208
+ background: var(--accent-dim);
209
+ }
210
+ .copy-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
211
+ .copy-button.is-copied { color: #04140f; border-color: var(--accent); background: var(--accent); }
121
212
 
122
213
  .section { padding: 84px 0; }
123
214
  .section--alt { background: linear-gradient(180deg, var(--haze), transparent 42%), rgba(12, 19, 33, .55); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@@ -137,11 +228,11 @@ code { font-size: .92em; color: #bfe9ff; }
137
228
  .info-card:hover, .feature-card:hover, .library-card:hover {
138
229
  transform: translateY(-4px);
139
230
  border-color: var(--line-strong);
140
- box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
231
+ box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
141
232
  }
142
233
  .info-card h3, .feature-card h3, .library-card h3 { margin: 8px 0 6px; color: var(--text); }
143
234
  .info-card p, .feature-card p, .library-card p { margin: 0; color: var(--muted); }
144
- .card-number { color: var(--accent); font-size: .8rem; font-weight: 850; letter-spacing: .08em; text-shadow: 0 0 14px var(--accent-glow); }
235
+ .card-number { color: var(--accent-bright); font-size: .8rem; font-weight: 850; letter-spacing: .08em; }
145
236
 
146
237
  .capability-list { display: flex; gap: 10px; flex-wrap: wrap; }
147
238
  .capability-list span, .library-category {
@@ -186,12 +277,16 @@ code { font-size: .92em; color: #bfe9ff; }
186
277
  .lib-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
187
278
  .library-card-top { min-height: 102px; }
188
279
  .library-card pre {
189
- overflow: auto;
190
- margin: 18px -8px -8px;
191
- padding: 16px;
280
+ position: relative;
281
+ width: 100%;
282
+ max-width: 100%;
283
+ min-width: 0;
284
+ overflow: hidden;
285
+ margin: 18px 0 -8px;
286
+ padding: 44px 16px 16px;
192
287
  border-radius: 9px;
193
- color: #d7f6ea;
194
- background: #0a101d;
288
+ color: #d6ead7;
289
+ background: #061b08;
195
290
  border: 1px solid var(--line);
196
291
  font-size: .82rem;
197
292
  }
@@ -211,10 +306,79 @@ textarea, input { caret-color: var(--accent); }
211
306
  .info-card:hover, .feature-card:hover, .library-card:hover { transform: none; }
212
307
  }
213
308
 
309
+ /* ──────────────────────────────────────────────────────────────────────
310
+ MOBILE LAYOUT (≤ 760px)
311
+ ────────────────────────────────────────────────────────────────────── */
214
312
  @media (max-width: 760px) {
215
- .nav-inner { align-items: flex-start; padding: 14px 0; }
216
- .nav-links { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
217
- .hero { padding: 68px 0 60px; }
218
- .three-column, .feature-grid, .lib-grid, .split { grid-template-columns: 1fr; }
219
- .section { padding: 60px 0; }
313
+
314
+ /* --- Nav: hamburger + collapsible menu --- */
315
+ .nav-toggle { display: flex; }
316
+ .nav-inner { flex-wrap: wrap; padding: 12px 0; }
317
+ .nav-links {
318
+ display: none;
319
+ flex-basis: 100%;
320
+ flex-direction: column;
321
+ gap: 0;
322
+ padding: 8px 0 4px;
323
+ }
324
+ .nav-links.is-open { display: flex; }
325
+ .nav-links a {
326
+ display: flex;
327
+ align-items: center;
328
+ min-height: 44px;
329
+ padding: 6px 0;
330
+ font-size: 1rem;
331
+ color: var(--muted);
332
+ border-bottom: 1px solid var(--line);
333
+ }
334
+ .nav-links a:last-child { border-bottom: none; }
335
+
336
+ /* --- Hero --- */
337
+ .hero { padding: 56px 0 48px; }
338
+ .hero-title { font-size: clamp(2rem, 8vw, 3rem); line-height: 1.05; }
339
+ .hero-lead { font-size: 1.05rem; line-height: 1.55; }
340
+ .hero-actions { gap: 10px; margin: 22px 0 24px; }
341
+
342
+ /* --- Buttons: touch-friendly --- */
343
+ .button { padding: 12px 20px; font-size: .95rem; min-height: 44px; }
344
+
345
+ /* --- Code windows: full-width, no overflow tricks --- */
346
+ .code-window {
347
+ padding: 18px 14px 16px;
348
+ font-size: .82rem;
349
+ border-radius: 10px;
350
+ }
351
+
352
+ /* --- Sections --- */
353
+ .section { padding: 48px 0; }
354
+ .section-title { font-size: clamp(1.6rem, 6vw, 2.2rem); margin-bottom: 24px; }
355
+
356
+ /* --- Grids: single column --- */
357
+ .three-column,
358
+ .feature-grid,
359
+ .lib-grid,
360
+ .split { grid-template-columns: 1fr; gap: 14px; }
361
+
362
+ /* --- Cards: touch-friendly tap targets --- */
363
+ .info-card,
364
+ .feature-card,
365
+ .library-card { padding: 20px 18px; }
366
+
367
+ /* --- Capability list --- */
368
+ .capability-list span { font-size: .8rem; padding: 7px 10px; }
369
+
370
+ /* --- Library search & filters --- */
371
+ .library-toolbar { flex-direction: column; gap: 12px; }
372
+ .lib-search-input { width: 100%; min-width: 0; font-size: 1rem; }
373
+ .lib-filters { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
374
+ .lib-filter { white-space: nowrap; min-height: 40px; font-size: .84rem; }
375
+
376
+ /* --- Split (reference section) --- */
377
+ .split { gap: 24px; }
378
+
379
+ /* --- Footer --- */
380
+ .footer-bottom { flex-direction: column; align-items: center; text-align: center; gap: 6px; }
381
+
382
+ /* --- Canvas background: prevent horizontal scroll --- */
383
+ #bg-canvas { width: 100vw; height: 100vh; pointer-events: none; }
220
384
  }
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3: provider-backed AI works in ordinary programs.
1
+ // PlainScript 1.0.35: 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.3: array literals and indexing.
1
+ // PlainScript 1.0.35: 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.3: asynchronous work and error recovery.
1
+ // PlainScript 1.0.35: 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.3: protected API route.
1
+ // PlainScript 1.0.35: 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.3: API keys, sessions, cookies, and auth helpers.
1
+ // PlainScript 1.0.35: 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.3: variables, values, and output.
1
+ // PlainScript 1.0.35: 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.3: Telegram bot handlers.
1
+ // PlainScript 1.0.35: Telegram bot handlers.
2
2
 
3
3
  bot env("TELEGRAM_BOT_TOKEN")
4
4
 
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3: cache and background work.
1
+ // PlainScript 1.0.35: 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.3: cache values and scheduled work.
1
+ // PlainScript 1.0.35: cache values and scheduled work.
2
2
 
3
3
  cache "redis://localhost:6379"
4
4
 
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3: lists, objects, and collection helpers.
1
+ // PlainScript 1.0.35: 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.3: parallel operations and timeouts.
1
+ // PlainScript 1.0.35: parallel operations and timeouts.
2
2
 
3
3
  make firstJob()
4
4
  wait for sleep(10)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3: conditions and string predicates.
1
+ // PlainScript 1.0.35: 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.3: SQLite database.
1
+ // PlainScript 1.0.35: 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.3: conditional blocks.
1
+ // PlainScript 1.0.35: 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.3: functions.
1
+ // PlainScript 1.0.35: functions.
2
2
  make greet(name)
3
3
  give `Hello, ${name}!`
4
4
  done
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3: production-shaped web entry point.
1
+ // PlainScript 1.0.35: 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.3: email application placeholder.
1
+ // PlainScript 1.0.35: 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.3: recovery and cleanup.
1
+ // PlainScript 1.0.35: recovery and cleanup.
2
2
  try
3
3
  show "work"
4
4
  recover as error
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3: expression operators.
1
+ // PlainScript 1.0.35: 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.3: upload route.
1
+ // PlainScript 1.0.35: 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.3: files and environment configuration.
1
+ // PlainScript 1.0.35: 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.3: file and path operations.
1
+ // PlainScript 1.0.35: 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.3: a complete authenticated SQLite API.
1
+ // PlainScript 1.0.35: 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.3: functions, defaults, and returns.
1
+ // PlainScript 1.0.35: functions, defaults, and returns.
2
2
 
3
3
  make greet(name)
4
4
  give `Hello, ${name}!`
@@ -1,2 +1,2 @@
1
- // PlainScript 1.0.3: hello world.
1
+ // PlainScript 1.0.35: hello world.
2
2
  show "Hello, PlainScript!"
@@ -1,3 +1,3 @@
1
- // PlainScript 1.0.3: HTTP client request.
1
+ // PlainScript 1.0.35: 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.3: HTTP client requests.
1
+ // PlainScript 1.0.35: 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.3: upload and OCR verification service.
1
+ // PlainScript 1.0.35: 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"
package/examples/json.pln CHANGED
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3: JSON values and transformations.
1
+ // PlainScript 1.0.35: 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.3: collection and numeric loops.
1
+ // PlainScript 1.0.35: 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.3: module entry point.
1
+ // PlainScript 1.0.35: module entry point.
2
2
  import { circleArea } from "./math.pln"
3
3
  show circleArea(2)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3: named imports.
1
+ // PlainScript 1.0.35: named imports.
2
2
 
3
3
  import { circleArea } from "./math.pln"
4
4
  show circleArea(2)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3: an imported module.
1
+ // PlainScript 1.0.35: an imported module.
2
2
 
3
3
  remember PI as 3.14159
4
4
 
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3: MongoDB.
1
+ // PlainScript 1.0.35: 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.3: object literals and member access.
1
+ // PlainScript 1.0.35: 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.3: upload handling and OCR.
1
+ // PlainScript 1.0.35: 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.3: importing npm packages.
1
+ // PlainScript 1.0.35: importing npm packages.
2
2
 
3
3
  use express
4
4
 
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3: record kind construction.
1
+ // PlainScript 1.0.35: 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.3: record kinds and record values.
1
+ // PlainScript 1.0.35: 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.3: fetch an upstream API from a route.
1
+ // PlainScript 1.0.35: 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.3: JSON REST route.
1
+ // PlainScript 1.0.35: 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.3: recurring task.
1
+ // PlainScript 1.0.35: recurring task.
2
2
  schedule "0 * * * *"
3
3
  show "hourly task"
4
4
  done