bounded-loops 0.2.1 → 0.3.0
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 +1 -1
- package/bin/bounded-loops.js +17 -7
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ bl new pytest-basic my-loop
|
|
|
26
26
|
bl run my-loop --yes
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
Full documentation, the
|
|
29
|
+
Full documentation, the 68 loop folders (64 keyless), the nine bounds, and the architecture
|
|
30
30
|
docs live in the [main repository](https://github.com/qualixar/bounded-loops).
|
|
31
31
|
Clone the repository when you want `bl list` to browse the full shipped loop
|
|
32
32
|
catalog.
|
package/bin/bounded-loops.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
// Node — Python 3.11+ must be available on your PATH.
|
|
11
11
|
|
|
12
12
|
const { spawnSync } = require('child_process');
|
|
13
|
+
const { version: npmVersion } = require('../package.json');
|
|
13
14
|
|
|
14
15
|
const args = process.argv.slice(2);
|
|
15
16
|
|
|
@@ -40,21 +41,30 @@ if (!python) {
|
|
|
40
41
|
process.exit(1);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
// Run only when the Python engine exactly matches this npm release. Merely
|
|
45
|
+
// importing bounded_loops is insufficient: an older global install would make
|
|
46
|
+
// `npx bounded-loops@0.3.0` silently execute 0.2.x.
|
|
47
|
+
const installed = spawnSync(
|
|
48
|
+
python,
|
|
49
|
+
[
|
|
50
|
+
'-c',
|
|
51
|
+
'from importlib.metadata import version; print(version("bounded-loops"))',
|
|
52
|
+
],
|
|
53
|
+
{ encoding: 'utf8' }
|
|
54
|
+
);
|
|
55
|
+
if (installed.status === 0 && installed.stdout.trim() === npmVersion) {
|
|
46
56
|
runCli(python);
|
|
47
57
|
}
|
|
48
58
|
|
|
49
|
-
// First run:
|
|
50
|
-
console.error(
|
|
59
|
+
// First run or version mismatch: install the exact matching Python engine.
|
|
60
|
+
console.error(`bounded-loops: installing Python engine ${npmVersion}…`);
|
|
51
61
|
const install = spawnSync(
|
|
52
62
|
python,
|
|
53
|
-
['-m', 'pip', 'install', '--quiet',
|
|
63
|
+
['-m', 'pip', 'install', '--quiet', `bounded-loops==${npmVersion}`],
|
|
54
64
|
{ stdio: 'inherit' }
|
|
55
65
|
);
|
|
56
66
|
if (install.status !== 0) {
|
|
57
|
-
console.error(
|
|
67
|
+
console.error(`Auto-install failed. Install it manually: pip install bounded-loops==${npmVersion}`);
|
|
58
68
|
process.exit(1);
|
|
59
69
|
}
|
|
60
70
|
runCli(python);
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bounded-loops",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "npx launcher for bounded-loops
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "npx launcher for bounded-loops: 68 loop folders, 64 keyless, with independent gates and nine enforced bounds. Requires Python 3.11+.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"bounded-loops": "bin/bounded-loops.js"
|
|
7
7
|
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": "node --test test/*.test.js"
|
|
10
|
+
},
|
|
8
11
|
"files": [
|
|
9
12
|
"bin/",
|
|
10
13
|
"README.md"
|