@aurodesignsystem/auro-library 2.6.1 → 2.6.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Semantic Release Automated Changelog
2
2
 
3
+ ## [2.6.2](https://github.com/AlaskaAirlines/auro-library/compare/v2.6.1...v2.6.2) (2024-08-07)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * update various build scripts ([9b726b3](https://github.com/AlaskaAirlines/auro-library/commit/9b726b3ad2fd616987a4488cc440f0f7498c0028))
9
+
3
10
  ## [2.6.1](https://github.com/AlaskaAirlines/auro-library/compare/v2.6.0...v2.6.1) (2024-08-06)
4
11
 
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem/auro-library",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
4
4
  "description": "This repository holds shared scripts, utilities, and workflows utilized across repositories along the Auro Design System.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -4,6 +4,10 @@ import fs from 'fs';
4
4
  import https from 'https';
5
5
  import { fileURLToPath } from 'url';
6
6
 
7
+ import AuroLibraryUtils from "../utils/auroLibraryUtils.mjs";
8
+
9
+ const auroLibraryUtils = new AuroLibraryUtils();
10
+
7
11
  const __dirname = fileURLToPath(new URL('.', import.meta.url));
8
12
 
9
13
  const readmeTemplateUrl = 'https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/README_esm.md';
@@ -50,23 +54,19 @@ function nameExtraction() {
50
54
 
51
55
  function formatTemplateFileContents(content, destination) {
52
56
  let nameExtractionData = nameExtraction();
57
+ let result = content;
53
58
 
54
59
  /**
55
60
  * Replace placeholder strings
56
61
  */
57
- const placeholders = {
58
- '[npm]': 'npm',
59
- '[name](?!\\()': 'name',
60
- '[Name](?!\\()': 'nameCap',
61
- '[namespace]': 'namespace',
62
- '[Namespace]': 'namespaceCap',
63
- '[Version]': 'version',
64
- '[dtVersion]': 'tokensVersion',
65
- '[wcssVersion]': 'wcssVersion'
66
- };
67
-
68
- let result = Object.entries(placeholders).reduce((acc, [key, value]) =>
69
- acc.replace(new RegExp(key, 'g'), nameExtractionData[value]), content);
62
+ result = result.replace(/\[npm]/g, nameExtractionData.npm);
63
+ result = result.replace(/\[name](?!\()/g, nameExtractionData.name);
64
+ result = result.replace(/\[Name](?!\()/g, nameExtractionData.nameCap);
65
+ result = result.replace(/\[namespace]/g, nameExtractionData.namespace);
66
+ result = result.replace(/\[Namespace]/g, nameExtractionData.namespaceCap);
67
+ result = result.replace(/\[Version]/g, nameExtractionData.version);
68
+ result = result.replace(/\[dtVersion]/g, nameExtractionData.tokensVersion);
69
+ result = result.replace(/\[wcssVersion]/g, nameExtractionData.wcssVersion);
70
70
 
71
71
  /**
72
72
  * Cleanup line breaks
@@ -122,7 +122,7 @@ function processReadme() {
122
122
  outputDir: './'
123
123
  };
124
124
 
125
- const markdownPath = path.join(__dirname, '../docTemplates/README.md');
125
+ const markdownPath = path.join(__dirname, './../../../../../docTemplates/README.md');
126
126
 
127
127
  markdownMagic(markdownPath, config, callback);
128
128
  }
@@ -135,7 +135,8 @@ function processDemo() {
135
135
  const callback = function(updatedContent, outputConfig) {
136
136
  if (fs.existsSync('./demo/index.md')) {
137
137
  fs.readFile('./demo/index.md', 'utf8', function(err, data) {
138
- formatTemplateFileContents(data, './demo/index.md');
138
+ // formatTemplateFileContents(data, './demo/index.md');
139
+ auroLibraryUtils.formatFileContents(data, './demo/index.md');
139
140
  });
140
141
  } else {
141
142
  console.log('ERROR: ./demo/index.md file is missing');
@@ -147,7 +148,7 @@ function processDemo() {
147
148
  outputDir: './demo'
148
149
  };
149
150
 
150
- const markdownPath = path.join(__dirname, '../docs/partials/index.md');
151
+ const markdownPath = path.join(__dirname, './../../../../../docs/partials/index.md');
151
152
 
152
153
  markdownMagic(markdownPath, configDemo, callback);
153
154
  }
@@ -172,7 +173,7 @@ function processApiExamples() {
172
173
  outputDir: './demo'
173
174
  };
174
175
 
175
- const markdownPath = path.join(__dirname, '../docs/partials/api.md');
176
+ const markdownPath = path.join(__dirname, './../../../../../docs/partials/api.md');
176
177
 
177
178
  markdownMagic(markdownPath, config, callback);
178
179
  }
@@ -128,7 +128,6 @@ export default class AuroLibraryUtils {
128
128
  packageJson = JSON.parse(packageJson);
129
129
 
130
130
  const pName = packageJson.name;
131
-
132
131
  const npmStart = pName.indexOf('@');
133
132
  const namespaceStart = pName.indexOf('/');
134
133
  const nameStart = pName.indexOf('-');
@@ -141,7 +140,10 @@ export default class AuroLibraryUtils {
141
140
  'namespaceCap': pName.substring(namespaceStart + 1)[0].toUpperCase() + pName.substring(namespaceStart + 2, nameStart),
142
141
  'name': pName.substring(nameStart + 1),
143
142
  'nameCap': pName.substring(nameStart + 1)[0].toUpperCase() + pName.substring(nameStart + 2),
144
- 'version': packageJson.version
143
+ 'version': packageJson.version,
144
+ 'tokensVersion': packageJson.peerDependencies['\@aurodesignsystem/design-tokens'].substring(1),
145
+ 'wcssVersion': packageJson.peerDependencies['\@aurodesignsystem/webcorestylesheets'].substring(1)
146
+
145
147
  };
146
148
  }
147
149