rapydscript-ng 0.8.1 → 0.8.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ version 0.8.2
2
+ =======================
3
+
4
+ * Fix fmt not recognizing stdlib modules in standalone build
5
+
1
6
  version 0.8.1
2
7
  =======================
3
8
 
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "start": "node bin/rapydscript",
15
15
  "build-self": "node bin/rapydscript self --complete"
16
16
  },
17
- "version": "0.8.1",
17
+ "version": "0.8.2",
18
18
  "license": "BSD-2-Clause",
19
19
  "engines": {
20
20
  "node": ">=0.14.0"
package/tools/fmt.mjs CHANGED
@@ -626,6 +626,13 @@ function is_visual_def_start(elements, idx) {
626
626
  // reading src/lib/. Fall back to reading src/lib/ directly when the generated
627
627
  // file is absent (e.g. running straight from the release/ tree).
628
628
  var STDLIB_MODULES = (function () {
629
+ var em = globalThis.__rapydscript_embedded__;
630
+ if (em) {
631
+ if (em.stdlib_modules) return new Set(em.stdlib_modules);
632
+ if (em.stdlib) return new Set(Object.keys(em.stdlib)
633
+ .filter(function (n) { return n.slice(-4) === '.pyj'; })
634
+ .map(function (n) { return n.slice(0, -4); }));
635
+ }
629
636
  try {
630
637
  return new Set(JSON.parse(fs.readFileSync(
631
638
  new URL('../dev/stdlib_modules.json', import.meta.url), 'utf-8')));