Skip to content

Commit

Permalink
Merge pull request #28 from fabrix-app/v1.5
Browse files Browse the repository at this point in the history
[feat] archetype testing, fixes #27
  • Loading branch information
scott-wyatt authored Oct 2, 2018
2 parents 3de2a53 + d9eb41a commit 21f0b80
Show file tree
Hide file tree
Showing 17 changed files with 65 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
- run:
name: test performance
command: npm run test-performance
- run:
name: test archetype
command: npm run test-archetype
- run:
name: code-coverage
command: './node_modules/.bin/nyc report --reporter=text-lcov'
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ build/Release
node_modules

*.sw*

# Archetype for CLI
archetype/package-lock.json
archetype/.nyc_output
1 change: 1 addition & 0 deletions archetype/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ npm-debug.log
dist
# other
*.sw*
.nyc_output
4 changes: 2 additions & 2 deletions archetype/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"build": "tsc -p ./src/tsconfig.release.json",
"lint": "tslint -p ./src",
"watch": "tsc -w -p ./src/tsconfig.release.json",
"test": "npm run clean && npm run lint && npm run build && nyc mocha",
"test": "npm run clean && npm run copy && npm run lint && npm run build && nyc mocha",
"prepublishOnly": "npm run compile",
"compile": "npm run clean && npm run build && npm run copy",
"copy": "copyfiles -u 1 src/**/*.json dist",
"copy": "copyfiles -u 1 src/config/**/*.json dist",
"clean": "rm -rf dist"
},
"main": "dist/index.js",
Expand Down
8 changes: 7 additions & 1 deletion archetype/src/config/env/development/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
export {
/**
* Development Env manifest
*/

import { main } from './main'

export {
main
}
18 changes: 18 additions & 0 deletions archetype/src/config/env/development/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Development Configuration
* Merges with (app.config.main)
*
* @see {@link http://fabrix.app/docs/config/main}
* @see {@link http://fabrix.app/docs/config/env}
*/

import { REPLSpool } from '@fabrix/spool-repl'

export const main = {
/**
* This array of spools will be merged with the parent config array
*/
spools: [
REPLSpool
]
}
2 changes: 1 addition & 1 deletion archetype/src/config/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* If your app will touch people from all over the world, i18n (or internationalization)
* may be an important part of your international strategy.
*
* @see http://fabrix.app/doc/config/i18n
* @see http://fabrix.app/docs/config/i18n
*/

export const i18n = {
Expand Down
2 changes: 1 addition & 1 deletion archetype/src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Fabrix Configuration Manifest
* @see {@link http://fabrix.app/doc/config/manifest}
* @see {@link http://fabrix.app/docs/config/manifest}
*/
import * as env from './env'
import { i18n } from './i18n'
Expand Down
2 changes: 1 addition & 1 deletion archetype/src/config/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Logging Configuration
* (app.config.log)
*
* @see {@link http://fabrix.app/doc/config/log}
* @see {@link http://fabrix.app/docs/config/log}
*/

export const log = {
Expand Down
8 changes: 7 additions & 1 deletion archetype/src/config/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@
* Main App Configuration
* (app.config.main)
*
* @see {@link http://fabrix.app/doc/config/main}
* @see {@link http://fabrix.app/docs/config/main}
*/

import { resolve } from 'path'

/**
* Spools: import spools
*/
import { RouterSpool } from '@fabrix/spool-router'

export const main = {

/**
* Order does *not* matter. Each module is loaded according to its own
* requirements.
*/
spools: [
RouterSpool
],

/**
Expand Down
2 changes: 1 addition & 1 deletion archetype/src/config/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Configure the model defaults
*
* @see {@link http://fabrix.app/doc/config/models}
* @see {@link http://fabrix.app/docs/config/models}
*/
export const models = {
/**
Expand Down
2 changes: 1 addition & 1 deletion archetype/src/config/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Configure how url patterns map to controllers, views, and static files.
*
* @see {@link http://fabrix.app/doc/config/routes}
* @see {@link http://fabrix.app/docs/config/routes}
*/

export const routes = { }
4 changes: 2 additions & 2 deletions archetype/src/config/stores.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Datastore Configuration
* Datastores Configuration
* (app.config.stores)
*
* Configure the ORM layer, connections, etc.
*
* @see {@link http://fabrix.app/doc/config/stores}
* @see {@link http://fabrix.app/docs/config/stores}
*/

export const stores = {
Expand Down
9 changes: 9 additions & 0 deletions archetype/src/config/web.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* Web Configuration
* (app.config.web)
*
* Pattern for common Web servers
*
* @see {@link http://fabrix.app/docs/config/web}
*/

export const web = {

}
6 changes: 4 additions & 2 deletions archetype/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
* @module server
*
* Fabrix framework.
* @see {@link http://fabrix.app}
*/

import { FabrixApp } from '@fabrix/fabrix'
import * as App from './'

const app = new FabrixApp(App)
const server = new FabrixApp(App)

app.start().catch(app.stop)
server.start()
.catch((err: any) => server.stop(err))
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fabrix/fabrix",
"version": "1.5.8",
"version": "1.5.9",
"description": "Strongly Typed Modern Web Application Framework for Node.js",
"keywords": [
"framework",
Expand Down Expand Up @@ -30,6 +30,7 @@
"watch": "tsc -w -p ./lib/tsconfig.release.json",
"test": "npm run clean && npm run lint && npm run build && nyc mocha",
"test-performance": "mocha test-performance",
"test-archetype": "cd archetype && npm install && npm test",
"prepublishOnly": "npm run compile",
"compile": "npm run clean && npm run build",
"clean": "rm -rf dist",
Expand Down

0 comments on commit 21f0b80

Please sign in to comment.