This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from blackbaud/rename-sky-pages
Rename Stache to SKY Pages
- Loading branch information
Showing
19 changed files
with
534 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
typings/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
|
||
/** | ||
* Called when loaded via require. | ||
* @name getExports | ||
* @param {SkyPagesConfig} skyPagesConfig | ||
* @returns {WebpackConfig} webpackConfig | ||
*/ | ||
const getExports = (skyPagesConfig) => { | ||
|
||
const extractCSS = new ExtractTextPlugin('stylesheets/[name].[hash].css') | ||
const assetLoader = path.resolve(__dirname, '..', 'sky-pages-asset-loader'); | ||
const moduleLoader = path.resolve(__dirname, '..', 'sky-pages-module-loader'); | ||
const resolves = [ | ||
path.join(__dirname, '..'), | ||
path.join(__dirname, '..', 'node_modules') | ||
]; | ||
|
||
return { | ||
entry: { | ||
polyfills: [path.resolve(__dirname, '..', 'src', 'polyfills.ts')], | ||
vendor: [path.resolve(__dirname, '..', 'src', 'vendor.ts')], | ||
app: [path.resolve(__dirname, '..', 'src', 'main.ts')] | ||
}, | ||
output: { | ||
path: path.join(process.cwd(), 'dist') | ||
}, | ||
resolveLoader: { | ||
root: resolves | ||
}, | ||
resolve: { | ||
root: resolves, | ||
extensions: [ | ||
'', | ||
'.js', | ||
'.ts' | ||
], | ||
}, | ||
module: { | ||
preLoaders: [ | ||
{ | ||
test: /sky-pages\.module\.ts$/, | ||
loader: moduleLoader | ||
}, | ||
{ | ||
test: /app\.component\.html$/, | ||
loader: assetLoader, | ||
query: { | ||
key: 'appComponentTemplate' | ||
} | ||
}, | ||
{ | ||
test: /app\.component\.scss$/, | ||
loader: assetLoader, | ||
query: { | ||
key: 'appComponentStyles' | ||
} | ||
} | ||
], | ||
loaders: [ | ||
{ | ||
test: /\.ts$/, | ||
loaders: [ | ||
'ts-loader?silent=true', | ||
'angular2-template-loader' | ||
] | ||
}, | ||
{ | ||
test: /\.s?css$/, | ||
loader: 'raw-loader!sass-loader' | ||
}, | ||
{ | ||
test: /\.html$/, | ||
loader: 'raw-loader' | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new webpack.optimize.CommonsChunkPlugin({ | ||
name: ['app', 'vendor', 'polyfills'] | ||
}), | ||
new HtmlWebpackPlugin({ | ||
template: path.resolve(__dirname, '..', 'src', 'index.html') | ||
}), | ||
extractCSS | ||
] | ||
}; | ||
}; | ||
|
||
// Expose to require | ||
module.exports = getExports; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare var SKY_PAGES: any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
getSkyPagesConfig: () => { | ||
return require('./sky-pages.json'); | ||
}, | ||
getWebpackConfig: (skyPagesConfig) => { | ||
return require('./config/webpack.config')(skyPagesConfig); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "blackbaud-sky-pages-out-skyux2", | ||
"version": "0.0.1", | ||
"description": "SKY Pages output for skyux2.", | ||
"main": "index.js", | ||
"scripts": { | ||
"postinstall": "typings -- install", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/blackbaud/sky-pages-out-skyux2.git" | ||
}, | ||
"keywords": [], | ||
"author": "Blackbaud", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/blackbaud/sky-pages-out-skyux2/issues" | ||
}, | ||
"homepage": "https://github.com/blackbaud/sky-pages-out-skyux2#readme", | ||
"dependencies": { | ||
"@angular/common": "2.0.0-rc.5", | ||
"@angular/compiler": "2.0.0-rc.5", | ||
"@angular/core": "2.0.0-rc.5", | ||
"@angular/platform-browser": "2.0.0-rc.5", | ||
"@angular/platform-browser-dynamic": "2.0.0-rc.5", | ||
"@angular/router": "3.0.0-rc.1", | ||
"angular2-template-loader": "0.4.0", | ||
"blackbaud-skyux2": "2.0.0-alpha.1", | ||
"blackbaud-sky-pages": "blackbaud/sky-pages", | ||
"codelyzer": "0.0.26", | ||
"core-js": "2.4.1", | ||
"extract-text-webpack-plugin": "1.0.1", | ||
"glob": "7.0.5", | ||
"html-webpack-plugin": "2.22.0", | ||
"node-sass": "3.8.0", | ||
"raw-loader": "0.5.1", | ||
"reflect-metadata": "0.1.3", | ||
"rxjs": "5.0.0-beta.6", | ||
"sass-loader": "^4.0.0", | ||
"style-loader": "0.13.1", | ||
"ts-helpers": "1.1.1", | ||
"ts-loader": "0.8.2", | ||
"typescript": "1.8.10", | ||
"typings": "1.3.2", | ||
"webpack": "1.13.1", | ||
"zone.js": "0.6.12" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
const loaderUtils = require('loader-utils'); | ||
|
||
module.exports = function(source) { | ||
const query = loaderUtils.parseQuery(this.query); | ||
const assets = this.options.SKY_PAGES.assets; | ||
|
||
if (assets && query.key && assets[query.key] && assets[query.key].length) { | ||
this.addDependency(assets[query.key][0].path); | ||
source = assets[query.key][0].get(); | ||
} | ||
|
||
return source; | ||
} |
Oops, something went wrong.