UNPKG

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