Skip to content

Commit 8e8b189

Browse files
committed
merge master
2 parents 0e2f04e + 87bef83 commit 8e8b189

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2246
-1120
lines changed

.vale.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ StylesPath = vale-styles
33
Vocab = Docs
44

55
[*.md]
6-
BasedOnStyles = write-good, Segment
6+
BasedOnStyles = write-good, segment

.vscode/launch.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": []
7+
}

Gemfile.lock

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ GEM
108108
rb-fsevent (0.10.4)
109109
rb-inotify (0.10.1)
110110
ffi (~> 1.0)
111-
rexml (3.2.4)
111+
rexml (3.2.5)
112112
rouge (3.25.0)
113113
ruby-enum (0.8.0)
114114
i18n

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ serve: package
5353
catalog: vendor/bundle
5454
@node scripts/catalog.js
5555

56+
.PHONY: changelog
57+
changelog: vendor/bundle
58+
@node scripts/changelog.js
59+
5660
.PHONY: sidenav
5761
sidenav: vendor/bundle
5862
@node scripts/nav.js

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ Each piece of frontmatter does something special!
189189
#### Content-related frontmatter
190190
- `beta`: default false. When true, show an "in beta" warning in the page layout (see the warning in `_includes/content/beta-note.md`)
191191
- `rewrite`: defaults to false. This is a legacy frontmatter flag that comes from the old `site-docs` repo, and which labels any destination that was rewritten in ~2018 to a standardized template. It disables the duplicate "connection modes" table that would otherwise show up in the boilerplate content at the end of the page.
192+
- `hide-dossier`: defaults to false. When true, hides the "quick info" box at the top of a destination page.
192193
- `hide-boilerplate`: defaults to false. When true, none of the content from `destination-footer.md` is appended to the destination page.
193194
- `hide-cmodes`: defaults to false. A renaming of "rewrite" for more clarity, hides the connection modes table in the boilerplate.
194195
- `hide-personas-partial`: defaults to false. When true, hides the section of content from `destination-footer.md` that talks about being able to receive personas data.

netlify.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
# ignore = "git log -1 --pretty=%B | ( ! grep -q '\[netlify\-build\]' )"
55
# Ignore if [netlify-ignore] is present
66

7+
# Don't build if there are no changes to src/
8+
ignore = "git diff --quiet HEAD^ HEAD src/"
9+
710
[context.deploy-preview]
811
command = "yarn develop"
9-
ignore = "git log -1 --pretty=%B | ( grep -q '\\[netlify\\-ignore\\]' )"
12+
ignore = "./scripts/ignore.sh"
1013

1114
[[redirects]]
1215
from = "/docs/*"

package-lock.json

Lines changed: 184 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"glightbox": "^3.0.6",
5353
"htm": "^3.0.4",
5454
"hyperlink": "^4.5.2",
55+
"json-to-pretty-yaml": "^1.2.2",
5556
"preact": "^10.5.12",
5657
"search-insights": "^1.7.1",
5758
"tap-spot": "^1.1.1",

scripts/catalog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ const updateSources = async () => {
294294
})
295295

296296
// Create source catalog yaml file
297-
const options = { noArrayIndent: true };
297+
const options = { noArrayIndent: false };
298298
var todayDate = new Date().toISOString().slice(0,10);
299299
output = "# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT\n"
300300
output += "# sources last updated " + todayDate + " \n";

scripts/changelog.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
const axios = require('axios');
2+
const path = require('path');
3+
const fs = require('fs');
4+
const fm = require('front-matter');
5+
const yaml = require('js-yaml');
6+
7+
API_URL = "https://api.github.com/repos/segmentio/"
8+
9+
const getLog = async (url = "") => {
10+
try {
11+
const res = await axios.get(url, {
12+
headers: {
13+
'Content-Type': 'application/json',
14+
}
15+
});
16+
return res.data
17+
} catch (error) {
18+
console.log(error)
19+
}
20+
}
21+
let libraries = ["analytics-android","analytics-ios", "analytics-react-native", "analytics-node", "analytics-python", "analytics-php", "analytics-go", "analytics-java", "analytics.NET"]
22+
23+
const replace_token = /.+\r\n(-{2,}\r\n)|.+\r\n(={2,}\r\n)/mg;
24+
const subst = ``
25+
26+
const updateLog = async(library) => {
27+
28+
let releasesUpdated = []
29+
let url = API_URL+library+'/releases'
30+
const releases = await getLog(url)
31+
releases.forEach(release => {
32+
let note = release.body
33+
cleaned_note = note.replace(replace_token,subst)
34+
let updatedRelease = {
35+
version: release.name,
36+
url: release.html_url,
37+
date: release.published_at,
38+
notes: cleaned_note
39+
}
40+
releasesUpdated.push(updatedRelease)
41+
})
42+
43+
const options = { noArrayIndent: true };
44+
var todayDate = new Date().toISOString().slice(0,10);
45+
output = "# AUTOGENERATED FROM GITHUB API. DO NOT EDIT\n"
46+
output += "# Releases last updated " + todayDate + " \n";
47+
output += yaml.safeDump({ releases: releasesUpdated }, options);
48+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/changelogs/${library}.yml`), output);
49+
}
50+
51+
libraries.forEach(library => {
52+
updateLog(library);
53+
});

0 commit comments

Comments
 (0)