Browse Source

Iteration on setup wiz

pull/1191/head
jlukic 10 years ago
parent
commit
368d6c5afd
7 changed files with 222 additions and 0 deletions
  1. 20
      semantic.json
  2. 12
      tasks/banner.js
  3. 20
      tasks/comments.js
  4. 21
      tasks/defaults.js
  5. 8
      tasks/log.js
  6. 102
      tasks/questions.js
  7. 39
      tasks/settings.js

20
semantic.json

@ -0,0 +1,20 @@
{
"base": "",
"paths": {
"source": {
"config" : "src/semantic.config",
"definitions" : "src/definitions/",
"site" : "src/site/",
"themes" : "src/themes/"
},
"output": {
"packaged" : "dist/",
"uncompressed" : "dist/components/",
"compressed" : "dist/components/",
"themes" : "dist/themes"
},
"clean" : "dist/"
}
}

12
tasks/banner.js

@ -0,0 +1,12 @@
module.exports = ''
+ ' /*' + '\n'
+ ' * # <%= package.title %>' + '\n'
+ ' * <%= package.repository.url %>' + '\n'
+ ' *' + '\n'
+ ' *' + '\n'
+ ' * Copyright 2014 Contributors' + '\n'
+ ' * Released under the MIT license' + '\n'
+ ' * http://opensource.org/licenses/MIT' + '\n'
+ ' *' + '\n'
+ ' */' + '\n'
;

20
tasks/comments.js

@ -0,0 +1,20 @@
module.exports = {
// remove variable comments from css
variables : {
in : /\/\*[\s\S]+\/\* End Config \*\//m,
out : '',
},
// adds spacing around comments
large: {
in : /(\/\*\*\*\*[\s\S]+?\*\/)/mg,
out : '\n\n$1\n'
},
small: {
in : /(\/\*---[\s\S]+?\*\/)/mg,
out : '\n$1\n'
},
tiny: {
in : /(\/\* [\s\S]+? \*\/)/mg,
out : '\n$1'
}
};

21
tasks/defaults.js

@ -0,0 +1,21 @@
/*******************************
Default Paths
*******************************/
module.exports = {
paths: {
source: {
config : 'src/',
definitions : 'src/',
site : 'src/',
themes : 'src/'
},
output: {
packaged : 'dist/',
uncompressed : 'dist/components/',
compressed : 'dist/components/',
themes : 'dist/themes'
},
clean : 'dist/'
}
};

8
tasks/log.js

@ -0,0 +1,8 @@
module.exports = {
created: function(file) {
return "Created: " + file;
},
modified: function(file) {
return "Modified: " + file;
}
};

102
tasks/questions.js

@ -0,0 +1,102 @@
/*******************************
Set-up Questions
*******************************/
var defaults = require('./defaults');
module.exports = {
setup: [
{
type: 'list',
name: 'install',
message: 'First run: Set-up Semantic UI',
choices: [
'Automatic (Use defaults locations and all packages)',
'Express (Set components and output folder)',
'Custom (Customize all config values)'
]
},
{
type: 'input',
name: 'site',
message: 'Where should we put your site folder?',
default: defaults.paths.source.site
},
{
type: 'input',
name: 'config',
message: 'Where should we put your semantic.config file?',
default: defaults.paths.source.config
},
{
type: 'input',
name: 'dest',
message: 'Where should we compile semantic to?',
default: defaults.paths.output.packaged
},
{
type: 'input',
name: 'dest',
message: 'Where should we output compressed components?',
default: defaults.paths.output.compressed
},
{
type: 'input',
name: 'dest',
message: 'Where should we output uncompressed components?',
default: defaults.paths.output.uncompressed
},
{
type: 'checkbox',
name: 'components',
message: 'What components should we include in the package? (Toggle with spacebar)',
choices: [
{name: "Button", checked: true },
{name: "Divider", checked: true },
{name: "Flag", checked: true },
{name: "Header", checked: true },
{name: "Icon", checked: true },
{name: "Image", checked: true },
{name: "Input", checked: true },
{name: "Label", checked: true },
{name: "List", checked: true },
{name: "Loader", checked: true },
{name: "Rail", checked: true },
{name: "Reveal", checked: true },
{name: "Segment", checked: true },
{name: "Step", checked: true },
{name: "Breadcrumb", checked: true },
{name: "Form", checked: true },
{name: "Grid", checked: true },
{name: "Menu", checked: true },
{name: "Message", checked: true },
{name: "Table", checked: true },
{name: "Card", checked: true },
{name: "Comment", checked: true },
{name: "Feed", checked: true },
{name: "Item", checked: true },
{name: "Statistic", checked: true },
{name: "Accordion", checked: true },
{name: "Checkbox", checked: true },
{name: "Dimmer", checked: true },
{name: "Dropdown", checked: true },
{name: "Modal", checked: true },
{name: "Nag", checked: true },
{name: "Popup", checked: true },
{name: "Progress", checked: true },
{name: "Rating", checked: true },
{name: "Search", checked: true },
{name: "Shape", checked: true },
{name: "Sidebar", checked: true },
{name: "Sticky", checked: true },
{name: "Tab", checked: true },
{name: "Transition", checked: true },
{name: "Video", checked: true },
{name: "Api", checked: true },
{name: "Form ", checked: true }
]
}
]
};

39
tasks/settings.js

@ -0,0 +1,39 @@
var package = require('../package.json');
module.export = {
del: {
silent: true
},
minify: {
processImport: false,
keepSpecialComments: 0
},
uglify: {
mangle: true
},
prefix: {
browsers: [
"last 2 version",
"> 1%",
"opera 12.1",
"safari 6",
"ie 9",
"bb 10",
"android 4"
]
},
header: {
package: package
},
sourcemap: {
includeContent: true,
sourceRoot: '/src'
},
minJS: {
extname: '.min.js'
},
minCSS: {
extname: '.min.css'
}
};
Loading…
Cancel
Save