-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
138 additions
and
107 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 |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
/.eslintcache | ||
|
||
/example/dist | ||
/example/node_modules | ||
/example/package-lock.json |
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 @@ | ||
#!/usr/bin/env node | ||
"use strict"; | ||
|
||
let faucet = require("faucet-pipeline-core"); | ||
let parseCLI = require("../lib/cli"); | ||
|
||
let { referenceDir, config, options } = parseCLI(); | ||
faucet(referenceDir, config, options); |
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
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
{ | ||
"scripts": { | ||
"start": "aiur --watch", | ||
"compile": "aiur --fingerprint --compact" | ||
}, | ||
"dependencies": { | ||
"aiur": "..", | ||
"prismjs": "^1.15.0" | ||
} | ||
} |
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,90 @@ | ||
let { abort } = require("faucet-pipeline-core/lib/util"); | ||
let parseArgs = require("minimist"); | ||
let aiur = require("."); | ||
|
||
let HELP = ` | ||
Usage: | ||
$ aiur [options] | ||
Options: | ||
-h, --help | ||
display this help message | ||
-w, --watch | ||
monitor the file system for changes to recompile automatically | ||
-s, --source | ||
aiur configuration file (default: ./aiur.config.js) | ||
-t, --target | ||
put the generated files here (default: ./dist) | ||
--fingerprint | ||
add unique hash to file names | ||
--sourcemaps | ||
generate source maps (where supported) | ||
--compact | ||
reduce output size (where supported) | ||
`.trim(); | ||
|
||
module.exports = function parseCLI(argv = process.argv.slice(2), help = HELP) { | ||
argv = parseArgs(argv, { | ||
boolean: ["watch", "fingerprint", "sourcemaps", "compact"], | ||
alias: { | ||
s: "source", | ||
t: "target", | ||
w: "watch", | ||
h: "help" | ||
}, | ||
default: { | ||
source: "./aiur.config.js", | ||
target: "./dist" | ||
} | ||
}); | ||
|
||
if(argv.help) { | ||
abort(help, 0); | ||
} | ||
|
||
if(argv.watch && argv.fingerprint) { // for convenience | ||
console.error("you might consider disabling fingerprinting in watch " + | ||
"mode to avoid littering your file system with obsolete bundles"); | ||
} | ||
|
||
let { source, target } = argv; | ||
// TODO: allow users to overwrite this in a custom faucet.config.js | ||
let baseURI = "/"; | ||
let config = { | ||
aiur: [{ | ||
source, | ||
target, | ||
baseURI | ||
}], | ||
|
||
// TODO: make this configurable | ||
sass: [{ | ||
source: "aiur/lib/style.scss", | ||
target: `${target}/style.css` | ||
}], | ||
|
||
// TODO: allow users to overwrite this in a custom faucet.config.js | ||
watchDirs: [source, "./components"], | ||
|
||
manifest: { | ||
baseURI, | ||
webRoot: target | ||
}, | ||
|
||
plugins: { | ||
aiur: { | ||
plugin: aiur, | ||
bucket: "markup" | ||
} | ||
} | ||
}; | ||
|
||
let options = { | ||
watch: argv.watch, | ||
fingerprint: argv.fingerprint, | ||
sourcemaps: argv.sourcemaps, | ||
compact: argv.compact | ||
}; | ||
|
||
return { referenceDir: process.cwd(), config, options }; | ||
}; |
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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
"use strict"; | ||
|
||
module.exports = { | ||
exports.pages = { | ||
"": "./welcome.md", | ||
atoms: { | ||
file: "./atoms.md", | ||
|
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
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
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