Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

button: add support to display version in element #115

Merged
merged 1 commit into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/testPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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/",
Expand Down Expand Up @@ -151,7 +152,8 @@
{
"assets": [
"./CHANGELOG.md",
"package.json"
"package.json",
"src/version.js"
]
}
],
Expand Down
5 changes: 5 additions & 0 deletions scripts/postCss.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
5 changes: 5 additions & 0 deletions scripts/prepForBuild.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
5 changes: 5 additions & 0 deletions scripts/removeNonRemPlugin.js
Original file line number Diff line number Diff line change
@@ -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-]*$/;
Expand Down
5 changes: 5 additions & 0 deletions scripts/staticStyles-template.js
Original file line number Diff line number Diff line change
@@ -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 %>`;
12 changes: 12 additions & 0 deletions scripts/version.js
Original file line number Diff line number Diff line change
@@ -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`)
2 changes: 2 additions & 0 deletions src/auro-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`<auro-loader pulse></auro-loader>` : undefined)}
Expand Down
1 change: 1 addition & 0 deletions src/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default '6.2.0'