@skillstech/thunderlang 0.5.10 → 0.5.12

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 (66) hide show
  1. package/CHANGELOG.md +450 -0
  2. package/dist/core.cjs +30434 -7577
  3. package/dist/index.cjs +28576 -5328
  4. package/dist/learn.cjs +24201 -5367
  5. package/package.json +12 -3
  6. package/src/bicep.mjs +167 -0
  7. package/src/cli.mjs +169 -3
  8. package/src/commands.mjs +464 -0
  9. package/src/core.d.ts +12 -4
  10. package/src/core.mjs +12 -4
  11. package/src/emit.mjs +1 -1
  12. package/src/executed.d.mts +53 -0
  13. package/src/executed.mjs +465 -0
  14. package/src/faithful.mjs +137 -0
  15. package/src/file-formats.mjs +35 -0
  16. package/src/hcl.mjs +94 -0
  17. package/src/index.d.ts +7 -1
  18. package/src/index.mjs +6 -1
  19. package/src/infra-bicep.mjs +312 -0
  20. package/src/infra-cloud.mjs +348 -0
  21. package/src/infra-compose.mjs +315 -0
  22. package/src/infra-containers.mjs +100 -0
  23. package/src/infra-docker.mjs +267 -0
  24. package/src/infra-expr.mjs +509 -0
  25. package/src/infra-gha.mjs +350 -0
  26. package/src/infra-k8s.mjs +657 -0
  27. package/src/infra-terraform.mjs +499 -0
  28. package/src/infra-words.mjs +811 -0
  29. package/src/libraries.mjs +202 -0
  30. package/src/lift.mjs +49 -6
  31. package/src/meaning.d.mts +89 -0
  32. package/src/meaning.mjs +2544 -0
  33. package/src/model.d.mts +65 -14
  34. package/src/model.mjs +496 -80
  35. package/src/powershell.mjs +1361 -0
  36. package/src/read-repo-fs.mjs +29 -7
  37. package/src/read-repo.d.mts +5 -1
  38. package/src/read-repo.mjs +33 -7
  39. package/src/read.d.mts +21 -1
  40. package/src/read.mjs +1017 -42
  41. package/src/review.d.mts +35 -0
  42. package/src/review.mjs +671 -0
  43. package/src/rlang.mjs +1084 -0
  44. package/src/round-trip.d.mts +12 -0
  45. package/src/round-trip.mjs +174 -0
  46. package/src/runners/thunder-generate.mjs +56 -0
  47. package/src/runners/thunder-trace.cjs +284 -0
  48. package/src/runners/thunder_trace.py +599 -0
  49. package/src/running.d.mts +104 -0
  50. package/src/running.mjs +787 -0
  51. package/src/same.d.mts +1 -0
  52. package/src/same.mjs +24 -3
  53. package/src/shell.mjs +1212 -0
  54. package/src/sql.mjs +3 -2
  55. package/src/steps.d.mts +6 -1
  56. package/src/steps.mjs +1448 -86
  57. package/src/system.d.mts +12 -0
  58. package/src/system.mjs +845 -0
  59. package/src/things-langs.mjs +275 -0
  60. package/src/thunderize.mjs +3 -3
  61. package/src/visual.d.mts +5 -5
  62. package/src/visual.mjs +24 -3
  63. package/src/write-steps.d.mts +64 -0
  64. package/src/write-steps.mjs +1608 -0
  65. package/src/write.mjs +2 -1
  66. package/src/yaml.mjs +403 -0
package/src/sql.mjs CHANGED
@@ -374,11 +374,12 @@ export function sqlItems(src) {
374
374
  if (r.kind === 'check') {
375
375
  const cond = sqlCondition(r.cond);
376
376
  const name = r.name || `${(r.cond.match(/[a-z_]\w*/i) || ['value'])[0]}_check`;
377
- push(name, r.line, [{ kind: 'branch', says: `If not: ${cond}`, code: `CHECK (${r.cond})`, line: r.line, children: [{ kind: 'fail', says: `Fails with Refused by the database: "The ${singular(table)} needs ${cond.replace(/"/g, "'")}"`, error: 'Refused by the database', message: `The ${singular(table)} needs ${cond.replace(/"/g, "'")}`, code: `CHECK (${r.cond})`, line: r.line }] }],
377
+ // The database's refusal is described, not quoted: the code holds no such message.
378
+ push(name, r.line, [{ kind: 'branch', says: `If not: ${cond}`, code: `CHECK (${r.cond})`, line: r.line, children: [{ kind: 'fail', says: `Fails with Refused by the database: the ${singular(table)} needs ${cond.replace(/"/g, "'")}`, error: 'Refused by the database', message: `The ${singular(table)} needs ${cond.replace(/"/g, "'")}`, code: `CHECK (${r.cond})`, line: r.line }] }],
378
379
  { says: `Every ${singular(table)} must have ${cond}.`, headline: `Every ${singular(table)} must have ${cond}.` });
379
380
  } else {
380
381
  const cols = listWords(r.cols.map(words));
381
- push(r.name || `unique_${r.cols.join('_and_')}`, r.line, [{ kind: 'branch', says: `If not: no other ${singular(table)} has the same ${cols}`, code: `UNIQUE (${r.cols.join(', ')})`, line: r.line, children: [{ kind: 'fail', says: `Fails with Refused by the database: "Each ${cols} can be used only once"`, error: 'Refused by the database', message: `Each ${cols} can be used only once`, code: `UNIQUE (${r.cols.join(', ')})`, line: r.line }] }],
382
+ push(r.name || `unique_${r.cols.join('_and_')}`, r.line, [{ kind: 'branch', says: `If not: no other ${singular(table)} has the same ${cols}`, code: `UNIQUE (${r.cols.join(', ')})`, line: r.line, children: [{ kind: 'fail', says: `Fails with Refused by the database: each ${cols} can be used only once`, error: 'Refused by the database', message: `Each ${cols} can be used only once`, code: `UNIQUE (${r.cols.join(', ')})`, line: r.line }] }],
382
383
  { says: `Each ${cols} can be used by only one ${singular(table)}.`, headline: `Each ${cols} can be used by only one ${singular(table)}.` });
383
384
  }
384
385
  }
package/src/steps.d.mts CHANGED
@@ -1,2 +1,7 @@
1
1
  export const STEPS_SCHEMA: 'thunder-steps-v1';
2
- export function classifyStatement(raw: string, opts?: { inner?: number }): { kind: string; says: string; code: string };
2
+ import type { Expr } from './meaning.mjs';
3
+ export function classifyStatement(raw: string, opts?: { inner?: number }): { kind: string; says: string; code: string; expr: Expr };
4
+ /** A statement's meaning tree, read in the language of the function being read. */
5
+ export function statementExpr(raw: string): Expr;
6
+ /** The language of the function being read ('' outside one). */
7
+ export function readingLanguage(): string;