podlite 0.0.96 → 0.0.98
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.podlite +34 -0
- package/esm/assemble/index.js +5 -4
- package/esm/assemble/index.js.map +1 -1
- package/esm/lint/grammar/lint.js +47 -22
- package/esm/lint/grammar/lint.js.map +1 -1
- package/esm/lint/grammar/scan.js +6 -6
- package/esm/lint/grammar/scan.js.map +1 -1
- package/esm/lint/implicit-code.d.ts +3 -0
- package/esm/lint/implicit-code.js +83 -0
- package/esm/lint/implicit-code.js.map +1 -0
- package/esm/lint/index.js +4 -2
- package/esm/lint/index.js.map +1 -1
- package/esm/lint/line-starts.d.ts +3 -0
- package/esm/lint/line-starts.js +14 -0
- package/esm/lint/line-starts.js.map +1 -0
- package/esm/lint/rules/abbreviated-attrs.js +6 -4
- package/esm/lint/rules/abbreviated-attrs.js.map +1 -1
- package/esm/lint/rules/allow-value.d.ts +3 -0
- package/esm/lint/rules/allow-value.js +42 -0
- package/esm/lint/rules/allow-value.js.map +1 -0
- package/esm/lint/rules/dead-definitions.js +19 -8
- package/esm/lint/rules/dead-definitions.js.map +1 -1
- package/esm/lint/rules/index.js +6 -0
- package/esm/lint/rules/index.js.map +1 -1
- package/esm/lint/rules/link-targets.js +8 -2
- package/esm/lint/rules/link-targets.js.map +1 -1
- package/esm/lint/rules/list-depth.d.ts +3 -0
- package/esm/lint/rules/list-depth.js +10 -0
- package/esm/lint/rules/list-depth.js.map +1 -0
- package/esm/lint/rules/markdown-in-pod.js +36 -4
- package/esm/lint/rules/markdown-in-pod.js.map +1 -1
- package/esm/lint/rules/table-column-width.d.ts +2 -3
- package/esm/lint/rules/table-column-width.js +8 -112
- package/esm/lint/rules/table-column-width.js.map +1 -1
- package/esm/lint/rules/unclosed-markup-code.js +46 -10
- package/esm/lint/rules/unclosed-markup-code.js.map +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/lib/assemble/index.js +5 -4
- package/lib/assemble/index.js.map +1 -1
- package/lib/lint/grammar/lint.js +47 -22
- package/lib/lint/grammar/lint.js.map +1 -1
- package/lib/lint/grammar/scan.js +6 -6
- package/lib/lint/grammar/scan.js.map +1 -1
- package/lib/lint/implicit-code.d.ts +3 -0
- package/lib/lint/implicit-code.js +86 -0
- package/lib/lint/implicit-code.js.map +1 -0
- package/lib/lint/index.js +4 -2
- package/lib/lint/index.js.map +1 -1
- package/lib/lint/line-starts.d.ts +3 -0
- package/lib/lint/line-starts.js +19 -0
- package/lib/lint/line-starts.js.map +1 -0
- package/lib/lint/rules/abbreviated-attrs.js +6 -4
- package/lib/lint/rules/abbreviated-attrs.js.map +1 -1
- package/lib/lint/rules/allow-value.d.ts +3 -0
- package/lib/lint/rules/allow-value.js +45 -0
- package/lib/lint/rules/allow-value.js.map +1 -0
- package/lib/lint/rules/dead-definitions.js +19 -8
- package/lib/lint/rules/dead-definitions.js.map +1 -1
- package/lib/lint/rules/index.js +6 -0
- package/lib/lint/rules/index.js.map +1 -1
- package/lib/lint/rules/link-targets.js +8 -2
- package/lib/lint/rules/link-targets.js.map +1 -1
- package/lib/lint/rules/list-depth.d.ts +3 -0
- package/lib/lint/rules/list-depth.js +13 -0
- package/lib/lint/rules/list-depth.js.map +1 -0
- package/lib/lint/rules/markdown-in-pod.js +36 -4
- package/lib/lint/rules/markdown-in-pod.js.map +1 -1
- package/lib/lint/rules/table-column-width.d.ts +2 -3
- package/lib/lint/rules/table-column-width.js +8 -113
- package/lib/lint/rules/table-column-width.js.map +1 -1
- package/lib/lint/rules/unclosed-markup-code.js +46 -10
- package/lib/lint/rules/unclosed-markup-code.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +7 -7
|
@@ -5,13 +5,16 @@ const attr = (node, name) => {
|
|
|
5
5
|
return item && item.value !== undefined && item.value !== null ? String(item.value) : undefined;
|
|
6
6
|
};
|
|
7
7
|
// An alias node carries no location, so the line is read back from the source;
|
|
8
|
-
// a warning that cannot say where is a warning the author cannot act on.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
// a warning that cannot say where is a warning the author cannot act on. The
|
|
9
|
+
// source is read once for all aliases, and the first line declaring a name wins.
|
|
10
|
+
const aliasLines = (source) => {
|
|
11
|
+
const lines = new Map();
|
|
12
|
+
source.split(/\r?\n/).forEach((line, at) => {
|
|
13
|
+
const found = /^\s*=alias\s+(\S+)(\s|$)/.exec(line);
|
|
14
|
+
if (found && !lines.has(found[1]))
|
|
15
|
+
lines.set(found[1], at + 1);
|
|
16
|
+
});
|
|
17
|
+
return lines;
|
|
15
18
|
};
|
|
16
19
|
const definitions = (ast) => {
|
|
17
20
|
const nodes = getFromTree(ast, () => true);
|
|
@@ -65,6 +68,14 @@ export const deadDefinitionsRule = {
|
|
|
65
68
|
return [];
|
|
66
69
|
const aliases = aliasUses(ast);
|
|
67
70
|
const keys = dataUses(ctx.source || '');
|
|
71
|
+
let lines;
|
|
72
|
+
const aliasLine = (name) => {
|
|
73
|
+
lines = lines || aliasLines(ctx.source || '');
|
|
74
|
+
const line = lines.get(name);
|
|
75
|
+
return line === undefined
|
|
76
|
+
? undefined
|
|
77
|
+
: { start: { line, column: 1, offset: 0 }, end: { line, column: 1, offset: 0 } };
|
|
78
|
+
};
|
|
68
79
|
return declared
|
|
69
80
|
.filter(item => !(item.kind === 'alias' ? aliases.has(item.name) : keys.has(item.name)))
|
|
70
81
|
.map(item => ({
|
|
@@ -73,7 +84,7 @@ export const deadDefinitionsRule = {
|
|
|
73
84
|
message: item.kind === 'alias'
|
|
74
85
|
? `=alias ${item.name} is never used; A<${item.name}> appears nowhere in the document`
|
|
75
86
|
: `=data :key<${item.name}> is never used; data:${item.name} appears nowhere in the document`,
|
|
76
|
-
location: item.location || (item.kind === 'alias' ? aliasLine(
|
|
87
|
+
location: item.location || (item.kind === 'alias' ? aliasLine(item.name) : undefined),
|
|
77
88
|
}));
|
|
78
89
|
},
|
|
79
90
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dead-definitions.js","sourceRoot":"","sources":["../../../src/lint/rules/dead-definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAmB,MAAM,iBAAiB,CAAA;AAGtF,MAAM,CAAC,MAAM,wBAAwB,GAAG,kBAAkB,CAAA;AAY1D,MAAM,IAAI,GAAG,CAAC,IAAa,EAAE,IAAY,EAAsB,EAAE;IAC/D,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAA;IAC5F,OAAO,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AACjG,CAAC,CAAA;AAED,+EAA+E;AAC/E,
|
|
1
|
+
{"version":3,"file":"dead-definitions.js","sourceRoot":"","sources":["../../../src/lint/rules/dead-definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAmB,MAAM,iBAAiB,CAAA;AAGtF,MAAM,CAAC,MAAM,wBAAwB,GAAG,kBAAkB,CAAA;AAY1D,MAAM,IAAI,GAAG,CAAC,IAAa,EAAE,IAAY,EAAsB,EAAE;IAC/D,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC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AAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;aACvF,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACZ,IAAI,EAAE,wBAAwB;YAC9B,QAAQ,EAAE,SAAkB;YAC5B,OAAO,EACL,IAAI,CAAC,IAAI,KAAK,OAAO;gBACnB,CAAC,CAAC,UAAU,IAAI,CAAC,IAAI,qBAAqB,IAAI,CAAC,IAAI,mCAAmC;gBACtF,CAAC,CAAC,cAAc,IAAI,CAAC,IAAI,yBAAyB,IAAI,CAAC,IAAI,kCAAkC;YACjG,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;SACtF,CAAC,CAAC,CAAA;IACP,CAAC;CACF,CAAA"}
|
package/esm/lint/rules/index.js
CHANGED
|
@@ -9,12 +9,15 @@ import { linkFileResolvesRule } from './link-file-resolves.js';
|
|
|
9
9
|
import { linkNotEmptyRule } from './link-not-empty.js';
|
|
10
10
|
import { attrValueDroppedRule } from './attr-value-dropped.js';
|
|
11
11
|
import { tableShapeRule } from './table-shape.js';
|
|
12
|
+
import { tableColumnWidthRule } from './table-column-width.js';
|
|
13
|
+
import { listDepthRule } from './list-depth.js';
|
|
12
14
|
import { markupCodeTooDeepRule } from './markup-code-too-deep.js';
|
|
13
15
|
import { deadDefinitionsRule } from './dead-definitions.js';
|
|
14
16
|
import { includeResolvesRule } from './include-resolves.js';
|
|
15
17
|
import { directiveNamedBlockRule, imageNamedBlockRule } from './named-blocks.js';
|
|
16
18
|
import { notifyAttributeRule } from './notify-attribute.js';
|
|
17
19
|
import { tocTitleAttributeRule } from './toc-title-attribute.js';
|
|
20
|
+
import { allowValueRule } from './allow-value.js';
|
|
18
21
|
export const DEFAULT_RULES = [
|
|
19
22
|
syntaxValidRule,
|
|
20
23
|
headingHierarchyRule,
|
|
@@ -27,6 +30,8 @@ export const DEFAULT_RULES = [
|
|
|
27
30
|
linkNotEmptyRule,
|
|
28
31
|
attrValueDroppedRule,
|
|
29
32
|
tableShapeRule,
|
|
33
|
+
tableColumnWidthRule,
|
|
34
|
+
listDepthRule,
|
|
30
35
|
markupCodeTooDeepRule,
|
|
31
36
|
deadDefinitionsRule,
|
|
32
37
|
includeResolvesRule,
|
|
@@ -34,5 +39,6 @@ export const DEFAULT_RULES = [
|
|
|
34
39
|
imageNamedBlockRule,
|
|
35
40
|
notifyAttributeRule,
|
|
36
41
|
tocTitleAttributeRule,
|
|
42
|
+
allowValueRule,
|
|
37
43
|
];
|
|
38
44
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lint/rules/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,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mB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,CAAC,MAAM,aAAa,GAAW;IACnC,eAAe;IACf,oBAAoB;IACpB,iBAAiB;IACjB,iBAAiB;IACjB,YAAY;IACZ,qBAAqB;IACrB,sBAAsB;IACtB,oBAAoB;IACpB,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;IACd,oBAAoB;IACpB,aAAa;IACb,qBAAqB;IACrB,mBAAmB;IACnB,mBAAmB;IACnB,uBAAuB;IACvB,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;IACrB,cAAc;CACf,CAAA"}
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
const textOf = (value) => {
|
|
3
3
|
if (typeof value === 'string')
|
|
4
4
|
return value;
|
|
5
|
-
if (value && typeof value === 'object'
|
|
6
|
-
|
|
5
|
+
if (value && typeof value === 'object') {
|
|
6
|
+
const inner = Reflect.get(value, 'value');
|
|
7
|
+
if (typeof inner === 'string')
|
|
8
|
+
return inner;
|
|
9
|
+
}
|
|
7
10
|
return '';
|
|
8
11
|
};
|
|
9
12
|
// A link without display text carries the target in its content instead of meta.
|
|
@@ -21,6 +24,9 @@ export const collectLinks = (node, at) => {
|
|
|
21
24
|
if (!node || typeof node !== 'object')
|
|
22
25
|
return [];
|
|
23
26
|
const n = node;
|
|
27
|
+
// a comment is not rendered, so a link inside it leads nowhere and is not checked
|
|
28
|
+
if (n.type === 'block' && n.name === 'comment')
|
|
29
|
+
return [];
|
|
24
30
|
const here = n.location || at;
|
|
25
31
|
const found = isLink(n) ? [{ target: linkTarget(n), at: here }] : [];
|
|
26
32
|
return [...found, ...collectLinks(n.content, here)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-targets.js","sourceRoot":"","sources":["../../../src/lint/rules/link-targets.ts"],"names":[],"mappings":"AAcA,6EAA6E;AAC7E,MAAM,MAAM,GAAG,CAAC,KAAc,EAAU,EAAE;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"link-targets.js","sourceRoot":"","sources":["../../../src/lint/rules/link-targets.ts"],"names":[],"mappings":"AAcA,6EAA6E;AAC7E,MAAM,MAAM,GAAG,CAAC,KAAc,EAAU,EAAE;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,MAAM,KAAK,GAAY,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAClD,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAA;IAC7C,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC,CAAA;AAED,iFAAiF;AACjF,MAAM,UAAU,GAAG,CAAC,IAAc,EAAU,EAAE;IAC5C,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;IAC1D,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/D,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;AAClC,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,CAAC,IAAkC,EAAW,EAAE,CAC7D,IAAI,CAAC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MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC/D,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;IACxD,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;IAC1C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AAC3D,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const LIST_DEPTH_RULE_ID = 'list-depth';
|
|
2
|
+
// passes on what the parser reports about a list nested deeper than it builds
|
|
3
|
+
export const listDepthRule = {
|
|
4
|
+
id: LIST_DEPTH_RULE_ID,
|
|
5
|
+
severity: 'warning',
|
|
6
|
+
check: (ast, _ctx) => (ast.diagnostics || [])
|
|
7
|
+
.filter(d => d.code === 'list-too-deep')
|
|
8
|
+
.map(d => ({ rule: LIST_DEPTH_RULE_ID, severity: d.severity, message: d.message, location: d.location })),
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=list-depth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-depth.js","sourceRoot":"","sources":["../../../src/lint/rules/list-depth.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAA;AAE9C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,aAAa,GAAS;IACjC,EAAE,EAAE,kBAAkB;IACtB,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,CAAC,GAAoB,EAAE,IAAiB,EAAe,EAAE,CAC9D,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,eAAe,CAAC;SACvC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;CAC9G,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isVerbatimBlock } from '@podlite/schema';
|
|
2
|
+
import { lineStarts, placeAtLine } from '../line-starts.js';
|
|
2
3
|
export const MARKDOWN_IN_POD_RULE_ID = 'markdown-in-pod';
|
|
3
4
|
export const markdownInPodRule = {
|
|
4
5
|
id: MARKDOWN_IN_POD_RULE_ID,
|
|
@@ -12,27 +13,59 @@ const FOREIGN = [
|
|
|
12
13
|
},
|
|
13
14
|
{ test: /\*\*[^*\s](?:[^*]*[^*\s])?\*\*/, says: 'a pair of asterisks is text here; bold is written as B<>' },
|
|
14
15
|
];
|
|
16
|
+
// A lone # as the first word of an item, a heading or a definition numbers it, and
|
|
17
|
+
// with :!numbered it is a literal #; either way it is not a Markdown heading.
|
|
18
|
+
const NUMBERABLE = /^(item\d*|head\d*|defn)$/;
|
|
19
|
+
const LONE_HASH = /^\s*#(\s|$)/;
|
|
20
|
+
// directives that set things up and add no text of their own
|
|
21
|
+
const SETUP = /^\s*=(config|alias|set)\b/;
|
|
15
22
|
// Talk about Markdown is legal: a line whose construct sits inside an inline
|
|
16
23
|
// code span is showing the markup, not using it.
|
|
17
24
|
const insideCode = (line) => /C<[^>]*>/.test(line) || /`[^`]+`/.test(line);
|
|
18
25
|
export function scanMarkdownInPod(content) {
|
|
19
26
|
const lines = content.split(/\r?\n/);
|
|
27
|
+
const starts = lineStarts(content);
|
|
20
28
|
const open = [];
|
|
21
29
|
const violations = [];
|
|
22
30
|
let abbreviatedTable = false;
|
|
31
|
+
// the first word of a numberable block is still to come: in a delimited block blank
|
|
32
|
+
// lines and setup directives come before it, in the other forms they end the block
|
|
33
|
+
let awaiting = null;
|
|
23
34
|
for (let i = 0; i < lines.length; i++) {
|
|
24
35
|
const line = lines[i];
|
|
25
36
|
const end = line.match(/^\s*=end\s+([\w-]+)/);
|
|
26
37
|
if (end) {
|
|
38
|
+
awaiting = null;
|
|
39
|
+
// a short table inside a block ends with the block
|
|
40
|
+
abbreviatedTable = false;
|
|
27
41
|
open.pop();
|
|
28
42
|
continue;
|
|
29
43
|
}
|
|
30
44
|
const begin = line.match(/^\s*=begin\s+([\w-]+)/);
|
|
31
45
|
if (begin) {
|
|
46
|
+
awaiting = NUMBERABLE.test(begin[1]) ? 'delimited' : null;
|
|
32
47
|
open.push(begin[1]);
|
|
33
48
|
abbreviatedTable = false;
|
|
34
49
|
continue;
|
|
35
50
|
}
|
|
51
|
+
// a continuation line belongs to the directive above it
|
|
52
|
+
if (awaiting && /^\s*=(\s|$)/.test(line))
|
|
53
|
+
continue;
|
|
54
|
+
if (awaiting === 'delimited' && SETUP.test(line))
|
|
55
|
+
continue;
|
|
56
|
+
if (/^\s*=/.test(line)) {
|
|
57
|
+
const marker = line.match(/^\s*=(?:for\s+)?([\w-]+)(.*)$/);
|
|
58
|
+
const named = marker ? marker[1] : '';
|
|
59
|
+
const shortForm = !/^\s*=for\s/.test(line);
|
|
60
|
+
awaiting = marker && NUMBERABLE.test(named) && (!shortForm || marker[2].trim() === '') ? 'paragraph' : null;
|
|
61
|
+
}
|
|
62
|
+
else if (line.trim() === '') {
|
|
63
|
+
if (awaiting === 'paragraph')
|
|
64
|
+
awaiting = null;
|
|
65
|
+
}
|
|
66
|
+
const first = awaiting !== null && line.trim() !== '' && !/^\s*=/.test(line);
|
|
67
|
+
if (first)
|
|
68
|
+
awaiting = null;
|
|
36
69
|
// a dash separator belongs to a table written the short way too, and that
|
|
37
70
|
// block runs to the first blank line
|
|
38
71
|
if (/^\s*=(?:for\s+)?table\b/.test(line)) {
|
|
@@ -50,14 +83,13 @@ export function scanMarkdownInPod(content) {
|
|
|
50
83
|
for (const foreign of FOREIGN) {
|
|
51
84
|
if (!foreign.test.test(line))
|
|
52
85
|
continue;
|
|
86
|
+
if (first && foreign === FOREIGN[0] && LONE_HASH.test(line))
|
|
87
|
+
continue;
|
|
53
88
|
violations.push({
|
|
54
89
|
rule: MARKDOWN_IN_POD_RULE_ID,
|
|
55
90
|
severity: 'warning',
|
|
56
91
|
message: foreign.says,
|
|
57
|
-
location:
|
|
58
|
-
start: { line: i + 1, column: 1, offset: 0 },
|
|
59
|
-
end: { line: i + 1, column: 1, offset: 0 },
|
|
60
|
-
},
|
|
92
|
+
location: placeAtLine(starts, i + 1),
|
|
61
93
|
});
|
|
62
94
|
break;
|
|
63
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-in-pod.js","sourceRoot":"","sources":["../../../src/lint/rules/markdown-in-pod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"markdown-in-pod.js","sourceRoot":"","sources":["../../../src/lint/rules/markdown-in-pod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,iBAAiB,CAAA;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAe;IAC3C,EAAE,EAAE,uBAAuB;IAC3B,QAAQ,EAAE,SAAS;CACpB,CAAA;AAQD,MAAM,OAAO,GAAc;IACzB,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,yEAAyE,EAAE;IAC5G;QACE,IAAI,EAAE,qCAAqC;QAC3C,IAAI,EAAE,kGAAkG;KACzG;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AAA;QAC5E,IAAI,KAAK;YAAE,QAAQ,GAAG,IAAI,CAAA;QAC1B,0EAA0E;QAC1E,qCAAqC;QACrC,IAAI,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACzC,gBAAgB,GAAG,IAAI,CAAA;YACvB,SAAQ;QACV,CAAC;QACD,IAAI,gBAAgB,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE;YAAE,gBAAgB,GAAG,KAAK,CAAA;QACpE,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,gBAAgB,GAAG,KAAK,CAAA;QAEhD,IAAI,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,gBAAgB;YAAE,SAAQ;QACrF,IAAI,UAAU,CAAC,IAAI,CAAC;YAAE,SAAQ;QAE9B,KAAK,MAAM,OAAO,IAAI,OAAO,EAAE,CAAC;YAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,SAAQ;YACtC,IAAI,KAAK,IAAI,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,SAAQ;YACrE,UAAU,CAAC,IAAI,CAAC;gBACd,IAAI,EAAE,uBAAuB;gBAC7B,QAAQ,EAAE,SAAS;gBACnB,OAAO,EAAE,OAAO,CAAC,IAAI;gBACrB,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;aACrC,CAAC,CAAA;YACF,MAAK;QACP,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Rule } from '../types';
|
|
2
2
|
export declare const TABLE_COLUMN_WIDTH_RULE_ID = "table-column-width";
|
|
3
|
-
export declare const tableColumnWidthRule:
|
|
4
|
-
export declare function scanTableColumns(content: string): Violation[];
|
|
3
|
+
export declare const tableColumnWidthRule: Rule;
|
|
@@ -1,118 +1,14 @@
|
|
|
1
|
-
import { isVerbatimBlock } from '@podlite/schema';
|
|
2
1
|
export const TABLE_COLUMN_WIDTH_RULE_ID = 'table-column-width';
|
|
2
|
+
const named = (d) => d.code === TABLE_COLUMN_WIDTH_RULE_ID;
|
|
3
|
+
// passes on what the parser reports under this name
|
|
3
4
|
export const tableColumnWidthRule = {
|
|
4
5
|
id: TABLE_COLUMN_WIDTH_RULE_ID,
|
|
5
6
|
severity: 'warning',
|
|
7
|
+
check: (ast, _ctx) => (ast.diagnostics || []).filter(named).map(d => ({
|
|
8
|
+
rule: TABLE_COLUMN_WIDTH_RULE_ID,
|
|
9
|
+
severity: d.severity,
|
|
10
|
+
message: d.message,
|
|
11
|
+
location: d.location,
|
|
12
|
+
})),
|
|
6
13
|
};
|
|
7
|
-
const SEPARATOR_LINE = /^[\s=+|_-]*[|+][\s=+|_-]*$/;
|
|
8
|
-
const hasBar = (line) => line.includes('|') || line.includes('+');
|
|
9
|
-
// A table with visible bars is cut by the column positions its separator line
|
|
10
|
-
// sets, not by the bars in the row itself. A cell that reaches the boundary
|
|
11
|
-
// pushes the column open for the whole table, so every row loses its last
|
|
12
|
-
// column at once — and the document still parses, silently.
|
|
13
|
-
const boundaries = (separator) => {
|
|
14
|
-
const out = [];
|
|
15
|
-
for (let i = 0; i < separator.length; i++) {
|
|
16
|
-
if (separator[i] === '|' || separator[i] === '+')
|
|
17
|
-
out.push(i);
|
|
18
|
-
}
|
|
19
|
-
return out;
|
|
20
|
-
};
|
|
21
|
-
const isEdge = (char) => char === '|' || char === '+' || char === ' ';
|
|
22
|
-
const collides = (line, boundary) => {
|
|
23
|
-
if (boundary >= line.length)
|
|
24
|
-
return false;
|
|
25
|
-
// content standing on the boundary is wrong however the row is written
|
|
26
|
-
if (!isEdge(line[boundary]))
|
|
27
|
-
return true;
|
|
28
|
-
// pressed against the boundary only matters where the row draws a bar of its
|
|
29
|
-
// own: a row whose cells are held apart by spaces may fill its column to the
|
|
30
|
-
// last position, and the parser reads it correctly
|
|
31
|
-
const drawsBar = line[boundary] === '|' || line[boundary] === '+';
|
|
32
|
-
return drawsBar && boundary > 0 && !isEdge(line[boundary - 1]);
|
|
33
|
-
};
|
|
34
|
-
const checkTable = (lines) => {
|
|
35
|
-
const separator = lines.find(l => SEPARATOR_LINE.test(l.text) && hasBar(l.text));
|
|
36
|
-
if (!separator)
|
|
37
|
-
return [];
|
|
38
|
-
const columns = boundaries(separator.text);
|
|
39
|
-
if (columns.length === 0)
|
|
40
|
-
return [];
|
|
41
|
-
const violations = [];
|
|
42
|
-
for (const row of lines) {
|
|
43
|
-
if (row === separator || row.text.trim() === '')
|
|
44
|
-
continue;
|
|
45
|
-
if (SEPARATOR_LINE.test(row.text))
|
|
46
|
-
continue;
|
|
47
|
-
const hit = columns.find(b => collides(row.text, b));
|
|
48
|
-
if (hit === undefined)
|
|
49
|
-
continue;
|
|
50
|
-
violations.push({
|
|
51
|
-
rule: TABLE_COLUMN_WIDTH_RULE_ID,
|
|
52
|
-
severity: 'warning',
|
|
53
|
-
message: `cell reaches the column boundary at column ${hit + 1}; leave a space before the bar or the table loses a column`,
|
|
54
|
-
location: {
|
|
55
|
-
start: { line: row.line, column: hit + 1, offset: 0 },
|
|
56
|
-
end: { line: row.line, column: hit + 1, offset: 0 },
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
return violations;
|
|
61
|
-
};
|
|
62
|
-
export function scanTableColumns(content) {
|
|
63
|
-
const lines = content.split(/\r?\n/);
|
|
64
|
-
// a table keeps its content verbatim too, and it is the one being read here
|
|
65
|
-
const verbatim = (name) => name !== 'table' && isVerbatimBlock(name);
|
|
66
|
-
const openBlocks = [];
|
|
67
|
-
const violations = [];
|
|
68
|
-
let table = null;
|
|
69
|
-
// the form of the table being read, not of a table around it: an abbreviated
|
|
70
|
-
// one ends where the parser ends it, inside a delimited table too
|
|
71
|
-
let abbreviatedForm = false;
|
|
72
|
-
const closeTable = () => {
|
|
73
|
-
if (table)
|
|
74
|
-
violations.push(...checkTable(table));
|
|
75
|
-
table = null;
|
|
76
|
-
};
|
|
77
|
-
for (let i = 0; i < lines.length; i++) {
|
|
78
|
-
const text = lines[i];
|
|
79
|
-
const begin = text.match(/^\s*=begin\s+([\w-]+)/);
|
|
80
|
-
const end = text.match(/^\s*=end\s+([\w-]+)/);
|
|
81
|
-
const abbreviated = text.match(/^\s*=(?:for\s+)?table\b/);
|
|
82
|
-
// an abbreviated table ends at the first blank line or directive
|
|
83
|
-
if (table && abbreviatedForm && /^\s*=[A-Za-z]/.test(text))
|
|
84
|
-
closeTable();
|
|
85
|
-
if (table && abbreviatedForm && text.trim() === '') {
|
|
86
|
-
closeTable();
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
if (end) {
|
|
90
|
-
if (end[1] === 'table')
|
|
91
|
-
closeTable();
|
|
92
|
-
openBlocks.pop();
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
if (begin) {
|
|
96
|
-
closeTable();
|
|
97
|
-
openBlocks.push(begin[1]);
|
|
98
|
-
if (begin[1] === 'table' && !openBlocks.some(verbatim)) {
|
|
99
|
-
table = [];
|
|
100
|
-
abbreviatedForm = false;
|
|
101
|
-
}
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
if (openBlocks.some(verbatim))
|
|
105
|
-
continue;
|
|
106
|
-
if (abbreviated) {
|
|
107
|
-
closeTable();
|
|
108
|
-
table = [];
|
|
109
|
-
abbreviatedForm = true;
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
if (table)
|
|
113
|
-
table.push({ text, line: i + 1 });
|
|
114
|
-
}
|
|
115
|
-
closeTable();
|
|
116
|
-
return violations;
|
|
117
|
-
}
|
|
118
14
|
//# sourceMappingURL=table-column-width.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-column-width.js","sourceRoot":"","sources":["../../../src/lint/rules/table-column-width.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"table-column-width.js","sourceRoot":"","sources":["../../../src/lint/rules/table-column-width.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAA;AAE9D,MAAM,KAAK,GAAG,CAAC,CAAmB,EAAW,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,0BAA0B,CAAA;AAErF,oDAAoD;AACpD,MAAM,CAAC,MAAM,oBAAoB,GAAS;IACxC,EAAE,EAAE,0BAA0B;IAC9B,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,CAAC,GAAoB,EAAE,IAAiB,EAAe,EAAE,CAC9D,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC9C,IAAI,EAAE,0BAA0B;QAChC,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,QAAQ,EAAE,CAAC,CAAC,QAAQ;KACrB,CAAC,CAAC;CACN,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isVerbatimBlock } from '@podlite/schema';
|
|
2
|
+
import { lineStarts, placeAtLine } from '../line-starts.js';
|
|
2
3
|
export const UNCLOSED_MARKUP_CODE_RULE_ID = 'unclosed-markup-code';
|
|
3
4
|
export const unclosedMarkupCodeRule = {
|
|
4
5
|
id: UNCLOSED_MARKUP_CODE_RULE_ID,
|
|
@@ -21,15 +22,42 @@ export const unclosedMarkupCodeRule = {
|
|
|
21
22
|
// code written inside a doubled one reads as unclosed, and correct markup gets
|
|
22
23
|
// reported — the worse of the two.
|
|
23
24
|
const OPENER = /(^|[^A-Za-z])([A-Z])(<+|«)/g;
|
|
25
|
+
// For each length of a run of closing brackets, the last place a closer of that
|
|
26
|
+
// length can start: a code opened with N brackets is closed if one starts after it.
|
|
27
|
+
// Built once per fragment, so a long paragraph is not searched again for every code.
|
|
28
|
+
const lastCloserStarts = (text) => {
|
|
29
|
+
const bestEnd = [-1, -1];
|
|
30
|
+
let at = 0;
|
|
31
|
+
while (at < text.length) {
|
|
32
|
+
if (text.charCodeAt(at) !== 62) {
|
|
33
|
+
at++;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const start = at;
|
|
37
|
+
while (at < text.length && text.charCodeAt(at) === 62)
|
|
38
|
+
at++;
|
|
39
|
+
const length = at - start;
|
|
40
|
+
while (bestEnd.length < length + 2)
|
|
41
|
+
bestEnd.push(-1);
|
|
42
|
+
bestEnd[length] = Math.max(bestEnd[length], at);
|
|
43
|
+
}
|
|
44
|
+
// a longer run holds every shorter closer, ending where it ends
|
|
45
|
+
for (let length = bestEnd.length - 2; length >= 1; length--) {
|
|
46
|
+
bestEnd[length] = Math.max(bestEnd[length], bestEnd[length + 1]);
|
|
47
|
+
}
|
|
48
|
+
return bestEnd.map((end, length) => (end === -1 ? -1 : end - length));
|
|
49
|
+
};
|
|
24
50
|
const unclosed = (text) => {
|
|
25
51
|
const missing = [];
|
|
52
|
+
const closerStarts = lastCloserStarts(text);
|
|
53
|
+
const lastGuillemet = text.lastIndexOf('»');
|
|
26
54
|
let match;
|
|
27
55
|
OPENER.lastIndex = 0;
|
|
28
56
|
while ((match = OPENER.exec(text)) !== null) {
|
|
29
57
|
const [whole, before, name, open] = match;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
58
|
+
const from = match.index + whole.length;
|
|
59
|
+
const closer = open === '«' ? lastGuillemet : closerStarts[open.length] ?? -1;
|
|
60
|
+
if (closer < from) {
|
|
33
61
|
missing.push({ name, at: match.index + before.length });
|
|
34
62
|
}
|
|
35
63
|
}
|
|
@@ -37,7 +65,9 @@ const unclosed = (text) => {
|
|
|
37
65
|
};
|
|
38
66
|
export function scanUnclosedMarkupCodes(content) {
|
|
39
67
|
const lines = content.split(/\r?\n/);
|
|
68
|
+
const starts = lineStarts(content);
|
|
40
69
|
const open = [];
|
|
70
|
+
let verbatimOpen = 0;
|
|
41
71
|
const violations = [];
|
|
42
72
|
let chunk = null;
|
|
43
73
|
let inAbbreviatedVerbatim = false;
|
|
@@ -45,17 +75,19 @@ export function scanUnclosedMarkupCodes(content) {
|
|
|
45
75
|
if (!chunk)
|
|
46
76
|
return;
|
|
47
77
|
const at = chunk;
|
|
78
|
+
// the codes come in order, so the line is counted on from the one before
|
|
79
|
+
let line = at.line;
|
|
80
|
+
let counted = 0;
|
|
48
81
|
for (const found of unclosed(at.text)) {
|
|
49
82
|
const name = found.name;
|
|
50
|
-
|
|
83
|
+
for (; counted < found.at; counted++)
|
|
84
|
+
if (at.text.charCodeAt(counted) === 10)
|
|
85
|
+
line++;
|
|
51
86
|
violations.push({
|
|
52
87
|
rule: UNCLOSED_MARKUP_CODE_RULE_ID,
|
|
53
88
|
severity: 'warning',
|
|
54
89
|
message: `${name}<> is closed by the end of the block, not by its own bracket; the text goes out as written`,
|
|
55
|
-
location:
|
|
56
|
-
start: { line, column: 1, offset: 0 },
|
|
57
|
-
end: { line, column: 1, offset: 0 },
|
|
58
|
-
},
|
|
90
|
+
location: placeAtLine(starts, line),
|
|
59
91
|
});
|
|
60
92
|
}
|
|
61
93
|
chunk = null;
|
|
@@ -65,7 +97,9 @@ export function scanUnclosedMarkupCodes(content) {
|
|
|
65
97
|
if (/^\s*=end\s+[\w-]+/.test(line)) {
|
|
66
98
|
close();
|
|
67
99
|
inAbbreviatedVerbatim = false;
|
|
68
|
-
open.pop();
|
|
100
|
+
const closed = open.pop();
|
|
101
|
+
if (closed !== undefined && isVerbatimBlock(closed))
|
|
102
|
+
verbatimOpen--;
|
|
69
103
|
continue;
|
|
70
104
|
}
|
|
71
105
|
const begin = line.match(/^\s*=begin\s+([\w-]+)/);
|
|
@@ -73,9 +107,11 @@ export function scanUnclosedMarkupCodes(content) {
|
|
|
73
107
|
close();
|
|
74
108
|
inAbbreviatedVerbatim = false;
|
|
75
109
|
open.push(begin[1]);
|
|
110
|
+
if (isVerbatimBlock(begin[1]))
|
|
111
|
+
verbatimOpen++;
|
|
76
112
|
continue;
|
|
77
113
|
}
|
|
78
|
-
if (
|
|
114
|
+
if (verbatimOpen > 0)
|
|
79
115
|
continue;
|
|
80
116
|
// a directive starts a chunk of its own; a blank line ends the one running
|
|
81
117
|
if (/^\s*=/.test(line)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unclosed-markup-code.js","sourceRoot":"","sources":["../../../src/lint/rules/unclosed-markup-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"unclosed-markup-code.js","sourceRoot":"","sources":["../../../src/lint/rules/unclosed-markup-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAExD,MAAM,CAAC,MAAM,4BAA4B,GAAG,sBAAsB,CAAA;AAElE,MAAM,CAAC,MAAM,sBAAsB,GAAe;IAChD,EAAE,EAAE,4BAA4B;IAChC,QAAQ,EAAE,SAAS;CACpB,CAAA;AAED,gFAAgF;AAChF,2EAA2E;AAC3E,8EAA8E;AAC9E,uEAAuE;AACvE,EAAE;AACF,gFAAgF;AAChF,wEAAwE;AACxE,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAC3E,EAAE;AACF,gFAAgF;AAChF,4EAA4E;AAC5E,gFAAgF;AAChF,+EAA+E;AAC/E,mCAAmC;AACnC,MAAM,MAAM,GAAG,6BAA6B,CAAA;AAE5C,gFAAgF;AAChF,oFAAoF;AACpF,qFAAqF;AACrF,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAY,EAAE;IAClD,MAAM,OAAO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/esm/version.js
CHANGED
package/lib/assemble/index.js
CHANGED
|
@@ -290,10 +290,11 @@ const assembleIncludes = (tree, opts) => {
|
|
|
290
290
|
}
|
|
291
291
|
const slot = slots[0];
|
|
292
292
|
const at = slot ? held.indexOf(slot) : -1;
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
293
|
+
const tail = at >= 0 ? held.splice(at) : [];
|
|
294
|
+
for (const entry of entries)
|
|
295
|
+
held.push(entry);
|
|
296
|
+
for (const entry of tail)
|
|
297
|
+
held.push(entry);
|
|
297
298
|
};
|
|
298
299
|
const report = (problem) => hold([{ problem, shown: true }]);
|
|
299
300
|
const flush = () => {
|