@leaders-tech/schemio-playground 0.1.0 → 0.1.6

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 CHANGED
@@ -1,8 +1,9 @@
1
1
  # Schemio playground web component
2
2
 
3
3
  This package registers a lazy-loaded `<schemio-playground>` custom element. It
4
- contains a Schemio editor, helpful diagnostics, a live input/output debugger,
5
- and optional browser-local saving.
4
+ contains a Schemio editor, error diagnostics, a live debugger with several
5
+ independent test cases, an animated signal visualizer, and optional
6
+ browser-local saving.
6
7
 
7
8
  Edit this file when the package API, installation command, or release process
8
9
  changes. Copy it when another standalone web component needs a short package
@@ -17,8 +18,7 @@ project with:
17
18
  pnpm add @leaders-tech/schemio-playground
18
19
  ```
19
20
 
20
- Before the first npm publication, or to use the latest repository version,
21
- install it directly from GitHub:
21
+ To use the latest repository version directly, install it from GitHub:
22
22
 
23
23
  ```bash
24
24
  pnpm add github:leaders-tech/scheme#path:/frontend
@@ -41,29 +41,59 @@ Then put the element in a page or a framework template:
41
41
  ```html
42
42
  <schemio-playground storage-key="cs0040-prob-a-xor">
43
43
  <script type="text/plain">
44
- scheme (a b) xor (out):
45
- local either both not_both
46
- (a b) or (either)
47
- (a b) and (both)
48
- (both) not (not_both)
49
- (either not_both) and (out)
50
- end
44
+ scheme (a b) xor (out):
45
+ local either both not_both
46
+ (a b) or (either)
47
+ (a b) and (both)
48
+ (both) not (not_both)
49
+ (either not_both) and (out)
50
+ end
51
51
  </script>
52
52
  </schemio-playground>
53
53
  ```
54
54
 
55
55
  `storage-key` is strongly recommended: the user's code is saved under that
56
56
  key in `localStorage`. Add `storage="off"` to disable saving, or `readonly` to
57
- show a non-editable program.
57
+ show a non-editable program. The shared indentation inside `script` is removed,
58
+ so the program can be aligned neatly with the surrounding HTML.
58
59
 
59
60
  The element dispatches a bubbling `schemio-change` event after every edit. Its
60
61
  `event.detail` contains `{ source, isValid }`.
61
62
 
63
+ ## Use direct browser files
64
+
65
+ Every `schemio-playground-v…` GitHub Release also contains
66
+ `schemio-playground-<version>-browser.tar.gz` and its SHA-256 checksum. Download
67
+ the archive from the [releases page](https://github.com/leaders-tech/scheme/releases),
68
+ unpack it next to the static course page, and rename its directory to
69
+ `schemio-playground` if desired:
70
+
71
+ ```bash
72
+ tar -xzf schemio-playground-<version>-browser.tar.gz
73
+ mv schemio-playground-<version>-browser schemio-playground
74
+ ```
75
+
76
+ Keep `schemio-playground.js` and `chunks/` together. From a neighbouring HTML
77
+ page served by the same static website, load it with:
78
+
79
+ ```html
80
+ <script type="module" src="./schemio-playground/schemio-playground.js"></script>
81
+ ```
82
+
83
+ The archive includes its own `README.md` with the complete copy-paste example.
84
+
62
85
  ## Release the package
63
86
 
64
87
  The GitHub Actions workflow publishes the package after a tag named
65
88
  `schemio-playground-v<package version>` is pushed, for example
66
- `schemio-playground-v0.1.0`. It first runs the tests, builds the package, and
67
- installs the resulting tarball with pnpm. Publishing needs an `NPM_TOKEN`
68
- repository secret that may publish the `@leaders-tech` npm scope. Without that
69
- secret the verification job still runs, while publishing is skipped.
89
+ `schemio-playground-v0.1.6`. It first runs the tests, builds the package, and
90
+ installs the resulting tarball with pnpm.
91
+
92
+ For the same tag, it also attaches a browser-ready archive and SHA-256 checksum
93
+ to the GitHub Release.
94
+
95
+ The package uses npm Trusted Publishing: npm must link this package to
96
+ `leaders-tech/scheme` and the `schemio-playground-package.yml` workflow, with
97
+ the `npm publish` action allowed. The workflow uses OpenID Connect and needs
98
+ no `NPM_TOKEN` secret or bypass-2FA token. Keep npm's recommended publishing
99
+ access setting: require 2FA and disallow bypass-2FA tokens.