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

Rename Stache to SKY Pages #1

Merged
merged 1 commit into from
Aug 31, 2016
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
39 changes: 39 additions & 0 deletions .gitignore
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/
94 changes: 94 additions & 0 deletions config/webpack.config.js
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;
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare var SKY_PAGES: any;
8 changes: 8 additions & 0 deletions index.js
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);
}
};
49 changes: 49 additions & 0 deletions package.json
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"
}
}
15 changes: 15 additions & 0 deletions sky-pages-asset-loader/index.js
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;
}
Loading