diff --git a/.github/workflows/testPublish.yml b/.github/workflows/testPublish.yml index ef56bf7..b858390 100644 --- a/.github/workflows/testPublish.yml +++ b/.github/workflows/testPublish.yml @@ -24,6 +24,7 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm ci + - run: npm run version - run: npm run sassBuild:component - run: npm run postCss:component - run: npm run sassRender @@ -44,6 +45,7 @@ jobs: with: node-version: 14 - run: npm ci + - run: npm run version - run: npm run sassBuild:component - run: npm run postCss:component - run: npm run sassRender diff --git a/package.json b/package.json index f2f45ba..369dc8d 100644 --- a/package.json +++ b/package.json @@ -96,6 +96,7 @@ ], "scripts": { "build": "npm run ciBuild", + "version": "node scripts/version.js", "apiBuild": "wca analyze 'src/auro-button.js' --outFiles docs/api.md", "bundler": "rollup -c", "bundle:test": "rollup -c -w", @@ -113,7 +114,7 @@ "test": "karma start --coverage", "test:watch": "karma start --auto-watch=true --single-run=false", "test:ci": "npm-run-all test lint", - "ciBuild": "npm-run-all sassBuild sassRender cssLint distJS bundler postinstall apiBuild", + "ciBuild": "npm-run-all version sassBuild sassRender cssLint distJS bundler postinstall apiBuild", "sassBuild": "npm-run-all sassBuild:demo sassBuild:component postCss:component sassRender", "sassBuild:dev": "npm-run-all sassBuild:demo sassBuild:component postCss:component sassRender", "sassBuild:demo": "node-sass ./demo/sass/ --output ./demo/css/", @@ -151,7 +152,8 @@ { "assets": [ "./CHANGELOG.md", - "package.json" + "package.json", + "src/version.js" ] } ], diff --git a/scripts/postCss.js b/scripts/postCss.js index 2eaa313..c2d49ca 100644 --- a/scripts/postCss.js +++ b/scripts/postCss.js @@ -1,3 +1,8 @@ +// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license +// See LICENSE in the project root for license information. + +// --------------------------------------------------------------------- + const autoprefixer = require('autoprefixer'); const postcss = require('postcss'); const remToPx = require('postcss-rem-to-pixel'); diff --git a/scripts/prepForBuild.js b/scripts/prepForBuild.js index 947303a..eb2b6b5 100644 --- a/scripts/prepForBuild.js +++ b/scripts/prepForBuild.js @@ -1,3 +1,8 @@ +// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license +// See LICENSE in the project root for license information. + +// --------------------------------------------------------------------- + const fs = require('fs'); const bundle = 'auro-button__bundled.js'; const indexFile = './build/index.html'; diff --git a/scripts/removeNonRemPlugin.js b/scripts/removeNonRemPlugin.js index 27e591a..738b146 100644 --- a/scripts/removeNonRemPlugin.js +++ b/scripts/removeNonRemPlugin.js @@ -1,3 +1,8 @@ +// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license +// See LICENSE in the project root for license information. + +// --------------------------------------------------------------------- + const postcss = require('postcss'); const customPropertyRegExp = /^--[A-z][\w-]*$/; diff --git a/scripts/staticStyles-template.js b/scripts/staticStyles-template.js index 31d2ffa..d6afcd1 100644 --- a/scripts/staticStyles-template.js +++ b/scripts/staticStyles-template.js @@ -1,2 +1,7 @@ +// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license +// See LICENSE in the project root for license information. + +// --------------------------------------------------------------------- + import {css} from 'lit-element'; export default css`<% content %>`; diff --git a/scripts/version.js b/scripts/version.js new file mode 100644 index 0000000..b2a3143 --- /dev/null +++ b/scripts/version.js @@ -0,0 +1,12 @@ +// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license +// See LICENSE in the project root for license information. + +// --------------------------------------------------------------------- + +const fs = require('fs'); +const json = require('../package.json'); +const version = json.version; + +fs.writeFileSync('./src/version.js', `export default '${version}'`); + +console.log(`\nGenerating version v${version} reference file \n`) diff --git a/src/auro-button.js b/src/auro-button.js index 711c731..294f770 100644 --- a/src/auro-button.js +++ b/src/auro-button.js @@ -11,6 +11,7 @@ import styleCss from "./style-css.js"; import styleCssFixed from './style-fixed-css.js'; import '@alaskaairux/auro-loader'; import { isFocusVisibleSupported, isFocusVisiblePolyfillAvailable } from './util'; +import version from './version'; /** * @attr {Boolean} fixed - uses px values instead of rem @@ -146,6 +147,7 @@ class AuroButton extends LitElement { type="${ifDefined(this.type ? this.type : undefined)}" .value="${ifDefined(this.value ? this.value : undefined)}" @click="${() => {}}" + version="${version}" > ${ifDefined(this.svgIconLeft ? this.getIcon(this.svgIconLeft) : undefined)} ${ifDefined(this.loading ? html`` : undefined)} diff --git a/src/version.js b/src/version.js new file mode 100644 index 0000000..bb707e2 --- /dev/null +++ b/src/version.js @@ -0,0 +1 @@ +export default '6.2.0' \ No newline at end of file