@aurodesignsystem/auro-library 2.6.2 → 2.7.0
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.
- package/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/scripts/build/generateDocs.mjs +21 -8
- package/scripts/utils/runtimeUtils.mjs +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Semantic Release Automated Changelog
|
|
2
2
|
|
|
3
|
+
# [2.7.0](https://github.com/AlaskaAirlines/auro-library/compare/v2.6.3...v2.7.0) (2024-08-21)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add registerComponent function ([fc3a135](https://github.com/AlaskaAirlines/auro-library/commit/fc3a135f5fad8e3b5fc022f2e0f38443b11681fc))
|
|
9
|
+
|
|
10
|
+
## [2.6.3](https://github.com/AlaskaAirlines/auro-library/compare/v2.6.2...v2.6.3) (2024-08-07)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **readme:** update generateDocs script for dynamic readme support [#57](https://github.com/AlaskaAirlines/auro-library/issues/57) ([f3c3092](https://github.com/AlaskaAirlines/auro-library/commit/f3c3092f4c9cc61dcc9f4b55cb5f63be4127c6de))
|
|
16
|
+
|
|
3
17
|
## [2.6.2](https://github.com/AlaskaAirlines/auro-library/compare/v2.6.1...v2.6.2) (2024-08-07)
|
|
4
18
|
|
|
5
19
|
|
package/package.json
CHANGED
|
@@ -10,10 +10,23 @@ const auroLibraryUtils = new AuroLibraryUtils();
|
|
|
10
10
|
|
|
11
11
|
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
12
12
|
|
|
13
|
-
const readmeTemplateUrl = 'https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/README_esm.md';
|
|
14
13
|
const dirDocTemplates = './docTemplates';
|
|
15
14
|
const readmeFilePath = dirDocTemplates + '/README.md';
|
|
16
15
|
|
|
16
|
+
// List of components that do not support ESM to determine which README to use
|
|
17
|
+
const nonEsmComponents = ['combobox', 'datepicker', 'menu', 'pane', 'select'];
|
|
18
|
+
|
|
19
|
+
function generateReadmeUrl() {
|
|
20
|
+
let nameExtractionData = nameExtraction();
|
|
21
|
+
let esmString = '';
|
|
22
|
+
|
|
23
|
+
if (!nonEsmComponents.includes(nameExtractionData.name)) {
|
|
24
|
+
esmString = '_esm';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return 'https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/README' + esmString + '.md';
|
|
28
|
+
}
|
|
29
|
+
|
|
17
30
|
/**
|
|
18
31
|
* Extract NPM, NAMESPACE and NAME from package.json
|
|
19
32
|
*/
|
|
@@ -25,12 +38,12 @@ function nameExtraction() {
|
|
|
25
38
|
}
|
|
26
39
|
})
|
|
27
40
|
|
|
28
|
-
packageJson = JSON.parse(packageJson);
|
|
29
|
-
|
|
41
|
+
packageJson = JSON.parse(packageJson);
|
|
42
|
+
|
|
30
43
|
let pName = packageJson.name;
|
|
31
44
|
let pVersion = packageJson.version;
|
|
32
|
-
let pdtVersion = packageJson.peerDependencies['\@aurodesignsystem/design-tokens'].substring(1)
|
|
33
|
-
let wcssVersion = packageJson.peerDependencies['\@aurodesignsystem/webcorestylesheets'].substring(1)
|
|
45
|
+
let pdtVersion = packageJson.peerDependencies['\@aurodesignsystem/design-tokens'].substring(1);
|
|
46
|
+
let wcssVersion = packageJson.peerDependencies['\@aurodesignsystem/webcorestylesheets'].substring(1);
|
|
34
47
|
|
|
35
48
|
let npmStart = pName.indexOf('@');
|
|
36
49
|
let namespaceStart = pName.indexOf('/');
|
|
@@ -46,7 +59,7 @@ function nameExtraction() {
|
|
|
46
59
|
'tokensVersion': pdtVersion,
|
|
47
60
|
'wcssVersion': wcssVersion
|
|
48
61
|
};
|
|
49
|
-
|
|
62
|
+
}
|
|
50
63
|
|
|
51
64
|
/**
|
|
52
65
|
* Replace all instances of [npm], [name], [Name], [namespace] and [Namespace] accordingly
|
|
@@ -183,7 +196,6 @@ function processApiExamples() {
|
|
|
183
196
|
* */
|
|
184
197
|
|
|
185
198
|
function copyReadmeLocally() {
|
|
186
|
-
|
|
187
199
|
if (!fs.existsSync(dirDocTemplates)){
|
|
188
200
|
fs.mkdirSync(dirDocTemplates);
|
|
189
201
|
}
|
|
@@ -196,7 +208,7 @@ function copyReadmeLocally() {
|
|
|
196
208
|
});
|
|
197
209
|
}
|
|
198
210
|
|
|
199
|
-
https.get(
|
|
211
|
+
https.get(generateReadmeUrl(), function(response) {
|
|
200
212
|
let writeTemplate = response.pipe(fs.createWriteStream(readmeFilePath));
|
|
201
213
|
|
|
202
214
|
writeTemplate.on('finish', () => {
|
|
@@ -214,3 +226,4 @@ function copyReadmeLocally() {
|
|
|
214
226
|
copyReadmeLocally();
|
|
215
227
|
processApiExamples();
|
|
216
228
|
processDemo();
|
|
229
|
+
|
|
@@ -8,6 +8,19 @@
|
|
|
8
8
|
export default class AuroLibraryRuntimeUtils {
|
|
9
9
|
|
|
10
10
|
/* eslint-disable jsdoc/require-param */
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This will register a new custom element with the browser.
|
|
14
|
+
* @param {String} name - The name of the custom element.
|
|
15
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
16
|
+
* @returns {void}
|
|
17
|
+
*/
|
|
18
|
+
registerComponent(name, componentClass) {
|
|
19
|
+
if (!customElements.get(name)) {
|
|
20
|
+
customElements.define(name, class extends componentClass {});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
11
24
|
/**
|
|
12
25
|
* Finds and returns the closest HTML Element based on a selector.
|
|
13
26
|
* @returns {void}
|