@mdsnai/sdk 0.2.0 → 0.2.1

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.
@@ -23,7 +23,7 @@ function parseMdsnBlocks(blocks) {
23
23
  continue;
24
24
  }
25
25
  if (!currentBlock) {
26
- if (line.startsWith("block ")) {
26
+ if (line.startsWith("BLOCK ")) {
27
27
  currentBlock = createBlock((0, statements_1.parseBlockHeaderLine)(line));
28
28
  documentBlocks.push(currentBlock);
29
29
  index += 1;
@@ -28,7 +28,7 @@ function parseStringArrayLiteral(raw) {
28
28
  return parsed;
29
29
  }
30
30
  function parseBlockHeaderLine(line) {
31
- const match = line.trim().match(/^block\s+([a-zA-Z_][\w-]*)\s*\{$/);
31
+ const match = line.trim().match(/^BLOCK\s+([a-zA-Z_][\w-]*)\s*\{$/);
32
32
  if (!match) {
33
33
  throw new Error(`Invalid block declaration: ${line}`);
34
34
  }
@@ -29,7 +29,7 @@ function createStarterSite(targetDir) {
29
29
  start: "mdsn start",
30
30
  },
31
31
  dependencies: {
32
- "@mdsnai/sdk": "^0.2.0",
32
+ "@mdsnai/sdk": "^0.2.1",
33
33
  },
34
34
  }, null, 2) + "\n", "utf8");
35
35
  (0, node_fs_1.writeFileSync)(node_path_1.default.join(targetDir, "pages", "index.md"), `---
@@ -49,7 +49,7 @@ Start with a working guestbook and reshape it into your own app.
49
49
  <!-- mdsn:block guestbook -->
50
50
 
51
51
  \`\`\`mdsn
52
- block guestbook {
52
+ BLOCK guestbook {
53
53
  INPUT text -> nickname
54
54
  INPUT text required -> message
55
55
  GET "/list" -> refresh
@@ -46,7 +46,7 @@ function renderMarkdownValue(type, value, options) {
46
46
  }
47
47
  }
48
48
  function serializeBlock(block) {
49
- const lines = ["```mdsn", `block ${block.name} {`];
49
+ const lines = ["```mdsn", `BLOCK ${block.name} {`];
50
50
  for (const input of block.inputs ?? []) {
51
51
  const requiredMarker = input.required ? " required" : "";
52
52
  const secretMarker = input.secret ? " secret" : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdsnai/sdk",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "private": false,
5
5
  "description": "SDK, framework host, parser, renderer, and CLI for building MDSN sites.",
6
6
  "license": "MIT",