Skip to content

Commit 7d2a1c8

Browse files
authored
Merge pull request #39 from fabrix-app/v1.6
[feat] start browser support
2 parents eab5b7d + d983ab1 commit 7d2a1c8

File tree

11 files changed

+3928
-238
lines changed

11 files changed

+3928
-238
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Dependency Status][daviddm-image]][daviddm-url]
88
[![Follow @FabrixApp on Twitter][twitter-image]][twitter-url]
99

10-
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.
10+
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.
1111

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

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

117117
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.
118118

119+
### Browser Support
120+
Browser support provided by Webpack is on it's way.
121+
122+
`webpack --config ./test-browser/webpack.config.js`
123+
119124
## License
120125
[MIT](https://github.com/fabrix-app/fabrix/blob/master/LICENSE)
121126

lib/Core.ts

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { union, defaultsDeep, isArray, toArray, mergeWith } from 'lodash'
22
import { FabrixApp } from './'
3-
import * as mkdirp from 'mkdirp'
43
import { Templates } from './'
54
import {
65
ApiNotDefinedError,
@@ -339,17 +338,20 @@ export const Core = {
339338
},
340339

341340
/**
342-
* Create configured paths if they don't exist
341+
* Create configured paths if they don't exist and target is Node.js
343342
*/
344343
async createDefaultPaths (app: FabrixApp) {
345344
const paths: {[key: string]: string} = app.config.get('main.paths') || { }
346-
347-
for (const [ , dir ] of Object.entries(paths)) {
348-
await mkdirp(dir, null, function (err: Error) {
349-
if (err) {
350-
app.log.error(err)
351-
}
352-
})
345+
const target: string = app.config.get('main.target') || 'node'
346+
if (target !== 'browser') {
347+
const mkdirp = await import('mkdirp')
348+
for (const [, dir] of Object.entries(paths)) {
349+
await mkdirp(dir, null, function (err: Error) {
350+
if (err) {
351+
app.log.error(err)
352+
}
353+
})
354+
}
353355
}
354356
},
355357

0 commit comments

Comments
 (0)