You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -108,8 +114,12 @@ async function createChangelogEntry(oldSchemaString, newSchemaString, previews)
108
114
}
109
115
}
110
116
111
-
// prepare the preview title from github/github source for the docs.
112
-
// ported from build-changelog-from-markdown
117
+
/**
118
+
* Prepare the preview title from github/github source for the docs.
119
+
* (ported from build-changelog-from-markdown)
120
+
* @param {string} title
121
+
* @return {string}
122
+
*/
113
123
functioncleanPreviewTitle(title){
114
124
if(title=="UpdateRefsPreview"){
115
125
title="Update refs preview"
@@ -122,17 +132,23 @@ function cleanPreviewTitle(title) {
122
132
}
123
133
124
134
/**
135
+
* Turn the given title into an HTML-ready anchor.
136
+
* (ported from https://github.com/github/graphql-docs/blob/master/lib/graphql_docs/update_internal_developer/change_log.rb#L281)
125
137
* @param {string} [previewTitle]
126
138
* @return {string}
127
139
*/
128
140
functionpreviewAnchor(previewTitle){
129
-
// ported from https://github.com/github/graphql-docs/blob/master/lib/graphql_docs/update_internal_developer/change_log.rb#L281
130
141
returnpreviewTitle
131
142
.toLowerCase()
132
143
.replace(//g,'-')
133
144
.replace(/[^\w-]/g,'')
134
145
}
135
146
147
+
/**
148
+
* Turn changes from graphql-inspector into messages for the HTML changelog.
149
+
* @param {Array<object>} changes
150
+
* @return {Array<string>}
151
+
*/
136
152
functioncleanMessagesFromChanges(changes){
137
153
returnchanges.map(function(change){
138
154
// replace single quotes around graphql names with backticks,
@@ -141,6 +157,15 @@ function cleanMessagesFromChanges(changes) {
141
157
})
142
158
}
143
159
160
+
/**
161
+
* Split `changesToReport` into two parts,
162
+
* one for changes in the main schema,
163
+
* and another for changes that are under preview.
164
+
* (Ported from https://github.com/github/graphql-docs/blob/7e6a5ccbf13cc7d875fee65527b25bc49e886b41/lib/graphql_docs/update_internal_developer/change_log.rb#L230)
0 commit comments