├── .gitignore ├── .npmignore ├── .travis.yml ├── LICENSE ├── README.md ├── bin ├── index.js ├── operations.js └── path.js ├── example ├── dev │ ├── css │ │ └── index.css │ ├── header.jpg │ ├── index.html │ ├── js │ │ ├── index.js │ │ └── zero.js │ ├── less │ │ └── index.css │ ├── md │ │ └── index.html │ ├── scss │ │ └── index.css │ ├── sitemap.xml │ ├── svg │ │ └── heritage-oaks.svg │ └── test.txt ├── encamp.json ├── encamped │ └── one │ │ ├── index.v.html │ │ └── two │ │ └── index.v.html └── src │ ├── css │ ├── index.b.css │ ├── one.i.css │ └── two.i.css │ ├── header.jpg │ ├── index.v.html │ ├── js │ ├── add.i.js │ ├── index.b.t.js │ ├── one.i.js │ ├── two.i.js │ └── zero.js │ ├── layout.l.html │ ├── less │ ├── child.i.less │ └── index.m.less │ ├── md │ └── index.md │ ├── partial │ ├── one.p.html │ ├── three.p.html │ └── two.p.html │ ├── scss │ ├── index.m.scss │ ├── one.i.scss │ └── two.i.scss │ ├── sitemap.xml │ ├── svg │ └── heritage-oaks.t.svg │ └── test.txt ├── index.js ├── lib ├── global.js ├── minify │ └── css.js ├── sitemap.js ├── terminal.js ├── transform │ ├── css │ │ ├── b.js │ │ ├── m.js │ │ └── t.js │ ├── html │ │ ├── comment.js │ │ ├── html.js │ │ ├── l.js │ │ ├── m.js │ │ ├── p.js │ │ └── v.js │ ├── index.js │ ├── js │ │ ├── b.js │ │ ├── m.js │ │ └── t.js │ ├── less │ │ ├── index.js │ │ └── m.js │ ├── md │ │ └── index.js │ ├── scss │ │ ├── index.js │ │ └── m.js │ └── svg │ │ └── t.js └── utility.js ├── package-lock.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | example 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "8" 4 | - "7" 5 | - "6" 6 | - "5" 7 | - "4" 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Mozilla Public License Version 2.0 2 | ================================== 3 | 4 | 1. Definitions 5 | -------------- 6 | 7 | 1.1. "Contributor" 8 | means each individual or legal entity that creates, contributes to 9 | the creation of, or owns Covered Software. 10 | 11 | 1.2. "Contributor Version" 12 | means the combination of the Contributions of others (if any) used 13 | by a Contributor and that particular Contributor's Contribution. 14 | 15 | 1.3. "Contribution" 16 | means Covered Software of a particular Contributor. 17 | 18 | 1.4. "Covered Software" 19 | means Source Code Form to which the initial Contributor has attached 20 | the notice in Exhibit A, the Executable Form of such Source Code 21 | Form, and Modifications of such Source Code Form, in each case 22 | including portions thereof. 23 | 24 | 1.5. "Incompatible With Secondary Licenses" 25 | means 26 | 27 | (a) that the initial Contributor has attached the notice described 28 | in Exhibit B to the Covered Software; or 29 | 30 | (b) that the Covered Software was made available under the terms of 31 | version 1.1 or earlier of the License, but not also under the 32 | terms of a Secondary License. 33 | 34 | 1.6. "Executable Form" 35 | means any form of the work other than Source Code Form. 36 | 37 | 1.7. "Larger Work" 38 | means a work that combines Covered Software with other material, in 39 | a separate file or files, that is not Covered Software. 40 | 41 | 1.8. "License" 42 | means this document. 43 | 44 | 1.9. "Licensable" 45 | means having the right to grant, to the maximum extent possible, 46 | whether at the time of the initial grant or subsequently, any and 47 | all of the rights conveyed by this License. 48 | 49 | 1.10. "Modifications" 50 | means any of the following: 51 | 52 | (a) any file in Source Code Form that results from an addition to, 53 | deletion from, or modification of the contents of Covered 54 | Software; or 55 | 56 | (b) any new file in Source Code Form that contains any Covered 57 | Software. 58 | 59 | 1.11. "Patent Claims" of a Contributor 60 | means any patent claim(s), including without limitation, method, 61 | process, and apparatus claims, in any patent Licensable by such 62 | Contributor that would be infringed, but for the grant of the 63 | License, by the making, using, selling, offering for sale, having 64 | made, import, or transfer of either its Contributions or its 65 | Contributor Version. 66 | 67 | 1.12. "Secondary License" 68 | means either the GNU General Public License, Version 2.0, the GNU 69 | Lesser General Public License, Version 2.1, the GNU Affero General 70 | Public License, Version 3.0, or any later versions of those 71 | licenses. 72 | 73 | 1.13. "Source Code Form" 74 | means the form of the work preferred for making modifications. 75 | 76 | 1.14. "You" (or "Your") 77 | means an individual or a legal entity exercising rights under this 78 | License. For legal entities, "You" includes any entity that 79 | controls, is controlled by, or is under common control with You. For 80 | purposes of this definition, "control" means (a) the power, direct 81 | or indirect, to cause the direction or management of such entity, 82 | whether by contract or otherwise, or (b) ownership of more than 83 | fifty percent (50%) of the outstanding shares or beneficial 84 | ownership of such entity. 85 | 86 | 2. License Grants and Conditions 87 | -------------------------------- 88 | 89 | 2.1. Grants 90 | 91 | Each Contributor hereby grants You a world-wide, royalty-free, 92 | non-exclusive license: 93 | 94 | (a) under intellectual property rights (other than patent or trademark) 95 | Licensable by such Contributor to use, reproduce, make available, 96 | modify, display, perform, distribute, and otherwise exploit its 97 | Contributions, either on an unmodified basis, with Modifications, or 98 | as part of a Larger Work; and 99 | 100 | (b) under Patent Claims of such Contributor to make, use, sell, offer 101 | for sale, have made, import, and otherwise transfer either its 102 | Contributions or its Contributor Version. 103 | 104 | 2.2. Effective Date 105 | 106 | The licenses granted in Section 2.1 with respect to any Contribution 107 | become effective for each Contribution on the date the Contributor first 108 | distributes such Contribution. 109 | 110 | 2.3. Limitations on Grant Scope 111 | 112 | The licenses granted in this Section 2 are the only rights granted under 113 | this License. No additional rights or licenses will be implied from the 114 | distribution or licensing of Covered Software under this License. 115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a 116 | Contributor: 117 | 118 | (a) for any code that a Contributor has removed from Covered Software; 119 | or 120 | 121 | (b) for infringements caused by: (i) Your and any other third party's 122 | modifications of Covered Software, or (ii) the combination of its 123 | Contributions with other software (except as part of its Contributor 124 | Version); or 125 | 126 | (c) under Patent Claims infringed by Covered Software in the absence of 127 | its Contributions. 128 | 129 | This License does not grant any rights in the trademarks, service marks, 130 | or logos of any Contributor (except as may be necessary to comply with 131 | the notice requirements in Section 3.4). 132 | 133 | 2.4. Subsequent Licenses 134 | 135 | No Contributor makes additional grants as a result of Your choice to 136 | distribute the Covered Software under a subsequent version of this 137 | License (see Section 10.2) or under the terms of a Secondary License (if 138 | permitted under the terms of Section 3.3). 139 | 140 | 2.5. Representation 141 | 142 | Each Contributor represents that the Contributor believes its 143 | Contributions are its original creation(s) or it has sufficient rights 144 | to grant the rights to its Contributions conveyed by this License. 145 | 146 | 2.6. Fair Use 147 | 148 | This License is not intended to limit any rights You have under 149 | applicable copyright doctrines of fair use, fair dealing, or other 150 | equivalents. 151 | 152 | 2.7. Conditions 153 | 154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted 155 | in Section 2.1. 156 | 157 | 3. Responsibilities 158 | ------------------- 159 | 160 | 3.1. Distribution of Source Form 161 | 162 | All distribution of Covered Software in Source Code Form, including any 163 | Modifications that You create or to which You contribute, must be under 164 | the terms of this License. You must inform recipients that the Source 165 | Code Form of the Covered Software is governed by the terms of this 166 | License, and how they can obtain a copy of this License. You may not 167 | attempt to alter or restrict the recipients' rights in the Source Code 168 | Form. 169 | 170 | 3.2. Distribution of Executable Form 171 | 172 | If You distribute Covered Software in Executable Form then: 173 | 174 | (a) such Covered Software must also be made available in Source Code 175 | Form, as described in Section 3.1, and You must inform recipients of 176 | the Executable Form how they can obtain a copy of such Source Code 177 | Form by reasonable means in a timely manner, at a charge no more 178 | than the cost of distribution to the recipient; and 179 | 180 | (b) You may distribute such Executable Form under the terms of this 181 | License, or sublicense it under different terms, provided that the 182 | license for the Executable Form does not attempt to limit or alter 183 | the recipients' rights in the Source Code Form under this License. 184 | 185 | 3.3. Distribution of a Larger Work 186 | 187 | You may create and distribute a Larger Work under terms of Your choice, 188 | provided that You also comply with the requirements of this License for 189 | the Covered Software. If the Larger Work is a combination of Covered 190 | Software with a work governed by one or more Secondary Licenses, and the 191 | Covered Software is not Incompatible With Secondary Licenses, this 192 | License permits You to additionally distribute such Covered Software 193 | under the terms of such Secondary License(s), so that the recipient of 194 | the Larger Work may, at their option, further distribute the Covered 195 | Software under the terms of either this License or such Secondary 196 | License(s). 197 | 198 | 3.4. Notices 199 | 200 | You may not remove or alter the substance of any license notices 201 | (including copyright notices, patent notices, disclaimers of warranty, 202 | or limitations of liability) contained within the Source Code Form of 203 | the Covered Software, except that You may alter any license notices to 204 | the extent required to remedy known factual inaccuracies. 205 | 206 | 3.5. Application of Additional Terms 207 | 208 | You may choose to offer, and to charge a fee for, warranty, support, 209 | indemnity or liability obligations to one or more recipients of Covered 210 | Software. However, You may do so only on Your own behalf, and not on 211 | behalf of any Contributor. You must make it absolutely clear that any 212 | such warranty, support, indemnity, or liability obligation is offered by 213 | You alone, and You hereby agree to indemnify every Contributor for any 214 | liability incurred by such Contributor as a result of warranty, support, 215 | indemnity or liability terms You offer. You may include additional 216 | disclaimers of warranty and limitations of liability specific to any 217 | jurisdiction. 218 | 219 | 4. Inability to Comply Due to Statute or Regulation 220 | --------------------------------------------------- 221 | 222 | If it is impossible for You to comply with any of the terms of this 223 | License with respect to some or all of the Covered Software due to 224 | statute, judicial order, or regulation then You must: (a) comply with 225 | the terms of this License to the maximum extent possible; and (b) 226 | describe the limitations and the code they affect. Such description must 227 | be placed in a text file included with all distributions of the Covered 228 | Software under this License. Except to the extent prohibited by statute 229 | or regulation, such description must be sufficiently detailed for a 230 | recipient of ordinary skill to be able to understand it. 231 | 232 | 5. Termination 233 | -------------- 234 | 235 | 5.1. The rights granted under this License will terminate automatically 236 | if You fail to comply with any of its terms. However, if You become 237 | compliant, then the rights granted under this License from a particular 238 | Contributor are reinstated (a) provisionally, unless and until such 239 | Contributor explicitly and finally terminates Your grants, and (b) on an 240 | ongoing basis, if such Contributor fails to notify You of the 241 | non-compliance by some reasonable means prior to 60 days after You have 242 | come back into compliance. Moreover, Your grants from a particular 243 | Contributor are reinstated on an ongoing basis if such Contributor 244 | notifies You of the non-compliance by some reasonable means, this is the 245 | first time You have received notice of non-compliance with this License 246 | from such Contributor, and You become compliant prior to 30 days after 247 | Your receipt of the notice. 248 | 249 | 5.2. If You initiate litigation against any entity by asserting a patent 250 | infringement claim (excluding declaratory judgment actions, 251 | counter-claims, and cross-claims) alleging that a Contributor Version 252 | directly or indirectly infringes any patent, then the rights granted to 253 | You by any and all Contributors for the Covered Software under Section 254 | 2.1 of this License shall terminate. 255 | 256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all 257 | end user license agreements (excluding distributors and resellers) which 258 | have been validly granted by You or Your distributors under this License 259 | prior to termination shall survive termination. 260 | 261 | ************************************************************************ 262 | * * 263 | * 6. Disclaimer of Warranty * 264 | * ------------------------- * 265 | * * 266 | * Covered Software is provided under this License on an "as is" * 267 | * basis, without warranty of any kind, either expressed, implied, or * 268 | * statutory, including, without limitation, warranties that the * 269 | * Covered Software is free of defects, merchantable, fit for a * 270 | * particular purpose or non-infringing. The entire risk as to the * 271 | * quality and performance of the Covered Software is with You. * 272 | * Should any Covered Software prove defective in any respect, You * 273 | * (not any Contributor) assume the cost of any necessary servicing, * 274 | * repair, or correction. This disclaimer of warranty constitutes an * 275 | * essential part of this License. No use of any Covered Software is * 276 | * authorized under this License except under this disclaimer. * 277 | * * 278 | ************************************************************************ 279 | 280 | ************************************************************************ 281 | * * 282 | * 7. Limitation of Liability * 283 | * -------------------------- * 284 | * * 285 | * Under no circumstances and under no legal theory, whether tort * 286 | * (including negligence), contract, or otherwise, shall any * 287 | * Contributor, or anyone who distributes Covered Software as * 288 | * permitted above, be liable to You for any direct, indirect, * 289 | * special, incidental, or consequential damages of any character * 290 | * including, without limitation, damages for lost profits, loss of * 291 | * goodwill, work stoppage, computer failure or malfunction, or any * 292 | * and all other commercial damages or losses, even if such party * 293 | * shall have been informed of the possibility of such damages. This * 294 | * limitation of liability shall not apply to liability for death or * 295 | * personal injury resulting from such party's negligence to the * 296 | * extent applicable law prohibits such limitation. Some * 297 | * jurisdictions do not allow the exclusion or limitation of * 298 | * incidental or consequential damages, so this exclusion and * 299 | * limitation may not apply to You. * 300 | * * 301 | ************************************************************************ 302 | 303 | 8. Litigation 304 | ------------- 305 | 306 | Any litigation relating to this License may be brought only in the 307 | courts of a jurisdiction where the defendant maintains its principal 308 | place of business and such litigation shall be governed by laws of that 309 | jurisdiction, without reference to its conflict-of-law provisions. 310 | Nothing in this Section shall prevent a party's ability to bring 311 | cross-claims or counter-claims. 312 | 313 | 9. Miscellaneous 314 | ---------------- 315 | 316 | This License represents the complete agreement concerning the subject 317 | matter hereof. If any provision of this License is held to be 318 | unenforceable, such provision shall be reformed only to the extent 319 | necessary to make it enforceable. Any law or regulation which provides 320 | that the language of a contract shall be construed against the drafter 321 | shall not be used to construe this License against a Contributor. 322 | 323 | 10. Versions of the License 324 | --------------------------- 325 | 326 | 10.1. New Versions 327 | 328 | Mozilla Foundation is the license steward. Except as provided in Section 329 | 10.3, no one other than the license steward has the right to modify or 330 | publish new versions of this License. Each version will be given a 331 | distinguishing version number. 332 | 333 | 10.2. Effect of New Versions 334 | 335 | You may distribute the Covered Software under the terms of the version 336 | of the License under which You originally received the Covered Software, 337 | or under the terms of any subsequent version published by the license 338 | steward. 339 | 340 | 10.3. Modified Versions 341 | 342 | If you create software not governed by this License, and you want to 343 | create a new license for such software, you may create and use a 344 | modified version of this License if you rename the license and remove 345 | any references to the name of the license steward (except to note that 346 | such modified license differs from this License). 347 | 348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary 349 | Licenses 350 | 351 | If You choose to distribute Source Code Form that is Incompatible With 352 | Secondary Licenses under the terms of this version of the License, the 353 | notice described in Exhibit B of this License must be attached. 354 | 355 | Exhibit A - Source Code Form License Notice 356 | ------------------------------------------- 357 | 358 | This Source Code Form is subject to the terms of the Mozilla Public 359 | License, v. 2.0. If a copy of the MPL was not distributed with this 360 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 361 | 362 | If it is not possible or desirable to put the notice in a particular 363 | file, then You may include the notice in a location (such as a LICENSE 364 | file in a relevant directory) where a recipient would be likely to look 365 | for such a notice. 366 | 367 | You may add additional accurate notices of copyright ownership. 368 | 369 | Exhibit B - "Incompatible With Secondary Licenses" Notice 370 | --------------------------------------------------------- 371 | 372 | This Source Code Form is "Incompatible With Secondary Licenses", as 373 | defined by the Mozilla Public License, v. 2.0. 374 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Total alerts](https://img.shields.io/lgtm/alerts/g/vokeio/muleify.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/vokeio/muleify/alerts/) 2 | [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/vokeio/muleify.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/vokeio/muleify/context:javascript) 3 | 4 | # Muleify 5 | **Static Site Generator | Website Bundler | Asset Compiler | Templating | Preprocessor** 6 | 7 | ### Overview 8 | Muleify is the one stop shop for your web front end needs, it is a command line tool that handles all your website development needs. Muleify has a unique no configuration required interface. It automatically handles many tasks such as compiling Sass, Scss, Less, Css, ES6 to ES5, bundling, and minifying. Muleify uses extensions and sub-extensions to automatically handle these tasks. With almost almost zero configuration or changes to existing projects you can get started. If there is a feature you want let me know or make a PR. 9 | 10 | ### Features 11 | Another static site and asset generator you might say. 12 | - zero configuration 13 | - quick and easy 14 | - no learning curve 15 | - based on extensions and sub-extensions 16 | - single page applications support (spa's) 17 | - imports, includes, partials, templates, and layouts 18 | - preprocessor types JavaScript, CSS, SCSS, SASS, LESS, HTML, MD 19 | 20 | ### Install 21 | `npm i -g muleify` 22 | 23 | ### Changes 24 | - 3.x.x uses async/awiat so node version >=7.6.0 25 | - 2.7.0 removes default sass/scss support. After install if you want to use sass run `muleify install-node-sass`. 26 | 27 | ## CLI 28 | - `muleify -p [options] ` Packs a folder or file 29 | - `input` path to folder or file 30 | - `output` path to folder or file 31 | - `-b, --bundle` Bundles the output 32 | - `-m, --minify` Minifies the output 33 | - `-t, --transpile` Transpile the output 34 | - `-w, --watch` Watches a file or folder 35 | - `-p, --path ` Defines the path to watch 36 | - `-s, --serve` Serves a folder or file 37 | 38 | - `muleify -s [options] [output]` Serves a folder or file 39 | - `input` path to folder 40 | - `output` path to folder (optional) 41 | - `-s, --spa` Enables single page application mode 42 | - `-c, --cors` Enables cross origin resource sharing mode 43 | 44 | - `muleify -m [options] ` Creates XML sitemap 45 | - `input` path to a folder to generate the sitemap 46 | - `output` path to a folder to output sitemap.xml 47 | - `-d, --domain ` Inserts domain into sitemap 48 | 49 | - `muleify -e [options] ` Creates folders and files from a json file 50 | - `input` path to a JSON file 51 | - `output` path to a folder 52 | 53 | - `muleify -i` Installs sass/scss compiler (might require sudo) 54 | 55 | ## Extensions 56 | Muleify uses extensions and sub-extensions to process specail file types. Sub-extensions are period separated names. They can be combined in any order or combination. The generated file will not contain the sub-extensions. For example a file in the src folder could be named `file.b.e.js` and the dist folder it would be named `file.js`. 57 | 58 | ### Options 59 | 60 | #### ALL 61 | - `i` - ignore 62 | 63 | #### HTML 64 | - `l` - **layout** wraps all view files 65 | - `v` - **view** inserted into layout 66 | - `p` - **partial** allows file to be imported 67 | - `m` - **minify** minify code (under development) 68 | 69 | #### MD 70 | 71 | #### JS 72 | - `b` - **bundle** modules ESM to UMD 73 | - `t` - **transpile** 74 | - async/await to promises 75 | - transpile to [browser list defaults](http://browserl.ist/?q=defaults) 76 | - `m` - **minify** minify code 77 | - `@preserve` will persist comments. 78 | - `@banner` will place comment at document start. 79 | 80 | #### CSS 81 | - `b` - **bundle** all imports 82 | - `t` - **transpile** 83 | - transpile to [browser list defaults](http://browserl.ist/?q=defaults) 84 | - `m` - **minify** minify code 85 | 86 | #### SCSS 87 | - `m` - **minify** minify code 88 | 89 | #### LESS 90 | - `m` - **minify** minify code 91 | 92 | ## Includes/Imports/Partials/Layouts 93 | The path includes/imports/partials/layouts are relative from the input folder. 94 | 95 | ### Options 96 | 97 | #### HTML 98 | Note `partial` relative path from file 99 | - layout a placeholder: `` 100 | - import a partial: `` 101 | - define a variable: `` 102 | - import a variable: `` 103 | 104 | #### MD 105 | Converts to HTML. 106 | 107 | #### JS 108 | Supports ESM `import` relative path from file and also the node resolution algorithm. For node resolution it will search the `node_modules` package.js files for `"module": "file"` or `main: "file"`. 109 | 110 | #### CSS 111 | Note `@import` relative path from file 112 | 113 | #### SCSS 114 | Sass automatically bundles imports. 115 | Note `@import` relative path from file 116 | 117 | #### LESS 118 | Less automatically bundles imports. 119 | Note `@import` relative path from file 120 | 121 | ## Authors 122 | [Alexander Elias](https://github.com/vokeio) 123 | 124 | ## License 125 | [Why You Should Choose MPL-2.0](http://veldstra.org/2016/12/09/you-should-choose-mpl2-for-your-opensource-project.html) 126 | This project is licensed under the MPL-2.0 License 127 | -------------------------------------------------------------------------------- /bin/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const Operations = require('./operations.js'); 4 | const Package = require('../package.json'); 5 | const Cliy = require('cliy'); 6 | 7 | (async function () { 8 | 9 | const program = new Cliy(); 10 | 11 | await program.setup({ 12 | name: Package.name, 13 | version: Package.version, 14 | operations: [ 15 | Operations.Pack, 16 | Operations.Serve, 17 | Operations.Map, 18 | Operations.Encamp, 19 | Operations.InstallSass 20 | ] 21 | }); 22 | 23 | program.log('Muleify', ['underline', 'cyan']); 24 | 25 | await program.run(process.argv); 26 | 27 | }()).catch(console.error); 28 | -------------------------------------------------------------------------------- /bin/operations.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Muleify = require('../index'); 4 | const Path = require('./path.js'); 5 | 6 | module.exports.Pack = { 7 | key: 'p', 8 | name: 'pack', 9 | description: 'Packs folder or file', 10 | options: [ 'input', 'output' ], 11 | async handler (options, results) { 12 | const input = await Path.call(this, options.input); 13 | const output = await Path.call(this, options.output); 14 | await Muleify.packer(input, output, results); 15 | this.log(`Packed: ${input} to ${output}`, [ 'green' ]); 16 | return true; 17 | }, 18 | operations: [ 19 | { 20 | key: 'b', 21 | name: 'bundle', 22 | description: 'Bundles the output', 23 | async handler () { return true; } 24 | }, 25 | { 26 | key: 'm', 27 | name: 'minify', 28 | description: 'Minifies the output', 29 | async handler () { return true; } 30 | }, 31 | { 32 | key: 't', 33 | name: 'transpile', 34 | description: 'Transpile the output', 35 | async handler () { return true; } 36 | }, 37 | { 38 | key: 'w', 39 | name: 'watch', 40 | description: 'Watches folder or file', 41 | async handler (options, results) { 42 | const self = this; 43 | const input = await Path.call(this, options.input); 44 | const output = await Path.call(this, options.output); 45 | const watcher = await Muleify.watcher(input, results); 46 | 47 | watcher.on('error', function (error) { 48 | self.error(error.stack); 49 | }); 50 | 51 | watcher.on('change', function (path) { 52 | Promise.resolve().then(function () { 53 | return Muleify.packer(input, output, results); 54 | }).then(function () { 55 | self.log(`Changed: ${path}`, [ 'magenta' ]); 56 | }).catch(function (error) { 57 | self.error(error.stack); 58 | }); 59 | }); 60 | 61 | self.log(`Watched: ${input} to ${output}`, [ 'green' ]); 62 | 63 | return true; 64 | } 65 | } 66 | ] 67 | }; 68 | 69 | module.exports.Serve = { 70 | key: 's', 71 | name: 'serve', 72 | description: 'Serves folder or file', 73 | options: [ 'path' ], 74 | async handler (options, results) { 75 | const path = await Path.call(this, options.path || options.output); 76 | const server = await Muleify.server(path, results); 77 | this.log(`Served: ${server.host}:${server.port}`, [ 'green' ]); 78 | return true; 79 | }, 80 | operations: [ 81 | { 82 | key: 's', 83 | name: 'spa', 84 | description: 'Enables single page application mode', 85 | async handler () { return true; } 86 | }, 87 | { 88 | key: 'c', 89 | name: 'cors', 90 | description: 'Enables cross origin resource sharing mode', 91 | async handler () { return true; } 92 | } 93 | ] 94 | }; 95 | 96 | module.exports.Map = { 97 | key: 'm', 98 | name: 'map', 99 | options: [ 'input', 'output', 'domain' ], 100 | description: 'Creates XML sitemap', 101 | async handler (options) { 102 | this.log('Mapping', [ 'underline', 'cyan' ]); 103 | const input = await Path.call(this, options.input); 104 | const output = await Path.call(this, options.output); 105 | await Muleify.map(input, output, options.domain); 106 | this.log(`Input: ${input}`, [ 'magenta' ]); 107 | this.log(`Output: ${output}`, [ 'magenta' ]); 108 | }, 109 | operations: [] 110 | }; 111 | 112 | module.exports.Encamp = { 113 | key: 'e', 114 | name: 'encamp', 115 | options: [ 'input', 'output' ], 116 | description: 'Creates folders and files from a json file', 117 | async handler (options) { 118 | this.log('Muleify Encamping', [ 'underline', 'cyan' ]); 119 | const input = await Path.call(this, options.input); 120 | const output = await Path.call(this, options.output); 121 | await Muleify.encamp(input, output); 122 | this.log(`Input: ${options.input}`, [ 'magenta' ]); 123 | this.log(`Output: ${options.output}`, [ 'magenta' ]); 124 | } 125 | }; 126 | 127 | module.exports.InstallSass = { 128 | key: 'i', 129 | name: 'install-sass', 130 | description: 'Installs sass/scss compiler (might require sudo)', 131 | async handler () { 132 | this.log('Installing...', [ 'white' ]); 133 | const data = await Muleify.sass(); 134 | this.log(data, [ 'white' ]); 135 | } 136 | }; 137 | -------------------------------------------------------------------------------- /bin/path.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Fs = require('fs'); 4 | const Path = require('path'); 5 | 6 | module.exports = async function (data) { 7 | const path = Path.resolve(process.cwd(), data); 8 | 9 | if (!Fs.existsSync(path)) { 10 | throw this.mix(`Path does not exist ${path}`, ['red']); 11 | } 12 | 13 | return path; 14 | }; 15 | -------------------------------------------------------------------------------- /example/dev/css/index.css: -------------------------------------------------------------------------------- 1 | .two-css { 2 | color: lightpink; 3 | } 4 | 5 | 6 | .one-css { 7 | color: lightblue; 8 | } 9 | 10 | 11 | :root { 12 | --gray: gray; 13 | } 14 | 15 | /* 16 | hello world 17 | */ 18 | .bundle-css { 19 | background: gray !important; 20 | background: var(--gray) !important; 21 | } 22 | -------------------------------------------------------------------------------- /example/dev/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xeaone/muleify/d5431afe1dfe038af9d0542e387c7116555bf806/example/dev/header.jpg -------------------------------------------------------------------------------- /example/dev/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello World's | More | Stuff 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

index

17 | 18 |
19 |

one-css

20 |
21 | 22 |
23 |

one-scss

24 |
25 | 26 |
27 |

two-css

28 |
29 | 30 |
31 |

two-scss

32 |
33 | 34 |

Partail Three

35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /example/dev/js/index.js: -------------------------------------------------------------------------------- 1 | function _call(body, then, direct) { 2 | if (direct) { 3 | return then ? then(body()) : body(); 4 | } 5 | 6 | try { 7 | var result = Promise.resolve(body()); 8 | return then ? result.then(then) : result; 9 | } catch (e) { 10 | return Promise.reject(e); 11 | } 12 | } 13 | 14 | function _await(value, then, direct) { 15 | if (direct) { 16 | return then ? then(value) : value; 17 | } 18 | 19 | if (!value || !value.then) { 20 | value = Promise.resolve(value); 21 | } 22 | 23 | return then ? value.then(then) : value; 24 | } 25 | 26 | function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 27 | 28 | (function (global, factory) { 29 | (typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define('Index', factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Index = factory()); 30 | })(this, function () { 31 | 'use strict'; 32 | 33 | var two = 2; 34 | var one = 1; 35 | 36 | var promise = function promise() { 37 | return Promise.resolve('adding'); 38 | }; 39 | 40 | var add = function add(numOne, numTwo) { 41 | return _call(promise, function (message) { 42 | console.log(message); 43 | return numOne + numTwo; 44 | }); 45 | }; 46 | /* 47 | @banner 48 | I am still here. 49 | */ 50 | 51 | /* 52 | @preserve 53 | I am still here again 54 | */ 55 | 56 | 57 | Promise.resolve().then(function () { 58 | return _await(add(one, two), function (sum) { 59 | console.log("".concat(sum)); 60 | }); 61 | }).catch(console.error); 62 | console.log('bundle'); 63 | var index_b_t = { 64 | add: add 65 | }; 66 | /* 67 | const p = Promise.resolve().then(function () { 68 | return 'hello world'; 69 | }); 70 | (async function () { 71 | const r = await p(); 72 | console.log(r); 73 | }()).catch(function (e) { 74 | console.log(e); 75 | }); 76 | */ 77 | 78 | return index_b_t; 79 | }); -------------------------------------------------------------------------------- /example/dev/js/zero.js: -------------------------------------------------------------------------------- 1 | (function (factory) { 2 | typeof define === 'function' && define.amd ? define('Zero', factory) : factory(); 3 | })(function () { 4 | 'use strict'; 5 | 6 | console.log('zero'); 7 | }); -------------------------------------------------------------------------------- /example/dev/less/index.css: -------------------------------------------------------------------------------- 1 | body{background:#5B83AD;} -------------------------------------------------------------------------------- /example/dev/md/index.html: -------------------------------------------------------------------------------- 1 |

TEST

2 | -------------------------------------------------------------------------------- /example/dev/scss/index.css: -------------------------------------------------------------------------------- 1 | @import './one.i.scss';.bundle-scss{background:black;} -------------------------------------------------------------------------------- /example/dev/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | www.foo.com/css/index.css 5 | 2021-06-09 6 | 7 | 8 | www.foo.com/header.jpg 9 | 2021-06-09 10 | 11 | 12 | www.foo.com/index.html 13 | 2021-06-09 14 | 15 | 16 | www.foo.com/js/index.js 17 | 2021-06-09 18 | 19 | 20 | www.foo.com/js/zero.js 21 | 2021-06-09 22 | 23 | 24 | www.foo.com/less/index.css 25 | 2021-06-09 26 | 27 | 28 | www.foo.com/md/index.html 29 | 2021-06-09 30 | 31 | 32 | www.foo.com/scss/index.css 33 | 2021-06-09 34 | 35 | 36 | www.foo.com/sitemap.xml 37 | 2021-06-09 38 | 39 | 40 | www.foo.com/svg/heritage-oaks.svg 41 | 2021-06-09 42 | 43 | 44 | www.foo.com/test.txt 45 | 2021-06-09 46 | 47 | -------------------------------------------------------------------------------- /example/dev/svg/heritage-oaks.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /example/dev/test.txt: -------------------------------------------------------------------------------- 1 | i am blue ba 2 | 3 | de 4 | -------------------------------------------------------------------------------- /example/encamp.json: -------------------------------------------------------------------------------- 1 | { 2 | "encamped": { 3 | "one": { 4 | "/": "index.v.html", 5 | "two": { 6 | "/": "index.v.html" 7 | } 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /example/encamped/one/index.v.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xeaone/muleify/d5431afe1dfe038af9d0542e387c7116555bf806/example/encamped/one/index.v.html -------------------------------------------------------------------------------- /example/encamped/one/two/index.v.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xeaone/muleify/d5431afe1dfe038af9d0542e387c7116555bf806/example/encamped/one/two/index.v.html -------------------------------------------------------------------------------- /example/src/css/index.b.css: -------------------------------------------------------------------------------- 1 | @import './one.i.css'; 2 | 3 | :root { 4 | --gray: gray; 5 | } 6 | 7 | /* 8 | hello world 9 | */ 10 | .bundle-css { 11 | background: var(--gray) !important; 12 | } 13 | -------------------------------------------------------------------------------- /example/src/css/one.i.css: -------------------------------------------------------------------------------- 1 | @import './two.i.css'; 2 | 3 | .one-css { 4 | color: lightblue; 5 | } 6 | -------------------------------------------------------------------------------- /example/src/css/two.i.css: -------------------------------------------------------------------------------- 1 | .two-css { 2 | color: lightpink; 3 | } 4 | -------------------------------------------------------------------------------- /example/src/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xeaone/muleify/d5431afe1dfe038af9d0542e387c7116555bf806/example/src/header.jpg -------------------------------------------------------------------------------- /example/src/index.v.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 |

index

8 | 9 | 10 | -------------------------------------------------------------------------------- /example/src/js/add.i.js: -------------------------------------------------------------------------------- 1 | 2 | const promise = function () { 3 | return Promise.resolve('adding'); 4 | }; 5 | 6 | const add = async function (numOne, numTwo) { 7 | const message = await promise(); 8 | console.log(message); 9 | return numOne + numTwo; 10 | } 11 | 12 | export { add }; 13 | -------------------------------------------------------------------------------- /example/src/js/index.b.t.js: -------------------------------------------------------------------------------- 1 | /* 2 | @banner 3 | I am still here. 4 | */ 5 | 6 | import { one, two} from './one.i.js'; 7 | import { add } from './add.i.js'; 8 | 9 | /* 10 | @preserve 11 | I am still here again 12 | */ 13 | 14 | Promise.resolve().then(async () => { 15 | 16 | const sum = await add(one, two); 17 | console.log(`${sum}`); 18 | 19 | }).catch(console.error); 20 | 21 | console.log('bundle'); 22 | 23 | export default { add } 24 | /* 25 | const p = Promise.resolve().then(function () { 26 | return 'hello world'; 27 | }); 28 | 29 | (async function () { 30 | 31 | const r = await p(); 32 | console.log(r); 33 | 34 | }()).catch(function (e) { 35 | console.log(e); 36 | }); 37 | */ 38 | -------------------------------------------------------------------------------- /example/src/js/one.i.js: -------------------------------------------------------------------------------- 1 | import { two } from './two.i.js'; 2 | 3 | var one = 1; 4 | 5 | export { one, two }; 6 | -------------------------------------------------------------------------------- /example/src/js/two.i.js: -------------------------------------------------------------------------------- 1 | var two = 2; 2 | export { two }; 3 | -------------------------------------------------------------------------------- /example/src/js/zero.js: -------------------------------------------------------------------------------- 1 | console.log('zero'); 2 | -------------------------------------------------------------------------------- /example/src/layout.l.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <!-- { "variable": "title" } --> | More | Stuff 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /example/src/less/child.i.less: -------------------------------------------------------------------------------- 1 | @nice-blue: #5B83AD; 2 | -------------------------------------------------------------------------------- /example/src/less/index.m.less: -------------------------------------------------------------------------------- 1 | @import './child.i.less'; 2 | 3 | body { 4 | background: @nice-blue; 5 | } 6 | -------------------------------------------------------------------------------- /example/src/md/index.md: -------------------------------------------------------------------------------- 1 | **TEST** 2 | -------------------------------------------------------------------------------- /example/src/partial/one.p.html: -------------------------------------------------------------------------------- 1 |
2 |

one-css

3 |
4 | 5 |
6 |

one-scss

7 |
8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/src/partial/three.p.html: -------------------------------------------------------------------------------- 1 |

Partail Three

2 | -------------------------------------------------------------------------------- /example/src/partial/two.p.html: -------------------------------------------------------------------------------- 1 |
2 |

two-css

3 |
4 | 5 |
6 |

two-scss

7 |
8 | -------------------------------------------------------------------------------- /example/src/scss/index.m.scss: -------------------------------------------------------------------------------- 1 | @import './one.i.scss'; 2 | 3 | .bundle-scss { 4 | background: black; 5 | } 6 | -------------------------------------------------------------------------------- /example/src/scss/one.i.scss: -------------------------------------------------------------------------------- 1 | @import './two.i.scss'; 2 | 3 | .one-scss { 4 | color: blue; 5 | } 6 | -------------------------------------------------------------------------------- /example/src/scss/two.i.scss: -------------------------------------------------------------------------------- 1 | .two-scss { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /example/src/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | www.foo.com/css/index.css 5 | 2021-06-09 6 | 7 | 8 | www.foo.com/header.jpg 9 | 2021-06-09 10 | 11 | 12 | www.foo.com/index.html 13 | 2021-06-09 14 | 15 | 16 | www.foo.com/js/index.js 17 | 2021-06-09 18 | 19 | 20 | www.foo.com/js/zero.js 21 | 2021-06-09 22 | 23 | 24 | www.foo.com/less/index.css 25 | 2021-06-09 26 | 27 | 28 | www.foo.com/md/index.html 29 | 2021-06-09 30 | 31 | 32 | www.foo.com/scss/index.css 33 | 2021-06-09 34 | 35 | 36 | www.foo.com/sitemap.xml 37 | 2021-06-09 38 | 39 | 40 | www.foo.com/svg/heritage-oaks.svg 41 | 2021-06-09 42 | 43 | 44 | www.foo.com/test.txt 45 | 2021-06-09 46 | 47 | -------------------------------------------------------------------------------- /example/src/svg/heritage-oaks.t.svg: -------------------------------------------------------------------------------- 1 | 2 | image/svg+xml 21 | 48 | 51 | 57 | 58 | 59 | 62 | 64 | 66 | 71 | 76 | 81 | 86 | 91 | 96 | 101 | 106 | 111 | 116 | 121 | 126 | 131 | 136 | 141 | 146 | 151 | 156 | 161 | 166 | 171 | 176 | 181 | 186 | 191 | 196 | 201 | 206 | 211 | 216 | 221 | 226 | 231 | 236 | 241 | 246 | 251 | 256 | 261 | 266 | 271 | 276 | 281 | 286 | 291 | 296 | 301 | 306 | 311 | 316 | 321 | 326 | 331 | 336 | 341 | 346 | 351 | 356 | 361 | 366 | 371 | 376 | 381 | 382 | 383 | 384 | 385 | 386 | -------------------------------------------------------------------------------- /example/src/test.txt: -------------------------------------------------------------------------------- 1 | i am blue ba 2 | 3 | de 4 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const Transform = require('./lib/transform'); 2 | const Sitemap = require('./lib/sitemap'); 3 | const Global = require('./lib/global'); 4 | const Observey = require('observey'); 5 | const Porty = require('porty'); 6 | const Path = require('path'); 7 | const Fsep = require('fsep'); 8 | const Nety = require('nety'); 9 | 10 | const LB = Global.lb; 11 | const IGNOREABLES = Global.ignoreables; 12 | 13 | const { Server, File, Normalize, Preflight } = Nety.HttpServer; 14 | 15 | const directory = async function (input, output, options) { 16 | let before = []; 17 | let after = []; 18 | 19 | const paths = await Fsep.walk({ 20 | path: input, 21 | ignoreDot: true, 22 | filters: IGNOREABLES 23 | }); 24 | 25 | paths.forEach(path => { 26 | if (LB.test(path)) { 27 | before.push(path); 28 | } else { 29 | after.push(path); 30 | } 31 | }); 32 | 33 | await Promise.all(before.map(async path => { 34 | return Transform(Path.join(input, path), Path.join(output, path), options); 35 | })); 36 | 37 | await Promise.all(after.map(async path => { 38 | return Transform(Path.join(input, path), Path.join(output, path), options); 39 | })); 40 | 41 | }; 42 | 43 | const file = async function (input, output, options) { 44 | await Transform(input, output, options); 45 | }; 46 | 47 | exports.packer = async function (input, output, options) { 48 | 49 | input = Path.resolve(process.cwd(), input); 50 | 51 | if (!Fsep.existsSync(input)) { 52 | throw new Error(`Input path does not exist ${input}`); 53 | } 54 | 55 | output = Path.resolve(process.cwd(), output); 56 | 57 | Global.input = input; // TODO find a way to remove this 58 | 59 | const stat = await Fsep.stat(input); 60 | 61 | if (stat.isFile()) { 62 | await file(input, output, options); 63 | } else if (stat.isDirectory()) { 64 | await directory(input, output, options); 65 | } else { 66 | throw new Error(`Input is not a file or direcotry ${input}`); 67 | } 68 | }; 69 | 70 | exports.watcher = async function (path, options) { 71 | const observer = new Observey({ path: path }); 72 | await observer.open(); 73 | return observer; 74 | }; 75 | 76 | exports.server = async function (folder, options) { 77 | const { spa } = options || {}; 78 | const port = await Porty.find(8080); 79 | 80 | const file = new File(); 81 | const normalize = new Normalize(); 82 | const preflight = new Preflight(); 83 | const server = new Server({ port, debug: true, host: 'localhost' }); 84 | 85 | await server.add(normalize); 86 | await server.add(preflight); 87 | await server.add(file); 88 | await server.get(async context => context.file({ spa, folder, path: context.url.pathname })); 89 | await server.open(); 90 | 91 | return server; 92 | }; 93 | 94 | exports.encamp = async function (input, output) { 95 | const data = await Fsep.readFile(input); 96 | await Fsep.scaffold(output, JSON.parse(data)); 97 | }; 98 | 99 | exports.map = async function (input, output, domain) { 100 | const paths = await Fsep.walk({ 101 | path: input, 102 | ignoreDot: true, 103 | filters: IGNOREABLES 104 | }); 105 | 106 | const sitemap = await Sitemap(paths, domain); 107 | const path = Path.join(output, 'sitemap.xml'); 108 | 109 | await Fsep.outputFile(path, sitemap); 110 | }; 111 | 112 | exports.sass = async function () { 113 | return await Terminal({ 114 | cmd: 'npm', 115 | args: [ 'i', '--no-save', 'node-sass' ], 116 | cwd: __dirname 117 | }); 118 | }; 119 | -------------------------------------------------------------------------------- /lib/global.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | 5 | lb: /(\.l\.)|(\.b\.)/g, 6 | 7 | layout: null, 8 | variables: new Map(), 9 | 10 | ignoreables: [ 11 | // 'dist', 12 | 'ignore', 13 | 'node_modules', 14 | '.DS_Store', 15 | '.git', 16 | '(\\.p\\.)', 17 | '(\\.i\\.)' 18 | ], 19 | 20 | commentRegExp: /()/ig, 21 | 22 | startDataRegExp: /()/ig, 24 | 25 | layoutRegExp: /()/ig, 26 | partialRegExp: /()/ig, 27 | variableRegExp: /()/ig 28 | 29 | }; 30 | -------------------------------------------------------------------------------- /lib/minify/css.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = async function (data) { 4 | return data 5 | .replace(/\/\*(?:(?!\*\/)[\s\S])*\*\//g, '') // comments 6 | .replace( /\s*({|}|;|:|!)\s*/g, '$1' ) // end white space 7 | .replace(/[\r\n\t]+/g, '') // lines tabs 8 | .replace(/\s{2,}/g, ' ' ) // double white space 9 | } 10 | -------------------------------------------------------------------------------- /lib/sitemap.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = async function (paths, domain) { 4 | var data = {}; 5 | 6 | domain = domain ? domain : '/'; 7 | domain = domain[domain.length-1] !== '/' ? domain + '/' : domain; 8 | 9 | var date = new Date(); 10 | var year = date.getFullYear(); 11 | var month = date.getMonth() + 1; 12 | var day = date.getDate(); 13 | 14 | day = day < 10 ? '0' + day : day; 15 | month = month < 10 ? '0' + month : month; 16 | 17 | data.middle = paths.join(`\n\t\t${year}-${month}-${day}\n\t\n\t\n\t\t${domain}`); 18 | data.middle = domain + data.middle; 19 | data.middle = `\t\n\t\t${data.middle}\n\t\t${year}-${month}-${day}\n\t`; 20 | 21 | data.main = `\n\n${data.middle}\n`; 22 | 23 | return data.main; 24 | }; 25 | -------------------------------------------------------------------------------- /lib/terminal.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const ChildProcess = require('child_process'); 4 | 5 | module.exports = function Terminal (data) { 6 | return new Promise(function (resolve, reject) { 7 | if (typeof data === 'string') data = { cmd: data }; 8 | data.args = data.args || []; 9 | 10 | var stdout = ''; 11 | var stderr = ''; 12 | var child = ChildProcess.spawn(data.cmd, data.args, data); 13 | 14 | child.stdout.on('data', function (data) { 15 | stdout += data; 16 | }); 17 | 18 | child.stderr.on('data', function (data) { 19 | stderr += data; 20 | }); 21 | 22 | child.on('error', function (error) { 23 | return reject(error); 24 | }); 25 | 26 | child.on('close', function (code) { 27 | if (stderr) { 28 | return resolve(stderr); 29 | } else if (stdout) { 30 | return resolve(stdout); 31 | } 32 | }); 33 | 34 | }); 35 | }; 36 | -------------------------------------------------------------------------------- /lib/transform/css/b.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Path = require('path'); 4 | const Fsep = require('fsep'); 5 | 6 | const URL = /.*?(?:'|")(.*?)(?:'|").*?;/; 7 | const IMPS = /@import.*?;/g; 8 | 9 | module.exports = async function CssBundle (text, input, output) { 10 | var imps = text.match(IMPS) || []; 11 | 12 | if (!imps.length) return text; 13 | 14 | var imp = imps[0]; 15 | var path = Path.join(input.directory, imp.replace(URL, '$1')); 16 | 17 | if (path === input.absolute) { 18 | throw new Error(`circlular import ${path}`); 19 | } 20 | 21 | const data = await Fsep.readFile(path, 'utf8'); 22 | text = text.replace(imp, data); 23 | 24 | return await CssBundle(text, input); 25 | }; 26 | -------------------------------------------------------------------------------- /lib/transform/css/m.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Minify = require('../../minify/css'); 4 | 5 | module.exports = async function (text, input, output) { 6 | return await Minify(text); 7 | }; 8 | -------------------------------------------------------------------------------- /lib/transform/css/t.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Postcss = require('postcss'); 4 | const Preset = require('postcss-preset-env'); 5 | 6 | const Plugins = [ 7 | Preset({ 8 | browsers: 'defaults' 9 | }) 10 | ]; 11 | 12 | module.exports = async function (text, input, output) { 13 | 14 | const processor = await Postcss(Plugins); 15 | const options = { from: undefined, to: undefined }; 16 | const result = await processor.process(text, options); 17 | 18 | text = result.css; 19 | 20 | return text; 21 | }; 22 | -------------------------------------------------------------------------------- /lib/transform/html/comment.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Global = require('../../global'); 4 | 5 | const END_DATA_REGEXP = Global.endDataRegExp; 6 | const START_DATA_REGEXP = Global.startDataRegExp; 7 | 8 | module.exports = function (comment) { 9 | const self = this; 10 | 11 | self.comment = comment; 12 | 13 | self.json = ''; 14 | self.key = ''; 15 | self.value = ''; 16 | self.pair = ''; 17 | self.count = 0; 18 | 19 | self.json = self.comment.replace(START_DATA_REGEXP, '{').replace(END_DATA_REGEXP, '}'); 20 | 21 | self.json = JSON.parse(self.json); 22 | self.keys = Object.keys(self.json); 23 | self.values = Object.values(self.json); 24 | 25 | self.key = self.keys[0]; 26 | self.value = self.values[0]; 27 | 28 | self.count = self.keys.length; 29 | } 30 | -------------------------------------------------------------------------------- /lib/transform/html/html.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Global = require('../../global'); 4 | const Comment = require('./comment'); 5 | 6 | const Path = require('path'); 7 | const Fsep = require('fsep'); 8 | 9 | const SRC = Global.input; 10 | const COMMENT_REGEXP = Global.commentRegExp; 11 | const PARTIAL_REGEXP = Global.partialRegExp; 12 | const VARIABLE_REGEXP = Global.variableRegExp; 13 | 14 | async function handleExportVariables (text, variables) { 15 | const comments = text.match(COMMENT_REGEXP) || []; 16 | 17 | if (comments.length) { 18 | comments.forEach(function (comment) { 19 | comment = new Comment(comment); 20 | if (comment.count > 1) { 21 | for (var i = 0; i < comment.count; i++) { 22 | var value = comment.values[i]; 23 | var key = comment.keys[i]; 24 | if (key !== 'partial' && key !== 'variable' && key !== 'layout') variables.set(key, value); 25 | } 26 | text = text.replace(comment.comment, ''); 27 | } else if (comment.key !== 'partial' && comment.key !== 'variable' && comment.key !== 'layout') { 28 | variables.set(comment.key, comment.value); 29 | text = text.replace(comment.comment, ''); 30 | } 31 | }); 32 | } 33 | 34 | return text; 35 | } 36 | 37 | async function handleImportVariables (text, variables) { 38 | const comments = text.match(VARIABLE_REGEXP) || []; 39 | 40 | if (comments.length) { 41 | comments.forEach(function (comment) { 42 | comment = new Comment(comment); 43 | var variableValue = variables.get(comment.value); 44 | if (variableValue) { 45 | var commentRegExp = new RegExp(comment.comment, 'ig'); 46 | text = text.replace(commentRegExp, variableValue); 47 | } 48 | }); 49 | } 50 | 51 | return text; 52 | } 53 | 54 | async function handleImportPartials (text, directory) { 55 | const partialComments = text.match(PARTIAL_REGEXP) || []; 56 | 57 | if (!partialComments.length) return text; 58 | 59 | var path, comment, partial; 60 | 61 | for (var i = 0, l = partialComments.length; i < l; i++) { 62 | var partialComment = partialComments[i]; 63 | 64 | comment = new Comment(partialComment); 65 | 66 | path = Path.isAbsolute(comment.value) ? comment.value : Path.join(directory, comment.value); 67 | path = Fsep.existsSync(path) ? path : Path.join(SRC, comment.value); 68 | 69 | partial = await Fsep.readFile(path, 'binary'); 70 | partial = await handleImportPartials(partial, path.replace(Path.basename(path), '')); 71 | 72 | text = text.replace(comment.comment, partial); 73 | } 74 | 75 | return text; 76 | } 77 | 78 | module.exports = async function (text, input, output) { 79 | var vairables = new Map(); 80 | 81 | text = await handleExportVariables(text, vairables); 82 | text = await handleImportPartials(text, input.directory); 83 | text = await handleImportVariables(text, vairables); 84 | 85 | return text; 86 | }; 87 | -------------------------------------------------------------------------------- /lib/transform/html/l.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Global = require('../../global'); 4 | 5 | module.exports = async function (text, input, output) { 6 | Global.layout = text; 7 | return text; 8 | }; 9 | -------------------------------------------------------------------------------- /lib/transform/html/m.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = async function (text, input, output) { 4 | return text 5 | .replace(/>\s+<') 6 | .replace(/[a-z-]+=""/g, '') 7 | .replace(/"([^ ]*)"/g, '$1') 8 | .replace(/<\/li>/, ''); 9 | }; 10 | -------------------------------------------------------------------------------- /lib/transform/html/p.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const HtmlTransformer = require('./html'); 4 | 5 | module.exports = async function (text, input, output) { 6 | return await HtmlTransformer(text, input, output); 7 | }; 8 | -------------------------------------------------------------------------------- /lib/transform/html/v.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const HtmlTransformer = require('./html'); 4 | const Global = require('../../global'); 5 | const LAYOUT = new RegExp(Global.layoutRegExp, 'i'); 6 | 7 | module.exports = async function (text, input, output) { 8 | if (!Global.layout) throw new Error('layout file required'); 9 | text = Global.layout.replace(LAYOUT, text); 10 | return await HtmlTransformer(text, input, output); 11 | }; 12 | -------------------------------------------------------------------------------- /lib/transform/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Fsep = require('fsep'); 4 | const Path = require('path'); 5 | const Utility = require('../utility'); 6 | 7 | module.exports = async function Transform (input, output, options) { 8 | input = await Utility.parsePath(input); 9 | output = await Utility.parsePath(output); 10 | 11 | if (options.bundle && !input.extensions.includes('b')) { 12 | input.extensions.push('b'); 13 | } 14 | 15 | if (options.minify && !input.extensions.includes('m')) { 16 | input.extensions.push('m'); 17 | } 18 | 19 | if (options.transpile && !input.extensions.includes('t') && (input.extensionMain === 'js' || input.extensionMain === 'css')) { 20 | input.extensions.push('t'); 21 | } 22 | 23 | var outputPath = await Utility.cleanExtensions(output.absolute); 24 | var extensions = await Utility.sortExtensions(input.extensions); 25 | 26 | if (extensions.length > 0) { 27 | extensions.pop(); 28 | extensions.splice(0, 0, input.extensionMain); 29 | } 30 | 31 | let text = await Fsep.readFile(input.absolute, 'binary'); 32 | 33 | if (input.isValidExtension) { 34 | var transformPathBase = __dirname; 35 | var transformPathFull = ''; 36 | 37 | for (var i = 0, l = extensions.length; i < l; i++) { 38 | let extension = extensions[i]; 39 | let transformMethod; 40 | 41 | transformPathFull = Path.join(transformPathBase, extension); 42 | 43 | if (i === 0) { 44 | transformPathBase = Path.join(transformPathBase, extension); 45 | } 46 | 47 | try { 48 | transformMethod = require(transformPathFull); 49 | text = await transformMethod(text, input, output); 50 | } catch (error) { 51 | if (error.code !== 'MODULE_NOT_FOUND') { 52 | throw error; 53 | } 54 | } 55 | 56 | } 57 | } 58 | 59 | if (input.hasExtension('l')) return; 60 | 61 | await Fsep.outputFile(outputPath, text, 'binary'); 62 | }; 63 | -------------------------------------------------------------------------------- /lib/transform/js/b.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { nodeResolve } = require('@rollup/plugin-node-resolve'); 4 | const RollupCommon = require('@rollup/plugin-commonjs'); 5 | const Rollup = require('rollup'); 6 | 7 | const RollupResolve = nodeResolve; 8 | 9 | module.exports = async function (text, input, output) { 10 | 11 | const bundle = await Rollup.rollup({ 12 | external: false, 13 | input: input.absolute, 14 | plugins: [ RollupResolve(), RollupCommon() ] 15 | }); 16 | 17 | const name = output.baseMain.charAt(0).toUpperCase() + output.baseMain.slice(1); 18 | 19 | const generate = await bundle.generate({ 20 | name, 21 | indent: '\t', 22 | format: 'umd', 23 | amd: { id: name } 24 | }); 25 | 26 | text = ''; 27 | 28 | for (const { code } of generate.output) { 29 | if (code) { 30 | text += code; 31 | } 32 | } 33 | 34 | return text; 35 | }; 36 | -------------------------------------------------------------------------------- /lib/transform/js/m.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BabelCore = require('@babel/core'); 4 | const BabelMinify = require('babel-preset-minify'); 5 | 6 | module.exports = async function (text, input, output) { 7 | 8 | text = BabelCore.transform(text, { 9 | code: true, 10 | ast: false, 11 | moduleRoot: input.directory, 12 | sourceRoot: input.directory, 13 | sourceMaps: false, 14 | shouldPrintComment: function (comment) { 15 | return /@preserve|banner/.test(comment); 16 | }, 17 | presets: [ 18 | [ BabelMinify ] 19 | ] 20 | }).code; 21 | 22 | var matches = text.match(/\/\*(.|[\r\n])*?\*\//g); 23 | 24 | if (matches) { 25 | matches.forEach(function (match) { 26 | if (match.indexOf('@banner') !== -1) { 27 | text = text.replace(match, ''); 28 | text = match.replace(/\s?@banner\s?/, '') + '\n' + text; 29 | } else { 30 | text = text.replace( 31 | match, 32 | '\n' + match.replace(/\s?@preserve\s?/, '') + '\n' 33 | ); 34 | } 35 | }); 36 | } 37 | 38 | return text; 39 | }; 40 | -------------------------------------------------------------------------------- /lib/transform/js/t.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BabelCore = require('@babel/core'); 4 | const BabelEnv = require('@babel/preset-env'); 5 | const BabelAsyncToPromises = require('babel-plugin-transform-async-to-promises'); 6 | 7 | module.exports = async function (text, input, ouput) { 8 | 9 | text = BabelCore.transform(text, { 10 | code: true, 11 | ast: false, 12 | comments: true, 13 | sourceMaps: false, 14 | moduleRoot: input.directory, 15 | sourceRoot: input.directory, 16 | plugins: [ BabelAsyncToPromises ], 17 | presets: [ 18 | [BabelEnv, { 19 | modules: false, 20 | targets: { 21 | browsers: 'defaults' 22 | } 23 | }] 24 | ] 25 | }).code; 26 | 27 | return text; 28 | }; 29 | -------------------------------------------------------------------------------- /lib/transform/less/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Less = require('less'); 4 | 5 | module.exports = async function (text, input, output) { 6 | 7 | const data = await Less.render(text, { 8 | paths: [ 9 | input.directory 10 | ] 11 | }); 12 | 13 | text = data.css; 14 | 15 | return text; 16 | }; 17 | -------------------------------------------------------------------------------- /lib/transform/less/m.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Minify = require('../../minify/css'); 4 | 5 | module.exports = async function (text, input, output) { 6 | return await Minify(text); 7 | }; 8 | -------------------------------------------------------------------------------- /lib/transform/md/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Marked = require('marked'); 4 | 5 | module.exports = async function (text, input, output) { 6 | return await Marked(text); 7 | }; 8 | -------------------------------------------------------------------------------- /lib/transform/scss/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Sass = require('node-sass'); 4 | 5 | const SassRender = function (options) { 6 | return new Promise(function (resolve, reject) { 7 | Sass.render(options, function (error, data) { 8 | if (error) reject(error); 9 | else resolve(data.css.toString()); 10 | }); 11 | }); 12 | }; 13 | 14 | module.exports = async function (text, input, output) { 15 | return await SassRender({ 16 | data: text, 17 | indentWidth: 4, 18 | indentType: '\t', 19 | outputStyle: 'expanded', 20 | includePaths: [ 21 | input.directory 22 | ] 23 | }); 24 | }; 25 | -------------------------------------------------------------------------------- /lib/transform/scss/m.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Minify = require('../../minify/css'); 4 | 5 | module.exports = async function (text, input, output) { 6 | return await Minify(text); 7 | }; 8 | -------------------------------------------------------------------------------- /lib/transform/svg/t.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Svgo = require('svgo'); 4 | 5 | module.exports = async function (text, input, output) { 6 | 7 | const result = await Svgo.optimize(text, { 8 | multipass: true, 9 | js2svg: { indent: 4, pretty: true }, 10 | floatPrecision: Math.min(Math.max(0, 3), 20), 11 | 12 | plugins: [ 13 | // { minifyStyles: true }, 14 | // { mergePaths: true }, 15 | // 'removeViewBox: false }, 16 | // { moveElemsAttrsToGroup: false }, 17 | // { removeAttrs: { attrs: '(class)' } }, 18 | 19 | 'sortAttrs', 20 | 'collapseGroups', 21 | 'moveGroupAttrsToElems', 22 | 23 | 'removeDesc', 24 | 'removeTitle', 25 | 'removeDoctype', 26 | 'removeUnusedNS', 27 | 'removeMetadata', 28 | 'removeComments', 29 | 'removeEmptyText', 30 | 'removeEmptyAttrs', 31 | 'removeDimensions', 32 | 'removeXMLProcInst', 33 | 'removeUselessDefs', 34 | 'removeHiddenElems', 35 | 'removeRasterImages', 36 | 'removeStyleElement', 37 | 'removeScriptElement', 38 | 'removeEditorsNSData', 39 | 'removeOffCanvasPaths', 40 | 'removeEmptyContainers', 41 | 'removeUnknownsAndDefaults', 42 | 'removeUselessStrokeAndFill', 43 | 'removeNonInheritableGroupAttrs', 44 | 45 | 'cleanupIDs', 46 | 'cleanupAttrs', 47 | 'cleanupListOfValues', 48 | 'cleanupNumericValues', 49 | 'cleanupEnableBackground', 50 | 51 | 'convertColors', 52 | 'convertPathData', 53 | 'convertTransform', 54 | 'convertShapeToPath', 55 | 'convertStyleToAttrs', 56 | 'convertEllipseToCircle' 57 | ] 58 | 59 | }); 60 | 61 | text = result.data; 62 | 63 | return text; 64 | }; 65 | -------------------------------------------------------------------------------- /lib/utility.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Path = require('path'); 4 | 5 | const LB = /(\.l\.)|(\.b\.)/g; 6 | const I = /[^i]|[lvpbtm]/; 7 | const L = /[^il]|[vpbtm]/; 8 | const V = /[^ilv]|[pbtm]/; 9 | const P = /[^ilvp]|[btm]/; 10 | const B = /[^ilvpb]|[tm]/; 11 | const T = /[^ilvpbt]|[m]/; 12 | const M = /[^ilvpbtm]/; 13 | 14 | const VALID_EXTENSIONS = [ 15 | 'js', 16 | 'md', 17 | 'css', 18 | 'svg', 19 | 'html', 20 | 'less', 21 | 'sass', 22 | 'scss' 23 | ]; 24 | 25 | module.exports.parsePath = async function (path) { 26 | var root = process.cwd(); 27 | var data = {}; 28 | 29 | path = Path.normalize(path); 30 | 31 | data.isRelative = !Path.isAbsolute(path); 32 | data.isAbsolute = Path.isAbsolute(path); 33 | 34 | data.baseFull = Path.basename(path); 35 | 36 | data.extensions = data.baseFull.split('.').slice(1); 37 | data.extensionFull = data.extensions.join('.'); 38 | data.extensionMain = data.extensions[data.extensions.length-1]; 39 | 40 | data.baseMain = Path.basename(path, '.' + data.extensionFull); 41 | 42 | if (data.isAbsolute) { 43 | data.absolute = path; 44 | data.relative = Path.relative(root, path); 45 | } 46 | 47 | if (data.isRelative) { 48 | data.relative = path; 49 | data.absolute = Path.resolve(root, path); 50 | // data.absolute = Path.join(root, path); 51 | } 52 | 53 | data.directory = Path.dirname(data.absolute); 54 | 55 | data.hasExtension = function (extension) { 56 | return data.extensions.indexOf(extension) !== -1; 57 | }; 58 | 59 | data.isValidExtension = VALID_EXTENSIONS.indexOf(data.extensionMain) !== -1; 60 | 61 | return data; 62 | }; 63 | 64 | module.exports.getPaths = async function (paths, extensions) { 65 | var matches = []; 66 | 67 | paths.forEach(function (path) { 68 | extensions.forEach(function (extension) { 69 | var extensionRegExp = new RegExp(extension); 70 | if (extensionRegExp.test(path)) matches.push(path); 71 | }); 72 | }); 73 | 74 | return matches; 75 | }; 76 | 77 | module.exports.hasMatch = async function (arrayOne, arrayTwo) { 78 | 79 | for (var i = 0, l = arrayOne.length; i < l; i++) { 80 | 81 | for (var c = 0, t = arrayTwo.length; c < t; c++) { 82 | var regexp = new RegExp(arrayTwo[c]); 83 | if (regexp.test(arrayOne[i])) return i; 84 | else continue; 85 | } 86 | 87 | } 88 | 89 | return -1; 90 | }; 91 | 92 | module.exports.sortPaths = async function (paths) { 93 | return paths.sort(function (p0, p1) { 94 | if (p0 === p1) return 0; 95 | else if (LB.test(p0) && !LB.test(p1)) return -1; 96 | else if (LB.test(p1) && !LB.test(p0)) return 1; 97 | else return 0; 98 | }); 99 | }; 100 | 101 | module.exports.sortExtensions = async function (extensions) { 102 | return extensions.sort(function (e0, e1) { // ilvpbem 103 | if (e0 === e1) return 0; 104 | else if (e0 === 'i' && I.test(e1)) return -1; 105 | else if (e1 === 'i' && I.test(e0)) return 1; 106 | else if (e0 === 'l' && L.test(e1)) return -1; 107 | else if (e1 === 'l' && L.test(e0)) return 1; 108 | else if (e0 === 'v' && V.test(e1)) return -1; 109 | else if (e1 === 'v' && V.test(e0)) return 1; 110 | else if (e0 === 'p' && P.test(e1)) return -1; 111 | else if (e1 === 'p' && P.test(e0)) return 1; 112 | else if (e0 === 'b' && B.test(e1)) return -1; 113 | else if (e1 === 'b' && B.test(e0)) return 1; 114 | else if (e0 === 't' && T.test(e1)) return -1; 115 | else if (e1 === 't' && T.test(e0)) return 1; 116 | else if (e0 === 'm' && M.test(e1)) return -1; 117 | else if (e1 === 'm' && M.test(e0)) return 1; 118 | else return 1; 119 | }); 120 | }; 121 | 122 | module.exports.cleanExtensions = async function (string) { 123 | return string 124 | .replace(/\.i\./g, '.') 125 | .replace(/\.l\./g, '.') 126 | .replace(/\.v\./g, '.') 127 | .replace(/\.p\./g, '.') 128 | .replace(/\.b\./g, '.') 129 | .replace(/\.t\./g, '.') 130 | .replace(/\.m\./g, '.') 131 | .replace(/\.md/g, '.html') 132 | .replace(/(\.sass)|(\.scss)|(\.less)/g, '.css'); 133 | }; 134 | 135 | module.exports.createPaths = async function createPaths (data, path) { 136 | var paths = []; 137 | 138 | if (!data) { 139 | return []; 140 | } else if (data.constructor.name === 'Array') { 141 | data.forEach(function (value) { 142 | paths.push(Path.join(path, value)); 143 | }); 144 | } else if (data.constructor.name === 'Object') { 145 | Object.keys(data).forEach(function (key) { 146 | var value = data[key]; 147 | if (!value) return null; 148 | else if (value.constructor.name === 'String') paths.push(Path.join(path, key, value)); 149 | else Array.prototype.push.apply(paths, createPaths(value, Path.join(path, key))); 150 | }); 151 | } 152 | 153 | return paths; 154 | }; 155 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "muleify", 3 | "version": "5.5.2", 4 | "description": "A zero configuration static site generator and asset preprocessor compiler.", 5 | "main": "index.js", 6 | "engines": { 7 | "node": ">=7.6.0" 8 | }, 9 | "bin": { 10 | "muleify": "bin/index.js" 11 | }, 12 | "scripts": { 13 | "test": "node bin -ptbw example/src example/dev -s example/dev" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/vokeio/muleify.git" 18 | }, 19 | "keywords": [ 20 | "build", 21 | "tool", 22 | "web", 23 | "components", 24 | "html", 25 | "css", 26 | "js", 27 | "cli", 28 | "gulp", 29 | "webpack", 30 | "webpacker", 31 | "webpacks", 32 | "webbundle", 33 | "webbundler", 34 | "webbundles", 35 | "web-pack", 36 | "web-packer", 37 | "web-packs", 38 | "web-bundle", 39 | "web-bundler", 40 | "web-bundles", 41 | "static", 42 | "site", 43 | "generator", 44 | "static-site", 45 | "static-site-generator", 46 | "muleify", 47 | "mule" 48 | ], 49 | "author": "Alexander Elias", 50 | "license": "MPL-2.0", 51 | "bugs": { 52 | "url": "https://github.com/vokeio/muleify/issues" 53 | }, 54 | "homepage": "https://github.com/vokeio/muleify#readme", 55 | "dependencies": { 56 | "@babel/core": "^7.14.3", 57 | "@babel/preset-env": "^7.14.4", 58 | "@rollup/plugin-commonjs": "^19.0.0", 59 | "@rollup/plugin-node-resolve": "^13.0.0", 60 | "babel-plugin-transform-async-to-promises": "^0.8.15", 61 | "babel-preset-minify": "^0.5.1", 62 | "cliy": "^3.1.2", 63 | "fsep": "^2.0.1", 64 | "less": "^4.1.1", 65 | "marked": "^2.0.7", 66 | "nety": "^0.3.8", 67 | "observey": "^2.0.0", 68 | "porty": "^3.1.1", 69 | "postcss": "^8.3.0", 70 | "postcss-preset-env": "^6.7.0", 71 | "rollup": "^2.51.1", 72 | "svgo": "^2.3.0" 73 | } 74 | } 75 | --------------------------------------------------------------------------------