UNPKG

9.76 kBMarkdownView Raw
1# Changelog
2
3## 7.0.0
4
5### [BREAKING]
6
7- dropped support for Node 10, added support for Node 16
8- removed deprecated createSitemapsAndIndex. use SitemapAndIndexStream or simpleSitemapAndIndex
9- dropped deprecated `getSitemapStream` option for SitemapAndIndexStream that does not return a write stream
10- fixed invalid documentation for #357
11
12### non-breaking
13
14- Added option to simplesitemap `publicBasePath`: allows the user to set the location of sitemap files hosted on the site fixes [#359]
15- bumped dependencies
16
17## 6.4.0
18
19- added support for content_loc parsing #347 and uploader info attr
20- added error handler option to sitemapstream #349 Thanks @marcoreni
21
22## 6.3.6
23
24- bump dependencies
25
26## 6.3.5
27
28- Add option to silence or redirect logs from parse #337
29 - `new XMLToSitemapItemStream({ logger: false })` or
30 - `new XMLToSitemapItemStream({ level: ErrorLevel.SILENT })` or
31 - `new XMLToSitemapItemStream({ logger: (level, ...message) => your.custom.logger(...message) })`
32
33## 6.3.4
34
35- bump dependencies
36- correct return type of xmllint. Was `Promise<null>` but actually returned `Promise<void>`
37- add alternate option for lang, hreflang as that is the actual name of the printed attribute
38
39## 6.3.3
40
41- bump ts to 4
42- change file reference in sitemap-index to include .gz fixes #334
43
44## 6.3.2
45
46- fix unreported timing issue in SitemapAndIndexStream uncovered in latest unit tests
47
48## 6.3.1
49
50- fix #331 incorrect type on sourceData in simpleSitemapAndIndex.
51
52## 6.3.0
53
54- simpleSitemap will create the dest directory if it doesn't exist
55- allow user to not gzip fixes #322
56
57## 6.2.0
58
59- Add simplified interface for creating sitemaps and index
60- fix bug where sitemap and index stream would not properly wait to emit finish event until all sitemaps had been written
61- bump deps
62
63## 6.1.7
64
65- Improve documentation and error messaging on ending a stream too early #317
66- bump dependencies
67
68## 6.1.6
69
70- support allow_embed #314
71- bump dependencies
72
73## 6.1.5
74
75- performance improvement for streamToPromise #307
76
77## 6.1.4
78
79- remove stale files from dist #298
80- Correct documentation on renamed XMLToSitemapOptions, XMLToSitemapItemStream #297
81- bump node typedef to 14.0.1
82
83## 6.1.3
84
85- bump node types resolves #293
86
87## 6.1.2
88
89- bump node types resolves #290
90
91## 6.1.1
92
93- Fix #286 sitemapindex tag not closing for deprecated createSitemapsAndIndex
94
95## 6.1.0
96
97- Added back xslUrl option removed in 5.0.0
98
99## 6.0.0
100
101- removed xmlbuilder as a dependency
102- added stronger validity checking on values supplied to sitemap
103- Added the ability to turn off or add custom xml namespaces
104- CLI and library now can accept a stream which will automatically write both the index and the sitemaps. See README for usage.
105
106### 6.0.0 breaking changes
107
108- renamed XMLToISitemapOptions to XMLToSitemapOptions
109- various error messages changed.
110- removed deprecated Sitemap and SitemapIndex classes
111- replaced buildSitemapIndex with SitemapIndexStream
112- Typescript: various types renamed or made more specific, removed I prefix
113- Typescript: view_count is now exclusively a number
114- Typescript: `price:type` and `price:resolution` are now more restrictive types
115- sitemap parser now returns a sitemapItem array rather than a config object that could be passed to the now removed Sitemap class
116- CLI no longer accepts multiple file arguments or a mixture of file and streams except as a part of a parameter eg. prepend
117
118## 5.1.0
119
120Fix for #255. Baidu does not like timestamp in its sitemap.xml, this adds an option to truncate lastmod
121
122```js
123new SitemapStream({ lastmodDateOnly: true });
124```
125
126## 5.0.1
127
128Fix for issue #254.
129
130```sh
131warning: failed to load external entity "./schema/all.xsd"
132Schemas parser error : Failed to locate the main schema resource at './schema/all.xsd'.
133WXS schema ./schema/all.xsd failed to compile
134```
135
136## 5.0.0
137
138### Streams
139
140This release is heavily focused on converting the core methods of this library to use streams. Why? Overall its made the API ~20% faster and uses only 10% or less of the memory. Some tradeoffs had to be made as in their nature streams are operate on individual segments of data as opposed to the whole. For instance, the streaming interface does not support removal of sitemap items as it does not hold on to a sitemap item after its converted to XML. It should however be possible to create your own transform that filters out entries should you desire it. The existing synchronous interfaces will remain for this release at least. Do not be surprised if they go away in a future breaking release.
141
142### Sitemap Index
143
144This library interface has been overhauled to use streams internally. Although it would have been preferable to convert this to a stream as well, I could not think of an interface that wouldn't actually end up more complex or confusing. It may be altered in the near future to accept a stream in addition to a simple list.
145
146### Misc
147
148- runnable examples, some pulled straight from README have been added to the examples directory.
149- createSitemapsIndex was renamed createSitemapsAndIndex to more accurately reflect its function. It now returns a promise that resolves to true or throws with an error.
150- You can now add to existing sitemap.xml files via the cli using `npx sitemap --prepend existingSitemap.xml < listOfNewURLs.json.txt`
151
152### 5.0 Breaking Changes
153
154- Dropped support for mobile sitemap - Google appears to have deleted their dtd and all references to it, strongly implying that they do not want you to use it. As its absence now breaks the validator, it has been dropped.
155- normalizeURL(url, XMLRoot, hostname) -> normalizeURL(url, hostname)
156 - The second argument was unused and has been eliminated
157- Support for Node 8 dropped - Node 8 is reaching its EOL December 2019
158- xslURL is being dropped from all apis - styling xml is out of scope of this library.
159- createSitemapIndex has been converted to a promised based api rather than callback.
160- createSitemapIndex now gzips by default - pass gzip: false to disable
161- cacheTime is being dropped from createSitemapIndex - This didn't actually cache the way it was written so this should be a non-breaking change in effect.
162- SitemapIndex as a class has been dropped. The class did all its work on construction and there was no reason to hold on to it once you created it.
163- The options for the cli have been overhauled
164 - `--json` is now inferred
165 - `--line-separated` has been flipped to `--single-line-json` to by default output options immediately compatible with feeding back into sitemap
166
167## 4.1.1
168
169Add a pretty print option to `toString(false)`
170pass true pretty print
171
172Add an xmlparser that will output a config that would generate that same file
173
174 cli:
175 use --parser to output the complete config --line-separated to print out line
176 separated config compatible with the --json input option for cli
177
178 lib: import parseSitemap and pass it a stream
179
180## 4.0.2
181
182Fix npx script error - needs the shebang
183
184## 4.0.1
185
186Validation functions which depend on xmllint will now warn if you do not have xmllint installed.
187
188## 4.0.0
189
190This release is geared around overhauling the public api for this library. Many
191options have been introduced over the years and this has lead to some inconsistencies
192that make the library hard to use. Most have been cleaned up but a couple notable
193items remain, including the confusing names of buildSitemapIndex and createSitemapIndex
194
195- A new experimental CLI
196 - stream in a list of urls stream out xml
197 - validate your generated sitemap
198- Sitemap video item now supports id element
199- Several schema errors have been cleaned up.
200- Docs have been updated and streamlined.
201
202### breaking changes
203
204- lastmod option parses all ISO8601 date-only strings as being in UTC rather than local time
205 - lastmodISO is deprecated as it is equivalent to lastmod
206 - lastmodfile now includes the file's time as well
207 - lastmodrealtime is no longer necessary
208- The default export of sitemap lib is now just createSitemap
209- Sitemap constructor now uses a object for its constructor
210
211```js
212 const { Sitemap } = require('sitemap');
213 const siteMap = new Sitemap({
214 urls = [],
215 hostname: 'https://example.com', // optional
216 cacheTime = 0,
217 xslUrl,
218 xmlNs,
219 level = 'warn'
220 })
221```
222
223- Sitemap no longer accepts a single string for its url
224- Drop support for node 6
225- Remove callback on toXML - This had no performance benefit
226- Direct modification of urls property on Sitemap has been dropped. Use add/remove/contains
227- When a Sitemap item is generated with invalid options it no longer throws by default
228 - instead it console warns.
229 - if you'd like to pre-verify your data the `validateSMIOptions` function is
230 now available
231 - To get the previous behavior pass level `createSitemap({...otheropts, level: 'throw' }) // ErrorLevel.THROW for TS users`
232
233## 3.2.2
234
235- revert https everywhere added in 3.2.0. xmlns is not url.
236- adds alias for lastmod in the form of lastmodiso
237- fixes bug in lastmod option for buildSitemapIndex where option would be overwritten if a lastmod option was provided with a single url
238- fixes #201, fixes #203
239
240## 3.2.1
241
242- no really fixes ts errors for real this time
243- fixes #193 in PR #198
244
245## 3.2.0
246
247- fixes #192, fixes #193 typescript errors
248- correct types on player:loc and restriction:relationship types
249- use https urls in xmlns
250
251## 3.1.0
252
253- fixes #187, #188 typescript errors
254- adds support for full precision priority #176
255
256## 3.0.0
257
258- Converted project to typescript
259- properly encode URLs #179
260- updated core dependency
261
262### 3.0 breaking changes
263
264This will likely not break anyone's code but we're bumping to be safe
265
266- root domain URLs are now suffixed with / (eg. `https://www.ya.ru` -> `https://www.ya.ru/`) This is a side-effect of properly encoding passed in URLs