Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into freeman-closed-complete
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackbaud-SteveBrush authored Jan 10, 2018
2 parents 3beb4ef + f04cff1 commit 32c36a2
Show file tree
Hide file tree
Showing 280 changed files with 3,600 additions and 2,186 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ before_install:

- npm install -g @blackbaud/skyux-cli
- export SAVAGE_BRANCH="^savage-"
- chmod +x ./scripts/build-packages.sh
- chmod +x ./scripts/travis-script-build.sh
- chmod +x ./scripts/travis-script-coverage.sh
- chmod +x ./scripts/travis-script-deploy.sh
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 2.6.0 (2017-01-04)

- Added demo components module to enable demo components to be consumed outside this project. This is to enable future refactoring of documentation into a separate repo. [#1350](https://github.com/blackbaud/skyux2/pull/1350)

# 2.5.0 (2017-12-15)

- Added URL validation directive. [#1334](https://github.com/blackbaud/skyux2/pull/1334) (Thanks @Blackbaud-JeffDye)
- Updated confirmation component API and event arguments. [#1333](https://github.com/blackbaud/skyux2/pull/1333)
- Accessibility is now checked by default during visual tests. [#1313](https://github.com/blackbaud/skyux2/pull/1313)

# 2.4.1 (2017-11-28)

- Fixed missing files in published package. [#1315](https://github.com/blackbaud/skyux2/pull/1315)
Expand Down
25 changes: 3 additions & 22 deletions config/rollup/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,15 @@
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import shared from './shared';

export default {
entry: '../../dist/core.js',
dest: '../../dist/bundles/core.umd.js',
format: 'umd',
moduleName: 'skyux.core',
context: 'this',
globals: {
'@angular/common': 'ng.common',
'@angular/compiler': 'ng.compiler',
'@angular/core': 'ng.core',
'@angular/forms': 'ng.forms',
'@angular/router': 'ng.router',
'ng2-dragula/ng2-dragula': 'ng2.dragula',
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',
'@angular/platform-browser': 'ng.platformBrowser',
'moment': 'moment'
},
external: [
'@angular/core',
'@angular/common',
'@angular/compiler',
'@angular/forms',
'@angular/router',
'@angular/platform-browser',
'@angular/platform-browser-dynamic',
'ng2-dragula/ng2-dragula',
'moment/moment'
],
globals: shared.globals,
external: shared.external,
plugins: [
nodeResolve(),
commonjs()
Expand Down
17 changes: 17 additions & 0 deletions config/rollup/rollup.demo.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import shared from './shared';

export default {
entry: '../../dist/demo.js',
dest: '../../dist/bundles/demo.umd.js',
format: 'umd',
moduleName: 'skyux.demo',
context: 'this',
globals: shared.globals,
external: shared.external,
plugins: [
nodeResolve(),
commonjs()
]
};
9 changes: 9 additions & 0 deletions config/rollup/rollup.demo.min.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import rollupConfig from './rollup.config.js';
import uglify from 'rollup-plugin-uglify';

var minConfig = rollupConfig;

minConfig.dest = '../../dist/bundles/demo.umd.min.js';
minConfig.plugins.push(uglify());

export default minConfig;
24 changes: 24 additions & 0 deletions config/rollup/shared.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export default {
globals: {
'@angular/common': 'ng.common',
'@angular/compiler': 'ng.compiler',
'@angular/core': 'ng.core',
'@angular/forms': 'ng.forms',
'@angular/router': 'ng.router',
'ng2-dragula/ng2-dragula': 'ng2.dragula',
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',
'@angular/platform-browser': 'ng.platformBrowser',
'moment': 'moment'
},
external: [
'@angular/core',
'@angular/common',
'@angular/compiler',
'@angular/forms',
'@angular/router',
'@angular/platform-browser',
'@angular/platform-browser-dynamic',
'ng2-dragula/ng2-dragula',
'moment/moment'
]
};
119 changes: 65 additions & 54 deletions config/utils/stage-ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ function writeTSConfig() {
"baseUrl": "."
},
"files": [
"core.ts"
"core.ts",
"demo.ts"
],
"exclude": [
"../node_modules"
Expand All @@ -67,34 +68,41 @@ function copySrc() {
}

function escapeContents(contents) {
return contents.toString().replace(/`/g, '\\`');
return contents.toString()
.replace(/`/g, '\`')
.replace(/\+/g, '+')
.replace(/\$/g, '$');
}

function compileSass(file) {
var contents = sass.renderSync({
file: file,
importer: tildeImporter,
let contents = '';

try {
contents = sass.renderSync({
file: file,
importer: tildeImporter,
outputStyle: 'compressed'
}).css;
} catch (e) {
console.log(e.message);
}

outputStyle: 'compressed'
}).css;

return contents;
}

function getHtmlContents(requireFile) {
var encodedHtml,
encodedTs,
fileContents,
fileSuffix = '.demo.html',
tsFileContents;
function getRawContents(requireFile) {
let fileContents = '';

fileContents = fs.readFileSync(requireFile).toString();
try {
fileContents = fs.readFileSync(requireFile).toString();
} catch (e) {}

return fileContents;
}

function getJsonContents(requireFile) {
var fileContents,
var fileContents = '',
newFileFirst,
newFileLast,
loaderIndex = requireFile.indexOf('json-loader!'),
Expand All @@ -106,9 +114,7 @@ function getJsonContents(requireFile) {
newFileName = newFileFirst + newFileLast;
}

fileContents = fs.readFileSync(newFileName);

return fileContents;
return getRawContents(newFileName);
}

function inlineContents(file, fileContents, requireMatch, requireFile, processFn) {
Expand All @@ -117,13 +123,17 @@ function inlineContents(file, fileContents, requireMatch, requireFile, processFn
requireContents;

requireFile = path.join(dirname, requireFile);
requireFile = requireFile.replace('!!raw-loader!', '');

switch (path.extname(requireFile)) {
case '.scss':
requireContents = compileSass(requireFile);
break;
case '.ts':
requireContents = escapeContents(getRawContents(requireFile));
break;
case '.html':
requireContents = getHtmlContents(requireFile);
requireContents = getRawContents(requireFile);
break;
case '.json':
requireContents = getJsonContents(requireFile);
Expand All @@ -140,25 +150,24 @@ function inlineContents(file, fileContents, requireMatch, requireFile, processFn
requireContents = processFn(requireContents);
}

fileContents = fileContents.replace(requireMatch, requireContents);
if (requireContents) {
fileContents = fileContents.replace(requireMatch, requireContents);
}

return fileContents;
}

function inlineHtmlCss() {
function injectRequiredFileContents() {
var files = glob.sync(TEMP_PATH + '/**/*.ts');

files.forEach(function (file) {
var fileContents,
var fileContents = '',
matches,
regex = /require\('(.+?\.(html|json|scss))'\)/gi;
regex = /require\('(.+?\.(html|json|scss|ts))'\)/gi;

fileContents = fs.readFileSync(
file,
{
encoding: 'utf8'
}
);
try {
fileContents = fs.readFileSync(file, { encoding: 'utf8' });
} catch (e) { }

while (matches = regex.exec(fileContents)) {
fileContents = inlineContents(file, fileContents, matches[0], matches[1]);
Expand All @@ -169,30 +178,33 @@ function inlineHtmlCss() {
regex.lastIndex = 0;
}

while (matches = /templateUrl\:\s*'(.+?\.html)'/gi.exec(fileContents)) {
fileContents = inlineContents(
file,
fileContents,
matches[0],
matches[1],
(requireContents) => {
return `template: ${requireContents}`
}
);
regex.lastIndex = 0;
}
// Don't replace raw typescript file contents from demos.
if (!/demo\.service\.ts$/.test(file)) {
while (matches = /templateUrl\:\s*'(.+?\.html)'/gi.exec(fileContents)) {
fileContents = inlineContents(
file,
fileContents,
matches[0],
matches[1],
(requireContents) => {
return `template: ${requireContents}`
}
);
regex.lastIndex = 0;
}

while (matches = /styleUrls\:\s*\[\s*'(.+?\.scss)']/gi.exec(fileContents)) {
fileContents = inlineContents(
file,
fileContents,
matches[0],
matches[1],
(requireContents) => {
return `styles: [${requireContents}]`
}
);
regex.lastIndex = 0;
while (matches = /styleUrls\:\s*\[\s*'(.+?\.scss)']/gi.exec(fileContents)) {
fileContents = inlineContents(
file,
fileContents,
matches[0],
matches[1],
(requireContents) => {
return `styles: [${requireContents}]`
}
);
regex.lastIndex = 0;
}
}

fs.writeFileSync(
Expand All @@ -206,5 +218,4 @@ function inlineHtmlCss() {
}

copySrc();
inlineHtmlCss();

injectRequiredFileContents();
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blackbaud/skyux",
"version": "2.4.1",
"version": "2.6.0",
"description": "SKY UX built on Angular 2",
"author": "Blackbaud, Inc.",
"homepage": "https://github.com/blackbaud/skyux2",
Expand All @@ -10,8 +10,7 @@
"dist"
],
"scripts": {
"build": "npm run clean:srctemp && node config/utils/stage-ts.js && cd .srctemp && ngc && cd ../ && npm run compile:sass && npm run copy:design-tokens && cd config/rollup && rollup -c rollup.config.js && rollup -c rollup.min.config.js && npm run clean:srctemp",
"build:skyux": "skyux build --output-keep-alive",
"build": "bash ./scripts/build-packages.sh",
"ci": "npm run lint && npm run test:ci",
"clean": "rimraf -- dist",
"clean:full": "npm cache clean && rimraf -- node_modules doc coverage dist .srctemp webdriver-screenshotslocal webdriver-screenshotslocal-diffs skyux-spa-visual-tests/node_modules/ skyux-spa-visual-tests/dist/",
Expand Down
16 changes: 16 additions & 0 deletions scripts/build-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Fail the build if this step fails
set -e

npm run clean:srctemp
node config/utils/stage-ts.js
cd .srctemp
ngc
cd ../
npm run compile:sass
npm run copy:design-tokens
cd config/rollup
rollup -c rollup.config.js
rollup -c rollup.min.config.js
rollup -c rollup.demo.config.js
rollup -c rollup.demo.min.config.js
npm run clean:srctemp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion skyux-spa-visual-tests/skyuxconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"a11y": {
"rules": {
"bypass": { "enabled": false },
"color-contrast": { "enabled": false }
"color-contrast": { "enabled": false },
"landmark-one-main": { "enabled": false }
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<button
type="button"
class="sky-btn sky-btn-primary sky-confirm-btn-ok"
(click)="openOKConfirm()">
OK confirm
</button>

<button
type="button"
class="sky-btn sky-btn-primary sky-confirm-btn-yescancel"
(click)="openYesCancelConfirm()">
Yes/cancel confirm
</button>

<button
type="button"
class="sky-btn sky-btn-primary sky-confirm-btn-yesnocancel"
(click)="openYesNoCancelConfirm()">
Yes/no/cancel confirm
</button>

<button
type="button"
class="sky-btn sky-btn-primary sky-confirm-btn-custom"
(click)="openCustomConfirm()">
Custom confirm
</button>
Loading

0 comments on commit 32c36a2

Please sign in to comment.