@thi.ng/tangle 1.1.52 → 1.1.54
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 +2 -2
- package/cli.js +2 -2
- package/package.json +12 -12
- package/tangle.js +3 -3
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 211 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
|
@@ -338,7 +338,7 @@ For Node.js REPL:
|
|
|
338
338
|
const tan = await import("@thi.ng/tangle");
|
|
339
339
|
```
|
|
340
340
|
|
|
341
|
-
Package sizes (brotli'd, pre-treeshake): ESM:
|
|
341
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 1.99 KB
|
|
342
342
|
|
|
343
343
|
## Dependencies
|
|
344
344
|
|
package/cli.js
CHANGED
|
@@ -27,10 +27,10 @@ const CMD = {
|
|
|
27
27
|
comments: opts.noComments !== true
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
for (
|
|
30
|
+
for (const file of inputs) {
|
|
31
31
|
ctx = tangleFile(file, ctx);
|
|
32
32
|
}
|
|
33
|
-
for (
|
|
33
|
+
for (const out in ctx.outputs) {
|
|
34
34
|
writeText(out, ctx.outputs[out], ctx.logger, opts.dryRun);
|
|
35
35
|
}
|
|
36
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/tangle",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.54",
|
|
4
4
|
"description": "Literate programming code block tangling / codegen utility, inspired by org-mode & noweb",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@thi.ng/api": "^8.12.
|
|
44
|
-
"@thi.ng/args": "^3.2.
|
|
45
|
-
"@thi.ng/checks": "^3.
|
|
46
|
-
"@thi.ng/compare": "^2.4.
|
|
47
|
-
"@thi.ng/date": "^2.7.
|
|
48
|
-
"@thi.ng/errors": "^2.5.
|
|
49
|
-
"@thi.ng/file-io": "^2.2.
|
|
50
|
-
"@thi.ng/logger": "^3.2.
|
|
51
|
-
"@thi.ng/strings": "^3.9.
|
|
52
|
-
"@thi.ng/transducers": "^9.6.
|
|
43
|
+
"@thi.ng/api": "^8.12.10",
|
|
44
|
+
"@thi.ng/args": "^3.2.5",
|
|
45
|
+
"@thi.ng/checks": "^3.8.0",
|
|
46
|
+
"@thi.ng/compare": "^2.4.36",
|
|
47
|
+
"@thi.ng/date": "^2.7.73",
|
|
48
|
+
"@thi.ng/errors": "^2.5.50",
|
|
49
|
+
"@thi.ng/file-io": "^2.2.20",
|
|
50
|
+
"@thi.ng/logger": "^3.2.9",
|
|
51
|
+
"@thi.ng/strings": "^3.9.31",
|
|
52
|
+
"@thi.ng/transducers": "^9.6.19"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/node": "^24.10.1",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"thi.ng": {
|
|
104
104
|
"year": 2022
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "824bf9047b5a10f777c5c5b4aeecf0c750a22c75\n"
|
|
107
107
|
}
|
package/tangle.js
CHANGED
|
@@ -104,7 +104,7 @@ const __resolveBlock = (block, ref, ctx) => {
|
|
|
104
104
|
block.body = block.body.replace(/\\</g, "<");
|
|
105
105
|
};
|
|
106
106
|
const __resolveBlocks = (ref, ctx) => {
|
|
107
|
-
for (
|
|
107
|
+
for (const id in ref.blocks) {
|
|
108
108
|
__resolveBlock(ref.blocks[id], ref, ctx);
|
|
109
109
|
}
|
|
110
110
|
return ref;
|
|
@@ -112,7 +112,7 @@ const __resolveBlocks = (ref, ctx) => {
|
|
|
112
112
|
const __parseFileMeta = (src) => {
|
|
113
113
|
if (!src.startsWith("---\n")) return {};
|
|
114
114
|
const res = {};
|
|
115
|
-
for (
|
|
115
|
+
for (const line of split(src.substring(4))) {
|
|
116
116
|
if (line === "---") break;
|
|
117
117
|
const [key, val] = line.split(/:\s+/g);
|
|
118
118
|
res[key.trim()] = val.trim();
|
|
@@ -167,7 +167,7 @@ const tangleFile = (path, ctx = {}) => {
|
|
|
167
167
|
const sorted = Object.values(blocks).sort(compareByKey("start"));
|
|
168
168
|
let prev = 0;
|
|
169
169
|
let res = [];
|
|
170
|
-
for (
|
|
170
|
+
for (const block of sorted) {
|
|
171
171
|
if (meta.publish) {
|
|
172
172
|
res.push(src.substring(prev, Math.max(prev, block.matchStart)));
|
|
173
173
|
if (block.publish !== "no") {
|