Skip to content

Commit

Permalink
Merge pull request #39 from fabrix-app/v1.6
Browse files Browse the repository at this point in the history
[feat] start browser support
  • Loading branch information
scott-wyatt authored Jun 9, 2019
2 parents eab5b7d + d983ab1 commit 7d2a1c8
Show file tree
Hide file tree
Showing 11 changed files with 3,928 additions and 238 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Dependency Status][daviddm-image]][daviddm-url]
[![Follow @FabrixApp on Twitter][twitter-image]][twitter-url]

Fabrix is a strongly typed modern web application framework for Node.js. It builds on the pedigree of [Rails](http://rubyonrails.org/) and [Grails](https://grails.org/) to accelerate development by adhering to a straightforward, convention-based, API-driven design philosophy.
Fabrix is a strongly typed modern web application framework for Node.js or even Browsers. It builds on the pedigree of [Rails](http://rubyonrails.org/) and [Grails](https://grails.org/) to accelerate development by adhering to a straightforward, convention-based, API-driven design philosophy.

_Note: Because Fabrix is lightweight and easily extendable, it's also very __very__ fast and well suited for function based environments._

Expand Down Expand Up @@ -116,6 +116,11 @@ Fabrix uses a continuous integration process and all tests must pass for Fabrix

Fabrix maintains a high score of coverage tests, any Pull Request should have well written Integration and Unit tests that increase the overall coverage score.

### Browser Support
Browser support provided by Webpack is on it's way.

`webpack --config ./test-browser/webpack.config.js`

## License
[MIT](https://github.com/fabrix-app/fabrix/blob/master/LICENSE)

Expand Down
20 changes: 11 additions & 9 deletions lib/Core.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { union, defaultsDeep, isArray, toArray, mergeWith } from 'lodash'
import { FabrixApp } from './'
import * as mkdirp from 'mkdirp'
import { Templates } from './'
import {
ApiNotDefinedError,
Expand Down Expand Up @@ -339,17 +338,20 @@ export const Core = {
},

/**
* Create configured paths if they don't exist
* Create configured paths if they don't exist and target is Node.js
*/
async createDefaultPaths (app: FabrixApp) {
const paths: {[key: string]: string} = app.config.get('main.paths') || { }

for (const [ , dir ] of Object.entries(paths)) {
await mkdirp(dir, null, function (err: Error) {
if (err) {
app.log.error(err)
}
})
const target: string = app.config.get('main.target') || 'node'
if (target !== 'browser') {
const mkdirp = await import('mkdirp')
for (const [, dir] of Object.entries(paths)) {
await mkdirp(dir, null, function (err: Error) {
if (err) {
app.log.error(err)
}
})
}
}
},

Expand Down
Loading

0 comments on commit 7d2a1c8

Please sign in to comment.