@aurodesignsystem/auro-library 5.14.0 → 5.14.2

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/bin/generateDocs.mjs +4 -210
  3. package/bin/generateDocs_index.mjs +4 -210
  4. package/dist/_chunks/chunk-2MOEVVSZ.mjs +308 -0
  5. package/dist/_chunks/chunk-H7YO7ERJ.mjs +69 -0
  6. package/dist/_chunks/chunk-JLCAYVRX.mjs +84 -0
  7. package/dist/_chunks/chunk-RKBXVLA5.mjs +5983 -0
  8. package/dist/_chunks/chunk-TDFKN2EP.mjs +38 -0
  9. package/dist/_chunks/chunk-UY4SIQT6.mjs +201 -0
  10. package/dist/_chunks/chunk-V7YBXHAI.mjs +32379 -0
  11. package/dist/bin/generateDocs.mjs +152 -0
  12. package/dist/bin/generateDocs_index.mjs +152 -0
  13. package/dist/build/generateDocs.mjs +18 -0
  14. package/dist/build/generateReadme.mjs +49 -0
  15. package/dist/build/generateWcaComponent.mjs +6657 -0
  16. package/dist/build/processors/defaultDocsProcessor.mjs +16 -0
  17. package/dist/build/processors/defaultDotGithubSync.mjs +12 -0
  18. package/dist/build/syncGithubFiles.mjs +18 -0
  19. package/dist/utils/auroTemplateFiller.mjs +8 -0
  20. package/dist/utils/sharedFileProcessorUtils.mjs +31 -0
  21. package/package.json +10 -5
  22. package/scripts/build/generateDocs.mjs +4 -24
  23. package/scripts/build/generateReadme.mjs +4 -60
  24. package/scripts/build/generateWcaComponent.mjs +4 -43
  25. package/scripts/build/postinstall.mjs +10 -10
  26. package/scripts/build/pre-commit.mjs +13 -7
  27. package/scripts/build/processors/defaultDocsProcessor.mjs +4 -83
  28. package/scripts/build/processors/defaultDotGithubSync.mjs +4 -83
  29. package/scripts/build/syncGithubFiles.mjs +4 -25
  30. package/scripts/runtime/floatingUI.mjs +2 -1
  31. package/scripts/runtime/generateUUID/generateUUID.mjs +41 -0
  32. package/scripts/runtime/generateUUID/index.mjs +1 -0
  33. package/scripts/utils/ansiColors.mjs +119 -0
  34. package/scripts/utils/auroLibraryUtils.mjs +87 -51
  35. package/scripts/utils/auroTemplateFiller.mjs +4 -178
  36. package/scripts/utils/logger.mjs +27 -16
  37. package/scripts/utils/sharedFileProcessorUtils.mjs +4 -270
  38. package/scripts/build/deprecatedProseToFieldPlugin.spec.js +0 -188
  39. package/scripts/runtime/ClickTracker/test/ClickTracker.test.js +0 -424
  40. package/scripts/runtime/FocusTrap/test/FocusTrap.test.js +0 -168
  41. package/scripts/runtime/Focusables/test/Focusables.test.js +0 -185
  42. package/scripts/runtime/dateUtilities/dateFormatter.test.js +0 -284
  43. package/scripts/runtime/dateUtilities/dateUtilities.test.js +0 -80
  44. package/scripts/runtime/floatingUI/test/floatingUI.test.js +0 -189
  45. package/scripts/runtime/floatingUI.test.js +0 -478
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Semantic Release Automated Changelog
2
2
 
3
+ ## [5.14.2](https://github.com/AlaskaAirlines/auro-library/compare/v5.14.1...v5.14.2) (2026-09-09)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **deps:** pre-compile doc-gen scripts; drop handlebars / markdown-magic from deps AB[#1616087](https://github.com/AlaskaAirlines/auro-library/issues/1616087) ([8d29b4b](https://github.com/AlaskaAirlines/auro-library/commit/8d29b4b79a73af72d603b91746edaac54902b074))
9
+
10
+ ## [5.14.1](https://github.com/AlaskaAirlines/auro-library/compare/v5.14.0...v5.14.1) (2026-09-01)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **floatingUI:** add generateUUID helper with insecure-context fallback AB[#1602198](https://github.com/AlaskaAirlines/auro-library/issues/1602198) ([329db41](https://github.com/AlaskaAirlines/auro-library/commit/329db41a1dccec136573ae049867e697cd10e648))
16
+
3
17
  # [5.14.0](https://github.com/AlaskaAirlines/auro-library/compare/v5.13.3...v5.14.0) (2026-08-30)
4
18
 
5
19
 
@@ -1,210 +1,4 @@
1
- import path from 'path';
2
- import markdownMagic from 'markdown-magic';
3
- import fs from 'fs';
4
- import https from 'https';
5
-
6
- const __dirname = new URL('.', import.meta.url).pathname;
7
-
8
- const readmeTemplateUrl = 'https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/README.md';
9
- const dirDocTemplates = './docTemplates';
10
- const readmeFilePath = dirDocTemplates + '/README.md';
11
-
12
- /**
13
- * Extract NPM, NAMESPACE and NAME from package.json
14
- */
15
-
16
- function nameExtraction() {
17
- const packageJson = fs.readFileSync('package.json', 'utf8', function(err, data) {
18
- if (err) {
19
- console.log('ERROR: Unable to read package.json file', err);
20
- }
21
- })
22
-
23
- let pName = JSON.parse(packageJson).name;
24
- let pVersion = JSON.parse(packageJson).version;
25
- let pdtVersion = JSON.parse(packageJson).peerDependencies['\@aurodesignsystem/design-tokens'].substring(1)
26
- let wcssVersion = JSON.parse(packageJson).peerDependencies['\@aurodesignsystem/webcorestylesheets'].substring(1)
27
-
28
- let npmStart = pName.indexOf('@');
29
- let namespaceStart = pName.indexOf('/');
30
- let nameStart = pName.indexOf('-');
31
-
32
- let result = {
33
- 'npm': pName.substring(npmStart, namespaceStart),
34
- 'namespace': pName.substring(namespaceStart + 1, nameStart),
35
- 'namespaceCap': pName.substring(namespaceStart + 1)[0].toUpperCase() + pName.substring(namespaceStart + 2, nameStart),
36
- 'name': pName.substring(nameStart + 1),
37
- 'nameCap': pName.substring(nameStart + 1)[0].toUpperCase() + pName.substring(nameStart + 2),
38
- 'version': pVersion,
39
- 'tokensVersion': pdtVersion,
40
- 'wcssVersion': wcssVersion
41
- };
42
-
43
- return result;
44
- }
45
-
46
- /**
47
- * Replace all instances of [npm], [name], [Name], [namespace] and [Namespace] accordingly
48
- */
49
-
50
- function formatTemplateFileContents(content, destination) {
51
- let nameExtractionData = nameExtraction();
52
- let result = content;
53
-
54
- /**
55
- * Replace placeholder strings
56
- */
57
- result = result.replace(/\[npm]/g, nameExtractionData.npm);
58
- result = result.replace(/\[name](?!\()/g, nameExtractionData.name);
59
- result = result.replace(/\[Name](?!\()/g, nameExtractionData.nameCap);
60
- result = result.replace(/\[namespace]/g, nameExtractionData.namespace);
61
- result = result.replace(/\[Namespace]/g, nameExtractionData.namespaceCap);
62
- result = result.replace(/\[Version]/g, nameExtractionData.version);
63
- result = result.replace(/\[dtVersion]/g, nameExtractionData.tokensVersion);
64
- result = result.replace(/\[wcssVersion]/g, nameExtractionData.wcssVersion);
65
-
66
- /**
67
- * Cleanup line breaks
68
- */
69
- result = result.replace(/(\r\n|\r|\n)[\s]+(\r\n|\r|\n)/g, '\r\n\r\n'); // Replace lines containing only whitespace with a carriage return.
70
- result = result.replace(/>(\r\n|\r|\n){2,}/g, '>\r\n'); // Remove empty lines directly after a closing html tag.
71
- result = result.replace(/>(\r\n|\r|\n)```/g, '>\r\n\r\n```'); // Ensure an empty line before code samples.
72
- result = result.replace(/>(\r\n|\r|\n){2,}```(\r\n|\r|\n)/g, '>\r\n```\r\n'); // Ensure no empty lines before close of code sample.
73
- result = result.replace(/([^(\r\n|\r|\n)])(\r?\n|\r(?!\n))+#/g, "$1\r\n\r\n#"); // Ensure empty line before header sections.
74
-
75
- /**
76
- * Write the result to the destination file
77
- */
78
- fs.writeFileSync(destination, result, { encoding: 'utf8'});
79
- }
80
-
81
- function formatApiTableContents(content, destination) {
82
- const nameExtractionData = nameExtraction();
83
- const wcName = nameExtractionData.namespace + '-' + nameExtractionData.name;
84
-
85
- let result = content;
86
-
87
- result = result
88
- .replace(/\r\n|\r|\n####\s`([a-zA-Z]*)`/g, `\r\n#### <a name="$1"></a>\`$1\`<a href="#" style="float: right; font-size: 1rem; font-weight: 100;">back to top</a>`)
89
- .replace(/\r\n|\r|\n\|\s`([a-zA-Z]*)`/g, '\r\n| [$1](#$1)')
90
- .replace(/\| \[\]\(#\)/g, "");
91
-
92
- fs.writeFileSync(destination, result, { encoding: 'utf8'});
93
-
94
- fs.readFile('./demo/apiExamples.md', 'utf8', function(err, data) {
95
- formatTemplateFileContents(data, './demo/apiExamples.md');
96
- });
97
- }
98
-
99
- /**
100
- * Compiles `./docTemplates/README.md` -> `./README.md`
101
- */
102
-
103
- function processReadme() {
104
- const callback = function(updatedContent, outputConfig) {
105
-
106
- if (fs.existsSync('./README.md')) {
107
- fs.readFile('./README.md', 'utf8', function(err, data) {
108
- formatTemplateFileContents(data, './README.md');
109
- });
110
- } else {
111
- console.log('ERROR: ./README.md file is missing');
112
- }
113
- };
114
-
115
- const config = {
116
- matchWord: 'AURO-GENERATED-CONTENT',
117
- outputDir: './'
118
- };
119
-
120
- const markdownPath = path.join(__dirname, '../docTemplates/README.md');
121
-
122
- markdownMagic(markdownPath, config, callback);
123
- }
124
-
125
- /**
126
- * Compiles `./docTemplates/demo.md` -> `./demo/demo.md`
127
- */
128
-
129
- function processDemo() {
130
- const callback = function(updatedContent, outputConfig) {
131
- if (fs.existsSync('./demo/demo.md')) {
132
- fs.readFile('./demo/demo.md', 'utf8', function(err, data) {
133
- formatTemplateFileContents(data, './demo/demo.md');
134
- });
135
- } else {
136
- console.log('ERROR: ./demo/demo.md file is missing');
137
- }
138
- };
139
-
140
- const configDemo = {
141
- matchWord: 'AURO-GENERATED-CONTENT',
142
- outputDir: './demo'
143
- };
144
-
145
- const markdownPath = path.join(__dirname, '../docs/partials/demo.md');
146
-
147
- markdownMagic(markdownPath, configDemo, callback);
148
- }
149
-
150
- /**
151
- * Compiles `./docTemplates/apiExamples.md` -> `./demo/apiExamples.md`
152
- */
153
-
154
- function processApiExamples() {
155
- const callback = function(updatedContent, outputConfig) {
156
- if (fs.existsSync('./demo/apiExamples.md')) {
157
- fs.readFile('./demo/apiExamples.md', 'utf8', function(err, data) {
158
- formatApiTableContents(data, './demo/apiExamples.md');
159
- });
160
- } else {
161
- console.log('ERROR: ./demo/apiExamples.md file is missing');
162
- }
163
- };
164
-
165
- const config = {
166
- matchWord: 'AURO-GENERATED-CONTENT',
167
- outputDir: './demo'
168
- };
169
-
170
- const markdownPath = path.join(__dirname, '../docs/partials/apiExamples.md');
171
-
172
- markdownMagic(markdownPath, config, callback);
173
- }
174
-
175
- /**
176
- * Copy README.md template from static source
177
- * */
178
-
179
- function copyReadmeLocally() {
180
-
181
- if (!fs.existsSync(dirDocTemplates)){
182
- fs.mkdirSync(dirDocTemplates);
183
- }
184
-
185
- if (!fs.existsSync(readmeFilePath)) {
186
- fs.writeFile(readmeFilePath, '', function(err) {
187
- if(err) {
188
- console.log('ERROR: Unable to create README.md file.', err);
189
- }
190
- });
191
- }
192
-
193
- https.get(readmeTemplateUrl, function(response) {
194
- let writeTemplate = response.pipe(fs.createWriteStream(readmeFilePath));
195
-
196
- writeTemplate.on('finish', () => {
197
- processReadme();
198
- });
199
-
200
- }).on('error', (err) => {
201
- console.log('ERROR: Unable to fetch README.md file from server.', err);
202
- });
203
- }
204
-
205
- /**
206
- * Run all the actual document generation
207
- */
208
- copyReadmeLocally();
209
- processApiExamples();
210
- processDemo();
1
+ // Shim for the pre-compiled build. Do not edit.
2
+ // Generated by build/bundleDocsScripts.mjs from src/bin/generateDocs.mjs.
3
+ // Edit that file, then run `npm run build:bundles`.
4
+ import "../dist/bin/generateDocs.mjs";
@@ -1,210 +1,4 @@
1
- import path from 'path';
2
- import markdownMagic from 'markdown-magic';
3
- import fs from 'fs';
4
- import https from 'https';
5
-
6
- const __dirname = new URL('.', import.meta.url).pathname;
7
-
8
- const readmeTemplateUrl = 'https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/README.md';
9
- const dirDocTemplates = './docTemplates';
10
- const readmeFilePath = dirDocTemplates + '/README.md';
11
-
12
- /**
13
- * Extract NPM, NAMESPACE and NAME from package.json
14
- */
15
-
16
- function nameExtraction() {
17
- const packageJson = fs.readFileSync('package.json', 'utf8', function(err, data) {
18
- if (err) {
19
- console.log('ERROR: Unable to read package.json file', err);
20
- }
21
- })
22
-
23
- let pName = JSON.parse(packageJson).name;
24
- let pVersion = JSON.parse(packageJson).version;
25
- let pdtVersion = JSON.parse(packageJson).peerDependencies['\@aurodesignsystem/design-tokens'].substring(1)
26
- let wcssVersion = JSON.parse(packageJson).peerDependencies['\@aurodesignsystem/webcorestylesheets'].substring(1)
27
-
28
- let npmStart = pName.indexOf('@');
29
- let namespaceStart = pName.indexOf('/');
30
- let nameStart = pName.indexOf('-');
31
-
32
- let result = {
33
- 'npm': pName.substring(npmStart, namespaceStart),
34
- 'namespace': pName.substring(namespaceStart + 1, nameStart),
35
- 'namespaceCap': pName.substring(namespaceStart + 1)[0].toUpperCase() + pName.substring(namespaceStart + 2, nameStart),
36
- 'name': pName.substring(nameStart + 1),
37
- 'nameCap': pName.substring(nameStart + 1)[0].toUpperCase() + pName.substring(nameStart + 2),
38
- 'version': pVersion,
39
- 'tokensVersion': pdtVersion,
40
- 'wcssVersion': wcssVersion
41
- };
42
-
43
- return result;
44
- }
45
-
46
- /**
47
- * Replace all instances of [npm], [name], [Name], [namespace] and [Namespace] accordingly
48
- */
49
-
50
- function formatTemplateFileContents(content, destination) {
51
- let nameExtractionData = nameExtraction();
52
- let result = content;
53
-
54
- /**
55
- * Replace placeholder strings
56
- */
57
- result = result.replace(/\[npm]/g, nameExtractionData.npm);
58
- result = result.replace(/\[name](?!\()/g, nameExtractionData.name);
59
- result = result.replace(/\[Name](?!\()/g, nameExtractionData.nameCap);
60
- result = result.replace(/\[namespace]/g, nameExtractionData.namespace);
61
- result = result.replace(/\[Namespace]/g, nameExtractionData.namespaceCap);
62
- result = result.replace(/\[Version]/g, nameExtractionData.version);
63
- result = result.replace(/\[dtVersion]/g, nameExtractionData.tokensVersion);
64
- result = result.replace(/\[wcssVersion]/g, nameExtractionData.wcssVersion);
65
-
66
- /**
67
- * Cleanup line breaks
68
- */
69
- result = result.replace(/(\r\n|\r|\n)[\s]+(\r\n|\r|\n)/g, '\r\n\r\n'); // Replace lines containing only whitespace with a carriage return.
70
- result = result.replace(/>(\r\n|\r|\n){2,}/g, '>\r\n'); // Remove empty lines directly after a closing html tag.
71
- result = result.replace(/>(\r\n|\r|\n)```/g, '>\r\n\r\n```'); // Ensure an empty line before code samples.
72
- result = result.replace(/>(\r\n|\r|\n){2,}```(\r\n|\r|\n)/g, '>\r\n```\r\n'); // Ensure no empty lines before close of code sample.
73
- result = result.replace(/([^(\r\n|\r|\n)])(\r?\n|\r(?!\n))+#/g, "$1\r\n\r\n#"); // Ensure empty line before header sections.
74
-
75
- /**
76
- * Write the result to the destination file
77
- */
78
- fs.writeFileSync(destination, result, { encoding: 'utf8'});
79
- }
80
-
81
- function formatApiTableContents(content, destination) {
82
- const nameExtractionData = nameExtraction();
83
- const wcName = nameExtractionData.namespace + '-' + nameExtractionData.name;
84
-
85
- let result = content;
86
-
87
- result = result
88
- .replace(/\r\n|\r|\n####\s`([a-zA-Z]*)`/g, `\r\n#### <a name="$1"></a>\`$1\`<a href="#" style="float: right; font-size: 1rem; font-weight: 100;">back to top</a>`)
89
- .replace(/\r\n|\r|\n\|\s`([a-zA-Z]*)`/g, '\r\n| [$1](#$1)')
90
- .replace(/\| \[\]\(#\)/g, "");
91
-
92
- fs.writeFileSync(destination, result, { encoding: 'utf8'});
93
-
94
- fs.readFile('./demo/apiExamples.md', 'utf8', function(err, data) {
95
- formatTemplateFileContents(data, './demo/apiExamples.md');
96
- });
97
- }
98
-
99
- /**
100
- * Compiles `./docTemplates/README.md` -> `./README.md`
101
- */
102
-
103
- function processReadme() {
104
- const callback = function(updatedContent, outputConfig) {
105
-
106
- if (fs.existsSync('./README.md')) {
107
- fs.readFile('./README.md', 'utf8', function(err, data) {
108
- formatTemplateFileContents(data, './README.md');
109
- });
110
- } else {
111
- console.log('ERROR: ./README.md file is missing');
112
- }
113
- };
114
-
115
- const config = {
116
- matchWord: 'AURO-GENERATED-CONTENT',
117
- outputDir: './'
118
- };
119
-
120
- const markdownPath = path.join(__dirname, '../docTemplates/README.md');
121
-
122
- markdownMagic(markdownPath, config, callback);
123
- }
124
-
125
- /**
126
- * Compiles `./docTemplates/demo.md` -> `./demo/index.md`
127
- */
128
-
129
- function processDemo() {
130
- const callback = function(updatedContent, outputConfig) {
131
- if (fs.existsSync('./demo/index.md')) {
132
- fs.readFile('./demo/index.md', 'utf8', function(err, data) {
133
- formatTemplateFileContents(data, './demo/index.md');
134
- });
135
- } else {
136
- console.log('ERROR: ./demo/index.md file is missing');
137
- }
138
- };
139
-
140
- const configDemo = {
141
- matchWord: 'AURO-GENERATED-CONTENT',
142
- outputDir: './demo'
143
- };
144
-
145
- const markdownPath = path.join(__dirname, '../docs/partials/index.md');
146
-
147
- markdownMagic(markdownPath, configDemo, callback);
148
- }
149
-
150
- /**
151
- * Compiles `./docTemplates/apiExamples.md` -> `./demo/apiExamples.md`
152
- */
153
-
154
- function processApiExamples() {
155
- const callback = function(updatedContent, outputConfig) {
156
- if (fs.existsSync('./demo/apiExamples.md')) {
157
- fs.readFile('./demo/apiExamples.md', 'utf8', function(err, data) {
158
- formatApiTableContents(data, './demo/apiExamples.md');
159
- });
160
- } else {
161
- console.log('ERROR: ./demo/apiExamples.md file is missing');
162
- }
163
- };
164
-
165
- const config = {
166
- matchWord: 'AURO-GENERATED-CONTENT',
167
- outputDir: './demo'
168
- };
169
-
170
- const markdownPath = path.join(__dirname, '../docs/partials/apiExamples.md');
171
-
172
- markdownMagic(markdownPath, config, callback);
173
- }
174
-
175
- /**
176
- * Copy README.md template from static source
177
- * */
178
-
179
- function copyReadmeLocally() {
180
-
181
- if (!fs.existsSync(dirDocTemplates)){
182
- fs.mkdirSync(dirDocTemplates);
183
- }
184
-
185
- if (!fs.existsSync(readmeFilePath)) {
186
- fs.writeFile(readmeFilePath, '', function(err) {
187
- if(err) {
188
- console.log('ERROR: Unable to create README.md file.', err);
189
- }
190
- });
191
- }
192
-
193
- https.get(readmeTemplateUrl, function(response) {
194
- let writeTemplate = response.pipe(fs.createWriteStream(readmeFilePath));
195
-
196
- writeTemplate.on('finish', () => {
197
- processReadme();
198
- });
199
-
200
- }).on('error', (err) => {
201
- console.log('ERROR: Unable to fetch README.md file from server.', err);
202
- });
203
- }
204
-
205
- /**
206
- * Run all the actual document generation
207
- */
208
- copyReadmeLocally();
209
- processApiExamples();
210
- processDemo();
1
+ // Shim for the pre-compiled build. Do not edit.
2
+ // Generated by build/bundleDocsScripts.mjs from src/bin/generateDocs_index.mjs.
3
+ // Edit that file, then run `npm run build:bundles`.
4
+ import "../dist/bin/generateDocs_index.mjs";