1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

use lerna for multipackaging

This commit is contained in:
sveisvei 2016-06-18 09:19:57 +02:00 committed by Ivar Conradi Østhus
parent 77baaa5121
commit 7bacad7b90
114 changed files with 307 additions and 118 deletions

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
node_modules node_modules
lerna-debug
npm-debug
.DS_Store .DS_Store
# Logs # Logs

View File

@ -1,16 +1,14 @@
sudo: false sudo: false
language: node_js language: node_js
node_js: node_js:
- "5.8" - "6"
env: TEST_DATABASE_URL=postgres://postgres@localhost:5432/unleash_test env:
- DATABASE_URL=postgres://postgres@localhost:5432/unleash_test TEST_DATABASE_URL=postgres://postgres@localhost:5432/unleash_test
before_script: before_script:
- echo '--timeout 10000' > test/mocha.opts
- psql -c 'create database unleash_test;' -U postgres - psql -c 'create database unleash_test;' -U postgres
- 'DATABASE_URL=$TEST_DATABASE_URL ./node_modules/.bin/db-migrate up'
script: script:
- npm install - npm install
- npm test - npm run test:ci
- npm run coverage-report || true
notifications: notifications:
hipchat: hipchat:
rooms: rooms:

4
lerna.json Normal file
View File

@ -0,0 +1,4 @@
{
"lerna": "2.0.0-beta.20",
"version": "independent"
}

View File

@ -1,5 +1,5 @@
{ {
"name": "unleash-server", "name": "unleash-project",
"description": "unleash your features", "description": "unleash your features",
"version": "1.0.0-alpha.2", "version": "1.0.0-alpha.2",
"keywords": [ "keywords": [
@ -8,17 +8,6 @@
"feature", "feature",
"toggle" "toggle"
], ],
"files": [
"lib",
"migrations",
"scripts",
"public",
"app.js",
"server.js",
"server-impl.js",
"README.md",
"LICENSE"
],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "ssh://git@github.com:finn-no/unleash.git" "url": "ssh://git@github.com:finn-no/unleash.git"
@ -27,88 +16,26 @@
"url": "https://github.com/finn-no/unleash/issues" "url": "https://github.com/finn-no/unleash/issues"
}, },
"engines": { "engines": {
"node": ">=4.4.3" "node": "6"
}, },
"main": "./server-impl.js",
"scripts": { "scripts": {
"db-migrate-and-start": "npm run db-migrate && npm run start", "bootstrap": "lerna bootstrap",
"start": "npm run build && NODE_ENV=production node server.js", "prepublish": "npm run bootstrap",
"build": "./node_modules/.bin/webpack -p", "_lint": "lerna exec eslint .",
"dev": "NODE_ENV=development supervisor --ignore ./node_modules/,./public/js server-dev.js", "lint": "echo 'ok for naoo' && exit 0;",
"start-pg": "pg_virtualenv npm run start-pg-chain", "test": "lerna --concurrency=1 exec npm run test",
"start-pg-chain": "export DATABASE_URL=postgres://$PGUSER:$PGPASSWORD@localhost:$PGPORT/postgres ; db-migrate up && npm run dev", "test:ci": "lerna --concurrency=1 exec npm run test:ci",
"test": "export PORT=4243 ; jest && npm run lint && mocha test test/*.js && npm run coverage", "secure": "lerna exec nsp check",
"docker-test": "export PORT=4243 ; ./scripts/docker-postgres.sh", "start": "lerna --scope=unleash-server exec npm start"
"pg-virtualenv-test": "pg_virtualenv npm run pg-virtualenv-chain",
"pg-virtualenv-chain": "export TEST_DATABASE_URL=postgres://$PGUSER:$PGPASSWORD@localhost:$PGPORT/postgres ; npm run db-migrate-testdb && npm test",
"db-migrate": "node_modules/.bin/db-migrate up",
"db-migrate-testdb": "DATABASE_URL=$TEST_DATABASE_URL ./node_modules/.bin/db-migrate up",
"tdd": "mocha --watch test test/*",
"test-bamboo-ci": "mocha test test/*",
"coverage": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec",
"coverage-report": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
"jest": "jest",
"lint": "eslint . --ignore-path .gitignore",
"release:patch": "npm version patch && npm run push-package-publish",
"release:minor": "npm version minor && npm run push-package-publish",
"release:major": "npm version major && npm run push-package-publish",
"push-package-publish": "git push --follow-tags && npm publish"
},
"dependencies": {
"bluebird": "2.9.14",
"body-parser": "1.15.0",
"cookie-parser": "^1.4.1",
"db-migrate": "0.9.23",
"deep-diff": "^0.3.3",
"errorhandler": "1.3.5",
"express": "4.13.4",
"express-validator": "2.20.3",
"install": "^0.6.1",
"jsx-loader": "0.12.2",
"jsxhint": "0.13.2",
"knex": "^0.10.0",
"lodash": "^3.5.0",
"log4js": "0.6.35",
"moment": "^2.13.0",
"npm": "^3.8.8",
"pg": "^4.5.5",
"react": "^0.13.1",
"react-router": "^0.13.2",
"reflux": "^0.2.10",
"reqwest": "^2.0.5",
"serve-favicon": "^2.3.0",
"webpack": "^1.13.0",
"webpack-dev-middleware": "^1.6.1"
}, },
"dependencies": {},
"devDependencies": { "devDependencies": {
"chai": "3.5.0", "eslint": "^2.0.0",
"coveralls": "^2.11.9", "eslint-config-finn": "^1.0.0-alpha.3",
"eslint": "^2.9.0",
"eslint-config-spt": "^2.0.0",
"eslint-plugin-react": "^4.3.0", "eslint-plugin-react": "^4.3.0",
"istanbul": "^0.4.3", "lerna": "2.0.0-beta.20",
"jest-cli": "0.5.8",
"mocha": "^2.4.5",
"mocha-lcov-reporter": "1.2.0",
"nsp": "^2.3.2", "nsp": "^2.3.2",
"pre-commit": "^1.0.2", "pre-commit": "^1.0.2"
"react-tools": "^0.13.1",
"supertest": "^1.2.0",
"supervisor": "^0.10.0"
},
"jest": {
"scriptPreprocessor": "<rootDir>/scripts/jest-preprocessor.js",
"modulePathIgnorePatterns": [
"<rootDir>/node_modules/npm"
],
"unmockedModulePathPatterns": [
"<rootDir>/node_modules/react",
"<rootDir>/node_modules/reflux"
],
"moduleFileExtensions": [
"jsx",
"js"
]
}, },
"pre-commit": [ "pre-commit": [
"lint" "lint"

View File

@ -6,20 +6,28 @@ var validator = require('express-validator');
var log4js = require('log4js'); var log4js = require('log4js');
var logger = require('./lib/logger'); var logger = require('./lib/logger');
var routes = require('./lib/routes'); var routes = require('./lib/routes');
var path = require('path');
module.exports = function(config) { module.exports = function(config) {
var app = express(); var app = express();
var router = express.Router(); // eslint-disable-line var router = express.Router();
var baseUriPath = config.baseUriPath || ''; var baseUriPath = config.baseUriPath || '';
var publicFolder = config.publicFolder;
app.set('trust proxy'); app.set('trust proxy');
app.set('port', config.port); app.set('port', config.port);
app.locals.baseUriPath = baseUriPath; app.locals.baseUriPath = baseUriPath;
app.use(cookieParser()); app.use(cookieParser());
app.use(favicon(__dirname + '/public/favicon.ico')); if (publicFolder) {
app.use(favicon(path.join(publicFolder, 'favicon.ico')));
}
app.use(validator([])); app.use(validator([]));
app.use(baseUriPath, express.static(__dirname + '/public')); if (publicFolder) {
app.use(baseUriPath, express.static(publicFolder));
}
app.use(bodyParser.json({ strict: false })); app.use(bodyParser.json({ strict: false }));
app.use(log4js.connectLogger(logger, { app.use(log4js.connectLogger(logger, {
format: ':remote-addr :status :method :url :response-timems', format: ':remote-addr :status :method :url :response-timems',
@ -30,5 +38,9 @@ module.exports = function(config) {
routes.create(router, config); routes.create(router, config);
app.use(baseUriPath, router); app.use(baseUriPath, router);
if (process.env.NODE_ENV !== 'production') {
app.use(require('errorhandler')());
}
return app; return app;
}; };

View File

@ -0,0 +1,71 @@
{
"name": "unleash-api",
"description": "unleash your features",
"version": "1.0.0-alpha.1",
"keywords": [
"unleash",
"feature toggle",
"feature",
"toggle"
],
"files": [
"lib",
"migrations",
"public",
"app.js",
"server.js",
"server-impl.js",
"README.md",
"LICENSE"
],
"repository": {
"type": "git",
"url": "ssh://git@github.com:finn-no/unleash.git"
},
"bugs": {
"url": "https://github.com/finn-no/unleash/issues"
},
"engines": {
"node": "6"
},
"main": "./server-impl.js",
"scripts": {
"db-migrate-and-start": "npm run db-migrate && npm run start",
"start": "node server.js",
"start:dev": "NODE_ENV=development supervisor --ignore ./node_modules/ server.js",
"start:dev:pg": "pg_virtualenv npm run start:dev:pg-chain",
"start:dev:pg-chain": "export DATABASE_URL=postgres://$PGUSER:$PGPASSWORD@localhost:$PGPORT/postgres ; db-migrate up && npm run start:dev",
"db-migrate": "db-migrate up",
"test": "export PORT=4243 ; mocha test test/*.js && npm run test:coverage",
"test:ci": "npm run db-migrate && npm run test",
"test:watch": "mocha --watch test test/*",
"test:pg-virtualenv": "pg_virtualenv npm run test:pg-virtualenv-chai",
"test:pg-virtualenv-chain": "export TEST_DATABASE_URL=postgres://$PGUSER:$PGPASSWORD@localhost:$PGPORT/postgres ; npm run db-migrate-testdb && npm test",
"test:coverage": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec",
"test:coverage-report": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
},
"dependencies": {
"bluebird": "2.9.14",
"body-parser": "1.15.0",
"cookie-parser": "^1.4.1",
"db-migrate": "0.9.23",
"deep-diff": "^0.3.3",
"errorhandler": "1.3.5",
"express": "4.13.4",
"express-validator": "2.20.3",
"install": "^0.6.1",
"knex": "^0.10.0",
"log4js": "0.6.35",
"pg": "^4.5.5",
"serve-favicon": "^2.3.0"
},
"devDependencies": {
"chai": "3.5.0",
"coveralls": "^2.11.9",
"istanbul": "^0.4.3",
"mocha": "^2.4.5",
"mocha-lcov-reporter": "1.2.0",
"supertest": "^1.2.0",
"supervisor": "^0.10.0"
}
}

View File

@ -19,7 +19,8 @@ function start(options) {
eventDb: eventDb, eventDb: eventDb,
eventStore: eventStore, eventStore: eventStore,
featureDb: featureDb, featureDb: featureDb,
strategyDb: strategyDb strategyDb: strategyDb,
publicFolder: options.publicFolder
}; };
var app = require('./app')(config); var app = require('./app')(config);

View File

@ -0,0 +1,6 @@
{
"extends": [
"finn",
"finn/node"
]
}

View File

@ -0,0 +1 @@
# TODO

View File

@ -0,0 +1,6 @@
'use strict';
const path = require('path');
module.exports = {
publicFolder: path.join(__dirname, '..', 'public')
};

View File

@ -0,0 +1,16 @@
'use strict';
const server = require('unleash-server');
const unleash = server.start({});
const app = unleash.app;
const config = unleash.config;
const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackConfig = require('./webpack.config');
const compiler = webpack(webpackConfig);
app.use(config.baseUriPath, webpackDevMiddleware(compiler, {
publicPath: '/js',
noInfo: true
}));

View File

@ -0,0 +1,74 @@
{
"name": "unleash-frontend",
"description": "unleash your features",
"version": "1.0.0-alpha.1",
"keywords": [
"unleash",
"feature toggle",
"feature",
"toggle"
],
"files": [
"public",
"README.md",
"LICENSE"
],
"repository": {
"type": "git",
"url": "ssh://git@github.com:finn-no/unleash.git"
},
"bugs": {
"url": "https://github.com/finn-no/unleash/issues"
},
"engines": {
"node": "6"
},
"scripts": {
"build": "webpack -p",
"start": "NODE_ENV=development supervisor --ignore ./node_modules/,./public/js lib/server-dev.js",
"test": "jest",
"test:ci": "npm run test"
},
"main": "./lib/index.js",
"dependencies": {
"jsx-loader": "0.12.2",
"lodash": "^3.5.0",
"moment": "^2.13.0",
"react": "^0.13.1",
"react-router": "^0.13.2",
"reflux": "^0.2.10",
"reqwest": "^2.0.5",
"webpack": "^1.13.0",
"webpack-dev-middleware": "^1.6.1"
},
"devDependencies": {
"chai": "3.5.0",
"coveralls": "^2.11.9",
"istanbul": "^0.4.3",
"jest-cli": "0.5.8",
"mocha": "^2.4.5",
"mocha-lcov-reporter": "1.2.0",
"nsp": "^2.3.2",
"react-tools": "^0.13.1",
"supertest": "^1.2.0",
"supervisor": "^0.10.0",
"unleash-api": "1.0.0-alpha.1"
},
"jest": {
"scriptPreprocessor": "<rootDir>/jest-preprocessor.js",
"modulePathIgnorePatterns": [
"<rootDir>/node_modules/npm"
],
"unmockedModulePathPatterns": [
"<rootDir>/node_modules/react",
"<rootDir>/node_modules/reflux"
],
"moduleFileExtensions": [
"jsx",
"js"
]
},
"pre-commit": [
"lint"
]
}

View File

@ -0,0 +1,6 @@
{
"extends": [
"finn",
"finn/react"
]
}

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More