plainscript-lang 0.1.7 → 1.0.0-beta
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 +61 -36
- package/compiler/bundler.js +1 -1
- package/compiler/cli.js +42 -42
- package/compiler/generator.js +623 -10
- package/compiler/lexer.js +31 -2
- package/compiler/parser.js +539 -22
- package/compiler/version.js +1 -1
- package/docs/CAPABILITY_GAP_AUDIT.md +379 -0
- package/docs/PLINJS_SPEC.md +124 -24
- package/docs/index.html +535 -2205
- package/docs/website/script.js +889 -133
- package/docs/website/style.css +652 -1113
- package/examples/{cache-and-jobs.pln → cache-and-jobs.ps} +1 -1
- package/examples/{database.pln → database.ps} +1 -1
- package/examples/{deployment.pln → deployment.ps} +1 -1
- package/examples/{email-send.pln → email-send.ps} +1 -1
- package/examples/{rest-api.pln → rest-api.ps} +1 -1
- package/examples/{scheduled-tasks.pln → scheduled-tasks.ps} +1 -1
- package/examples/{websocket-server.pln → websocket-server.ps} +1 -1
- package/package.json +2 -2
- package/docs/website/index.html +0 -1500
- /package/examples/{arrays.pln → arrays.ps} +0 -0
- /package/examples/{day2.pln → day2.ps} +0 -0
- /package/examples/{day3.pln → day3.ps} +0 -0
- /package/examples/{expressions.pln → expressions.ps} +0 -0
- /package/examples/football-backend/{app.pln → app.ps} +0 -0
- /package/examples/{hello.pln → hello.ps} +0 -0
- /package/examples/id-verification/{app.pln → app.ps} +0 -0
- /package/examples/{loops.pln → loops.ps} +0 -0
- /package/examples/{objects.pln → objects.ps} +0 -0
- /package/examples/{rest-api-fetch.pln → rest-api-fetch.ps} +0 -0
- /package/examples/{server.pln → server.ps} +0 -0
- /package/examples/{start.pln → start.ps} +0 -0
- /package/examples/{stdlib.pln → stdlib.ps} +0 -0
- /package/examples/{telegram-bot.pln → telegram-bot.ps} +0 -0
- /package/examples/{web-app.pln → web-app.ps} +0 -0
- /package/examples/whatsapp-bot/{pairing.pln → pairing.ps} +0 -0
- /package/examples/whatsapp-bot/{qr.pln → qr.ps} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// PlainScript v2.1 — Cache, background jobs and cron working together
|
|
2
2
|
//
|
|
3
|
-
// Run with: REDIS_URL=redis://localhost:6379 plainscript run examples/cache-and-jobs.
|
|
3
|
+
// Run with: REDIS_URL=redis://localhost:6379 plainscript run examples/cache-and-jobs.ps
|
|
4
4
|
//
|
|
5
5
|
// Heavy work is pushed off the request path with "run background", shared
|
|
6
6
|
// state lives in Redis, and a cron job refreshes it every minute.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// PlainScript v2.1 — Databases: SQLite, parameters and transactions
|
|
2
2
|
//
|
|
3
|
-
// Run with: plainscript run examples/database.
|
|
3
|
+
// Run with: plainscript run examples/database.ps
|
|
4
4
|
//
|
|
5
5
|
// SQL placeholders are written {likeThis} and bind to PlainScript variables of
|
|
6
6
|
// the same name. A transaction block runs all enclosed writes atomically.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// PlainScript v1.0.1 — runtime dependency and deployment example
|
|
2
2
|
//
|
|
3
3
|
// `plainscript build` and `plainscript run` detect express from `web app` and install it
|
|
4
|
-
// when it is missing. `plainscript start` builds src/app.
|
|
4
|
+
// when it is missing. `plainscript start` builds src/app.ps by default.
|
|
5
5
|
|
|
6
6
|
web app
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// PlainScript v2.1 — Sending email
|
|
2
2
|
//
|
|
3
|
-
// Run with: MAIL_PASS=secret plainscript run examples/email-send.
|
|
3
|
+
// Run with: MAIL_PASS=secret plainscript run examples/email-send.ps
|
|
4
4
|
//
|
|
5
5
|
// Configure the outgoing transport once, then send as many mails as you
|
|
6
6
|
// like. Credentials come from the environment — never hardcode them.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// PlainScript v2.1 — A real REST API
|
|
2
2
|
//
|
|
3
|
-
// Run with: plainscript run examples/rest-api.
|
|
3
|
+
// Run with: plainscript run examples/rest-api.ps
|
|
4
4
|
// Try: curl http://localhost:3000/api/users
|
|
5
5
|
//
|
|
6
6
|
// Demonstrates method routes, route groups, CORS, request validation,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// PlainScript v2.1 — Scheduled and recurring tasks
|
|
2
2
|
//
|
|
3
|
-
// Run with: plainscript run examples/scheduled-tasks.
|
|
3
|
+
// Run with: plainscript run examples/scheduled-tasks.ps
|
|
4
4
|
//
|
|
5
5
|
// "every" covers simple intervals; "schedule" accepts any standard cron
|
|
6
6
|
// expression (powered by croner).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// PlainScript v2.1 — WebSocket chat server
|
|
2
2
|
//
|
|
3
|
-
// Run with: plainscript run examples/websocket-server.
|
|
3
|
+
// Run with: plainscript run examples/websocket-server.ps
|
|
4
4
|
// Then connect any ws client to ws://localhost:8080 and start typing.
|
|
5
5
|
// Every message a client sends is echoed back to it and broadcast to
|
|
6
6
|
// everyone else.
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plainscript-lang",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta",
|
|
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/backend.test.js && node tests/runtime.test.js && node tests/acceptance.test.js && node tests/whatsapp.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/backend.test.js && node tests/runtime.test.js && node tests/acceptance.test.js && node tests/whatsapp.test.js && node tests/audit.test.js"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"compiler",
|