Quasars are among the most luminous objects in the universe. Each one greatly outshines the combined output of all the stars in their host galaxies. (For instance, in 2015 astronomers announced they’d found a quasar that shines some 400 trillion times brighter than our sun.)
All large galaxies have giant black holes at their centers, and a quasar forms when one actively starts feeding, pulling in matter like gas and dust. But this stuff doesn’t fall directly into the black hole — it circles around the abyss at ever-increasing speeds while spiraling inward. Eventually, the cosmic food becomes so hot (from friction) that it pours out light before some of it makes its way into the black hole. The object that generates this prodigious amount of light — the black hole and cloud of debris swirling around it — is a quasar.
Quasar is the library that runs quasars, compiles data and debris, and produces a singular document
quasars
are the build taskstemplates
are the before filesdebris
are the global dependencies
Quasars can be large or small, complex or simple, and can include multiple frontend stacks. At the end of the day it is a document generator that takes input data and produces a singular output. That output is something that you might find yourself wanting to build, repeatedly, with either the same data or different data, in a predictably manner, to any destination of your choice. Quasars can support anything from entire websites to singular components used in other websites. Quasar can support JSON document generation and feed itself that JSON to create more JSON or an HTML file. Quasar can support TXT file output if you simply want to have your files ingested by something else. Quasar can deploy your resources to the cloud, or host them directly for testing purposes.
Quasar was built to facilitate the collaboration of different groups to create a singular output, for example: a sales team, a design team, an implementation team, and a QA team; the output of work from one team goes into quasar and becomes an input to the process of delivery on an item for the rest of the teams. In this example: the sales team creates a receipt from a sale, design creates assets from receipt information and provides that information in a new receipt, implementation creates the output from the receipt and assets, and QA tests the final output in a test environment (automated + human verified) and creates final receipt with the information included from all previous teams. The final receipts represent the entire product in it's raw form, and can be rebuilt over and over again. Receipts can be updated as assets change or templates change or the parameters of a sale changes, and rebuilt without having to revisit the entire process all over again. This enables small changes to be made by non-technical people, like: updating an image, updating copy, choosing a different template for the output, or changing the details of the sale.
- install nodejs
- run
yarn install
to install dependencies
- run
bin/cli
to use the cli of quasar - run
bin/watch
to automate jobs using json files in the /json folder - run
bin/web
to run an api and web server with form @ http://localhost:3000
--port=3000
argument to set the port number to run the application on
--runAsDaemon=true
argument to run the web api or watch jobs tasks in the background
--runWebApi=true
argument to run the api @ http://localhost:3000
--watchJobs=true
argument to autoload json files to build quasars
--runWebform=true
to run the webform @ http://localhost:3000
--autoBuildWebForm=true
to build the quasarWebform task on startup
--autoBuildWebApp=true
to build the quasarWebApp task on startup
--reRun=true
to rebuild the last successfully run arguments back through quasar
Useful CLI commands:
bin/dev
will runbin/clean
andbin/buildWebForm
to build a new version of the app thenbin/web
so you can test quasar output from the webform.bin/clean
will delete the outputFolder.bin/cleanOutput
will delete the outputFolder.bin/cleanDev
will delete the local development folders and the dist folder.bin/app
takes the has the following default arguments that you can override the cli with --[arg]=[val] (eg: --runWebApi=true ):
defaultCliArgs = {
port: process.env.PORT,
runOnce: false,
watchJobs: false,
qType: false,
runWebForm: false,
autoBuildWebForm: false,
runWebApi: false }
- there is a
.vscode/launch.json
file in the repository that enables debugging of the application in vscode. You can use the above arguments in your IDE and override any of the above arguments.
- install nodejs
- run
yarn install
to install dependencies
- run
bin/cli
to use the cli of quasar - run
bin/watch
to automate jobs using json files in the /json folder - run
bin/web
to run an api and web server with form @ http://localhost:3000
- run
bin/cli
to run the application as a process, see the Coommand Line Interface section of the documentation for flags that you can use when running the cli as a process.
- Initial release
- This is basically what Quasi should have been, a more simple pipeline. The scope creep of that project really torpedo'd it, but I like the ebb and flow and how it brought me to this point. I could actually see quasar become the underlying engine for Quasi, and Quasi becoming the quasar generation tool.
- This is the biggest set of functionality yet byeond the core, that brings with it a lot of breaking changes to make the core more robust. Heading towards a milestone of "0.5.0 robustness", this version introduces a more complex version of an example quasar, 'quasar-webform' that demonstrates; a precompile method, asset compiling for the html, css, and js files, accompanying files from the templates folder to be bundled as an express application complete with package.json, and other use cases not present in the more simple example, 'page' quasar. This quasar webForm is a client application that runs in the browser with a web api, in addition to the cli, [UNFINISHED]
- Description changed to "a Quick, Usable, And Simple; Application Runtime" to fit the QUASAR acronym.
- This milestone represents a functional usage of quasar in the wild on a daily basis. From nothing to something, this milestone includes the following featureset:
- build pipeline that globs html, js, and css files alongside imported assets and using templating to generate a single html outputFile that can be used as an Single Page Application.
- globbed sources files can be minified on output.
- template sourcefiles can be precompiled from the languages: mustache, sass, jsx into html, css, and javascript respectively.
- application available as a process, a CLI app, an express webForm Application, and an express webApi; from the terminal, independently or concurrently.
- application can be packaged into a multi-platform electron application.
- every feature of the pipeline is available through the CLI which is the core of all functionality wrapped by the API and webForm and electron App.
- Major breaking change which now uses classes for each task, unifying core functionality across all tasks.
- This milestone represents a shift in the direction towards true modularity and abstraction of the core components of the quasar runtime, setting this project up for a future and final refactor before 1.0:
- lib : The static utility methods that stores no knowledge of the objects it manipulates from outside of itself. This library can be shimmed, but is not a class because it shouldn't follow inheritance rules. The core functionality of the runtime lives here. The core functionality could later be refactored into a runtime object that has awareness of
QuasarTasksFactory
and compiles a build pipeline usng them. - api : The programmable interface to the core library. This could be refactored in the future to; take all of the functionality out of this file and put it into the runtime, include only passthrough methods for the runtime and lib.
- cli : The orchestrator of the core library and api together. This could be refactored in the future to; take all of the functionality out of this file and put it into the runtime, be an orchestrator that is command based which uses the runtime.
- config : The configuration object that is used with each
QuasarTask
and in the core library. This object contains absolute paths to environment files and folders. - electron : The electron wrapper around the cli and api for running an electron application for the
quasarWebform
orquasarWebapp
. - task : The base class for each
QuasarTask
which contains core functionality of a task that is run by the runtime (or build pipeline).
- lib : The static utility methods that stores no knowledge of the objects it manipulates from outside of itself. This library can be shimmed, but is not a class because it shouldn't follow inheritance rules. The core functionality of the runtime lives here. The core functionality could later be refactored into a runtime object that has awareness of
- Another breaking change, as now the core modules have been reorganized into their final v1.0.0 states. The functionality of these core modules are now locked and this version is the basis of what will become the contract with consumers. The API will evolve from here to include different use cases of the runtime as methods and will not include methods of the library directly.
- The core modules:
- lib : The abstracted utility methods of the runtime live here.
- runtime : the build pipeline that processes
QuasarTask
s. - api : The programmable interface to the core library and runtime.
- cli : The orchestrator of the api and runtime.
- web : the express application that takes POST requests and serves the
quasarWebform
orquasarWebapp
. - config : The configuration object that is used with each
QuasarTask
to load lib methods. - task : The base class for each
QuasarTask
that is processed by the runtime. - electron : The electron wrapper around the cli and api for running an electron application for the
quasarWebform
orquasarWebapp
.
- The
QuasarApi
class functionality is now purely defined within the class and each method of the runtime is overloaded 1:1. Documentation of the API is available to built using theapi-docs
quasar on the scripts folder and exists in theabout/scripts.md
file. The API offers the following quasar build pipeline functionality to be used by quasars:- load and run quasars
- log information with quasar for debugging and progress reporting
- clean (delete) public and build folders
- move files between quasar temporary build and public folders
- compile assets into singular file within assets folder to be used in the outputFile
- inject debris, required, and included files within the template files
- download and unpack source files to assets folder
- output to HTML, JSON, and TXT file pipeline methods
- upload outputFiles to S3 and Dropbox
-
Quasar Runtime and web interface is complete for the original roadmap:
- Upload to AWS buckets
- Express based web UI with live preview for quasar building
- Asset compiler and bundler
- Builder packaged as an electron application
- Asset mutation on output (minification, tree shaking, code splitting, uglification)
- Command line interface and bin files for local use of the runtime
- Application Programmable Interface for use in production applicaitons as a build utility
- Web Form interface to run quasars in a browser with a simple menu and form which use the API
- SAAS application suite for all things Quasar including plugins that consume the API and middleware that uses the core modules.
-
Version 1 lifecycle:
- Locked functionality across runtime and API. No new runtime methods. No new
QuasarTask
methods, no new external lib methods. - Contract with consuming developers locked at version 1 of
QuasarTask
base methods and fields. - No refactors of the architecture or core modules allowed.
- Version will see minor and patch updates for as long as the code is being used in production environments.
- Locked functionality across runtime and API. No new runtime methods. No new
Web components should be isolated, self-contained, modular, consistent, pluggable, injectable, renderable, updatable, and testable. These things mean different, but separate, solutions for different people - but those differences between developers shouldn't hold hostage the stack and course of development in order to accomplish small website features and frontend solutions for larger applications. Data layer interactions, state management, api interactions, and the setup and teardown of components shouldn't be handled by the components themselves; this is a given.
To think that language, stack, or framework used to create a component should also dictate the implementation of the stack is limiting as well. As long as you know how to get access to the data, can make api interactions from a common core, be able to attach to global events, and have your render managed externally then you should be enabled to implement your component however you see fit. With the advent of transpilers like Babel and compilers like Sass, in addition to tools that do minification and tree shaking and code splitting, we can do a lot more to support the wide range of developer experience and comfort with different stacks and tools to build their frontends.
The architecture of view and view model separated by how data is stored and retrieved and how the combination of the two is rendered has always been littered with business rules and data processing before and after long term storage retrieval. There must be a way to separate business rules from the process of rendering and using data as we have been able to separate view from model.
Quasar is much like webpack or browserify in that it compiles code into a singular output from various resources. However, what Quasar does differently than these packages is that it provides a server for real-time rendering of templated code into singular outputs from templates developed in any sort of architecture. Quasar has no front end dependencies outside of the templates allowing developers of templates to define the stack and the user to simply input data into each build. The "build process" for quasar was my original reason for calling this a runtime and it was originally built on top of an express application using an HTML webform. The build process in Quasar comprises the following steps:
Run
Validate Required Input Arguments from the input [receipt]
Copy files from sources [local, web]
Setting additional arguments from the input using the source files [.zip files]
Injecting code associated with the template [debris]
Injecting data into the template [arguments]
Compiling all js, css, and html elements into a singular text based output [template assets]
Uploading files to the cloud [aws s3, dropbox, google]
Deploying code to endpoint [google ad manager, placements]
End
Each Quasar, a type of middleware, has a build task file and a template folder associated with it. Quasar loads these files and uses some data, like defined arguments for template data, from these files to build the webform and webapp which serve as a user interface to create Quasar build jobs. This runtime was originally developed as an express web application which uses gulp to watch a local filesystem folder for new job files (.json) created by the web api endpoint which receives the receipts as json data. The Quasar Webform and Webapp are also generated by Quasar and I have developed those two stacks on React, which can be generated on the fly when starting up the web api which serves the form (on localhost:3000).
The architecture of this platform is as follows:
The Quasar SDK
- the runtime actions and tools that allow quasar developers to use any front-end stack they want to produce a singular html output that is cross-browser compatible.
The Quasar CLI
- the command line interface to the SDK which can run builds and spin up the Web Api.
The Quasar Web Api
- the express application which hosts and receives requests for running Quasar builds.
The Quasar Electron App
- the electron application which runs the Web Api and serves the webform or webapp in an application window on OS X, Windows, or Linux.
The Quasar Lambda Function
- an AWS Lambda implementation of the Quasar SDK for running builds in a serverless environment.
The Quasar Webform
- a longform UI of all the inputs for each Quasar in an environment. This was the original way to use Quasar and is now more of a developer tool.
The Quasar WebApp
- the platform application for the Quasar ecosystem in a scalable environment which allows users to login, manage builds step by step with a wizard, update and invalidate files uploaded to external storage, preview outputs in environments where Quasar widgets live, deploy widgets to production websites, and see usage statistics of quasars in production.
When writing a quasar
quasars
are build tasks that associate user provided data with template files in a pipeline to produce a single text file output. The output can have dependency files associated with it, or it can be a single, self contained, piece of code.
The base class for a quasar can be overloaded for your custom specifications or used in place and extended. By default, the build pipeline will run the following methods sequentially:
validateRequiredArgs
build
cleanUp
And, by default, each of those methods will follow the build pipeline from downloading or unpacking source files, verifying and setting required data, and cleaning up after moving and staging files. The build method in the base class, by default, does not produce an outputFile as this is a scaffolding class and the logic behind an outputFile is too specific to the implementation, in most cases, to be handled dynamically.
When writing debris
debris
are text based assets that are injected into quasars in an ordered fashion as they are included, or directly as comments within the quasars template files using the convention below. Debris can be the file itself or it can be a manifest that points to a file src to either be included as a tag or downloaded and replaced inline with wrapping code (.uri
file). Debris do not have access to template data at build time, so they must follow the practice of creating an initializing method for templated data to pass params to if they are needed.
To require or include debris in your template files use the following convention. A file that is included with require will only be included if it has not been included before. Files included with include will always be included.
//=require vendor/**/*.js
//=require relative/path/to/file.js
/*=include relative/path/to/file.css */
<!--=include relative/path/to/file.html -->
When writing a template
templates
are the target files for each quasar build and can comprise the entire source of the quasar build or be partial components that wrap external sources for the desired output. Data is injected into template files during build time following the convention.
Template files can be lodash or _ (underscore) templates and data is typically inserted in that way. These templating methods can be used in any template file type (js, css, html).
- Upload to AWS buckets
- Express based web UI with live preview for quasar building
- Plugin architecture allows for a common extending of each component
- Asset compiler and bundler
- Builder packaged as an electron application
- Asset mutation on output (minification, tree shaking, code splitting, uglification)
- QuasarApi ⇐
QuasarRuntime
The API wrapper around the quasar runtime.
- QuasarCli
Processes command line arguments to run quasar runtime methods.
- QuasarConfig
Contains the path information for loading quasar files.
- DTQuasarTask ⇐
QuasarTask
A quasar task with Digital Trends specific business logic
- QuasarElectronApp
Runs the QuasarWebApp in an electron window
- QuasArgs
The default quasArgs object used in quasar builds.
- QuasarRuntime
The quasar Runtime [use the quasar API, not this class directly].
- QuasarTask
A task that can be run by the quasar runtime API.
- QuasarWebApp
The web application for running the quasar API and webform.
QuasarApi ⇐ QuasarRuntime
The API wrapper around the quasar runtime.
Kind: global class
Extends: QuasarRuntime
Export:
- QuasarApi ⇐
QuasarRuntime
- .config :
QuasarConfig
- .cleanDevFolders(quasArgs) ⇒
promise
- .cleanOutputFolders(quasArgs, [allFolders]) ⇒
promise
- .cleanAssetsFolder(quasArgs, subdirectory) ⇒
promise
- .compileScriptsToAssetsFolder(quasArgs, files, outputFilename) ⇒
promise
- .compileStylesToAssetsFolder(quasArgs, files, outputFilename) ⇒
promise
- .compileTargetFileToAssetsFolder(quasArgs) ⇒
promise
- .copyFilesFromAssetsFolderToOutput(quasArgs, files, excludeFiles) ⇒
promise
- .copyFilesFromSourcesFolderToOutput(quasArgs, [files], [excludeFiles]) ⇒
promise
- .copyFilesFromTemplatesFolderToAssetsFolder(quasArgs, files, [excludeFiles]) ⇒
promise
- .copyFilesFromTemplatesFolderToOutput(quasArgs, files, [excludeFiles]) ⇒
promise
- .copyFilesToOutputFolder(quasArgs, fromDirectory, files, [excludeFiles]) ⇒
promise
- .copyTemplateFilesToAssetsPath(quasArgs) ⇒
promise
- .debug(message, obj, condition)
- .downloadFileFromUrlToSourcesFolder(quasArgs, url) ⇒
promise
- .downloadSourceFilesToSourcesFolder(quasArgs) ⇒
promise
- .findTargetFile(quasArgs, nextPath, originalPath, exhausted) ⇒
string
- .getAvailableSourceFilenames(quasArgs) ⇒
array
- .getAvailableDebrisFilenames(quasArgs) ⇒
array
- .getAvailableTaskNames() ⇒
array
- .getQuasarOutputPath([quasArgs]) ⇒
string
- .getTaskNames([dir]) ⇒
array
- .getTasksAssociatedByOutputType(taskNames, [orderByQuasar]) ⇒
object
- .injectCode(quasArgs) ⇒
object
- .injectDebrisFilesIntoStream(quasArgs, contents, [minify]) ⇒
stream
- .injectRequiredFilesIntoStream(quasArgs, contents) ⇒
stream
- .loadTasks(taskPaths, [loadDefaults], [clobber]) ⇒
array
- .logArgsToFile(quasArgs, [toStatus], [overwite]) ⇒
QuasArgs
- .logBuildQueued(quasArgs) ⇒
QuasArgs
- .logCritical(message, obj, color)
- .logData(message, obj, color)
- .logEnd(message, obj, color)
- .logError(message, obj, color)
- .logInfo(message, obj, color)
- .logSuccess(message, obj, color)
- .makePromptRequired() ⇒
function
- .makePromptRequiredAndSanitary() ⇒
function
- .moveTargetFilesToRootOfAssetsPath(quasArgs) ⇒
promise
- .outputToHtmlFile(quasArgs) ⇒
object
- .outputToJsonFile(quasArgs) ⇒
object
- .outputToTextFile(quasArgs) ⇒
object
- .promptConsole(questions, getResults, [showOptional], [optionalOnly]) ⇒
promise
- .runFromArgsFile(qType, argsFile)
- .runLastSuccessfulBuild([quasArgs]) ⇒
promise
- .runQuasar(quasar, [quasArgs], registerTask, end) ⇒
promise
- .unpackSourceFiles(quasArgs, subDirectory) ⇒
promise
- .uploadOutputFiles(quasArgs, [excludeFiles]) ⇒
promise
- .uploadOutputFileAsTxt(quasArgs) ⇒
promise
- .uploadOutputFileWithMetadata(quasArgs) ⇒
promise
- .config :
quasarApi.config : QuasarConfig
Kind: instance property of QuasarApi
cleans local files in the application root for development testing
Kind: instance method of QuasarApi
Overrides: cleanDevFolders
Param | Type |
---|---|
quasArgs | QuasArgs |
deletes the contents of the output root folder and all subdirectories
Kind: instance method of QuasarApi
Overrides: cleanOutputFolders
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
[allFolders] | boolean |
false |
deletes the contents of the assets folder for this quasar
Kind: instance method of QuasarApi
Overrides: cleanAssetsFolder
Param | Type |
---|---|
quasArgs | QuasArgs |
subdirectory | string |
Compiles jsx templates in the templates folder and outputs the targetFile into the assets folder.
Kind: instance method of QuasarApi
Overrides: compileScriptsToAssetsFolder
Returns: promise
- gulp chain
Param | Type | Description |
---|---|---|
quasArgs | QuasArgs |
|
files | array | string |
gulp src input |
outputFilename | string |
Compiles sass templates in the templates folder, using json files for data input which mirror the input filenames, and outputs the targetFile into the assets folder.
Kind: instance method of QuasarApi
Overrides: compileStylesToAssetsFolder
Returns: promise
- gulp chain
Param | Type | Description |
---|---|---|
quasArgs | QuasArgs |
|
files | array | string |
gulp src input |
outputFilename | string |
compiles mustache templates in the templates folder, using json files for data input which mirror the input filenames, and outputs the targetFile into the assets folder.
Kind: instance method of QuasarApi
Overrides: compileTargetFileToAssetsFolder
Returns: promise
- gulp chain
Param | Type |
---|---|
quasArgs | QuasArgs |
copies files from the assets folder to the output folder given the quasArgs folder information
Kind: instance method of QuasarApi
Overrides: copyFilesFromAssetsFolderToOutput
Param | Type |
---|---|
quasArgs | QuasArgs |
files | * |
excludeFiles | * |
copies files the sources folder to the output folder given the quasArgs folder information
Kind: instance method of QuasarApi
Overrides: copyFilesFromSourcesFolderToOutput
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
[files] | * |
|
[excludeFiles] | * |
[] |
copies files from the templates folder to the assets folder given the quasArgs folder information
Kind: instance method of QuasarApi
Overrides: copyFilesFromTemplatesFolderToAssetsFolder
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
files | * |
|
[excludeFiles] | * |
[] |
copies files from the templates folder to the output folder given the quasArgs folder information
Kind: instance method of QuasarApi
Overrides: copyFilesFromTemplatesFolderToOutput
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
files | * |
|
[excludeFiles] | * |
[] |
copies files from a directory to the output folder given the quasArgs folder information
Kind: instance method of QuasarApi
Overrides: copyFilesToOutputFolder
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
fromDirectory | * |
|
files | * |
|
[excludeFiles] | * |
[] |
copies files from the templates folder to the assets folder given the quasArgs folder information
Kind: instance method of QuasarApi
Overrides: copyTemplateFilesToAssetsPath
Param | Type |
---|---|
quasArgs | QuasArgs |
makes a call to log and is used as a canary for testing
Kind: instance method of QuasarApi
Overrides: debug
Param | Type |
---|---|
message | string |
obj | object |
condition | string |
downloads source files from a url into the sources folder to be used at build time
Kind: instance method of QuasarApi
Overrides: downloadFileFromUrlToSourcesFolder
Param | Type |
---|---|
quasArgs | QuasArgs |
url | string |
downloads source files from a url into the sources folder to be used at build time
Kind: instance method of QuasarApi
Overrides: downloadSourceFilesToSourcesFolder
Param | Type |
---|---|
quasArgs | QuasArgs |
searches for a target file in the various available folders by name, qType, oType, and extension until it finds one
Kind: instance method of QuasarApi
Overrides: findTargetFile
Param | Type |
---|---|
quasArgs | QuasArgs |
nextPath | string |
originalPath | string |
exhausted | string |
gets the filenames of the source extension type from the sources folder
Kind: instance method of QuasarApi
Overrides: getAvailableSourceFilenames
Returns: array
- list of filenames from sources folder
Param | Type |
---|---|
quasArgs | QuasArgs |
gets the debris filenames from the debris folder
Kind: instance method of QuasarApi
Overrides: getAvailableDebrisFilenames
Returns: array
- list of filenames from debris folder
Param | Type |
---|---|
quasArgs | QuasArgs |
gets an array of the loaded task names
Kind: instance method of QuasarApi
Overrides: getAvailableTaskNames
gets the outputPath for quasars
Kind: instance method of QuasarApi
Overrides: getQuasarOutputPath
Param | Type | Default |
---|---|---|
[quasArgs] | QuasArgs |
{} |
gets the task names from the tasks folder
Kind: instance method of QuasarApi
Overrides: getTaskNames
Param | Type | Default |
---|---|---|
[dir] | string |
null |
gets task names associated with the oType field
Kind: instance method of QuasarApi
Overrides: getTasksAssociatedByOutputType
Param | Type | Default |
---|---|---|
taskNames | array |
|
[orderByQuasar] | boolean |
false |
Injects asset file references into the output file in the assets folder.
Kind: instance method of QuasarApi
Overrides: injectCode
Returns: object
- the quasargs used
Param | Type |
---|---|
quasArgs | QuasArgs |
Injects require statements for debris.
Kind: instance method of QuasarApi
Overrides: injectDebrisFilesIntoStream
Returns: stream
- the stream written to
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
contents | stream |
|
[minify] | boolean |
false |
Injects require statements for the default asset files (css and js).
Kind: instance method of QuasarApi
Overrides: injectRequiredFilesIntoStream
Returns: stream
- the stream written to
Param | Type |
---|---|
quasArgs | QuasArgs |
contents | stream |
loads the quasar tasks into the gulp taskList
Kind: instance method of QuasarApi
Overrides: loadTasks
Returns: array
- the tasks loaded
Param | Type | Default |
---|---|---|
taskPaths | array |
|
[loadDefaults] | boolean |
false |
[clobber] | boolean |
true |
quasarApi.logArgsToFile(quasArgs, [toStatus], [overwite]) ⇒ QuasArgs
writes the args to file with the status passed in
Kind: instance method of QuasarApi
Overrides: logArgsToFile
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
[toStatus] | string |
null |
[overwite] | boolean |
false |
quasarApi.logBuildQueued(quasArgs) ⇒ QuasArgs
logs quasArgs to the jobFile
Kind: instance method of QuasarApi
Overrides: logBuildQueued
Returns: QuasArgs
- the quasargs logged with updated argsFile entry
Param | Type |
---|---|
quasArgs | QuasArgs |
ogs a critical message
Kind: instance method of QuasarApi
Overrides: logCritical
Param | Type |
---|---|
message | string |
obj | object |
color | color |
Logs a data message
Kind: instance method of QuasarApi
Overrides: logData
Param | Type |
---|---|
message | string |
obj | object |
color | color |
Logs an end message
Kind: instance method of QuasarApi
Overrides: logEnd
Param | Type |
---|---|
message | string |
obj | object |
color | color |
Logs an error message
Kind: instance method of QuasarApi
Overrides: logError
Param | Type |
---|---|
message | string |
obj | object |
color | color |
Logs an info message (default)
Kind: instance method of QuasarApi
Overrides: logInfo
Param | Type |
---|---|
message | string |
obj | object |
color | color |
Logs a success message
Kind: instance method of QuasarApi
Overrides: logSuccess
Param | Type |
---|---|
message | string |
obj | object |
color | color |
used with inquirer questions to ensure that values entered have a length
Kind: instance method of QuasarApi
Overrides: makePromptRequired
used with inquirer questions to ensure that values entered from the CLI follow the required ruleset
Kind: instance method of QuasarApi
Overrides: makePromptRequiredAndSanitary
moves the target html, js, and css files to the assetsFolder
Kind: instance method of QuasarApi
Overrides: moveTargetFilesToRootOfAssetsPath
Param | Type |
---|---|
quasArgs | QuasArgs |
Compiles the quasar into the outputFile alongside the assets into the outputFolder as HTML.
Kind: instance method of QuasarApi
Overrides: outputToHtmlFile
Returns: object
- quasArgs including errors if they exist
Param | Type |
---|---|
quasArgs | QuasArgs |
Compiles the quasar into the outputFile alongside the assets into the outputFolder as JSON.
Kind: instance method of QuasarApi
Overrides: outputToJsonFile
Returns: object
- quasArgs including errors if they exist
Param | Type |
---|---|
quasArgs | QuasArgs |
Compiles the quasar into the outputFile alongside the assets into the outputFolder as TXT.
Kind: instance method of QuasarApi
Overrides: outputToTextFile
Returns: object
- quasArgs including errors if they exist
Param | Type |
---|---|
quasArgs | QuasArgs |
prompts the terminal with questions
Kind: instance method of QuasarApi
Overrides: promptConsole
Returns: promise
- the promise of a prompt of the user to the command line interface
Param | Type | Default | Description |
---|---|---|---|
questions | array |
the questions to ask the user | |
getResults | function |
callback after prompt has completed | |
[showOptional] | boolean |
false |
|
[optionalOnly] | boolean |
|
spawns a task to run a quasar from quasArgs saved in a json file.
Kind: instance method of QuasarApi
Overrides: runFromArgsFile
Param | Type |
---|---|
qType | * |
argsFile | * |
runs the last successfully recorded argsFile
Kind: instance method of QuasarApi
Overrides: runLastSuccessfulBuild
Returns: promise
- resolves to the QuasArgs used
Param | Type | Default |
---|---|---|
[quasArgs] | QuasArgs |
|
Runs a quasar build task
Kind: instance method of QuasarApi
Overrides: runQuasar
Param | Type | Default | Description |
---|---|---|---|
quasar | string |
name of the quasar to run | |
[quasArgs] | QuasArgs |
{} |
|
registerTask | bool |
whether or not to register the quasar with gulp | |
end | function |
the callback for when the task has completed |
unzips or moves source files to the assets folder
Kind: instance method of QuasarApi
Overrides: unpackSourceFiles
Param | Type | Description |
---|---|---|
quasArgs | QuasArgs |
|
subDirectory | string |
the subdirectory of the assets folder to place the source files |
Uploads output files to Amazon S3.
Kind: instance method of QuasarApi
Overrides: uploadOutputFiles
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
[excludeFiles] | array |
[] |
Uploads the outputFile to Amazon S3.
Kind: instance method of QuasarApi
Overrides: uploadOutputFileAsTxt
Param | Type |
---|---|
quasArgs | QuasArgs |
Uploads the outputFile to Amazon S3.
Kind: instance method of QuasarApi
Overrides: uploadOutputFileWithMetadata
Param | Type |
---|---|
quasArgs | QuasArgs |
Processes command line arguments to run quasar runtime methods.
Kind: global class
Export:
- QuasarCli
- .app
- .applicationRoot
- .jobsFolder
- .outputRoot
- .getJobError(jobFile) ⇒
string
- .init([appRoot], [outRoot])
- .packageIntoElectronApp() ⇒
promise
- .processArgsFile(argsFile, data)
- .quasarSelectPrompt(tasks) ⇒
promise
- .run([args]) ⇒
promise
- .runProcess(args, resolve, reject) ⇒
promise
- .spawnElectronApp()
- .spawnWebApp() ⇒
boolean
- .spawnWebForm() ⇒
boolean
- .watchJobs()
returns the application attached to the CLI
Kind: instance property of QuasarCli
Read only: true
the absolute path to the application root
Kind: instance property of QuasarCli
Read only: true
the absolute path to the jobs folder
Kind: instance property of QuasarCli
Read only: true
the absolute path to the output root folder
Kind: instance property of QuasarCli
Read only: true
extracts the error from the jobfile
Kind: instance method of QuasarCli
Param | Type | Description |
---|---|---|
jobFile | string |
the jobFile path |
creates the application job folders and sets initial vars
Kind: instance method of QuasarCli
Param | Type | Default |
---|---|---|
[appRoot] | * |
process.cwd() |
[outRoot] | string |
"`${os.homedir()}/Documents/quasar/`" |
runs electron-packager on the applicationRoot and uses the electron.js file for driving the application
Kind: instance method of QuasarCli
Summary: [INCOMPLETE]
Returns: promise
- gulp chain
processes a job file and kicks off a build from those args
Kind: instance method of QuasarCli
Param | Type | Description |
---|---|---|
argsFile | string |
the path to the argsfile to process |
data | * |
prompts the user from the command line with the given tasks
Kind: instance method of QuasarCli
Param | Type | Description |
---|---|---|
tasks | QuasarTask |
defaults to available tasks |
runs the command from the arguments passed in from the command line and invocation
Kind: instance method of QuasarCli
Param | Type | Default |
---|---|---|
[args] | object |
{} |
runs the arguments as a single batch process
Kind: instance method of QuasarCli
Param | Type |
---|---|
args | object |
resolve | function |
reject | function |
spawns a new instance of electron from the applicationRoot folder
Kind: instance method of QuasarCli
spawns the web app and web api in an express application
Kind: instance method of QuasarCli
Returns: boolean
- whether or not the web app was successfully run
spawns the web form and web api in an express application
Kind: instance method of QuasarCli
Returns: boolean
- whether or not the web form was successfully run
watches the jobs created folder for new files created and process the argsFile as a new quasar build
Kind: instance method of QuasarCli
Contains the path information for loading quasar files.
Kind: global class
Export:
- QuasarConfig
- .applicationRoot ⇒
string
- .assetsFolder ⇒
string
- .debrisFolder ⇒
string
- .jobsFolder ⇒
string
- .node_modules ⇒
string
- .outputFolder ⇒
string
- .quasarsFolder ⇒
string
- .sourcesFolder ⇒
string
- .tasks ⇒
array
- .tasks
- .templatesFolder ⇒
string
- .init(applicationRoot, [outputRoot])
- .applicationRoot ⇒
the absolute path of the application
Kind: instance property of QuasarConfig
Returns: string
- application root path
Read only: true
the absolute path of the assets folder
Kind: instance property of QuasarConfig
Returns: string
- assets folder path
Read only: true
the absolute path of the debris folder
Kind: instance property of QuasarConfig
Returns: string
- debris folder path
Read only: true
the absolute path of the jobs folder
Kind: instance property of QuasarConfig
Returns: string
- jobs folder path
Read only: true
the absolute path of the node_modules folder
Kind: instance property of QuasarConfig
Returns: string
- node_modules folder path
Read only: true
the absolute path of the output folder
Kind: instance property of QuasarConfig
Returns: string
- output folder path
Read only: true
the absolute path of the quasars folder
Kind: instance property of QuasarConfig
Returns: string
- quasars folder path
Read only: true
the absolute path of the sources folder
Kind: instance property of QuasarConfig
Returns: string
- sources folder path
Read only: true
an array of tasks for this configuration
Kind: instance property of QuasarConfig
Returns: array
- list of tasks
Read only: true
sets the list of tasks for this configuration
Kind: instance property of QuasarConfig
Param | Type |
---|---|
tasks | array |
the absolute path of the templates folder
Kind: instance property of QuasarConfig
Returns: string
- templates folder path
Read only: true
initializes the configuration values from an applicationRoot which defaults to the running process location
Kind: instance method of QuasarConfig
Param | Type | Default | Description |
---|---|---|---|
applicationRoot | string |
defaults to the running process location | |
[outputRoot] | string |
null |
the output root location |
DTQuasarTask ⇐ QuasarTask
A quasar task with Digital Trends specific business logic
Kind: global class
Extends: QuasarTask
Export:
- DTQuasarTask ⇐
QuasarTask
- .getDefaultQuasarQuestions() ⇒
array
- .resolveQuasArgs([args])
- .build() ⇒
promise
- .cleanUp()
- .getQuasarPrompts() ⇒
array
- .promptUser() ⇒
promise
- .registerRequiredQuasArgs([requiredArgs], [optionalRequiredArgs], [clobber])
- .registerTasks()
- .run([args]) ⇒
promise
- .setConfig(_config, [applicationRoot], [force])
- .setDefaultQuasArgs(qType, [additionalArgs]) ⇒
QuasArgs
- .setSourceAndOutputPlusArgs([args])
- .setSourceQuaArgsFromSourceFiles(map, defaultKey)
- .validateRequiredArgs([args]) ⇒
promise
- .getDefaultQuasarQuestions() ⇒
returns a list of default prompts for a quasar.
Kind: instance method of DTQuasarTask
Overrides: getDefaultQuasarQuestions
Returns: array
- list of default prompts
sets digital trends specific quasArgs data.
Kind: instance method of DTQuasarTask
Overrides: resolveQuasArgs
Param | Type | Default |
---|---|---|
[args] | QuasArgs |
{} |
Builds the quasar into a single outputFile.
Kind: instance method of DTQuasarTask
Returns: promise
- the build promise chane
deletes the assets folder and any other temporary build files
Kind: instance method of DTQuasarTask
retrieves the list of inquirer questions to ask the user
Kind: instance method of DTQuasarTask
Returns: array
- array of questions
See: https://www.npmjs.com/package/inquirer#questions
prompts the user from the CLI to get the QuasArgs
Kind: instance method of DTQuasarTask
Returns: promise
- prompt promise
adds required and optional defined arguments, and the defaults, within the quasArgs
Kind: instance method of DTQuasarTask
Summary: This method expects that the second parameter requiredArgs
is an array of objects with the same structure as inquirer's .prompt questions parameter
See: https://www.npmjs.com/package/inquirer#questions
Param | Type | Default |
---|---|---|
[requiredArgs] | array |
[] |
[optionalRequiredArgs] | array |
[] |
[clobber] | boolean |
true |
register the build tasks for this quasar
Kind: instance method of DTQuasarTask
Runs the quasar through validation, build, then cleanup.
Kind: instance method of DTQuasarTask
Param | Type | Default |
---|---|---|
[args] | QuasArgs |
{} |
sets the configuration values from the quasar runtime
Kind: instance method of DTQuasarTask
Param | Type | Default |
---|---|---|
_config | QuasarConfig |
|
[applicationRoot] | String |
process.cwd() |
[force] | boolean |
false |
dtQuasarTask.setDefaultQuasArgs(qType, [additionalArgs]) ⇒ QuasArgs
sets the default quasArgs including command line arguments in order of priority from: QuasArgs class, additionalArgs param, cliArgs, loaded from file
Kind: instance method of DTQuasarTask
Param | Type | Default |
---|---|---|
qType | string |
|
[additionalArgs] | object |
{} |
sets the default values of the source and output arguments from user input
Kind: instance method of DTQuasarTask
Param | Type | Default |
---|---|---|
[args] | QuasArgs |
{} |
unpacks source files and sets quasArg values using the regex map passed in
Kind: instance method of DTQuasarTask
Param | Type |
---|---|
map | object |
defaultKey | string |
sets args from quasar form data and runs validation on the final fields
Kind: instance method of DTQuasarTask
Returns: promise
- resolves to true if validation is successful
Param | Type | Default |
---|---|---|
[args] | QuasArgs |
{} |
Runs the QuasarWebApp in an electron window
Kind: global class
Export:
- QuasarElectronApp
- .createWindow([title], [htmlContent]) ⇒
BrowserWindow
- .electrify() ⇒
BrowserWindow
- .getIconFilePath([rootPath], [iconName], [iconExt]) ⇒
BrowserWindow
- .runElectron()
- .showErrorWindow(error) ⇒
BrowserWindow
- .createWindow([title], [htmlContent]) ⇒
creates an electron window
Kind: instance method of QuasarElectronApp
Param | Type | Default |
---|---|---|
[title] | string |
"'quasar'" |
[htmlContent] | string |
null |
runs the quasar cli to watch the jobs folder, then creates the app window
Kind: instance method of QuasarElectronApp
returns the path to the icon file
Kind: instance method of QuasarElectronApp
Param | Type | Default |
---|---|---|
[rootPath] | string |
"appRoot" |
[iconName] | string |
"'icon'" |
[iconExt] | string |
"'.ico'" |
Creates an electron app and sets it up to run quasar
Kind: instance method of QuasarElectronApp
creates a window with the content of an error for debugging purposes
Kind: instance method of QuasarElectronApp
Param | Type |
---|---|
error | * |
The default quasArgs object used in quasar builds.
Kind: global class
Export:
- QuasArgs
- .qType :
string
- .domain :
string
- .signature :
string
- .buildUser :
string
- .target :
string
- .status :
string
- .jobTimestamp :
string
- .outputFolder :
string
- .sourcesFolder :
string
- .jobsFolder :
string
- .debrisFolder :
string
- .templatesFolder :
string
- .assetsFolder :
string
- .targetFilePath :
string
- .argsFile :
string
- .targetEnvironments :
array
- .cliArgs :
map
- .runArgs :
map
- .sourceFileRegexMaps :
map
- .debris :
array
- .requiredArgs :
array
- .dbFolder :
string
- .bucket :
string
- .logFile :
string
- .sourceExt :
string
- .outputExt :
string
- .cdnUrlStart :
string
- .cssInjectTargets :
Array.<string>
- .jsInjectTargets :
Array.<string>
- .outputVersion :
int
- .uploadOutputFileAsTxtFile :
boolean
- .uploadToS3 :
boolean
- .unpackSourceFiles :
boolean
- .minifyScripts :
boolean
- .minifyStyles :
boolean
- .minifyHtml :
boolean
- .overwriteUnpackDestination :
boolean
- .overwriteTargetFileFromTemplate :
boolean
- .cleanUpTargetFileTemplate :
boolean
- .useJobTimestampForBuild :
boolean
- .buildCompletedSuccessfully :
boolean
- .excludeOutputFileFromUpload :
boolean
- .wrapInHtmlTags :
boolean
- .versionOutputFile :
boolean
- .debugAssetsFolder :
boolean
- .qType :
This is the main field of a quasar and is used in many places and used to infer build task and template files
Kind: instance property of QuasArgs
Summary: the quasar type
This field could be used to designate builds between different pages, or to represent different data types. In the end, it's up to the implementation as to how this is relevant.
Kind: instance property of QuasArgs
Summary: the namespace or global name of the quasar
Example
(the name of a company) 'Toyota'
This field is more granular than the field before it, domain, and represents a more specific identifier for something lik a region or position in a document.
Kind: instance property of QuasArgs
Summary: the id or build name of the quasar
Example
(the name of a product) 'Tacoma'
This field defaults to the machine hostname
Kind: instance property of QuasArgs
Summary: the name of the user who initiated the build
This field tells quasar to look when targeting a file for a build. If left blank, this will be inferred from the qType variable and fallback to any .html quasar can find between the templates folder and the assets folder.
Kind: instance property of QuasArgs
Summary: the main file to target when building the quasar
This field changes as the quasar moves through each phase of the build
Kind: instance property of QuasArgs
Summary: the status of the build of quasar
Default: "'created'"
Example
[ 'created', 'queued', 'completed', 'failed' ]
This field also serves as specific job identifier for the assets folder and can be used to version the output
Kind: instance property of QuasArgs
Summary: the timestamp of the build
Default: "Date.now()"
This path is where quasar outputs are saved once the build has finished.
Kind: instance property of QuasArgs
Summary: The absolute path to the output folder
Example
`/${publicFolder}/${domain}/${signature}`
This path is where sources are downloaded to and pulled from during build time.
Kind: instance property of QuasArgs
Summary: The absolute path to the sources folder
This path is where quasArgs are saved as the build moves through the each status of the build.
Kind: instance property of QuasArgs
Summary: The absolute path to the jobs folder
This path is where quasArgs are saved as the build moves through the each status of the build.
Kind: instance property of QuasArgs
Summary: The absolute path to the debris folder
This path is where quasar gets the template files for the build. This field looks for a folder with the name of the qType.
Kind: instance property of QuasArgs
Summary: The absolute path to the sources folder
Default: "`${args.config.templatesFolder}/${this.qType}`"
This path is where quasar puts the template files for the build to stage for output. Files in this folder are modified ahead of build time and then data from both the quasArgs set by the user are piped into the template files.
Kind: instance property of QuasArgs
Summary: The absolute path to the assets folder
Default: "`${args.config.assetsFolder}/${this.qType}`"
This field is used at build time and cannot be set by the user.
Kind: instance property of QuasArgs
Summary: the full filename of the target
Default: "`${this.qType}.html`"
This field is used at build time and cannot be set by the user.
Kind: instance property of QuasArgs
Summary: the asbolute path to the jobfile which is saved into the jobs folder under the status
Default: "`${this.jobsFolder}/${this.status}/${this.qType}_${this.jobTimestamp}.json`"
This field is used to designate a quasar's intended output to differentiate it between a build of the same type used between different use cases only by the environment it is in.
Kind: instance property of QuasArgs
Summary: the acronyms of each environment where this quasar will live
Kind: instance property of QuasArgs
Summary: the arguments that the quasar has been run with from the CLI
Kind: instance property of QuasArgs
Summary: the arguments that the quasar has been run with from the CLI with a jobFile
Kind: instance property of QuasArgs
Summary: the regex maps to required args for inferring sourceFile assets
This field is a list of js or css files to inject into the output. The contents of the files are piped into script or style tags depending on the file type. Debris are piped into the file only once.
Kind: instance property of QuasArgs
Summary: the list of debris to require with this quasar build.
This field is used with the inquirerjs node package and follows the structure of 'questions'.
Kind: instance property of QuasArgs
Summary: the args that the user can set from a UI.
See: https://github.com/SBoudrias/Inquirer.js/
Example
const questions = [{
type: 'input',
name: 'domain',
shortMessage: 'Domain',
message: 'Enter the name of the domain to be used in building assets:',
required: true,
}];
Kind: instance property of QuasArgs
Summary: the name of the folder to upload to when uploading files to Dropbox.
Kind: instance property of QuasArgs
Summary: the name of the bucket to upload to when uploading files to Amazon AWS S3.
If this field is populated then critical level logs will also be saved to the file specified
Kind: instance property of QuasArgs
Summary: the file to log outputs to
Default: "'.log'"
This field is appended to the source name when seeking to unpack or copy source files to the assets folder
Kind: instance property of QuasArgs
Summary: the extension of the source file
Default: "'.zip'"
This field is appended to the outputFile name when building the output.
Kind: instance property of QuasArgs
Summary: the extension of the outputFile
Default: "'.html'"
This
Kind: instance property of QuasArgs
Summary: the
Default: "'https=//cdn.com/'"
These tags are used to search the outputFile and insert default css files found in the template
Kind: instance property of QuasArgs
Summary: a list of the targets for pre and post injection of style tags
These tags are used to search the outputFile and insert default js files found in the template
Kind: instance property of QuasArgs
Summary: a list of the targets for pre and post injection of script tags
This field is not used unless there is another file found with the same id, in which case _${++outputVersion}
is appended to the outputFile name.
Kind: instance property of QuasArgs
Summary: the version number to append to the end of a file
This will use the Dropbox credentials found in a .config file.
Kind: instance property of QuasArgs
Summary: upload the outputFile to Dropbpx as a .txt file
Default: false
This will use the Amazon AWS IAM credentials found in a .config file.
Kind: instance property of QuasArgs
Summary: upload files to S3 using the domain and signature fields into the destination set in the bucket field.
Default: false
This field is mostly used for testing purposes.
Kind: instance property of QuasArgs
Summary: this will flag whether or not to unpack (unzip) the source file
Default: true
This field is used at build time to flag whether or not to run minification strategies on injected script files.
Kind: instance property of QuasArgs
Summary: run minification on script files injected
Default: false
This field is used at build time to flag whether or not to run minification strategies on injected style files.
Kind: instance property of QuasArgs
Summary: run minification on style files injected
Default: false
This field is used at build time to flag whether or not to run minification strategies on the outputFile.
Kind: instance property of QuasArgs
Summary: run minification on html output
Default: false
This field determines whether or not to preserve or destroy an existing outputFile when copying files to the assets folder during the unpacking of source files.
Kind: instance property of QuasArgs
Summary: overwrite existing assets folder contents on unpack
Default: false
This field determines whether or no to override an existing file at the targetFilePath with the file ${qType}.html
from the templates folder.
Kind: instance property of QuasArgs
Summary: overwrite the targetFile using the template file
Default: true
This is a debug field which, if set, will have quasar delete the targetFile after it has been used in the build.
Kind: instance property of QuasArgs
Summary: delete the targetFile
Default: false
This field, if set, will append the jobTimestamp to assets to ensure uniqueness of the build.
Kind: instance property of QuasArgs
Summary: append the jobTimestamp to the assetsFolder and asset files
Default: true
This field is used by the runtime and set upon successful build before outputting the args to file.
Kind: instance property of QuasArgs
Summary: denotes whether or not these quasArgs have been put through a build and have succeeded
Default: false
This is mostly a debug field which allows quasar to not upload the outputFile.
Kind: instance property of QuasArgs
Summary: exclude the outputFile from uploading to Amazon AWS S3
Default: false
This field denotes whether or not the output should be wrapped in html tags.
Kind: instance property of QuasArgs
Summary: wrap the outputFile in html tags
Default: true
This field tells quasar to append the version number to the outputFile if a file exists already with that name in the outputFolder.
Kind: instance property of QuasArgs
Summary: append the version to the outputFile, if one already exists with that name
Default: true
This is a debug field that allows a dev to analyze what state the assets files were in before injection and build.
Kind: instance property of QuasArgs
Summary: debug flag for the files used as templates for the build
Default: false
The quasar Runtime [use the quasar API, not this class directly].
Kind: global class
Requires: module:gulp
, module:gulp-template
, module:gulp-rename
, module:gulp-inject-string
, module:gulp-insert
, module:gulp-concat
, module:gulp-flatmap
, module:gulp-mustache
, module:gulp-clean-css
, module:gulp-include
, module:gulp-html-beautify
, module:gulp-browserify
, module:gulp-babel
, module:gulp-s3-upload
, module:gulp-dropbox
, module:gulp-download-files
Export:
- QuasarRuntime
- new QuasarRuntime()
- .config :
QuasarConfig
- .cleanDevFolders(quasArgs) ⇒
promise
- .cleanOutputFolders(quasArgs, [allFolders]) ⇒
promise
- .cleanAssetsFolder(quasArgs, subdirectory) ⇒
promise
- .compileScriptsToAssetsFolder(quasArgs, files, outputFilename) ⇒
promise
- .compileStylesToAssetsFolder(quasArgs, files, outputFilename) ⇒
promise
- .compileTargetFileToAssetsFolder(quasArgs) ⇒
promise
- .copyFilesFromAssetsFolderToOutput(quasArgs, files, excludeFiles) ⇒
promise
- .copyFilesFromSourcesFolderToOutput(quasArgs, [files], [excludeFiles]) ⇒
promise
- .copyFilesFromTemplatesFolderToAssetsFolder(quasArgs, files, [excludeFiles]) ⇒
promise
- .copyFilesFromTemplatesFolderToOutput(quasArgs, files, [excludeFiles]) ⇒
promise
- .copyFilesToOutputFolder(quasArgs, fromDirectory, files, [excludeFiles]) ⇒
promise
- .copyTemplateFilesToAssetsPath(quasArgs) ⇒
promise
- .debug(message, obj, condition)
- .downloadFileFromUrlToSourcesFolder(quasArgs, url) ⇒
promise
- .downloadSourceFilesToSourcesFolder(quasArgs) ⇒
promise
- .findTargetFile(quasArgs, nextPath, originalPath, exhausted) ⇒
string
- .getAvailableSourceFilenames(quasArgs) ⇒
array
- .getAvailableDebrisFilenames(quasArgs) ⇒
array
- .getAvailableTaskNames() ⇒
array
- .getQuasarOutputPath([quasArgs]) ⇒
string
- .getTaskNames([dir]) ⇒
array
- .getTasksAssociatedByOutputType(taskNames, [orderByQuasar]) ⇒
object
- .injectCode(quasArgs) ⇒
object
- .injectDebrisFilesIntoStream(quasArgs, contents, [minify]) ⇒
stream
- .injectRequiredFilesIntoStream(quasArgs, contents) ⇒
stream
- .loadTasks(taskPaths, [loadDefaults], [clobber]) ⇒
array
- .logArgsToFile(quasArgs, [toStatus], [overwite]) ⇒
QuasArgs
- .logBuildQueued(quasArgs) ⇒
QuasArgs
- .logCritical(message, obj, color)
- .logData(message, obj, color)
- .logEnd(message, obj, color)
- .logError(message, obj, color)
- .logInfo(message, obj, color)
- .logSuccess(message, obj, color)
- .makePromptRequired() ⇒
function
- .makePromptRequiredAndSanitary() ⇒
function
- .moveTargetFilesToRootOfAssetsPath(quasArgs) ⇒
promise
- .outputToHtmlFile(quasArgs) ⇒
object
- .outputToJsonFile(quasArgs) ⇒
object
- .outputToTextFile(quasArgs) ⇒
object
- .promptConsole(questions, getResults, [showOptional], [optionalOnly]) ⇒
promise
- .runFromArgsFile(qType, argsFile)
- .runLastSuccessfulBuild([quasArgs]) ⇒
promise
- .runQuasar(quasar, [quasArgs], registerTask, end) ⇒
promise
- .unpackSourceFiles(quasArgs, subDirectory) ⇒
promise
- .uploadOutputFiles(quasArgs, [excludeFiles]) ⇒
promise
- .uploadOutputFileAsTxt(quasArgs) ⇒
promise
- .uploadOutputFileWithMetadata(quasArgs) ⇒
promise
the build pipeline of the quasar framework
quasarRuntime.config : QuasarConfig
Kind: instance property of QuasarRuntime
cleans local files in the application root for development testing
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
quasArgs | QuasArgs |
deletes the contents of the output root folder and all subdirectories
Kind: instance method of QuasarRuntime
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
[allFolders] | boolean |
false |
deletes the contents of the assets folder for this quasar
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
quasArgs | QuasArgs |
subdirectory | string |
Compiles jsx templates in the templates folder and outputs the targetFile into the assets folder.
Kind: instance method of QuasarRuntime
Returns: promise
- gulp chain
Param | Type | Description |
---|---|---|
quasArgs | QuasArgs |
|
files | array | string |
gulp src input |
outputFilename | string |
Compiles sass templates in the templates folder, using json files for data input which mirror the input filenames, and outputs the targetFile into the assets folder.
Kind: instance method of QuasarRuntime
Returns: promise
- gulp chain
Param | Type | Description |
---|---|---|
quasArgs | QuasArgs |
|
files | array | string |
gulp src input |
outputFilename | string |
compiles mustache templates in the templates folder, using json files for data input which mirror the input filenames, and outputs the targetFile into the assets folder.
Kind: instance method of QuasarRuntime
Returns: promise
- gulp chain
Param | Type |
---|---|
quasArgs | QuasArgs |
copies files from the assets folder to the output folder given the quasArgs folder information
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
quasArgs | QuasArgs |
files | * |
excludeFiles | * |
copies files the sources folder to the output folder given the quasArgs folder information
Kind: instance method of QuasarRuntime
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
[files] | * |
|
[excludeFiles] | * |
[] |
copies files from the templates folder to the assets folder given the quasArgs folder information
Kind: instance method of QuasarRuntime
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
files | * |
|
[excludeFiles] | * |
[] |
copies files from the templates folder to the output folder given the quasArgs folder information
Kind: instance method of QuasarRuntime
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
files | * |
|
[excludeFiles] | * |
[] |
copies files from a directory to the output folder given the quasArgs folder information
Kind: instance method of QuasarRuntime
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
fromDirectory | * |
|
files | * |
|
[excludeFiles] | * |
[] |
copies files from the templates folder to the assets folder given the quasArgs folder information
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
quasArgs | QuasArgs |
makes a call to log and is used as a canary for testing
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
message | string |
obj | object |
condition | string |
downloads source files from a url into the sources folder to be used at build time
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
quasArgs | QuasArgs |
url | string |
downloads source files from a url into the sources folder to be used at build time
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
quasArgs | QuasArgs |
searches for a target file in the various available folders by name, qType, oType, and extension until it finds one
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
quasArgs | QuasArgs |
nextPath | string |
originalPath | string |
exhausted | string |
gets the filenames of the source extension type from the sources folder
Kind: instance method of QuasarRuntime
Returns: array
- list of filenames from sources folder
Param | Type |
---|---|
quasArgs | QuasArgs |
gets the debris filenames from the debris folder
Kind: instance method of QuasarRuntime
Returns: array
- list of filenames from debris folder
Param | Type |
---|---|
quasArgs | QuasArgs |
gets an array of the loaded task names
Kind: instance method of QuasarRuntime
gets the outputPath for quasars
Kind: instance method of QuasarRuntime
Param | Type | Default |
---|---|---|
[quasArgs] | QuasArgs |
{} |
gets the task names from the tasks folder
Kind: instance method of QuasarRuntime
Param | Type | Default |
---|---|---|
[dir] | string |
null |
gets task names associated with the oType field
Kind: instance method of QuasarRuntime
Param | Type | Default |
---|---|---|
taskNames | array |
|
[orderByQuasar] | boolean |
false |
Injects asset file references into the output file in the assets folder.
Kind: instance method of QuasarRuntime
Returns: object
- the quasargs used
Param | Type |
---|---|
quasArgs | QuasArgs |
Injects require statements for debris.
Kind: instance method of QuasarRuntime
Returns: stream
- the stream written to
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
contents | stream |
|
[minify] | boolean |
false |
Injects require statements for the default asset files (css and js).
Kind: instance method of QuasarRuntime
Returns: stream
- the stream written to
Param | Type |
---|---|
quasArgs | QuasArgs |
contents | stream |
loads the quasar tasks into the gulp taskList
Kind: instance method of QuasarRuntime
Returns: array
- the tasks loaded
Param | Type | Default |
---|---|---|
taskPaths | array |
|
[loadDefaults] | boolean |
false |
[clobber] | boolean |
true |
quasarRuntime.logArgsToFile(quasArgs, [toStatus], [overwite]) ⇒ QuasArgs
writes the args to file with the status passed in
Kind: instance method of QuasarRuntime
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
[toStatus] | string |
null |
[overwite] | boolean |
false |
quasarRuntime.logBuildQueued(quasArgs) ⇒ QuasArgs
logs quasArgs to the jobFile
Kind: instance method of QuasarRuntime
Returns: QuasArgs
- the quasargs logged with updated argsFile entry
Param | Type |
---|---|
quasArgs | QuasArgs |
ogs a critical message
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
message | string |
obj | object |
color | color |
Logs a data message
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
message | string |
obj | object |
color | color |
Logs an end message
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
message | string |
obj | object |
color | color |
Logs an error message
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
message | string |
obj | object |
color | color |
Logs an info message (default)
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
message | string |
obj | object |
color | color |
Logs a success message
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
message | string |
obj | object |
color | color |
used with inquirer questions to ensure that values entered have a length
Kind: instance method of QuasarRuntime
used with inquirer questions to ensure that values entered from the CLI follow the required ruleset
Kind: instance method of QuasarRuntime
moves the target html, js, and css files to the assetsFolder
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
quasArgs | QuasArgs |
Compiles the quasar into the outputFile alongside the assets into the outputFolder as HTML.
Kind: instance method of QuasarRuntime
Returns: object
- quasArgs including errors if they exist
Param | Type |
---|---|
quasArgs | QuasArgs |
Compiles the quasar into the outputFile alongside the assets into the outputFolder as JSON.
Kind: instance method of QuasarRuntime
Returns: object
- quasArgs including errors if they exist
Param | Type |
---|---|
quasArgs | QuasArgs |
Compiles the quasar into the outputFile alongside the assets into the outputFolder as TXT.
Kind: instance method of QuasarRuntime
Returns: object
- quasArgs including errors if they exist
Param | Type |
---|---|
quasArgs | QuasArgs |
prompts the terminal with questions
Kind: instance method of QuasarRuntime
Returns: promise
- the promise of a prompt of the user to the command line interface
Param | Type | Default | Description |
---|---|---|---|
questions | array |
the questions to ask the user | |
getResults | function |
callback after prompt has completed | |
[showOptional] | boolean |
false |
|
[optionalOnly] | boolean |
|
spawns a task to run a quasar from quasArgs saved in a json file.
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
qType | * |
argsFile | * |
runs the last successfully recorded argsFile
Kind: instance method of QuasarRuntime
Returns: promise
- resolves to the QuasArgs used
Param | Type | Default |
---|---|---|
[quasArgs] | QuasArgs |
|
Runs a quasar build task
Kind: instance method of QuasarRuntime
Param | Type | Default | Description |
---|---|---|---|
quasar | string |
name of the quasar to run | |
[quasArgs] | QuasArgs |
{} |
|
registerTask | bool |
whether or not to register the quasar with gulp | |
end | function |
the callback for when the task has completed |
unzips or moves source files to the assets folder
Kind: instance method of QuasarRuntime
Param | Type | Description |
---|---|---|
quasArgs | QuasArgs |
|
subDirectory | string |
the subdirectory of the assets folder to place the source files |
Uploads output files to Amazon S3.
Kind: instance method of QuasarRuntime
Param | Type | Default |
---|---|---|
quasArgs | QuasArgs |
|
[excludeFiles] | array |
[] |
Uploads the outputFile to Amazon S3.
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
quasArgs | QuasArgs |
Uploads the outputFile to Amazon S3.
Kind: instance method of QuasarRuntime
Param | Type |
---|---|
quasArgs | QuasArgs |
A task that can be run by the quasar runtime API.
Kind: global class
Summary: This class can be extended to create custom quasars as shown in the example.
Export:
- QuasarTask
- instance
- .build() ⇒
promise
- .cleanUp()
- .getDefaultQuasarQuestions() ⇒
array
- .getQuasarPrompts() ⇒
array
- .promptUser() ⇒
promise
- .registerRequiredQuasArgs([requiredArgs], [optionalRequiredArgs], [clobber])
- .registerTasks()
- .resolveQuasArgs([args])
- .run([args]) ⇒
promise
- .setConfig(_config, [applicationRoot], [force])
- .setDefaultQuasArgs(qType, [additionalArgs]) ⇒
QuasArgs
- .setSourceAndOutputPlusArgs([args])
- .setSourceQuaArgsFromSourceFiles(map, defaultKey)
- .validateRequiredArgs([args]) ⇒
promise
- .build() ⇒
- static
- instance
Builds the quasar into a single outputFile.
Kind: instance method of QuasarTask
Returns: promise
- the build promise chane
deletes the assets folder and any other temporary build files
Kind: instance method of QuasarTask
returns a list of default prompts for a quasar.
Kind: instance method of QuasarTask
Returns: array
- list of default prompts
retrieves the list of inquirer questions to ask the user
Kind: instance method of QuasarTask
Returns: array
- array of questions
See: https://www.npmjs.com/package/inquirer#questions
prompts the user from the CLI to get the QuasArgs
Kind: instance method of QuasarTask
Returns: promise
- prompt promise
adds required and optional defined arguments, and the defaults, within the quasArgs
Kind: instance method of QuasarTask
Summary: This method expects that the second parameter requiredArgs
is an array of objects with the same structure as inquirer's .prompt questions parameter
See: https://www.npmjs.com/package/inquirer#questions
Param | Type | Default |
---|---|---|
[requiredArgs] | array |
[] |
[optionalRequiredArgs] | array |
[] |
[clobber] | boolean |
true |
register the build tasks for this quasar
Kind: instance method of QuasarTask
method for extended classes to do extra work for quasArgs after validation
Kind: instance method of QuasarTask
Param | Type | Default |
---|---|---|
[args] | QuasArgs |
{} |
Runs the quasar through validation, build, then cleanup.
Kind: instance method of QuasarTask
Param | Type | Default |
---|---|---|
[args] | QuasArgs |
{} |
sets the configuration values from the quasar runtime
Kind: instance method of QuasarTask
Param | Type | Default |
---|---|---|
_config | QuasarConfig |
|
[applicationRoot] | String |
process.cwd() |
[force] | boolean |
false |
quasarTask.setDefaultQuasArgs(qType, [additionalArgs]) ⇒ QuasArgs
sets the default quasArgs including command line arguments in order of priority from: QuasArgs class, additionalArgs param, cliArgs, loaded from file
Kind: instance method of QuasarTask
Param | Type | Default |
---|---|---|
qType | string |
|
[additionalArgs] | object |
{} |
sets the default values of the source and output arguments from user input
Kind: instance method of QuasarTask
Param | Type | Default |
---|---|---|
[args] | QuasArgs |
{} |
unpacks source files and sets quasArg values using the regex map passed in
Kind: instance method of QuasarTask
Param | Type |
---|---|
map | object |
defaultKey | string |
sets args from quasar form data and runs validation on the final fields
Kind: instance method of QuasarTask
Returns: promise
- resolves to true if validation is successful
Param | Type | Default |
---|---|---|
[args] | QuasArgs |
{} |
downloads source files, sets defaults from form args, and copies files to the assets folder
Kind: static method of QuasarTask
Returns: promise
- resolves to true if validation is successful
Param | Type | Default |
---|---|---|
[args] | QuasArgs |
{} |
The web application for running the quasar API and webform.
Kind: global class
Export:
- QuasarWebApp
- .port :
string
- ._app :
express
- .availableTasks :
array
- .app ⇒
express
- .autoReloadingPageWithMessage([message]) ⇒
string
- .createJobFile(args) ⇒
promise
- .getJob(req, res)
- .getJobStatus(jobId) ⇒
string
- .getPublicBuild(req, res)
- .onTaskDataReceived(req, res) ⇒
promise
- .run([app], [port], [start])
- .saveSourceFiles(args) ⇒
QuasArgs
- .sendJobFileCompleted(job, jobFile) ⇒
promise
- .sendJobFileQueued(job, jobFile) ⇒
promise
- .port :
Kind: instance property of QuasarWebApp
Kind: instance property of QuasarWebApp
Kind: instance property of QuasarWebApp
retrieves the express instance for the web app
Kind: instance property of QuasarWebApp
Read only: true
the content for a loading page with a message
Kind: instance method of QuasarWebApp
Param | Type | Default |
---|---|---|
[message] | string |
"`Loading ...`" |
Writes a jobFile to the jobs folder
Kind: instance method of QuasarWebApp
Returns: promise
- resolves with the created job information
Param | Type | Description |
---|---|---|
args | QuasArgs |
the args to create the job with |
sends the outputFile of a job or the json data about the job if it has not completed
Kind: instance method of QuasarWebApp
Param | Type |
---|---|
req | * |
res | * |
returns the status of a job based on the filename and which job folder it is in
Kind: instance method of QuasarWebApp
Param | Type |
---|---|
jobId | * |
returns the directory view of a domain/signature for a given date range
Kind: instance method of QuasarWebApp
Param | Type |
---|---|
req | * |
res | * |
creates a jobfile and returns the preliminary data to the response
Kind: instance method of QuasarWebApp
Returns: promise
- the json response to the request
Param | Type |
---|---|
req | * |
res | * |
runs the express application with webpage and API
Kind: instance method of QuasarWebApp
Param | Type | Default |
---|---|---|
[app] | express |
|
[port] | number |
|
[start] | boolean |
false |
quasarWebApp.saveSourceFiles(args) ⇒ QuasArgs
saves an uploaded source file to the sources folder
Kind: instance method of QuasarWebApp
Returns: QuasArgs
- the saved QuasArgs
Param | Type |
---|---|
args | QuasArgs |
sends a response to a client when a job has been completed
Kind: instance method of QuasarWebApp
Param | Type |
---|---|
job | * |
jobFile | * |
sends a response to a client when a job has been queued
Kind: instance method of QuasarWebApp
Returns: promise
- resolves to the job queued information
Param | Type |
---|---|
job | string |
jobFile | string |