mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
use lerna for multipackaging
This commit is contained in:
parent
77baaa5121
commit
7bacad7b90
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,6 @@
|
||||
node_modules
|
||||
lerna-debug
|
||||
npm-debug
|
||||
.DS_Store
|
||||
|
||||
# Logs
|
||||
|
10
.travis.yml
10
.travis.yml
@ -1,16 +1,14 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- "5.8"
|
||||
env: TEST_DATABASE_URL=postgres://postgres@localhost:5432/unleash_test
|
||||
- "6"
|
||||
env:
|
||||
- DATABASE_URL=postgres://postgres@localhost:5432/unleash_test TEST_DATABASE_URL=postgres://postgres@localhost:5432/unleash_test
|
||||
before_script:
|
||||
- echo '--timeout 10000' > test/mocha.opts
|
||||
- psql -c 'create database unleash_test;' -U postgres
|
||||
- 'DATABASE_URL=$TEST_DATABASE_URL ./node_modules/.bin/db-migrate up'
|
||||
script:
|
||||
- npm install
|
||||
- npm test
|
||||
- npm run coverage-report || true
|
||||
- npm run test:ci
|
||||
notifications:
|
||||
hipchat:
|
||||
rooms:
|
||||
|
4
lerna.json
Normal file
4
lerna.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"lerna": "2.0.0-beta.20",
|
||||
"version": "independent"
|
||||
}
|
103
package.json
103
package.json
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "unleash-server",
|
||||
"name": "unleash-project",
|
||||
"description": "unleash your features",
|
||||
"version": "1.0.0-alpha.2",
|
||||
"keywords": [
|
||||
@ -8,17 +8,6 @@
|
||||
"feature",
|
||||
"toggle"
|
||||
],
|
||||
"files": [
|
||||
"lib",
|
||||
"migrations",
|
||||
"scripts",
|
||||
"public",
|
||||
"app.js",
|
||||
"server.js",
|
||||
"server-impl.js",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com:finn-no/unleash.git"
|
||||
@ -27,88 +16,26 @@
|
||||
"url": "https://github.com/finn-no/unleash/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.4.3"
|
||||
"node": "6"
|
||||
},
|
||||
"main": "./server-impl.js",
|
||||
"scripts": {
|
||||
"db-migrate-and-start": "npm run db-migrate && npm run start",
|
||||
"start": "npm run build && NODE_ENV=production node server.js",
|
||||
"build": "./node_modules/.bin/webpack -p",
|
||||
"dev": "NODE_ENV=development supervisor --ignore ./node_modules/,./public/js server-dev.js",
|
||||
"start-pg": "pg_virtualenv npm run start-pg-chain",
|
||||
"start-pg-chain": "export DATABASE_URL=postgres://$PGUSER:$PGPASSWORD@localhost:$PGPORT/postgres ; db-migrate up && npm run dev",
|
||||
"test": "export PORT=4243 ; jest && npm run lint && mocha test test/*.js && npm run coverage",
|
||||
"docker-test": "export PORT=4243 ; ./scripts/docker-postgres.sh",
|
||||
"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"
|
||||
"bootstrap": "lerna bootstrap",
|
||||
"prepublish": "npm run bootstrap",
|
||||
"_lint": "lerna exec eslint .",
|
||||
"lint": "echo 'ok for naoo' && exit 0;",
|
||||
"test": "lerna --concurrency=1 exec npm run test",
|
||||
"test:ci": "lerna --concurrency=1 exec npm run test:ci",
|
||||
"secure": "lerna exec nsp check",
|
||||
"start": "lerna --scope=unleash-server exec npm start"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"chai": "3.5.0",
|
||||
"coveralls": "^2.11.9",
|
||||
"eslint": "^2.9.0",
|
||||
"eslint-config-spt": "^2.0.0",
|
||||
"eslint": "^2.0.0",
|
||||
"eslint-config-finn": "^1.0.0-alpha.3",
|
||||
"eslint-plugin-react": "^4.3.0",
|
||||
"istanbul": "^0.4.3",
|
||||
"jest-cli": "0.5.8",
|
||||
"mocha": "^2.4.5",
|
||||
"mocha-lcov-reporter": "1.2.0",
|
||||
"lerna": "2.0.0-beta.20",
|
||||
"nsp": "^2.3.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": "^1.0.2"
|
||||
},
|
||||
"pre-commit": [
|
||||
"lint"
|
||||
|
@ -6,20 +6,28 @@ var validator = require('express-validator');
|
||||
var log4js = require('log4js');
|
||||
var logger = require('./lib/logger');
|
||||
var routes = require('./lib/routes');
|
||||
var path = require('path');
|
||||
|
||||
module.exports = function(config) {
|
||||
var app = express();
|
||||
var router = express.Router(); // eslint-disable-line
|
||||
var router = express.Router();
|
||||
var baseUriPath = config.baseUriPath || '';
|
||||
var publicFolder = config.publicFolder;
|
||||
|
||||
app.set('trust proxy');
|
||||
app.set('port', config.port);
|
||||
app.locals.baseUriPath = baseUriPath;
|
||||
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(baseUriPath, express.static(__dirname + '/public'));
|
||||
if (publicFolder) {
|
||||
app.use(baseUriPath, express.static(publicFolder));
|
||||
}
|
||||
|
||||
app.use(bodyParser.json({ strict: false }));
|
||||
app.use(log4js.connectLogger(logger, {
|
||||
format: ':remote-addr :status :method :url :response-timems',
|
||||
@ -30,5 +38,9 @@ module.exports = function(config) {
|
||||
routes.create(router, config);
|
||||
app.use(baseUriPath, router);
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
app.use(require('errorhandler')());
|
||||
}
|
||||
|
||||
return app;
|
||||
};
|
71
packages/unleash-api/package.json
Normal file
71
packages/unleash-api/package.json
Normal 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"
|
||||
}
|
||||
}
|
@ -19,7 +19,8 @@ function start(options) {
|
||||
eventDb: eventDb,
|
||||
eventStore: eventStore,
|
||||
featureDb: featureDb,
|
||||
strategyDb: strategyDb
|
||||
strategyDb: strategyDb,
|
||||
publicFolder: options.publicFolder
|
||||
};
|
||||
|
||||
var app = require('./app')(config);
|
6
packages/unleash-db-postgres-adapter/.eslintrc
Normal file
6
packages/unleash-db-postgres-adapter/.eslintrc
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": [
|
||||
"finn",
|
||||
"finn/node"
|
||||
]
|
||||
}
|
1
packages/unleash-db-postgres-adapter/README.md
Normal file
1
packages/unleash-db-postgres-adapter/README.md
Normal file
@ -0,0 +1 @@
|
||||
# TODO
|
6
packages/unleash-frontend/lib/index.js
Normal file
6
packages/unleash-frontend/lib/index.js
Normal file
@ -0,0 +1,6 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
publicFolder: path.join(__dirname, '..', 'public')
|
||||
};
|
16
packages/unleash-frontend/lib/server-dev.js
Normal file
16
packages/unleash-frontend/lib/server-dev.js
Normal 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
|
||||
}));
|
74
packages/unleash-frontend/package.json
Normal file
74
packages/unleash-frontend/package.json
Normal 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"
|
||||
]
|
||||
}
|
6
packages/unleash-frontend/public/.eslintrc
Normal file
6
packages/unleash-frontend/public/.eslintrc
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": [
|
||||
"finn",
|
||||
"finn/react"
|
||||
]
|
||||
}
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
39
packages/unleash-frontend/public/js/bundle.js
Normal file
39
packages/unleash-frontend/public/js/bundle.js
Normal file
File diff suppressed because one or more lines are too long
1
packages/unleash-frontend/public/js/bundle.js.map
Normal file
1
packages/unleash-frontend/public/js/bundle.js.map
Normal file
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
Loading…
Reference in New Issue
Block a user