From 0bd0924aeefe1bf7beffa34a37f8a348a65bc4a5 Mon Sep 17 00:00:00 2001 From: ivaosthu Date: Thu, 10 Nov 2016 15:52:49 +0100 Subject: [PATCH] remove all lerna stuff --- .eslintrc | 10 ++- packages/unleash-api/app.js => app.js | 0 .../unleash-server/bin => bin}/unleash.js | 0 lerna.json | 4 - .../lib => lib}/client-metrics/index.js | 0 .../lib => lib}/client-metrics/list.js | 0 .../lib => lib}/client-metrics/list.test.js | 0 .../lib => lib}/client-metrics/projection.js | 0 .../lib => lib}/client-metrics/service.js | 0 .../lib => lib}/client-metrics/ttl-list.js | 0 .../client-metrics/ttl-list.test.js | 0 .../lib => lib}/db/client-instance-store.js | 0 .../lib => lib}/db/client-metrics-store.js | 0 .../lib => lib}/db/client-strategy-store.js | 0 .../unleash-api/lib => lib}/db/db-pool.js | 0 .../unleash-api/lib => lib}/db/event-store.js | 0 .../lib => lib}/db/feature-toggle-store.js | 0 {packages/unleash-api/lib => lib}/db/index.js | 0 .../lib => lib}/db/strategy-store.js | 0 .../lib => lib}/error/name-exists-error.js | 0 .../lib => lib}/error/notfound-error.js | 0 .../lib => lib}/error/validate-request.js | 0 .../lib => lib}/error/validation-error.js | 0 .../unleash-api/lib => lib}/event-differ.js | 0 .../unleash-api/lib => lib}/event-type.js | 0 .../unleash-api/lib => lib}/extract-user.js | 0 .../helper/legacy-feature-mapper.js | 0 {packages/unleash-api/lib => lib}/logger.js | 0 .../unleash-api/lib => lib}/routes/event.js | 0 .../lib => lib}/routes/feature-archive.js | 0 .../unleash-api/lib => lib}/routes/feature.js | 0 .../lib => lib}/routes/health-check.js | 0 .../unleash-api/lib => lib}/routes/index.js | 0 .../unleash-api/lib => lib}/routes/metrics.js | 0 .../lib => lib}/routes/strategy.js | 0 .../20141020151056-initial-schema.js | 0 ...41110144153-add-description-to-features.js | 0 ...5-add-parameters-template-to-strategies.js | 0 .../20141117202209-insert-default-strategy.js | 0 .../20141118071458-default-strategy-event.js | 0 ...215210141-005-archived-flag-to-features.js | 0 .../20150210152531-006-rename-eventtype.js | 0 ...160618193924-add-strategies-to-features.js | 0 .../20161027134128-create-metrics.js | 0 ...20161102212415-create-client-strategies.js | 0 .../20161104074441-create-client-instances.js | 0 .../sql/001-initial-schema.down.sql | 0 .../sql/001-initial-schema.up.sql | 0 .../002-add-description-to-features.down.sql | 0 .../002-add-description-to-features.up.sql | 0 ...parameters-template-to-strategies.down.sql | 0 ...d-parameters-template-to-strategies.up.sql | 0 ...004-insert-default-strategy-event.down.sql | 0 .../004-insert-default-strategy-event.up.sql | 0 .../sql/004-insert-default-strategy.down.sql | 0 .../sql/004-insert-default-strategy.up.sql | 0 .../005-archived-flag-to-features.down.sql | 0 .../sql/005-archived-flag-to-features.up.sql | 0 .../sql/006-rename-eventtype.down.sql | 0 .../sql/006-rename-eventtype.up.sql | 0 .../007-add-strategies-to-features.down.sql | 0 .../sql/007-add-strategies-to-features.up.sql | 0 .../sql/008-create-metrics.down.sql | 0 .../sql/008-create-metrics.up.sql | 0 .../sql/009-create-client-strategies.down.sql | 0 .../sql/009-create-client-strategies.up.sql | 0 .../sql/010-create-client-instances.down.sql | 0 .../sql/010-create-client-instances.up.sql | 0 .../unleash-api/migrator.js => migrator.js | 0 package.json | 81 ++++++++++++++----- packages/unleash-api/.eslintrc | 9 --- packages/unleash-api/package.json | 80 ------------------ packages/unleash-server/.eslintrc | 6 -- packages/unleash-server/package.json | 42 ---------- packages/unleash-server/server-impl.js | 3 - .../scripts => scripts}/docker-postgres.sh | 0 .../scripts => scripts}/migration-runner.js | 0 .../dev-server.js => server-dev.js | 0 .../server-impl.js => server-impl.js | 0 .../server.js => server-prod.js | 3 +- {packages/unleash-api/test => test}/.eslintrc | 0 .../test => test}/e2e/database-config.js | 0 .../test => test}/e2e/event-api.test.js | 0 .../test => test}/e2e/feature-api.test.js | 0 .../e2e/feature-archive-api.test.js | 0 .../test => test}/e2e/router.test.js | 0 .../test => test}/e2e/strategy-api.test.js | 0 .../test => test}/e2e/test-helper.js | 0 .../test => test}/unit/event-differ.test.js | 0 .../unit/helper/legacy-feature-mapper.test.js | 0 .../test => test}/unit/routes/feature.test.js | 0 .../routes/mocks/fake-feature-toggle-store.js | 0 .../unit/routes/mocks/fake-metrics-store.js | 0 .../routes/mocks/fake-strategies-store.js | 0 .../unit/routes/strategies.test.js | 0 95 files changed, 68 insertions(+), 170 deletions(-) rename packages/unleash-api/app.js => app.js (100%) rename {packages/unleash-server/bin => bin}/unleash.js (100%) delete mode 100644 lerna.json rename {packages/unleash-api/lib => lib}/client-metrics/index.js (100%) rename {packages/unleash-api/lib => lib}/client-metrics/list.js (100%) rename {packages/unleash-api/lib => lib}/client-metrics/list.test.js (100%) rename {packages/unleash-api/lib => lib}/client-metrics/projection.js (100%) rename {packages/unleash-api/lib => lib}/client-metrics/service.js (100%) rename {packages/unleash-api/lib => lib}/client-metrics/ttl-list.js (100%) rename {packages/unleash-api/lib => lib}/client-metrics/ttl-list.test.js (100%) rename {packages/unleash-api/lib => lib}/db/client-instance-store.js (100%) rename {packages/unleash-api/lib => lib}/db/client-metrics-store.js (100%) rename {packages/unleash-api/lib => lib}/db/client-strategy-store.js (100%) rename {packages/unleash-api/lib => lib}/db/db-pool.js (100%) rename {packages/unleash-api/lib => lib}/db/event-store.js (100%) rename {packages/unleash-api/lib => lib}/db/feature-toggle-store.js (100%) rename {packages/unleash-api/lib => lib}/db/index.js (100%) rename {packages/unleash-api/lib => lib}/db/strategy-store.js (100%) rename {packages/unleash-api/lib => lib}/error/name-exists-error.js (100%) rename {packages/unleash-api/lib => lib}/error/notfound-error.js (100%) rename {packages/unleash-api/lib => lib}/error/validate-request.js (100%) rename {packages/unleash-api/lib => lib}/error/validation-error.js (100%) rename {packages/unleash-api/lib => lib}/event-differ.js (100%) rename {packages/unleash-api/lib => lib}/event-type.js (100%) rename {packages/unleash-api/lib => lib}/extract-user.js (100%) rename {packages/unleash-api/lib => lib}/helper/legacy-feature-mapper.js (100%) rename {packages/unleash-api/lib => lib}/logger.js (100%) rename {packages/unleash-api/lib => lib}/routes/event.js (100%) rename {packages/unleash-api/lib => lib}/routes/feature-archive.js (100%) rename {packages/unleash-api/lib => lib}/routes/feature.js (100%) rename {packages/unleash-api/lib => lib}/routes/health-check.js (100%) rename {packages/unleash-api/lib => lib}/routes/index.js (100%) rename {packages/unleash-api/lib => lib}/routes/metrics.js (100%) rename {packages/unleash-api/lib => lib}/routes/strategy.js (100%) rename {packages/unleash-api/migrations => migrations}/20141020151056-initial-schema.js (100%) rename {packages/unleash-api/migrations => migrations}/20141110144153-add-description-to-features.js (100%) rename {packages/unleash-api/migrations => migrations}/20141117200435-add-parameters-template-to-strategies.js (100%) rename {packages/unleash-api/migrations => migrations}/20141117202209-insert-default-strategy.js (100%) rename {packages/unleash-api/migrations => migrations}/20141118071458-default-strategy-event.js (100%) rename {packages/unleash-api/migrations => migrations}/20141215210141-005-archived-flag-to-features.js (100%) rename {packages/unleash-api/migrations => migrations}/20150210152531-006-rename-eventtype.js (100%) rename {packages/unleash-api/migrations => migrations}/20160618193924-add-strategies-to-features.js (100%) rename {packages/unleash-api/migrations => migrations}/20161027134128-create-metrics.js (100%) rename {packages/unleash-api/migrations => migrations}/20161102212415-create-client-strategies.js (100%) rename {packages/unleash-api/migrations => migrations}/20161104074441-create-client-instances.js (100%) rename {packages/unleash-api/migrations => migrations}/sql/001-initial-schema.down.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/001-initial-schema.up.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/002-add-description-to-features.down.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/002-add-description-to-features.up.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/003-add-parameters-template-to-strategies.down.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/003-add-parameters-template-to-strategies.up.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/004-insert-default-strategy-event.down.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/004-insert-default-strategy-event.up.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/004-insert-default-strategy.down.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/004-insert-default-strategy.up.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/005-archived-flag-to-features.down.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/005-archived-flag-to-features.up.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/006-rename-eventtype.down.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/006-rename-eventtype.up.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/007-add-strategies-to-features.down.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/007-add-strategies-to-features.up.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/008-create-metrics.down.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/008-create-metrics.up.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/009-create-client-strategies.down.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/009-create-client-strategies.up.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/010-create-client-instances.down.sql (100%) rename {packages/unleash-api/migrations => migrations}/sql/010-create-client-instances.up.sql (100%) rename packages/unleash-api/migrator.js => migrator.js (100%) delete mode 100644 packages/unleash-api/.eslintrc delete mode 100644 packages/unleash-api/package.json delete mode 100644 packages/unleash-server/.eslintrc delete mode 100644 packages/unleash-server/package.json delete mode 100644 packages/unleash-server/server-impl.js rename {packages/unleash-api/scripts => scripts}/docker-postgres.sh (100%) rename {packages/unleash-api/scripts => scripts}/migration-runner.js (100%) rename packages/unleash-api/dev-server.js => server-dev.js (100%) rename packages/unleash-api/server-impl.js => server-impl.js (100%) rename packages/unleash-server/server.js => server-prod.js (84%) rename {packages/unleash-api/test => test}/.eslintrc (100%) rename {packages/unleash-api/test => test}/e2e/database-config.js (100%) rename {packages/unleash-api/test => test}/e2e/event-api.test.js (100%) rename {packages/unleash-api/test => test}/e2e/feature-api.test.js (100%) rename {packages/unleash-api/test => test}/e2e/feature-archive-api.test.js (100%) rename {packages/unleash-api/test => test}/e2e/router.test.js (100%) rename {packages/unleash-api/test => test}/e2e/strategy-api.test.js (100%) rename {packages/unleash-api/test => test}/e2e/test-helper.js (100%) rename {packages/unleash-api/test => test}/unit/event-differ.test.js (100%) rename {packages/unleash-api/test => test}/unit/helper/legacy-feature-mapper.test.js (100%) rename {packages/unleash-api/test => test}/unit/routes/feature.test.js (100%) rename {packages/unleash-api/test => test}/unit/routes/mocks/fake-feature-toggle-store.js (100%) rename {packages/unleash-api/test => test}/unit/routes/mocks/fake-metrics-store.js (100%) rename {packages/unleash-api/test => test}/unit/routes/mocks/fake-strategies-store.js (100%) rename {packages/unleash-api/test => test}/unit/routes/strategies.test.js (100%) diff --git a/.eslintrc b/.eslintrc index 5b1068a0b9..047272e06d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,5 +1,9 @@ { "extends": [ - "finn" - ] -} \ No newline at end of file + "finn", + "finn/node" + ], + "rules": { + "max-nested-callbacks": "off" + } +} diff --git a/packages/unleash-api/app.js b/app.js similarity index 100% rename from packages/unleash-api/app.js rename to app.js diff --git a/packages/unleash-server/bin/unleash.js b/bin/unleash.js similarity index 100% rename from packages/unleash-server/bin/unleash.js rename to bin/unleash.js diff --git a/lerna.json b/lerna.json deleted file mode 100644 index dfcc2e9f35..0000000000 --- a/lerna.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "lerna": "2.0.0-beta.30", - "version": "independent" -} diff --git a/packages/unleash-api/lib/client-metrics/index.js b/lib/client-metrics/index.js similarity index 100% rename from packages/unleash-api/lib/client-metrics/index.js rename to lib/client-metrics/index.js diff --git a/packages/unleash-api/lib/client-metrics/list.js b/lib/client-metrics/list.js similarity index 100% rename from packages/unleash-api/lib/client-metrics/list.js rename to lib/client-metrics/list.js diff --git a/packages/unleash-api/lib/client-metrics/list.test.js b/lib/client-metrics/list.test.js similarity index 100% rename from packages/unleash-api/lib/client-metrics/list.test.js rename to lib/client-metrics/list.test.js diff --git a/packages/unleash-api/lib/client-metrics/projection.js b/lib/client-metrics/projection.js similarity index 100% rename from packages/unleash-api/lib/client-metrics/projection.js rename to lib/client-metrics/projection.js diff --git a/packages/unleash-api/lib/client-metrics/service.js b/lib/client-metrics/service.js similarity index 100% rename from packages/unleash-api/lib/client-metrics/service.js rename to lib/client-metrics/service.js diff --git a/packages/unleash-api/lib/client-metrics/ttl-list.js b/lib/client-metrics/ttl-list.js similarity index 100% rename from packages/unleash-api/lib/client-metrics/ttl-list.js rename to lib/client-metrics/ttl-list.js diff --git a/packages/unleash-api/lib/client-metrics/ttl-list.test.js b/lib/client-metrics/ttl-list.test.js similarity index 100% rename from packages/unleash-api/lib/client-metrics/ttl-list.test.js rename to lib/client-metrics/ttl-list.test.js diff --git a/packages/unleash-api/lib/db/client-instance-store.js b/lib/db/client-instance-store.js similarity index 100% rename from packages/unleash-api/lib/db/client-instance-store.js rename to lib/db/client-instance-store.js diff --git a/packages/unleash-api/lib/db/client-metrics-store.js b/lib/db/client-metrics-store.js similarity index 100% rename from packages/unleash-api/lib/db/client-metrics-store.js rename to lib/db/client-metrics-store.js diff --git a/packages/unleash-api/lib/db/client-strategy-store.js b/lib/db/client-strategy-store.js similarity index 100% rename from packages/unleash-api/lib/db/client-strategy-store.js rename to lib/db/client-strategy-store.js diff --git a/packages/unleash-api/lib/db/db-pool.js b/lib/db/db-pool.js similarity index 100% rename from packages/unleash-api/lib/db/db-pool.js rename to lib/db/db-pool.js diff --git a/packages/unleash-api/lib/db/event-store.js b/lib/db/event-store.js similarity index 100% rename from packages/unleash-api/lib/db/event-store.js rename to lib/db/event-store.js diff --git a/packages/unleash-api/lib/db/feature-toggle-store.js b/lib/db/feature-toggle-store.js similarity index 100% rename from packages/unleash-api/lib/db/feature-toggle-store.js rename to lib/db/feature-toggle-store.js diff --git a/packages/unleash-api/lib/db/index.js b/lib/db/index.js similarity index 100% rename from packages/unleash-api/lib/db/index.js rename to lib/db/index.js diff --git a/packages/unleash-api/lib/db/strategy-store.js b/lib/db/strategy-store.js similarity index 100% rename from packages/unleash-api/lib/db/strategy-store.js rename to lib/db/strategy-store.js diff --git a/packages/unleash-api/lib/error/name-exists-error.js b/lib/error/name-exists-error.js similarity index 100% rename from packages/unleash-api/lib/error/name-exists-error.js rename to lib/error/name-exists-error.js diff --git a/packages/unleash-api/lib/error/notfound-error.js b/lib/error/notfound-error.js similarity index 100% rename from packages/unleash-api/lib/error/notfound-error.js rename to lib/error/notfound-error.js diff --git a/packages/unleash-api/lib/error/validate-request.js b/lib/error/validate-request.js similarity index 100% rename from packages/unleash-api/lib/error/validate-request.js rename to lib/error/validate-request.js diff --git a/packages/unleash-api/lib/error/validation-error.js b/lib/error/validation-error.js similarity index 100% rename from packages/unleash-api/lib/error/validation-error.js rename to lib/error/validation-error.js diff --git a/packages/unleash-api/lib/event-differ.js b/lib/event-differ.js similarity index 100% rename from packages/unleash-api/lib/event-differ.js rename to lib/event-differ.js diff --git a/packages/unleash-api/lib/event-type.js b/lib/event-type.js similarity index 100% rename from packages/unleash-api/lib/event-type.js rename to lib/event-type.js diff --git a/packages/unleash-api/lib/extract-user.js b/lib/extract-user.js similarity index 100% rename from packages/unleash-api/lib/extract-user.js rename to lib/extract-user.js diff --git a/packages/unleash-api/lib/helper/legacy-feature-mapper.js b/lib/helper/legacy-feature-mapper.js similarity index 100% rename from packages/unleash-api/lib/helper/legacy-feature-mapper.js rename to lib/helper/legacy-feature-mapper.js diff --git a/packages/unleash-api/lib/logger.js b/lib/logger.js similarity index 100% rename from packages/unleash-api/lib/logger.js rename to lib/logger.js diff --git a/packages/unleash-api/lib/routes/event.js b/lib/routes/event.js similarity index 100% rename from packages/unleash-api/lib/routes/event.js rename to lib/routes/event.js diff --git a/packages/unleash-api/lib/routes/feature-archive.js b/lib/routes/feature-archive.js similarity index 100% rename from packages/unleash-api/lib/routes/feature-archive.js rename to lib/routes/feature-archive.js diff --git a/packages/unleash-api/lib/routes/feature.js b/lib/routes/feature.js similarity index 100% rename from packages/unleash-api/lib/routes/feature.js rename to lib/routes/feature.js diff --git a/packages/unleash-api/lib/routes/health-check.js b/lib/routes/health-check.js similarity index 100% rename from packages/unleash-api/lib/routes/health-check.js rename to lib/routes/health-check.js diff --git a/packages/unleash-api/lib/routes/index.js b/lib/routes/index.js similarity index 100% rename from packages/unleash-api/lib/routes/index.js rename to lib/routes/index.js diff --git a/packages/unleash-api/lib/routes/metrics.js b/lib/routes/metrics.js similarity index 100% rename from packages/unleash-api/lib/routes/metrics.js rename to lib/routes/metrics.js diff --git a/packages/unleash-api/lib/routes/strategy.js b/lib/routes/strategy.js similarity index 100% rename from packages/unleash-api/lib/routes/strategy.js rename to lib/routes/strategy.js diff --git a/packages/unleash-api/migrations/20141020151056-initial-schema.js b/migrations/20141020151056-initial-schema.js similarity index 100% rename from packages/unleash-api/migrations/20141020151056-initial-schema.js rename to migrations/20141020151056-initial-schema.js diff --git a/packages/unleash-api/migrations/20141110144153-add-description-to-features.js b/migrations/20141110144153-add-description-to-features.js similarity index 100% rename from packages/unleash-api/migrations/20141110144153-add-description-to-features.js rename to migrations/20141110144153-add-description-to-features.js diff --git a/packages/unleash-api/migrations/20141117200435-add-parameters-template-to-strategies.js b/migrations/20141117200435-add-parameters-template-to-strategies.js similarity index 100% rename from packages/unleash-api/migrations/20141117200435-add-parameters-template-to-strategies.js rename to migrations/20141117200435-add-parameters-template-to-strategies.js diff --git a/packages/unleash-api/migrations/20141117202209-insert-default-strategy.js b/migrations/20141117202209-insert-default-strategy.js similarity index 100% rename from packages/unleash-api/migrations/20141117202209-insert-default-strategy.js rename to migrations/20141117202209-insert-default-strategy.js diff --git a/packages/unleash-api/migrations/20141118071458-default-strategy-event.js b/migrations/20141118071458-default-strategy-event.js similarity index 100% rename from packages/unleash-api/migrations/20141118071458-default-strategy-event.js rename to migrations/20141118071458-default-strategy-event.js diff --git a/packages/unleash-api/migrations/20141215210141-005-archived-flag-to-features.js b/migrations/20141215210141-005-archived-flag-to-features.js similarity index 100% rename from packages/unleash-api/migrations/20141215210141-005-archived-flag-to-features.js rename to migrations/20141215210141-005-archived-flag-to-features.js diff --git a/packages/unleash-api/migrations/20150210152531-006-rename-eventtype.js b/migrations/20150210152531-006-rename-eventtype.js similarity index 100% rename from packages/unleash-api/migrations/20150210152531-006-rename-eventtype.js rename to migrations/20150210152531-006-rename-eventtype.js diff --git a/packages/unleash-api/migrations/20160618193924-add-strategies-to-features.js b/migrations/20160618193924-add-strategies-to-features.js similarity index 100% rename from packages/unleash-api/migrations/20160618193924-add-strategies-to-features.js rename to migrations/20160618193924-add-strategies-to-features.js diff --git a/packages/unleash-api/migrations/20161027134128-create-metrics.js b/migrations/20161027134128-create-metrics.js similarity index 100% rename from packages/unleash-api/migrations/20161027134128-create-metrics.js rename to migrations/20161027134128-create-metrics.js diff --git a/packages/unleash-api/migrations/20161102212415-create-client-strategies.js b/migrations/20161102212415-create-client-strategies.js similarity index 100% rename from packages/unleash-api/migrations/20161102212415-create-client-strategies.js rename to migrations/20161102212415-create-client-strategies.js diff --git a/packages/unleash-api/migrations/20161104074441-create-client-instances.js b/migrations/20161104074441-create-client-instances.js similarity index 100% rename from packages/unleash-api/migrations/20161104074441-create-client-instances.js rename to migrations/20161104074441-create-client-instances.js diff --git a/packages/unleash-api/migrations/sql/001-initial-schema.down.sql b/migrations/sql/001-initial-schema.down.sql similarity index 100% rename from packages/unleash-api/migrations/sql/001-initial-schema.down.sql rename to migrations/sql/001-initial-schema.down.sql diff --git a/packages/unleash-api/migrations/sql/001-initial-schema.up.sql b/migrations/sql/001-initial-schema.up.sql similarity index 100% rename from packages/unleash-api/migrations/sql/001-initial-schema.up.sql rename to migrations/sql/001-initial-schema.up.sql diff --git a/packages/unleash-api/migrations/sql/002-add-description-to-features.down.sql b/migrations/sql/002-add-description-to-features.down.sql similarity index 100% rename from packages/unleash-api/migrations/sql/002-add-description-to-features.down.sql rename to migrations/sql/002-add-description-to-features.down.sql diff --git a/packages/unleash-api/migrations/sql/002-add-description-to-features.up.sql b/migrations/sql/002-add-description-to-features.up.sql similarity index 100% rename from packages/unleash-api/migrations/sql/002-add-description-to-features.up.sql rename to migrations/sql/002-add-description-to-features.up.sql diff --git a/packages/unleash-api/migrations/sql/003-add-parameters-template-to-strategies.down.sql b/migrations/sql/003-add-parameters-template-to-strategies.down.sql similarity index 100% rename from packages/unleash-api/migrations/sql/003-add-parameters-template-to-strategies.down.sql rename to migrations/sql/003-add-parameters-template-to-strategies.down.sql diff --git a/packages/unleash-api/migrations/sql/003-add-parameters-template-to-strategies.up.sql b/migrations/sql/003-add-parameters-template-to-strategies.up.sql similarity index 100% rename from packages/unleash-api/migrations/sql/003-add-parameters-template-to-strategies.up.sql rename to migrations/sql/003-add-parameters-template-to-strategies.up.sql diff --git a/packages/unleash-api/migrations/sql/004-insert-default-strategy-event.down.sql b/migrations/sql/004-insert-default-strategy-event.down.sql similarity index 100% rename from packages/unleash-api/migrations/sql/004-insert-default-strategy-event.down.sql rename to migrations/sql/004-insert-default-strategy-event.down.sql diff --git a/packages/unleash-api/migrations/sql/004-insert-default-strategy-event.up.sql b/migrations/sql/004-insert-default-strategy-event.up.sql similarity index 100% rename from packages/unleash-api/migrations/sql/004-insert-default-strategy-event.up.sql rename to migrations/sql/004-insert-default-strategy-event.up.sql diff --git a/packages/unleash-api/migrations/sql/004-insert-default-strategy.down.sql b/migrations/sql/004-insert-default-strategy.down.sql similarity index 100% rename from packages/unleash-api/migrations/sql/004-insert-default-strategy.down.sql rename to migrations/sql/004-insert-default-strategy.down.sql diff --git a/packages/unleash-api/migrations/sql/004-insert-default-strategy.up.sql b/migrations/sql/004-insert-default-strategy.up.sql similarity index 100% rename from packages/unleash-api/migrations/sql/004-insert-default-strategy.up.sql rename to migrations/sql/004-insert-default-strategy.up.sql diff --git a/packages/unleash-api/migrations/sql/005-archived-flag-to-features.down.sql b/migrations/sql/005-archived-flag-to-features.down.sql similarity index 100% rename from packages/unleash-api/migrations/sql/005-archived-flag-to-features.down.sql rename to migrations/sql/005-archived-flag-to-features.down.sql diff --git a/packages/unleash-api/migrations/sql/005-archived-flag-to-features.up.sql b/migrations/sql/005-archived-flag-to-features.up.sql similarity index 100% rename from packages/unleash-api/migrations/sql/005-archived-flag-to-features.up.sql rename to migrations/sql/005-archived-flag-to-features.up.sql diff --git a/packages/unleash-api/migrations/sql/006-rename-eventtype.down.sql b/migrations/sql/006-rename-eventtype.down.sql similarity index 100% rename from packages/unleash-api/migrations/sql/006-rename-eventtype.down.sql rename to migrations/sql/006-rename-eventtype.down.sql diff --git a/packages/unleash-api/migrations/sql/006-rename-eventtype.up.sql b/migrations/sql/006-rename-eventtype.up.sql similarity index 100% rename from packages/unleash-api/migrations/sql/006-rename-eventtype.up.sql rename to migrations/sql/006-rename-eventtype.up.sql diff --git a/packages/unleash-api/migrations/sql/007-add-strategies-to-features.down.sql b/migrations/sql/007-add-strategies-to-features.down.sql similarity index 100% rename from packages/unleash-api/migrations/sql/007-add-strategies-to-features.down.sql rename to migrations/sql/007-add-strategies-to-features.down.sql diff --git a/packages/unleash-api/migrations/sql/007-add-strategies-to-features.up.sql b/migrations/sql/007-add-strategies-to-features.up.sql similarity index 100% rename from packages/unleash-api/migrations/sql/007-add-strategies-to-features.up.sql rename to migrations/sql/007-add-strategies-to-features.up.sql diff --git a/packages/unleash-api/migrations/sql/008-create-metrics.down.sql b/migrations/sql/008-create-metrics.down.sql similarity index 100% rename from packages/unleash-api/migrations/sql/008-create-metrics.down.sql rename to migrations/sql/008-create-metrics.down.sql diff --git a/packages/unleash-api/migrations/sql/008-create-metrics.up.sql b/migrations/sql/008-create-metrics.up.sql similarity index 100% rename from packages/unleash-api/migrations/sql/008-create-metrics.up.sql rename to migrations/sql/008-create-metrics.up.sql diff --git a/packages/unleash-api/migrations/sql/009-create-client-strategies.down.sql b/migrations/sql/009-create-client-strategies.down.sql similarity index 100% rename from packages/unleash-api/migrations/sql/009-create-client-strategies.down.sql rename to migrations/sql/009-create-client-strategies.down.sql diff --git a/packages/unleash-api/migrations/sql/009-create-client-strategies.up.sql b/migrations/sql/009-create-client-strategies.up.sql similarity index 100% rename from packages/unleash-api/migrations/sql/009-create-client-strategies.up.sql rename to migrations/sql/009-create-client-strategies.up.sql diff --git a/packages/unleash-api/migrations/sql/010-create-client-instances.down.sql b/migrations/sql/010-create-client-instances.down.sql similarity index 100% rename from packages/unleash-api/migrations/sql/010-create-client-instances.down.sql rename to migrations/sql/010-create-client-instances.down.sql diff --git a/packages/unleash-api/migrations/sql/010-create-client-instances.up.sql b/migrations/sql/010-create-client-instances.up.sql similarity index 100% rename from packages/unleash-api/migrations/sql/010-create-client-instances.up.sql rename to migrations/sql/010-create-client-instances.up.sql diff --git a/packages/unleash-api/migrator.js b/migrator.js similarity index 100% rename from packages/unleash-api/migrator.js rename to migrator.js diff --git a/package.json b/package.json index 8fd750f730..4f556a8bca 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "unleash-project", + "name": "unleash-server", "description": "unleash your features", "version": "1.0.0-alpha.2", "keywords": [ @@ -8,6 +8,15 @@ "feature", "toggle" ], + "files": [ + "lib", + "migrations", + "public", + "app.js", + "server-impl.js", + "README.md", + "LICENSE" + ], "repository": { "type": "git", "url": "ssh://git@github.com:finn-no/unleash.git" @@ -19,27 +28,57 @@ "node": "6" }, "license": "Apache-2.0", - "scripts": { - "bootstrap": "lerna bootstrap", - "prepublish": "npm run bootstrap", - "lint": "eslint . --ext=js,jsx", - "test": "npm run lint && lerna --concurrency=1 exec npm run test", - "test:ci": "npm run lint && lerna --concurrency=1 exec npm run test:ci", - "nsp": "lerna exec nsp check", - "start": "lerna --scope=unleash-server exec npm start", - "publish": "lerna publish", - "publish:dry": "lerna publish --skip-git --skip-npm", - "db-migrate": "lerna --scope=unleash-api exec npm run db-migrate", - "heroku-postbuild": "npm run bootstrap && lerna --scope=unleash-frontend exec npm run build" + "main": "./server.js", + "bin": { + "unleash": "./bin/unleash.js" + }, + "scripts": { + "db-migrate-and-start": "npm run db-migrate && npm run start", + "start": "node dev-server.js", + "start:dev": "NODE_ENV=development supervisor --ignore ./node_modules/ dev-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", + "db-migrate:down": "db-migrate down", + "test": "export PORT=4243 ; mocha --recursive test && npm run test:coverage", + "test:unit": "mocha test/unit/**/*.js ", + "test:ci": "npm run db-migrate && npm run test", + "test:docker": "./scripts/docker-postgres.sh", + "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 test --report lcovonly -- -R spec --recursive", + "test:coverage-report": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage" + }, + "dependencies": { + "body-parser": "1.15.2", + "cookie-parser": "^1.4.1", + "commander": "^2.9.0", + "db-migrate": "0.10.0-beta.17", + "db-migrate-pg": "0.1.10", + "deep-diff": "^0.3.3", + "errorhandler": "^1.4.3", + "express": "4.14.0", + "express-validator": "2.20.8", + "install": "^0.8.1", + "joi": "^9.2.0", + "knex": "^0.12.6", + "log4js": "^0.6.38", + "moment": "^2.15.2", + "pg": "^6.1.0", + "serve-favicon": "^2.3.0", + "yallist": "^2.0.0" }, - "dependencies": {}, "devDependencies": { - "babel-eslint": "^7.0.0", - "eslint": "^3.9.1", - "eslint-config-finn": "1.0.0-beta.1", - "eslint-config-finn-react": "^1.0.0-alpha.2", - "eslint-plugin-react": "^6.4.1", - "lerna": "2.0.0-beta.30", - "nsp": "^2.6.2" + "bluebird": "^3.4.6", + "ava": "^0.16.0", + "coveralls": "^2.11.12", + "istanbul": "^0.4.5", + "mocha": "^3.0.2", + "mocha-lcov-reporter": "1.2.0", + "sinon": "^1.17.5", + "supertest": "^2.0.0", + "supervisor": "^0.11.0", + "unleash-frontend": "1.0.0-alpha.2" } } diff --git a/packages/unleash-api/.eslintrc b/packages/unleash-api/.eslintrc deleted file mode 100644 index 047272e06d..0000000000 --- a/packages/unleash-api/.eslintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": [ - "finn", - "finn/node" - ], - "rules": { - "max-nested-callbacks": "off" - } -} diff --git a/packages/unleash-api/package.json b/packages/unleash-api/package.json deleted file mode 100644 index 4f5929dbad..0000000000 --- a/packages/unleash-api/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "unleash-api", - "description": "unleash your features", - "version": "1.0.0-alpha.2", - "keywords": [ - "unleash", - "feature toggle", - "feature", - "toggle" - ], - "files": [ - "lib", - "migrations", - "public", - "app.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" - }, - "license": "Apache-2.0", - "main": "./server-impl.js", - "scripts": { - "db-migrate-and-start": "npm run db-migrate && npm run start", - "start": "node dev-server.js", - "start:dev": "NODE_ENV=development supervisor --ignore ./node_modules/ dev-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", - "db-migrate:down": "db-migrate down", - "test": "export PORT=4243 ; mocha --recursive test && npm run test:coverage", - "test:unit": "mocha test/unit/**/*.js ", - "test:ci": "npm run db-migrate && npm run test", - "test:docker": "./scripts/docker-postgres.sh", - "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 test --report lcovonly -- -R spec --recursive", - "test:coverage-report": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage" - }, - "dependencies": { - "body-parser": "1.15.2", - "cookie-parser": "^1.4.1", - "db-migrate": "0.10.0-beta.17", - "db-migrate-pg": "0.1.10", - "deep-diff": "^0.3.3", - "errorhandler": "^1.4.3", - "express": "4.14.0", - "express-validator": "2.20.8", - "install": "^0.8.1", - "joi": "^9.2.0", - "knex": "^0.12.6", - "log4js": "^0.6.38", - "moment": "^2.15.2", - "pg": "^6.1.0", - "serve-favicon": "^2.3.0", - "yallist": "^2.0.0" - }, - "devDependencies": { - "bluebird": "^3.4.6", - "ava": "^0.16.0", - "coveralls": "^2.11.12", - "istanbul": "^0.4.5", - "mocha": "^3.0.2", - "mocha-lcov-reporter": "1.2.0", - "sinon": "^1.17.5", - "supertest": "^2.0.0", - "supervisor": "^0.11.0", - "unleash-frontend": "1.0.0-alpha.2" - } -} diff --git a/packages/unleash-server/.eslintrc b/packages/unleash-server/.eslintrc deleted file mode 100644 index 88b8a0343d..0000000000 --- a/packages/unleash-server/.eslintrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "finn", - "finn/node" - ] -} \ No newline at end of file diff --git a/packages/unleash-server/package.json b/packages/unleash-server/package.json deleted file mode 100644 index 05dad2a26e..0000000000 --- a/packages/unleash-server/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "unleash-server", - "description": "unleash your features", - "version": "1.0.0-alpha.2", - "keywords": [ - "unleash", - "feature toggle", - "feature", - "toggle" - ], - "files": [ - "server.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.js", - "bin": { - "unleash": "./bin/unleash.js" - }, - "scripts": { - "db-migrate-and-start": "npm run db-migrate && npm run start", - "start": "NODE_ENV=production node server-impl.js", - "test": "echo 'TODO add server tests'; exit 0;", - "test:ci": "npm run test" - }, - "dependencies": { - "commander": "^2.9.0", - "unleash-api": "1.0.0-alpha.2", - "unleash-frontend": "1.0.0-alpha.2" - }, - "devDependencies": {} -} diff --git a/packages/unleash-server/server-impl.js b/packages/unleash-server/server-impl.js deleted file mode 100644 index 8d7080fa7c..0000000000 --- a/packages/unleash-server/server-impl.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -require('./server.js').start(); diff --git a/packages/unleash-api/scripts/docker-postgres.sh b/scripts/docker-postgres.sh similarity index 100% rename from packages/unleash-api/scripts/docker-postgres.sh rename to scripts/docker-postgres.sh diff --git a/packages/unleash-api/scripts/migration-runner.js b/scripts/migration-runner.js similarity index 100% rename from packages/unleash-api/scripts/migration-runner.js rename to scripts/migration-runner.js diff --git a/packages/unleash-api/dev-server.js b/server-dev.js similarity index 100% rename from packages/unleash-api/dev-server.js rename to server-dev.js diff --git a/packages/unleash-api/server-impl.js b/server-impl.js similarity index 100% rename from packages/unleash-api/server-impl.js rename to server-impl.js diff --git a/packages/unleash-server/server.js b/server-prod.js similarity index 84% rename from packages/unleash-server/server.js rename to server-prod.js index 2b43e6be0a..8a893b62c2 100644 --- a/packages/unleash-server/server.js +++ b/server-prod.js @@ -1,9 +1,8 @@ 'use strict'; -const unleash = require('unleash-api'); +const unleash = require('./server-impl'); const { publicFolder } = require('unleash-frontend'); - module.exports = { start: options => { const opts = Object.assign({}, { publicFolder }, options); diff --git a/packages/unleash-api/test/.eslintrc b/test/.eslintrc similarity index 100% rename from packages/unleash-api/test/.eslintrc rename to test/.eslintrc diff --git a/packages/unleash-api/test/e2e/database-config.js b/test/e2e/database-config.js similarity index 100% rename from packages/unleash-api/test/e2e/database-config.js rename to test/e2e/database-config.js diff --git a/packages/unleash-api/test/e2e/event-api.test.js b/test/e2e/event-api.test.js similarity index 100% rename from packages/unleash-api/test/e2e/event-api.test.js rename to test/e2e/event-api.test.js diff --git a/packages/unleash-api/test/e2e/feature-api.test.js b/test/e2e/feature-api.test.js similarity index 100% rename from packages/unleash-api/test/e2e/feature-api.test.js rename to test/e2e/feature-api.test.js diff --git a/packages/unleash-api/test/e2e/feature-archive-api.test.js b/test/e2e/feature-archive-api.test.js similarity index 100% rename from packages/unleash-api/test/e2e/feature-archive-api.test.js rename to test/e2e/feature-archive-api.test.js diff --git a/packages/unleash-api/test/e2e/router.test.js b/test/e2e/router.test.js similarity index 100% rename from packages/unleash-api/test/e2e/router.test.js rename to test/e2e/router.test.js diff --git a/packages/unleash-api/test/e2e/strategy-api.test.js b/test/e2e/strategy-api.test.js similarity index 100% rename from packages/unleash-api/test/e2e/strategy-api.test.js rename to test/e2e/strategy-api.test.js diff --git a/packages/unleash-api/test/e2e/test-helper.js b/test/e2e/test-helper.js similarity index 100% rename from packages/unleash-api/test/e2e/test-helper.js rename to test/e2e/test-helper.js diff --git a/packages/unleash-api/test/unit/event-differ.test.js b/test/unit/event-differ.test.js similarity index 100% rename from packages/unleash-api/test/unit/event-differ.test.js rename to test/unit/event-differ.test.js diff --git a/packages/unleash-api/test/unit/helper/legacy-feature-mapper.test.js b/test/unit/helper/legacy-feature-mapper.test.js similarity index 100% rename from packages/unleash-api/test/unit/helper/legacy-feature-mapper.test.js rename to test/unit/helper/legacy-feature-mapper.test.js diff --git a/packages/unleash-api/test/unit/routes/feature.test.js b/test/unit/routes/feature.test.js similarity index 100% rename from packages/unleash-api/test/unit/routes/feature.test.js rename to test/unit/routes/feature.test.js diff --git a/packages/unleash-api/test/unit/routes/mocks/fake-feature-toggle-store.js b/test/unit/routes/mocks/fake-feature-toggle-store.js similarity index 100% rename from packages/unleash-api/test/unit/routes/mocks/fake-feature-toggle-store.js rename to test/unit/routes/mocks/fake-feature-toggle-store.js diff --git a/packages/unleash-api/test/unit/routes/mocks/fake-metrics-store.js b/test/unit/routes/mocks/fake-metrics-store.js similarity index 100% rename from packages/unleash-api/test/unit/routes/mocks/fake-metrics-store.js rename to test/unit/routes/mocks/fake-metrics-store.js diff --git a/packages/unleash-api/test/unit/routes/mocks/fake-strategies-store.js b/test/unit/routes/mocks/fake-strategies-store.js similarity index 100% rename from packages/unleash-api/test/unit/routes/mocks/fake-strategies-store.js rename to test/unit/routes/mocks/fake-strategies-store.js diff --git a/packages/unleash-api/test/unit/routes/strategies.test.js b/test/unit/routes/strategies.test.js similarity index 100% rename from packages/unleash-api/test/unit/routes/strategies.test.js rename to test/unit/routes/strategies.test.js