@podlite/publisher 0.0.52 → 0.0.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.
Files changed (52) hide show
  1. package/CHANGELOG.podlite +26 -0
  2. package/esm/catalogue.d.ts +17 -0
  3. package/esm/catalogue.js +156 -0
  4. package/esm/catalogue.js.map +1 -0
  5. package/esm/images-plugin.js +3 -1
  6. package/esm/images-plugin.js.map +1 -1
  7. package/esm/include-resolve-plugin.d.ts +16 -1
  8. package/esm/include-resolve-plugin.js +235 -104
  9. package/esm/include-resolve-plugin.js.map +1 -1
  10. package/esm/links-plugin.d.ts +9 -1
  11. package/esm/links-plugin.js +144 -58
  12. package/esm/links-plugin.js.map +1 -1
  13. package/esm/node-utils.d.ts +3 -2
  14. package/esm/node-utils.js +60 -19
  15. package/esm/node-utils.js.map +1 -1
  16. package/esm/react-plugin.js +9 -1
  17. package/esm/react-plugin.js.map +1 -1
  18. package/esm/reading.d.ts +5 -0
  19. package/esm/reading.js +34 -0
  20. package/esm/reading.js.map +1 -0
  21. package/esm/record.d.ts +2 -2
  22. package/esm/record.js +1 -1
  23. package/esm/record.js.map +1 -1
  24. package/esm/site-data-plugin.d.ts +1 -0
  25. package/esm/site-data-plugin.js +12 -1
  26. package/esm/site-data-plugin.js.map +1 -1
  27. package/esm/source.d.ts +6 -0
  28. package/esm/source.js +27 -0
  29. package/esm/source.js.map +1 -1
  30. package/esm/version.d.ts +1 -1
  31. package/esm/version.js +1 -1
  32. package/lib/catalogue.d.ts +17 -0
  33. package/lib/catalogue.js +197 -0
  34. package/lib/images-plugin.js +3 -1
  35. package/lib/include-resolve-plugin.d.ts +16 -1
  36. package/lib/include-resolve-plugin.js +270 -103
  37. package/lib/links-plugin.d.ts +9 -1
  38. package/lib/links-plugin.js +177 -56
  39. package/lib/node-utils.d.ts +3 -2
  40. package/lib/node-utils.js +73 -31
  41. package/lib/react-plugin.js +9 -1
  42. package/lib/reading.d.ts +5 -0
  43. package/lib/reading.js +38 -0
  44. package/lib/record.d.ts +2 -2
  45. package/lib/record.js +2 -1
  46. package/lib/site-data-plugin.d.ts +1 -0
  47. package/lib/site-data-plugin.js +13 -1
  48. package/lib/source.d.ts +6 -0
  49. package/lib/source.js +29 -1
  50. package/lib/version.d.ts +1 -1
  51. package/lib/version.js +1 -1
  52. package/package.json +4 -4
package/CHANGELOG.podlite CHANGED
@@ -2,6 +2,32 @@
2
2
 
3
3
  =head1 Upcoming
4
4
 
5
+ =head1 0.0.53
6
+
7
+ =item B<Breaking:> the include plugin assembles C<=include> with the assembler of C<podlite>. The blocks an include finds take the place of the directive, and no C<include> node is left around them. They are read from the text of their source, with the settings in effect where the directive stands, and the includes inside them are assembled as well. The plugin takes C<catalogue>, the records the site read before the plugins ran: an include finds its source there, as well as among the documents plugins make later in the chain. Without it the plugin says so and looks among the records at hand. A relative path in a C<file:> source is resolved from the file the directive is written in; before, the source was the record whose path ended with the written one. A C<doc:> name that two documents answer to resolves to neither, and the refusal names both. With C<bounds>, a path written in one of those directories does not lead out of it
8
+
9
+ =item a C<=set> before an include that brings no block reaches the next block
10
+
11
+ =item B<Breaking:> an include that does not place what it names stops the build with C<IncludeError>, one line for each such include, with the file and the line of the directive and the files it came through. It stops on a missing source or address; a selector that cannot be read; a scheme the site does not read; a name that answers to two documents; a file that includes itself. It was a warning, and the page was published without the included text
12
+
13
+ =item C<includePasses> gives the include plugin in two passes over one catalogue. C<first> goes before the plugins of images, links and React and places what it can; an include of a document a plugin makes later in the chain, the site data or a name given in C<late>, waits there. C<last> goes after them and places only such documents; one that holds an include, or brings a picture or a link, stops the build. The site data plugin exports the name of its document as C<SITE_DATA_DOCUMENT>
14
+
15
+ =item a record is read with the body of C<=React> as Podlite in its place, by the reader an include reads the texts it brings with: an include inside the body is assembled, and the React plugin keeps the blocks of the body as the content of the block rather than reading the body again into a nested list
16
+
17
+ =item the tables of contents written in a record are built again once the includes are in, and take in the headings of a C<=React> body; a table an include brought stays as its own file built it
18
+
19
+ =item the header, the footer and the description of a record are assembled as well, each from the file it was written in. A template is assembled as a record of the chain; a template a record carries is left as it is
20
+
21
+ =item the images, links and React plugins find a path written in a block an include brought from the file the block was written in, not from the file of the record: a picture, a C<file:> link and a component import of an included chapter work as they do in the chapter itself
22
+
23
+ =item a link to a file placed at more than one address goes to the address a search engine is told to index: the current version of a document, not its permanent address marked C<:noindex>. The map of addresses is keyed by the absolute path of a file
24
+
25
+ =item B<Breaking:> a C<doc:> link whose name no published document answers to, or that two documents answer to, stops the build with C<LinkError>, naming the file and the line. So does a link to a section the document does not have; a link to a section goes to the address the page gives that section. The link was replaced by the words "not found", and of two documents the last one won. The links plugin takes C<documents>, the files the include plugin finds a name in (C<includePasses> gives it), so that a link and an include read a name alike, and C<home>, the file of the home page, whose address C</> the site data plugin gives only later. A link to the section a document is named by goes to the page itself. C<doc:#section> goes to a section of the page the link is on. A name an include brought into a document is not a name of that document
26
+
27
+ =item C<nodeOrigin> gives the file a node of a record was written in, when an include brought it there. The mark is held under a symbol key on the node, so a copy made by spreading the node keeps it and JSON does not carry it
28
+
29
+ =item C<=Include> is no longer read as C<=include>: by the specification it is a named block. The lint of C<podlite> warns about it
30
+
5
31
  =head1 0.0.52
6
32
 
7
33
  =item a record keeps the text it was read from: C<recordSource> returns the text, the file name and the type given for it, C<recordOrigin> returns the same for a record the pubdate plugin cut out of a file, and C<isParsedTree> tells whether the tree is still the one that was parsed. C<parseText> parses a given text as a file of that name is read. The source is held under a symbol key, so it is absent from JSON and from C<Object.keys>, and present when a record is printed or compared deeply
@@ -0,0 +1,17 @@
1
+ import type { AstTree, PodliteDocument } from '@podlite/schema';
2
+ import type { Sources } from 'podlite';
3
+ import { publishRecord } from './record';
4
+ export type CatalogueOptions = {
5
+ bounds?: string[];
6
+ parse?: (text: string, file: string) => PodliteDocument | AstTree;
7
+ waits?: (name: string) => boolean;
8
+ };
9
+ export type Catalogue = {
10
+ sources: Sources;
11
+ add: (records: publishRecord[]) => void;
12
+ idOf: (record: object) => string | undefined;
13
+ named: (name: string) => string[];
14
+ textOf: (id: string) => string | undefined;
15
+ };
16
+ export declare const idOfFile: (file: string) => string;
17
+ export declare const catalogueOf: (records?: publishRecord[], options?: CatalogueOptions) => Catalogue;
@@ -0,0 +1,156 @@
1
+ /*
2
+ =begin pod :kind<module>
3
+
4
+ =head2 catalogue
5
+
6
+ This module holds the texts an include on a site can bring. They are the
7
+ records the site read before the plugins ran, and the documents plugins make
8
+ later in the chain. Several records read from one file are one source. The
9
+ current version of a document and its permanent address are one source. A page
10
+ cut out of a file is that file.
11
+
12
+ The id of a source is the absolute path of the file it was read from. A
13
+ document a plugin makes is known by the name it was made under, resolved the
14
+ same way.
15
+
16
+ A path in a C<file:> source is resolved from the directory of the file it is
17
+ written in. A mask is matched against the files of the catalogue. A C<doc:>
18
+ source is the document whose C<=NAME> or C<=TITLE> answers to the name. When two
19
+ sources answer to a name, it resolves to neither, and the answer names both.
20
+ When no document answers to a name yet and the host says it will be made later,
21
+ an include of it is left for a later pass.
22
+
23
+ =end pod
24
+ */
25
+ import * as path from 'path';
26
+ import matter from 'gray-matter';
27
+ import { filePathMatches, getDocIDs, mkRootBlock } from '@podlite/schema';
28
+ import { formatOfFile, formatOfType } from 'podlite';
29
+ import { getParserTypeforFile, PARSER_TYPES } from './node-utils.js';
30
+ import { isParsedTree, recordOrigin, recordSource } from './source.js';
31
+ const isMask = (written) => /[*?]/.test(written);
32
+ const isUnder = (file, dir) => {
33
+ const relative = path.relative(dir, file);
34
+ return relative !== '' && relative !== '..' && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative);
35
+ };
36
+ /*
37
+ =begin pod :kind<export>
38
+
39
+ =head2 idOfFile
40
+
41
+ The id of a file as a source: its absolute path, from the working directory.
42
+
43
+ =end pod
44
+ */
45
+ export const idOfFile = (file) => path.resolve(file);
46
+ // a Markdown text is read without its front matter, as the record was
47
+ const readable = (source) => getParserTypeforFile(source.file, source.mime) === PARSER_TYPES.MARKDOWN ? matter(source.text).content : source.text;
48
+ /*
49
+ =begin pod :kind<export>
50
+
51
+ =head2 catalogueOf
52
+
53
+ A catalogue over the readings of the records given. Records added later bring
54
+ the readings it does not hold; a reading it holds already is not taken twice.
55
+
56
+ =end pod
57
+ */
58
+ export const catalogueOf = (records = [], options = {}) => {
59
+ const entries = new Map();
60
+ const held = new WeakSet();
61
+ const bounds = (options.bounds ?? []).map(dir => path.resolve(dir));
62
+ let names;
63
+ const add = (list) => {
64
+ for (const record of list) {
65
+ const source = recordOrigin(record);
66
+ if (!source || held.has(source))
67
+ continue;
68
+ held.add(source);
69
+ const id = idOfFile(source.file);
70
+ if (entries.has(id))
71
+ continue;
72
+ const own = recordSource(record) === source && isParsedTree(record);
73
+ const entry = { id, source, tree: own ? record.node : undefined };
74
+ entries.set(id, entry);
75
+ if (names)
76
+ index(names, entry);
77
+ }
78
+ };
79
+ const index = (into, entry) => {
80
+ const tree = entry.tree ?? options.parse?.(readable(entry.source), entry.source.file);
81
+ if (!tree)
82
+ return;
83
+ const node = Array.isArray(tree) ? mkRootBlock({}, tree) : tree;
84
+ for (const name of new Set(getDocIDs({ file: entry.source.file, node }))) {
85
+ into.set(name, [...(into.get(name) ?? []), entry.id]);
86
+ }
87
+ };
88
+ // the names each document answers to, built on the first question
89
+ const namesOf = () => {
90
+ if (names)
91
+ return names;
92
+ names = new Map();
93
+ for (const entry of entries.values())
94
+ index(names, entry);
95
+ return names;
96
+ };
97
+ // the directory a path written in that place does not lead out of
98
+ const boundOf = (dir) => bounds.filter(bound => dir === bound || isUnder(dir, bound)).sort((a, b) => b.length - a.length)[0];
99
+ const sourceAt = (id, name) => {
100
+ const entry = entries.get(id);
101
+ const format = entry?.source.mime ? formatOfType(entry.source.mime) : formatOfFile(id);
102
+ return { id, name, context: path.dirname(id), ...(format ? { format } : {}) };
103
+ };
104
+ const locateFile = (written, context, plain) => {
105
+ const dir = path.resolve(String(context ?? ''));
106
+ const bound = boundOf(dir);
107
+ const inside = (id) => bound === undefined || isUnder(id, bound);
108
+ if (plain || !isMask(written)) {
109
+ const id = path.resolve(dir, written);
110
+ if (!inside(id))
111
+ return {
112
+ masked: false,
113
+ sources: [],
114
+ failed: `the path leads out of ${path.relative(process.cwd(), bound) || '.'}`,
115
+ };
116
+ return { masked: false, sources: [sourceAt(id, written)] };
117
+ }
118
+ const pattern = path.resolve(dir, written);
119
+ const found = [...entries.keys()].filter(id => inside(id) && filePathMatches(id, pattern)).sort();
120
+ return {
121
+ masked: true,
122
+ // named the way the mask is written, for the selection to match it back
123
+ sources: found.map(id => sourceAt(id, path.isAbsolute(written) ? id : path.relative(dir, id))),
124
+ };
125
+ };
126
+ const locateDoc = (written) => {
127
+ const ids = namesOf().get(written) ?? [];
128
+ if (!ids.length && options.waits?.(written))
129
+ return undefined;
130
+ if (ids.length > 1) {
131
+ const files = ids.map(id => entries.get(id).source.file).join(', ');
132
+ return { masked: false, sources: [], failed: `more than one document is named ${written}: ${files}` };
133
+ }
134
+ return { masked: false, sources: ids.map(id => ({ ...sourceAt(id, written) })) };
135
+ };
136
+ const sources = {
137
+ schemes: ['file', 'doc'],
138
+ locate: (written, context, plain, _at, scheme) => scheme === 'doc' ? locateDoc(written) : locateFile(written, context, plain),
139
+ read: source => {
140
+ const entry = entries.get(source.id);
141
+ return entry ? readable(entry.source) : null;
142
+ },
143
+ };
144
+ const idOf = (record) => {
145
+ const source = recordOrigin(record);
146
+ return source ? idOfFile(source.file) : undefined;
147
+ };
148
+ const named = (name) => namesOf().get(name) ?? [];
149
+ const textOf = (id) => {
150
+ const entry = entries.get(id);
151
+ return entry ? readable(entry.source) : undefined;
152
+ };
153
+ add(records);
154
+ return { sources, add, idOf, named, textOf };
155
+ };
156
+ //# sourceMappingURL=catalogue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalogue.js","sourceRoot":"","sources":["../src/catalogue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;AACF,OAAO,KAAK,IAAI,MAAM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,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QAC7B,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IACnD,CAAC,CAAA;IAED,GAAG,CAAC,OAAO,CAAC,CAAA;IACZ,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;AAC9C,CAAC,CAAA"}
@@ -3,6 +3,7 @@ import { ASSETS_PATH, IMAGE_LIB } from './constants.js';
3
3
  import pathMod from 'path';
4
4
  import * as fs from 'fs';
5
5
  import { getPathToOpen } from './node-utils.js';
6
+ import { nodeOrigin } from './source.js';
6
7
  const ORIENTATION_TAG = 0x0112;
7
8
  export const readOrientation = (file) => {
8
9
  let bytes;
@@ -82,7 +83,8 @@ export default {}
82
83
  ':image': node => {
83
84
  // process copy files to assets
84
85
  // '../assets/'
85
- const { path } = getPathToOpen(node.src, file);
86
+ // a picture an include brought is found from the file it was written in
87
+ const { path } = getPathToOpen(node.src, nodeOrigin(node)?.file ?? file);
86
88
  const { name, ext, dir } = pathMod.parse(path);
87
89
  const variable_name = 'i' + path.split('/').slice(1).join('_').replace(/\W+/g, '_').toLowerCase();
88
90
  const newFileName = `${variable_name}${ext}`;
@@ -1 +1 @@
1
- {"version":3,"file":"images-plugin.js","sourceRoot":"","sources":["../src/images-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAW,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,OAAO,MAAM,MAAM,CAAA;AAC1B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAG5C,MAAM,eAAe,GAAG,MAAM,CAAA;AAE9B,MAAM,CAAC,MAAM,eAAe,GAAG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C3C,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBACrB,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;YAC9D,CAAC;YAED,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,CAAA;QACpC,CAAC,CAAC,CAAA;QACF,OAAO,GAAG,CAAA;IACZ,CAAC,CAAA;IAED,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;AAC5B,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -1,3 +1,18 @@
1
+ import { publishRecord } from './record';
1
2
  import { PodliteWebPlugin } from './plugins';
2
- declare const plugin: () => PodliteWebPlugin;
3
+ export type IncludeResolveOptions = {
4
+ catalogue?: publishRecord[];
5
+ bounds?: string[];
6
+ late?: string[];
7
+ };
8
+ export declare class IncludeError extends Error {
9
+ readonly problems: string[];
10
+ constructor(problems: string[]);
11
+ }
12
+ export declare const includePasses: (options?: IncludeResolveOptions) => {
13
+ first: PodliteWebPlugin;
14
+ last: PodliteWebPlugin;
15
+ documents: (name: string) => string[];
16
+ };
17
+ declare const plugin: (options?: IncludeResolveOptions) => PodliteWebPlugin;
3
18
  export default plugin;