@aurodesignsystem/auro-library 3.0.6 → 3.0.7
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
|
+
## [3.0.7](https://github.com/AlaskaAirlines/auro-library/compare/v3.0.6...v3.0.7) (2025-01-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Performance Improvements
|
|
7
|
+
|
|
8
|
+
* add ability to pass custom env variables [#103](https://github.com/AlaskaAirlines/auro-library/issues/103) ([fab4c8e](https://github.com/AlaskaAirlines/auro-library/commit/fab4c8e10cab475426b3ed5dfe6db7e9ac99f07c))
|
|
9
|
+
|
|
3
10
|
## [3.0.6](https://github.com/AlaskaAirlines/auro-library/compare/v3.0.5...v3.0.6) (2025-01-02)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED
|
@@ -70,9 +70,10 @@ export class AuroTemplateFiller {
|
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* @param {string} template - The string to use to run variable replacement
|
|
73
|
+
* @param {object} extraVars - Additional variables to use in the template
|
|
73
74
|
* @return {string}
|
|
74
75
|
*/
|
|
75
|
-
replaceTemplateValues(template) {
|
|
76
|
+
replaceTemplateValues(template, extraVars = {}) {
|
|
76
77
|
const compileResult = Handlebars.compile(template);
|
|
77
78
|
|
|
78
79
|
// replace all handlebars placeholders FIRST, then apply legacy replacements
|
|
@@ -84,7 +85,8 @@ export class AuroTemplateFiller {
|
|
|
84
85
|
Namespace: this.values.namespaceCap,
|
|
85
86
|
Version: this.values.version,
|
|
86
87
|
dtVersion: this.values.tokensVersion,
|
|
87
|
-
wcssVersion: this.values.wcssVersion
|
|
88
|
+
wcssVersion: this.values.wcssVersion,
|
|
89
|
+
...extraVars
|
|
88
90
|
}, {
|
|
89
91
|
helpers: {
|
|
90
92
|
'capitalize': (str) => str.charAt(0).toUpperCase() + str.slice(1),
|
|
@@ -154,6 +154,7 @@ export function generateReadmeUrl(branchOrTag = 'master', variantOverride = '')
|
|
|
154
154
|
* @property {Partial<MarkdownMagicOptions>} [mdMagicConfig] - extra configuration options for md magic
|
|
155
155
|
* @property {Array<(contents: string) => string>} [preProcessors] - extra processor functions to run on content AFTER markdownmagic and BEFORE templateFiller
|
|
156
156
|
* @property {Array<(contents: string) => string>} [postProcessors] - extra processor functions to run on content
|
|
157
|
+
* @property {object} [extraVars] - extra variables to use in the template
|
|
157
158
|
*/
|
|
158
159
|
|
|
159
160
|
|
|
@@ -222,7 +223,7 @@ export async function optionallyCopyFile(input, output, overwrite = true) {
|
|
|
222
223
|
* @param {FileProcessorConfig} config - the config for this file
|
|
223
224
|
*/
|
|
224
225
|
export async function processContentForFile(config) {
|
|
225
|
-
const { input: rawInput, output, mdMagicConfig } = config
|
|
226
|
+
const { input: rawInput, output, mdMagicConfig, extraVars = {} } = config
|
|
226
227
|
|
|
227
228
|
// Helper vars
|
|
228
229
|
const derivedInputPath = typeof rawInput === 'string' ? rawInput : rawInput.fileName;
|
|
@@ -253,7 +254,7 @@ export async function processContentForFile(config) {
|
|
|
253
254
|
}
|
|
254
255
|
|
|
255
256
|
// 3c. Replace template variables in output file
|
|
256
|
-
fileContents = templateFiller.replaceTemplateValues(fileContents);
|
|
257
|
+
fileContents = templateFiller.replaceTemplateValues(fileContents, extraVars);
|
|
257
258
|
|
|
258
259
|
// 3d. Run any post-processors
|
|
259
260
|
if (config.postProcessors) {
|