From a29fba44e06435f57fb25ef4e59dc67d9d068217 Mon Sep 17 00:00:00 2001 From: Max Polsky Date: Wed, 8 Jun 2022 09:59:49 +0300 Subject: [PATCH] Nx migration (#275) * refactor: created apps and libs folder * init: new project.json file for each project * refactor: changed the lib folder to src in each package * refgactor: added new files to gitignore * fix: updated github action to support the folder rename * fix: test fix to support the new src folder * feat: NX * feat: build and only then install * test: added general jest config file * test: build test files in commons * feat: nx will build the test-commons package * test: updated jest for test-commons * added nx files to config package * added NX files to the security package * added NX files to the core package * updated the workapace files * fix: right import from db-commons * megartion to postgres package * updated some jest config files in core package * NX migration to the mysql package * updated the mysql test script * NX migration to the mssql package * NX migration to the spanner package * NX migration to the mongo package * NX migration to the firestore package * NX migration to the firestore package * NX migration to the airtable package * NX migration to the bigquery package * NX migration to the google-sheets package * fixed the jest config of the security package * NX migration to the external-db app * refactor: rearranging files in the test-commons package * feat: new tool that will publish the packages * nx files * nop * refactor: db-commons files rearrangement * nop * skip-nx-cache in tests * updated github test yml * disable google-sheets tests for now * test: fixed the test for firestore * spec files will not be compiled * refactor: new build stage in the main dockerfile * Merge branch 'master' into nx-migration * fix: added new isObject function to the item_trasformer * feat: updated the package name in the publish script --- .dockerignore | 26 +++- .eslintrc.json | 127 ++++++++---------- .github/workflows/main.yml | 9 +- .gitignore | 12 +- Dockerfile | 34 +++-- apps/velo-external-db/.eslintrc.json | 18 +++ .../velo-external-db}/.gitignore | 0 .../velo-external-db}/.nvmrc | 0 .../velo-external-db/.travis.yml | 0 apps/velo-external-db/Dockerfile | 9 ++ .../collection-level-roles-config.json | 0 apps/velo-external-db/jest.config.js | 24 ++++ apps/velo-external-db/project.json | 73 ++++++++++ .../velo-external-db}/roles-config.json | 0 .../lib => apps/velo-external-db/src}/app.js | 3 + .../src}/auth/auth_request_handlers.js | 0 .../velo-external-db/src}/auth_router.js | 0 .../src/environments/environment.js | 3 + .../src/environments/environment.prod.js | 3 + .../velo-external-db/src}/storage/factory.js | 0 .../src}/storage/stub-db/init.js | 0 .../src}/storage/stub-db/providers.js | 0 .../src}/storage/stub-db/stub-connector.js | 0 .../test/drivers/auth_test_support.js | 0 .../drivers/authorization_test_support.js | 0 .../drivers/data_api_rest_test_support.js | 0 .../test/drivers/data_provider_matchers.js | 0 .../test/drivers/schema_api_rest_matchers.js | 0 .../drivers/schema_api_rest_test_support.js | 0 .../test/drivers/schema_provider_matchers.js | 0 .../velo-external-db/test/e2e/app.e2e.spec.js | 0 .../test/e2e/app_auth.e2e.spec.js | 0 .../test/e2e/app_data.e2e.spec.js | 0 .../test/e2e/app_schema.e2e.spec.js | 0 .../velo-external-db/test/env/ci_utils.js | 0 .../velo-external-db/test/env/env.db.setup.js | 5 + .../test/env/env.db.teardown.js | 2 +- .../velo-external-db/test/gen.js | 0 .../test/resources/docker-compose.yaml | 0 .../test/resources/e2e_resources.js | 8 +- .../resources/engines/airtable_resources.js | 0 .../resources/engines/bigquery_resources.js | 5 +- .../test/resources/engines/docker_support.js | 0 .../resources/engines/dynamodb_resources.js | 0 .../resources/engines/firestore_resources.js | 0 .../engines/google_sheets_resources.js | 0 .../test/resources/engines/init-mongo.js | 0 .../test/resources/engines/mongo_resources.js | 0 .../test/resources/engines/mssql_resources.js | 1 - .../test/resources/engines/mysql_resources.js | 0 .../resources/engines/postgres_resources.js | 0 .../resources/engines/spanner_resources.js | 0 .../test/resources/operations_resources.js | 1 + .../test/resources/provider_resources.js | 8 +- .../test/resources/test_suite_definition.js | 0 .../test/storage/data_provider.spec.js | 2 +- .../test/storage/database_operation.spec.js | 0 .../test/storage/schema_provider.spec.js | 0 apps/velo-external-db/tsconfig.app.json | 16 +++ apps/velo-external-db/tsconfig.json | 16 +++ apps/velo-external-db/tsconfig.spec.json | 20 +++ jest.preset.js | 3 + lerna.json | 6 - libs/external-db-airtable/.eslintrc.json | 18 +++ .../external-db-airtable}/.gitignore | 0 .../external-db-airtable/README.md | 0 libs/external-db-airtable/jest.config.js | 19 +++ libs/external-db-airtable/package.json | 5 + libs/external-db-airtable/project.json | 46 +++++++ .../src}/airtable_config_validator.js | 0 .../src}/airtable_data_provider.js | 0 .../src}/airtable_operations.js | 0 .../src}/airtable_schema_provider.js | 0 .../src}/airtable_utils.js | 0 .../src}/connection_provider.js | 0 .../external-db-airtable/src}/index.js | 0 .../src}/sql_exception_translator.js | 0 .../src}/sql_filter_transformer.js | 0 .../src}/sql_filter_transformer.spec.js | 0 .../src}/sql_schema_translator.js | 0 .../src}/sql_schema_translator.spec.js | 0 .../src}/supported_operations.js | 0 .../tests/drivers/air_table_base.js | 0 .../tests/drivers/air_table_mock_utils.js | 0 .../tests/drivers/air_table_table.js | 0 .../drivers/db_operations_test_support.js | 2 +- .../tests/drivers/mock_air_table.js | 0 .../sql_filter_transformer_test_support.js | 2 +- libs/external-db-airtable/tsconfig.json | 23 ++++ libs/external-db-airtable/tsconfig.lib.json | 15 +++ libs/external-db-airtable/tsconfig.spec.json | 9 ++ libs/external-db-bigquery/.eslintrc.json | 18 +++ .../external-db-bigquery/README.md | 0 libs/external-db-bigquery/jest.config.js | 19 +++ libs/external-db-bigquery/package.json | 5 + libs/external-db-bigquery/project.json | 46 +++++++ .../src}/bigquery_config_validator.js | 0 .../src}/bigquery_data_provider.js | 0 .../src}/bigquery_operations.js | 0 .../src}/bigquery_schema_provider.js | 0 .../src}/bigquery_utils.js | 0 .../src}/bigquery_utils.spec.js | 0 .../src}/bigquery_utils_test_support.js | 0 .../src}/connection_provider.js | 0 .../external-db-bigquery/src}/index.js | 0 .../src}/sql_exception_translator.js | 0 .../src}/sql_filter_transformer.js | 0 .../src}/sql_filter_transformer.spec.js | 0 .../src}/sql_schema_translator.js | 0 .../src}/supported_operations.js | 0 .../drivers/db_operations_test_support.js | 4 +- .../sql_filter_transformer_test_support.js | 0 libs/external-db-bigquery/tsconfig.json | 23 ++++ libs/external-db-bigquery/tsconfig.lib.json | 15 +++ libs/external-db-bigquery/tsconfig.spec.json | 9 ++ libs/external-db-config/.eslintrc.json | 18 +++ .../external-db-config/.gitignore | 0 .../external-db-config/README.md | 0 libs/external-db-config/jest.config.js | 18 +++ libs/external-db-config/package.json | 5 + libs/external-db-config/project.json | 46 +++++++ .../external-db-config/src}/factory.js | 0 .../external-db-config/src}/index.js | 0 .../readers/authorization_config_reader.js | 0 .../src}/readers/aws_auth_config_reader.js | 0 .../aws_authorization_config_reader.js | 0 .../src}/readers/aws_config_reader.js | 0 .../src}/readers/azure_auth_config_reader.js | 0 .../src}/readers/azure_config_reader.js | 0 .../src}/readers/common_config_reader.js | 0 .../src}/readers/gcp_auth_config_reader.js | 0 .../src}/readers/gcp_config_reader.js | 0 .../src}/readers/stub_config_reader.js | 0 .../src}/service/config_reader.js | 0 .../src}/service/config_reader.spec.js | 0 .../src}/service/config_reader_matchers.js | 0 .../src}/utils/config_utils.js | 0 .../src}/utils/config_utils.spec.js | 0 .../authorization_config_validator.js | 0 .../validators/common_config_validator.js | 0 .../src}/validators/config_validator.js | 0 .../drivers/aws_mongo_config_test_support.js | 2 +- .../drivers/aws_mysql_config_test_support.js | 2 +- .../azure_mysql_config_test_support.js | 2 +- .../drivers/common_config_test_support.js | 2 +- ...external_config_reader_e2e_test_support.js | 3 +- .../external_db_config_test_support.js | 0 .../gcp_firestore_config_test_support.js | 2 +- .../drivers/gcp_mysql_config_test_support.js | 2 +- .../gcp_spanner_config_test_support.js | 2 +- .../e2e/external_db_config_client.e2e.spec.js | 0 .../e2e/external_db_config_client_matcher.js | 0 .../external-db-config/test/gen.js | 0 .../provider/config_reader_service.spec.js | 0 .../external-db-config/test/test_utils.js | 0 libs/external-db-config/tsconfig.json | 23 ++++ libs/external-db-config/tsconfig.lib.json | 15 +++ libs/external-db-config/tsconfig.spec.json | 9 ++ libs/external-db-dynamodb/.eslintrc.json | 18 +++ .../external-db-dynamodb}/.gitignore | 0 .../external-db-dynamodb/README.md | 0 libs/external-db-dynamodb/jest.config.js | 19 +++ libs/external-db-dynamodb/package.json | 5 + libs/external-db-dynamodb/project.json | 46 +++++++ .../src}/connection_provider.js | 0 .../src}/dynamo_config_validator.js | 0 .../src}/dynamo_data_provider.js | 0 .../src}/dynamo_data_requests_utils.js | 0 .../src}/dynamo_operations.js | 0 .../src}/dynamo_schema_provider.js | 0 .../src}/dynamo_schema_requests_utils.js | 0 .../external-db-dynamodb/src}/dynamo_utils.js | 0 .../src}/dynamo_utils.spec.js | 0 .../external-db-dynamodb/src}/index.js | 0 .../src}/sql_exception_translator.js | 0 .../src}/sql_filter_transformer.js | 3 +- .../src}/sql_filter_transformer.spec.js | 0 .../src}/supported_operations.js | 0 .../drivers/db_operations_test_support.js | 4 +- .../sql_filter_transformer_test_support.js | 3 +- .../external-db-dynamodb/tests/gen.js | 0 libs/external-db-dynamodb/tsconfig.json | 23 ++++ libs/external-db-dynamodb/tsconfig.lib.json | 15 +++ libs/external-db-dynamodb/tsconfig.spec.json | 9 ++ libs/external-db-firestore/.eslintrc.json | 18 +++ .../external-db-firestore}/.gitignore | 0 .../external-db-firestore}/.nvmrc | 0 .../external-db-firestore/README.md | 0 libs/external-db-firestore/jest.config.js | 19 +++ libs/external-db-firestore/package.json | 5 + libs/external-db-firestore/project.json | 48 +++++++ .../src}/connection_provider.js | 0 .../src}/firestore_config_validator.js | 0 .../src}/firestore_data_provider.js | 0 .../src}/firestore_operations.js | 0 .../src}/firestore_schema_provider.js | 0 .../src}/firestore_utils.js | 0 .../external-db-firestore/src}/index.js | 0 .../src}/sql_exception_translator.js | 0 .../src}/sql_filter_transformer.js | 0 .../src}/sql_filter_transformer.spec.js | 0 .../src}/supported_operations.js | 0 .../tests/drivers/broken_creds.json | 0 .../drivers/db_operations_test_support.js | 4 +- .../sql_filter_transformer_test_support.js | 2 +- .../external-db-firestore/tests/gen.js | 0 libs/external-db-firestore/tsconfig.json | 23 ++++ libs/external-db-firestore/tsconfig.lib.json | 15 +++ libs/external-db-firestore/tsconfig.spec.json | 9 ++ libs/external-db-google-sheets/.eslintrc.json | 18 +++ .../external-db-google-sheets/.gitignore | 0 .../external-db-google-sheets/README.md | 0 libs/external-db-google-sheets/jest.config.js | 19 +++ libs/external-db-google-sheets/package.json | 5 + libs/external-db-google-sheets/project.json | 46 +++++++ .../src}/connection_provider.js | 0 .../src}/google_sheet_config_validator.js | 0 .../src}/google_sheet_data_provider.js | 0 .../src}/google_sheet_exception_translator.js | 0 .../src}/google_sheet_operations.js | 0 .../src}/google_sheet_schema_provider.js | 0 .../src}/google_sheet_utils.js | 0 .../external-db-google-sheets/src}/index.js | 0 .../src}/sql_filter_transformer.js | 0 .../src}/supported_operations.js | 0 .../tests/google_sheet_doc_class.js | 0 .../tests/google_sheet_sheet_class.js | 0 .../tests/google_sheets_test_utils.js | 0 .../tests/mock-server.js | 0 .../tests/mock_google_sheets_api.js | 0 .../sql_filter_transformer_test_support.js | 2 +- .../tests/templates.js | 0 libs/external-db-google-sheets/tsconfig.json | 23 ++++ .../tsconfig.lib.json | 15 +++ .../tsconfig.spec.json | 9 ++ libs/external-db-mongo/.eslintrc.json | 18 +++ .../external-db-mongo}/.gitignore | 0 .../external-db-mongo}/.nvmrc | 0 .../external-db-mongo/README.md | 0 libs/external-db-mongo/jest.config.js | 19 +++ libs/external-db-mongo/package.json | 5 + libs/external-db-mongo/project.json | 48 +++++++ .../src}/connection_provider.js | 0 .../src}/exception_translator.js | 3 +- .../external-db-mongo/src}/index.js | 0 .../src}/mongo_config_validator.js | 0 .../src}/mongo_data_provider.js | 0 .../src}/mongo_operations.js | 0 .../src}/mongo_schema_provider.js | 0 .../external-db-mongo/src}/mongo_utils.js | 0 .../src}/mongo_utils.spec.js | 0 .../src}/sql_filter_transformer.js | 0 .../src}/sql_filter_transformer.spec.js | 0 .../src}/supported_operations.js | 0 .../drivers/db_operations_test_support.js | 2 +- .../sql_filter_transformer_test_support.js | 0 libs/external-db-mongo/tsconfig.json | 23 ++++ libs/external-db-mongo/tsconfig.lib.json | 15 +++ libs/external-db-mongo/tsconfig.spec.json | 9 ++ libs/external-db-mssql/.eslintrc.json | 18 +++ .../external-db-mssql}/.gitignore | 0 .../external-db-mssql}/.nvmrc | 0 .../external-db-mssql/README.md | 0 libs/external-db-mssql/jest.config.js | 19 +++ libs/external-db-mssql/package.json | 5 + libs/external-db-mssql/project.json | 48 +++++++ .../src}/connection_provider.js | 0 .../external-db-mssql/src}/index.js | 0 .../src}/mssql_config_validator.js | 0 .../src}/mssql_data_provider.js | 0 .../src}/mssql_operations.js | 0 .../src}/mssql_schema_provider.js | 0 .../external-db-mssql/src}/mssql_utils.js | 0 .../src}/mysql_utils.spec.js | 0 .../src}/sql_exception_translator.js | 0 .../src}/sql_filter_transformer.js | 0 .../src}/sql_filter_transformer.spec.js | 0 .../src}/sql_schema_translator.js | 0 .../src}/sql_schema_translator.spec.js | 0 .../src}/supported_operations.js | 0 .../drivers/db_operations_test_support.js | 2 +- .../sql_filter_transformer_test_support.js | 2 +- libs/external-db-mssql/tsconfig.json | 23 ++++ libs/external-db-mssql/tsconfig.lib.json | 15 +++ libs/external-db-mssql/tsconfig.spec.json | 9 ++ libs/external-db-mysql/.eslintrc.json | 18 +++ .../external-db-mysql}/.gitignore | 0 .../external-db-mysql}/.nvmrc | 0 .../external-db-mysql/README.md | 0 libs/external-db-mysql/jest.config.js | 18 +++ libs/external-db-mysql/package.json | 5 + libs/external-db-mysql/project.json | 48 +++++++ .../src}/config_validator.spec.js | 0 .../src}/connection_provider.js | 0 .../external-db-mysql/src}/index.js | 0 .../src}/mysql_config_validator.js | 0 .../src}/mysql_data_provider.js | 0 .../src}/mysql_operations.js | 0 .../src}/mysql_schema_provider.js | 0 .../external-db-mysql/src}/mysql_utils.js | 0 .../src}/mysql_utils.spec.js | 0 .../src}/sql_exception_translator.js | 0 .../src}/sql_filter_transformer.js | 0 .../src}/sql_filter_transformer.spec.js | 0 .../src}/sql_schema_translator.js | 0 .../src}/sql_schema_translator.spec.js | 0 .../src}/supported_operations.js | 0 .../drivers/db_operations_test_support.js | 4 +- .../sql_filter_transformer_test_support.js | 2 +- .../external-db-mysql/tests/gen.js | 0 libs/external-db-mysql/tsconfig.json | 23 ++++ libs/external-db-mysql/tsconfig.lib.json | 15 +++ libs/external-db-mysql/tsconfig.spec.json | 9 ++ libs/external-db-postgres/.eslintrc.json | 18 +++ .../external-db-postgres}/.gitignore | 0 .../external-db-postgres}/.nvmrc | 0 .../external-db-postgres/README.md | 0 libs/external-db-postgres/jest.config.js | 19 +++ libs/external-db-postgres/package.json | 5 + libs/external-db-postgres/project.json | 48 +++++++ .../src}/config_validator.spec.js | 0 .../src}/connection_provider.js | 2 +- .../external-db-postgres/src}/index.js | 0 .../src}/postgres_config_validator.js | 0 .../src}/postgres_data_provider.js | 0 .../src}/postgres_operations.js | 0 .../src}/postgres_schema_provider.js | 0 .../src}/postgres_utils.js | 0 .../src}/sql_exception_translator.js | 0 .../src}/sql_filter_transformer.js | 0 .../src}/sql_filter_transformer.spec.js | 0 .../src}/sql_schema_translator.js | 0 .../src}/sql_schema_translator.spec.js | 0 .../src}/supported_operations.js | 0 .../drivers/db_operations_test_support.js | 4 +- .../sql_filter_transformer_test_support.js | 2 +- .../external-db-postgres/tests/gen.js | 0 libs/external-db-postgres/tsconfig.json | 23 ++++ libs/external-db-postgres/tsconfig.lib.json | 15 +++ libs/external-db-postgres/tsconfig.spec.json | 9 ++ libs/external-db-security/.eslintrc.json | 18 +++ .../external-db-security/.gitignore | 0 .../external-db-security/README.md | 0 libs/external-db-security/jest.config.js | 21 +++ libs/external-db-security/package.json | 5 + libs/external-db-security/project.json | 46 +++++++ .../src}/auth-providers/aws_auth_provider.js | 0 .../auth-providers/azure_auth_provider.js | 0 .../src}/auth-providers/gcp_auth_provider.js | 0 .../src}/auth-providers/stub_auth_provider.js | 0 .../external-db-security/src}/factory.js | 0 .../external-db-security/src}/index.js | 0 .../src}/services/role_authorization.js | 3 +- .../src}/services/role_authorization.spec.js | 7 +- .../external-db-security/src}/test/gen.js | 0 libs/external-db-security/tsconfig.json | 23 ++++ libs/external-db-security/tsconfig.lib.json | 15 +++ libs/external-db-security/tsconfig.spec.json | 9 ++ libs/external-db-spanner/.eslintrc.json | 18 +++ .../external-db-spanner}/.gitignore | 0 .../external-db-spanner}/.nvmrc | 0 .../external-db-spanner/README.md | 0 libs/external-db-spanner/jest.config.js | 19 +++ libs/external-db-spanner/package.json | 5 + libs/external-db-spanner/project.json | 48 +++++++ .../src}/connection_provider.js | 0 .../external-db-spanner/src}/escaping.spec.js | 0 .../external-db-spanner/src}/index.js | 0 .../src}/spanner_config_validator.js | 0 .../src}/spanner_data_provider.js | 0 .../src}/spanner_operations.js | 0 .../src}/spanner_schema_provider.js | 0 .../external-db-spanner/src}/spanner_utils.js | 0 .../src}/spanner_utils.spec.js | 0 .../src}/sql_exception_translator.js | 0 .../src}/sql_filter_transformer.js | 0 .../src}/sql_filter_transformer.spec.js | 0 .../src}/sql_schema_translator.js | 0 .../src}/sql_schema_translator.spec.js | 0 .../src}/supported_operations.js | 0 .../drivers/db_operations_test_support.js | 2 +- .../sql_filter_transformer_test_support.js | 2 +- libs/external-db-spanner/tsconfig.json | 23 ++++ libs/external-db-spanner/tsconfig.lib.json | 15 +++ libs/external-db-spanner/tsconfig.spec.json | 9 ++ libs/test-commons/.eslintrc.json | 18 +++ {packages => libs}/test-commons/README.md | 0 libs/test-commons/jest.config.js | 15 +++ libs/test-commons/package.json | 5 + libs/test-commons/project.json | 46 +++++++ libs/test-commons/src/index.js | 4 + .../lib => libs/test-commons/src/libs}/gen.js | 0 .../test-commons/src/libs}/test-commons.js | 0 libs/test-commons/tsconfig.json | 23 ++++ libs/test-commons/tsconfig.lib.json | 15 +++ libs/test-commons/tsconfig.spec.json | 9 ++ libs/velo-external-db-commons/.eslintrc.json | 18 +++ .../velo-external-db-commons/README.md | 0 libs/velo-external-db-commons/jest.config.js | 15 +++ libs/velo-external-db-commons/package.json | 5 + libs/velo-external-db-commons/project.json | 46 +++++++ libs/velo-external-db-commons/src/index.js | 13 ++ .../src/libs}/config_commons.js | 0 .../src/libs}/data_commons.js | 0 .../src/libs}/db_connector.js | 0 .../src/libs}/errors.js | 0 .../src/libs}/schema_commons.js | 0 libs/velo-external-db-commons/tsconfig.json | 23 ++++ .../tsconfig.lib.json | 15 +++ .../tsconfig.spec.json | 9 ++ libs/velo-external-db-core/.eslintrc.json | 18 +++ .../velo-external-db-core}/.gitignore | 0 .../velo-external-db-core}/.nvmrc | 0 .../velo-external-db-core/README.md | 0 libs/velo-external-db-core/jest.config.js | 19 +++ libs/velo-external-db-core/package.json | 5 + libs/velo-external-db-core/project.json | 46 +++++++ .../src}/assets/cloud_bg.svg | 0 .../src}/assets/cloudy-bg.svg | 0 .../src}/assets/dark_bg.svg | 0 .../src}/assets/lightbulb_icon.svg | 0 .../src}/assets/sad-unicorn.svg | 0 .../src}/assets/sad-wix.svg | 0 .../src}/assets/stylesheets/style.css | 0 .../src}/assets/wix-logo.svg | 0 .../converters/aggregation_transformer.js | 0 .../aggregation_transformer.spec.js | 0 .../src}/converters/data_utils.js | 0 .../src}/converters/data_utils.spec.js | 0 .../src}/converters/filter_transformer.js | 0 .../converters/filter_transformer.spec.js | 0 .../src}/converters/item_transformer.js | 4 +- .../src}/converters/item_transformer.spec.js | 0 .../src}/converters/query_validator.js | 0 .../src}/converters/query_validator.spec.js | 0 .../src}/converters/query_validator_utils.js | 0 .../converters/query_validator_utils.spec.js | 0 .../src}/converters/utils.js | 0 .../src}/data_hooks_utils.js | 0 .../src}/data_hooks_utils.spec.js | 0 .../src}/health/app_info.js | 0 .../src}/health/app_info.spec.js | 0 .../velo-external-db-core/src}/index.js | 0 .../src}/roles-config.json | 0 .../velo-external-db-core/src}/router.js | 0 .../src}/schema_hooks_utils.js | 0 .../src}/schema_hooks_utils.spec.js | 0 .../src}/service/data.js | 0 .../src}/service/data.spec.js | 0 .../src}/service/operation.js | 0 .../src}/service/operation.spec.js | 0 .../src}/service/schema.js | 0 .../src}/service/schema.spec.js | 0 .../src}/service/schema_aware_data.js | 0 .../src}/service/schema_aware_data.spec.js | 0 .../src}/service/schema_information.js | 10 +- .../src}/service/schema_information.spec.js | 1 - .../src}/utils/data_utils.js | 0 .../src}/utils/date_time_provider.js | 0 .../src/utils/router_utils.build.js | 18 +++ .../src}/utils/router_utils.js | 0 .../src}/views/error.ejs | 0 .../src}/views/index.ejs | 0 .../src}/views/login.ejs | 0 .../src}/views/partials/details.ejs | 0 .../src}/web/auth-middleware.js | 0 .../src}/web/auth-middleware.spec.js | 0 .../src}/web/auth-role-middleware.js | 0 .../src}/web/auth-role-middleware.spec.js | 0 .../src}/web/error-middleware.js | 0 .../src}/web/error-middleware.spec.js | 0 .../src}/web/middleware-support.js | 0 .../aggregation_transformer_test_support.js | 0 .../test/drivers/app_info_test_support.js | 0 .../drivers/auth_middleware_test_support.js | 0 .../drivers/data_provider_test_support.js | 0 .../test/drivers/data_service_test_support.js | 0 .../date_time_provider_test_support.js | 0 .../filter_transformer_test_support.js | 2 +- .../test/drivers/hooks_test_support.js | 0 .../test/drivers/item_patcher_test_support.js | 0 .../operation_provider_test_support.js | 0 .../drivers/query_validator_test_support.js | 0 .../schema_information_test_support.js | 0 .../test/drivers/schema_matchers.js | 0 .../drivers/schema_provider_test_support.js | 0 .../test/e2e/app_data_hooks.e2e.spec.js | 0 .../test/e2e/app_schema_hooks.e2e.spec.js | 0 .../velo-external-db-core/test/gen.js | 0 libs/velo-external-db-core/tsconfig.json | 23 ++++ libs/velo-external-db-core/tsconfig.lib.json | 15 +++ libs/velo-external-db-core/tsconfig.spec.json | 9 ++ nx.json | 35 +++++ package.json | 120 +++++++++++------ packages/external-db-airtable/jest.config.js | 7 - packages/external-db-airtable/package.json | 41 ------ packages/external-db-bigquery/package.json | 39 ------ packages/external-db-config/jest.config.js | 7 - packages/external-db-config/package.json | 38 ------ packages/external-db-dynamodb/jest.config.js | 7 - packages/external-db-dynamodb/package.json | 41 ------ packages/external-db-firestore/jest.config.js | 8 -- packages/external-db-firestore/package.json | 39 ------ .../external-db-google-sheets/jest.config.js | 7 - .../external-db-google-sheets/package.json | 40 ------ packages/external-db-mongo/jest.config.js | 7 - packages/external-db-mongo/package.json | 39 ------ packages/external-db-mssql/jest.config.js | 7 - packages/external-db-mssql/package.json | 40 ------ packages/external-db-mysql/jest.config.js | 7 - packages/external-db-mysql/package.json | 39 ------ packages/external-db-postgres/jest.config.js | 7 - packages/external-db-postgres/package.json | 40 ------ packages/external-db-security/jest.config.js | 7 - packages/external-db-security/package.json | 44 ------ packages/external-db-spanner/jest.config.js | 7 - packages/external-db-spanner/package.json | 42 ------ packages/test-commons/lib/index.js | 4 - packages/test-commons/package.json | 33 ----- .../velo-external-db-commons/lib/index.js | 13 -- .../velo-external-db-commons/package.json | 32 ----- packages/velo-external-db-core/jest.config.js | 8 -- packages/velo-external-db-core/package.json | 52 ------- packages/velo-external-db/jest.config.js | 11 -- packages/velo-external-db/package.json | 73 ---------- tools/scripts/publish.mjs | 63 +++++++++ tsconfig.base.json | 37 +++++ workspace.json | 21 +++ 528 files changed, 2664 insertions(+), 993 deletions(-) create mode 100644 apps/velo-external-db/.eslintrc.json rename {packages/external-db-airtable => apps/velo-external-db}/.gitignore (100%) rename {packages/external-db-firestore => apps/velo-external-db}/.nvmrc (100%) rename {packages => apps}/velo-external-db/.travis.yml (100%) create mode 100644 apps/velo-external-db/Dockerfile rename {packages => apps}/velo-external-db/collection-level-roles-config.json (100%) create mode 100644 apps/velo-external-db/jest.config.js create mode 100644 apps/velo-external-db/project.json rename {packages/velo-external-db-core/lib => apps/velo-external-db}/roles-config.json (100%) rename {packages/velo-external-db/lib => apps/velo-external-db/src}/app.js (99%) rename {packages/velo-external-db/lib => apps/velo-external-db/src}/auth/auth_request_handlers.js (100%) rename {packages/velo-external-db/lib => apps/velo-external-db/src}/auth_router.js (100%) create mode 100644 apps/velo-external-db/src/environments/environment.js create mode 100644 apps/velo-external-db/src/environments/environment.prod.js rename {packages/velo-external-db/lib => apps/velo-external-db/src}/storage/factory.js (100%) rename {packages/velo-external-db/lib => apps/velo-external-db/src}/storage/stub-db/init.js (100%) rename {packages/velo-external-db/lib => apps/velo-external-db/src}/storage/stub-db/providers.js (100%) rename {packages/velo-external-db/lib => apps/velo-external-db/src}/storage/stub-db/stub-connector.js (100%) rename {packages => apps}/velo-external-db/test/drivers/auth_test_support.js (100%) rename {packages => apps}/velo-external-db/test/drivers/authorization_test_support.js (100%) rename {packages => apps}/velo-external-db/test/drivers/data_api_rest_test_support.js (100%) rename {packages => apps}/velo-external-db/test/drivers/data_provider_matchers.js (100%) rename {packages => apps}/velo-external-db/test/drivers/schema_api_rest_matchers.js (100%) rename {packages => apps}/velo-external-db/test/drivers/schema_api_rest_test_support.js (100%) rename {packages => apps}/velo-external-db/test/drivers/schema_provider_matchers.js (100%) rename {packages => apps}/velo-external-db/test/e2e/app.e2e.spec.js (100%) rename {packages => apps}/velo-external-db/test/e2e/app_auth.e2e.spec.js (100%) rename {packages => apps}/velo-external-db/test/e2e/app_data.e2e.spec.js (100%) rename {packages => apps}/velo-external-db/test/e2e/app_schema.e2e.spec.js (100%) rename {packages => apps}/velo-external-db/test/env/ci_utils.js (100%) rename {packages => apps}/velo-external-db/test/env/env.db.setup.js (94%) rename {packages => apps}/velo-external-db/test/env/env.db.teardown.js (99%) rename {packages => apps}/velo-external-db/test/gen.js (100%) rename {packages => apps}/velo-external-db/test/resources/docker-compose.yaml (100%) rename {packages => apps}/velo-external-db/test/resources/e2e_resources.js (90%) rename {packages => apps}/velo-external-db/test/resources/engines/airtable_resources.js (100%) rename {packages => apps}/velo-external-db/test/resources/engines/bigquery_resources.js (85%) rename {packages => apps}/velo-external-db/test/resources/engines/docker_support.js (100%) rename {packages => apps}/velo-external-db/test/resources/engines/dynamodb_resources.js (100%) rename {packages => apps}/velo-external-db/test/resources/engines/firestore_resources.js (100%) rename {packages => apps}/velo-external-db/test/resources/engines/google_sheets_resources.js (100%) rename {packages => apps}/velo-external-db/test/resources/engines/init-mongo.js (100%) rename {packages => apps}/velo-external-db/test/resources/engines/mongo_resources.js (100%) rename {packages => apps}/velo-external-db/test/resources/engines/mssql_resources.js (99%) rename {packages => apps}/velo-external-db/test/resources/engines/mysql_resources.js (100%) rename {packages => apps}/velo-external-db/test/resources/engines/postgres_resources.js (100%) rename {packages => apps}/velo-external-db/test/resources/engines/spanner_resources.js (100%) rename {packages => apps}/velo-external-db/test/resources/operations_resources.js (97%) rename {packages => apps}/velo-external-db/test/resources/provider_resources.js (91%) rename {packages => apps}/velo-external-db/test/resources/test_suite_definition.js (100%) rename {packages => apps}/velo-external-db/test/storage/data_provider.spec.js (99%) rename {packages => apps}/velo-external-db/test/storage/database_operation.spec.js (100%) rename {packages => apps}/velo-external-db/test/storage/schema_provider.spec.js (100%) create mode 100644 apps/velo-external-db/tsconfig.app.json create mode 100644 apps/velo-external-db/tsconfig.json create mode 100644 apps/velo-external-db/tsconfig.spec.json create mode 100644 jest.preset.js delete mode 100644 lerna.json create mode 100644 libs/external-db-airtable/.eslintrc.json rename {packages/external-db-dynamodb => libs/external-db-airtable}/.gitignore (100%) rename {packages => libs}/external-db-airtable/README.md (100%) create mode 100644 libs/external-db-airtable/jest.config.js create mode 100644 libs/external-db-airtable/package.json create mode 100644 libs/external-db-airtable/project.json rename {packages/external-db-airtable/lib => libs/external-db-airtable/src}/airtable_config_validator.js (100%) rename {packages/external-db-airtable/lib => libs/external-db-airtable/src}/airtable_data_provider.js (100%) rename {packages/external-db-airtable/lib => libs/external-db-airtable/src}/airtable_operations.js (100%) rename {packages/external-db-airtable/lib => libs/external-db-airtable/src}/airtable_schema_provider.js (100%) rename {packages/external-db-airtable/lib => libs/external-db-airtable/src}/airtable_utils.js (100%) rename {packages/external-db-airtable/lib => libs/external-db-airtable/src}/connection_provider.js (100%) rename {packages/external-db-airtable/lib => libs/external-db-airtable/src}/index.js (100%) rename {packages/external-db-airtable/lib => libs/external-db-airtable/src}/sql_exception_translator.js (100%) rename {packages/external-db-airtable/lib => libs/external-db-airtable/src}/sql_filter_transformer.js (100%) rename {packages/external-db-airtable/lib => libs/external-db-airtable/src}/sql_filter_transformer.spec.js (100%) rename {packages/external-db-airtable/lib => libs/external-db-airtable/src}/sql_schema_translator.js (100%) rename {packages/external-db-airtable/lib => libs/external-db-airtable/src}/sql_schema_translator.spec.js (100%) rename {packages/external-db-airtable/lib => libs/external-db-airtable/src}/supported_operations.js (100%) rename {packages => libs}/external-db-airtable/tests/drivers/air_table_base.js (100%) rename {packages => libs}/external-db-airtable/tests/drivers/air_table_mock_utils.js (100%) rename {packages => libs}/external-db-airtable/tests/drivers/air_table_table.js (100%) rename {packages => libs}/external-db-airtable/tests/drivers/db_operations_test_support.js (95%) rename {packages => libs}/external-db-airtable/tests/drivers/mock_air_table.js (100%) rename {packages => libs}/external-db-airtable/tests/drivers/sql_filter_transformer_test_support.js (97%) create mode 100644 libs/external-db-airtable/tsconfig.json create mode 100644 libs/external-db-airtable/tsconfig.lib.json create mode 100644 libs/external-db-airtable/tsconfig.spec.json create mode 100644 libs/external-db-bigquery/.eslintrc.json rename {packages => libs}/external-db-bigquery/README.md (100%) create mode 100644 libs/external-db-bigquery/jest.config.js create mode 100644 libs/external-db-bigquery/package.json create mode 100644 libs/external-db-bigquery/project.json rename {packages/external-db-bigquery/lib => libs/external-db-bigquery/src}/bigquery_config_validator.js (100%) rename {packages/external-db-bigquery/lib => libs/external-db-bigquery/src}/bigquery_data_provider.js (100%) rename {packages/external-db-bigquery/lib => libs/external-db-bigquery/src}/bigquery_operations.js (100%) rename {packages/external-db-bigquery/lib => libs/external-db-bigquery/src}/bigquery_schema_provider.js (100%) rename {packages/external-db-bigquery/lib => libs/external-db-bigquery/src}/bigquery_utils.js (100%) rename {packages/external-db-bigquery/lib => libs/external-db-bigquery/src}/bigquery_utils.spec.js (100%) rename {packages/external-db-bigquery/lib => libs/external-db-bigquery/src}/bigquery_utils_test_support.js (100%) rename {packages/external-db-bigquery/lib => libs/external-db-bigquery/src}/connection_provider.js (100%) rename {packages/external-db-bigquery/lib => libs/external-db-bigquery/src}/index.js (100%) rename {packages/external-db-bigquery/lib => libs/external-db-bigquery/src}/sql_exception_translator.js (100%) rename {packages/external-db-bigquery/lib => libs/external-db-bigquery/src}/sql_filter_transformer.js (100%) rename {packages/external-db-bigquery/lib => libs/external-db-bigquery/src}/sql_filter_transformer.spec.js (100%) rename {packages/external-db-bigquery/lib => libs/external-db-bigquery/src}/sql_schema_translator.js (100%) rename {packages/external-db-bigquery/lib => libs/external-db-bigquery/src}/supported_operations.js (100%) rename {packages => libs}/external-db-bigquery/tests/drivers/db_operations_test_support.js (86%) rename {packages => libs}/external-db-bigquery/tests/drivers/sql_filter_transformer_test_support.js (100%) create mode 100644 libs/external-db-bigquery/tsconfig.json create mode 100644 libs/external-db-bigquery/tsconfig.lib.json create mode 100644 libs/external-db-bigquery/tsconfig.spec.json create mode 100644 libs/external-db-config/.eslintrc.json rename {packages => libs}/external-db-config/.gitignore (100%) rename {packages => libs}/external-db-config/README.md (100%) create mode 100644 libs/external-db-config/jest.config.js create mode 100644 libs/external-db-config/package.json create mode 100644 libs/external-db-config/project.json rename {packages/external-db-config/lib => libs/external-db-config/src}/factory.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/index.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/readers/authorization_config_reader.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/readers/aws_auth_config_reader.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/readers/aws_authorization_config_reader.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/readers/aws_config_reader.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/readers/azure_auth_config_reader.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/readers/azure_config_reader.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/readers/common_config_reader.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/readers/gcp_auth_config_reader.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/readers/gcp_config_reader.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/readers/stub_config_reader.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/service/config_reader.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/service/config_reader.spec.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/service/config_reader_matchers.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/utils/config_utils.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/utils/config_utils.spec.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/validators/authorization_config_validator.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/validators/common_config_validator.js (100%) rename {packages/external-db-config/lib => libs/external-db-config/src}/validators/config_validator.js (100%) rename {packages => libs}/external-db-config/test/drivers/aws_mongo_config_test_support.js (97%) rename {packages => libs}/external-db-config/test/drivers/aws_mysql_config_test_support.js (97%) rename {packages => libs}/external-db-config/test/drivers/azure_mysql_config_test_support.js (96%) rename {packages => libs}/external-db-config/test/drivers/common_config_test_support.js (91%) rename {packages => libs}/external-db-config/test/drivers/external_config_reader_e2e_test_support.js (96%) rename {packages => libs}/external-db-config/test/drivers/external_db_config_test_support.js (100%) rename {packages => libs}/external-db-config/test/drivers/gcp_firestore_config_test_support.js (96%) rename {packages => libs}/external-db-config/test/drivers/gcp_mysql_config_test_support.js (97%) rename {packages => libs}/external-db-config/test/drivers/gcp_spanner_config_test_support.js (96%) rename {packages => libs}/external-db-config/test/e2e/external_db_config_client.e2e.spec.js (100%) rename {packages => libs}/external-db-config/test/e2e/external_db_config_client_matcher.js (100%) rename {packages => libs}/external-db-config/test/gen.js (100%) rename {packages => libs}/external-db-config/test/provider/config_reader_service.spec.js (100%) rename {packages => libs}/external-db-config/test/test_utils.js (100%) create mode 100644 libs/external-db-config/tsconfig.json create mode 100644 libs/external-db-config/tsconfig.lib.json create mode 100644 libs/external-db-config/tsconfig.spec.json create mode 100644 libs/external-db-dynamodb/.eslintrc.json rename {packages/external-db-firestore => libs/external-db-dynamodb}/.gitignore (100%) rename {packages => libs}/external-db-dynamodb/README.md (100%) create mode 100644 libs/external-db-dynamodb/jest.config.js create mode 100644 libs/external-db-dynamodb/package.json create mode 100644 libs/external-db-dynamodb/project.json rename {packages/external-db-dynamodb/lib => libs/external-db-dynamodb/src}/connection_provider.js (100%) rename {packages/external-db-dynamodb/lib => libs/external-db-dynamodb/src}/dynamo_config_validator.js (100%) rename {packages/external-db-dynamodb/lib => libs/external-db-dynamodb/src}/dynamo_data_provider.js (100%) rename {packages/external-db-dynamodb/lib => libs/external-db-dynamodb/src}/dynamo_data_requests_utils.js (100%) rename {packages/external-db-dynamodb/lib => libs/external-db-dynamodb/src}/dynamo_operations.js (100%) rename {packages/external-db-dynamodb/lib => libs/external-db-dynamodb/src}/dynamo_schema_provider.js (100%) rename {packages/external-db-dynamodb/lib => libs/external-db-dynamodb/src}/dynamo_schema_requests_utils.js (100%) rename {packages/external-db-dynamodb/lib => libs/external-db-dynamodb/src}/dynamo_utils.js (100%) rename {packages/external-db-dynamodb/lib => libs/external-db-dynamodb/src}/dynamo_utils.spec.js (100%) rename {packages/external-db-dynamodb/lib => libs/external-db-dynamodb/src}/index.js (100%) rename {packages/external-db-dynamodb/lib => libs/external-db-dynamodb/src}/sql_exception_translator.js (100%) rename {packages/external-db-dynamodb/lib => libs/external-db-dynamodb/src}/sql_filter_transformer.js (98%) rename {packages/external-db-dynamodb/lib => libs/external-db-dynamodb/src}/sql_filter_transformer.spec.js (100%) rename {packages/external-db-dynamodb/lib => libs/external-db-dynamodb/src}/supported_operations.js (100%) rename {packages => libs}/external-db-dynamodb/tests/drivers/db_operations_test_support.js (93%) rename {packages => libs}/external-db-dynamodb/tests/drivers/sql_filter_transformer_test_support.js (97%) rename {packages => libs}/external-db-dynamodb/tests/gen.js (100%) create mode 100644 libs/external-db-dynamodb/tsconfig.json create mode 100644 libs/external-db-dynamodb/tsconfig.lib.json create mode 100644 libs/external-db-dynamodb/tsconfig.spec.json create mode 100644 libs/external-db-firestore/.eslintrc.json rename {packages/external-db-mongo => libs/external-db-firestore}/.gitignore (100%) rename {packages/external-db-mongo => libs/external-db-firestore}/.nvmrc (100%) rename {packages => libs}/external-db-firestore/README.md (100%) create mode 100644 libs/external-db-firestore/jest.config.js create mode 100644 libs/external-db-firestore/package.json create mode 100644 libs/external-db-firestore/project.json rename {packages/external-db-firestore/lib => libs/external-db-firestore/src}/connection_provider.js (100%) rename {packages/external-db-firestore/lib => libs/external-db-firestore/src}/firestore_config_validator.js (100%) rename {packages/external-db-firestore/lib => libs/external-db-firestore/src}/firestore_data_provider.js (100%) rename {packages/external-db-firestore/lib => libs/external-db-firestore/src}/firestore_operations.js (100%) rename {packages/external-db-firestore/lib => libs/external-db-firestore/src}/firestore_schema_provider.js (100%) rename {packages/external-db-firestore/lib => libs/external-db-firestore/src}/firestore_utils.js (100%) rename {packages/external-db-firestore/lib => libs/external-db-firestore/src}/index.js (100%) rename {packages/external-db-firestore/lib => libs/external-db-firestore/src}/sql_exception_translator.js (100%) rename {packages/external-db-firestore/lib => libs/external-db-firestore/src}/sql_filter_transformer.js (100%) rename {packages/external-db-firestore/lib => libs/external-db-firestore/src}/sql_filter_transformer.spec.js (100%) rename {packages/external-db-firestore/lib => libs/external-db-firestore/src}/supported_operations.js (100%) rename {packages => libs}/external-db-firestore/tests/drivers/broken_creds.json (100%) rename {packages => libs}/external-db-firestore/tests/drivers/db_operations_test_support.js (87%) rename {packages => libs}/external-db-firestore/tests/drivers/sql_filter_transformer_test_support.js (98%) rename {packages => libs}/external-db-firestore/tests/gen.js (100%) create mode 100644 libs/external-db-firestore/tsconfig.json create mode 100644 libs/external-db-firestore/tsconfig.lib.json create mode 100644 libs/external-db-firestore/tsconfig.spec.json create mode 100644 libs/external-db-google-sheets/.eslintrc.json rename {packages => libs}/external-db-google-sheets/.gitignore (100%) rename {packages => libs}/external-db-google-sheets/README.md (100%) create mode 100644 libs/external-db-google-sheets/jest.config.js create mode 100644 libs/external-db-google-sheets/package.json create mode 100644 libs/external-db-google-sheets/project.json rename {packages/external-db-google-sheets/lib => libs/external-db-google-sheets/src}/connection_provider.js (100%) rename {packages/external-db-google-sheets/lib => libs/external-db-google-sheets/src}/google_sheet_config_validator.js (100%) rename {packages/external-db-google-sheets/lib => libs/external-db-google-sheets/src}/google_sheet_data_provider.js (100%) rename {packages/external-db-google-sheets/lib => libs/external-db-google-sheets/src}/google_sheet_exception_translator.js (100%) rename {packages/external-db-google-sheets/lib => libs/external-db-google-sheets/src}/google_sheet_operations.js (100%) rename {packages/external-db-google-sheets/lib => libs/external-db-google-sheets/src}/google_sheet_schema_provider.js (100%) rename {packages/external-db-google-sheets/lib => libs/external-db-google-sheets/src}/google_sheet_utils.js (100%) rename {packages/external-db-google-sheets/lib => libs/external-db-google-sheets/src}/index.js (100%) rename {packages/external-db-google-sheets/lib => libs/external-db-google-sheets/src}/sql_filter_transformer.js (100%) rename {packages/external-db-google-sheets/lib => libs/external-db-google-sheets/src}/supported_operations.js (100%) rename {packages => libs}/external-db-google-sheets/tests/google_sheet_doc_class.js (100%) rename {packages => libs}/external-db-google-sheets/tests/google_sheet_sheet_class.js (100%) rename {packages => libs}/external-db-google-sheets/tests/google_sheets_test_utils.js (100%) rename {packages => libs}/external-db-google-sheets/tests/mock-server.js (100%) rename {packages => libs}/external-db-google-sheets/tests/mock_google_sheets_api.js (100%) rename {packages => libs}/external-db-google-sheets/tests/sql_filter_transformer_test_support.js (96%) rename {packages => libs}/external-db-google-sheets/tests/templates.js (100%) create mode 100644 libs/external-db-google-sheets/tsconfig.json create mode 100644 libs/external-db-google-sheets/tsconfig.lib.json create mode 100644 libs/external-db-google-sheets/tsconfig.spec.json create mode 100644 libs/external-db-mongo/.eslintrc.json rename {packages/external-db-mssql => libs/external-db-mongo}/.gitignore (100%) rename {packages/external-db-mssql => libs/external-db-mongo}/.nvmrc (100%) rename {packages => libs}/external-db-mongo/README.md (100%) create mode 100644 libs/external-db-mongo/jest.config.js create mode 100644 libs/external-db-mongo/package.json create mode 100644 libs/external-db-mongo/project.json rename {packages/external-db-mongo/lib => libs/external-db-mongo/src}/connection_provider.js (100%) rename {packages/external-db-mongo/lib => libs/external-db-mongo/src}/exception_translator.js (79%) rename {packages/external-db-mongo/lib => libs/external-db-mongo/src}/index.js (100%) rename {packages/external-db-mongo/lib => libs/external-db-mongo/src}/mongo_config_validator.js (100%) rename {packages/external-db-mongo/lib => libs/external-db-mongo/src}/mongo_data_provider.js (100%) rename {packages/external-db-mongo/lib => libs/external-db-mongo/src}/mongo_operations.js (100%) rename {packages/external-db-mongo/lib => libs/external-db-mongo/src}/mongo_schema_provider.js (100%) rename {packages/external-db-mongo/lib => libs/external-db-mongo/src}/mongo_utils.js (100%) rename {packages/external-db-mongo/lib => libs/external-db-mongo/src}/mongo_utils.spec.js (100%) rename {packages/external-db-mongo/lib => libs/external-db-mongo/src}/sql_filter_transformer.js (100%) rename {packages/external-db-mongo/lib => libs/external-db-mongo/src}/sql_filter_transformer.spec.js (100%) rename {packages/external-db-mongo/lib => libs/external-db-mongo/src}/supported_operations.js (100%) rename {packages => libs}/external-db-mongo/tests/drivers/db_operations_test_support.js (96%) rename {packages => libs}/external-db-mongo/tests/drivers/sql_filter_transformer_test_support.js (100%) create mode 100644 libs/external-db-mongo/tsconfig.json create mode 100644 libs/external-db-mongo/tsconfig.lib.json create mode 100644 libs/external-db-mongo/tsconfig.spec.json create mode 100644 libs/external-db-mssql/.eslintrc.json rename {packages/external-db-mysql => libs/external-db-mssql}/.gitignore (100%) rename {packages/external-db-mysql => libs/external-db-mssql}/.nvmrc (100%) rename {packages => libs}/external-db-mssql/README.md (100%) create mode 100644 libs/external-db-mssql/jest.config.js create mode 100644 libs/external-db-mssql/package.json create mode 100644 libs/external-db-mssql/project.json rename {packages/external-db-mssql/lib => libs/external-db-mssql/src}/connection_provider.js (100%) rename {packages/external-db-mssql/lib => libs/external-db-mssql/src}/index.js (100%) rename {packages/external-db-mssql/lib => libs/external-db-mssql/src}/mssql_config_validator.js (100%) rename {packages/external-db-mssql/lib => libs/external-db-mssql/src}/mssql_data_provider.js (100%) rename {packages/external-db-mssql/lib => libs/external-db-mssql/src}/mssql_operations.js (100%) rename {packages/external-db-mssql/lib => libs/external-db-mssql/src}/mssql_schema_provider.js (100%) rename {packages/external-db-mssql/lib => libs/external-db-mssql/src}/mssql_utils.js (100%) rename {packages/external-db-mssql/lib => libs/external-db-mssql/src}/mysql_utils.spec.js (100%) rename {packages/external-db-mssql/lib => libs/external-db-mssql/src}/sql_exception_translator.js (100%) rename {packages/external-db-mssql/lib => libs/external-db-mssql/src}/sql_filter_transformer.js (100%) rename {packages/external-db-mssql/lib => libs/external-db-mssql/src}/sql_filter_transformer.spec.js (100%) rename {packages/external-db-mssql/lib => libs/external-db-mssql/src}/sql_schema_translator.js (100%) rename {packages/external-db-mssql/lib => libs/external-db-mssql/src}/sql_schema_translator.spec.js (100%) rename {packages/external-db-mssql/lib => libs/external-db-mssql/src}/supported_operations.js (100%) rename {packages => libs}/external-db-mssql/tests/drivers/db_operations_test_support.js (96%) rename {packages => libs}/external-db-mssql/tests/drivers/sql_filter_transformer_test_support.js (99%) create mode 100644 libs/external-db-mssql/tsconfig.json create mode 100644 libs/external-db-mssql/tsconfig.lib.json create mode 100644 libs/external-db-mssql/tsconfig.spec.json create mode 100644 libs/external-db-mysql/.eslintrc.json rename {packages/external-db-postgres => libs/external-db-mysql}/.gitignore (100%) rename {packages/external-db-postgres => libs/external-db-mysql}/.nvmrc (100%) rename {packages => libs}/external-db-mysql/README.md (100%) create mode 100644 libs/external-db-mysql/jest.config.js create mode 100644 libs/external-db-mysql/package.json create mode 100644 libs/external-db-mysql/project.json rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/config_validator.spec.js (100%) rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/connection_provider.js (100%) rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/index.js (100%) rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/mysql_config_validator.js (100%) rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/mysql_data_provider.js (100%) rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/mysql_operations.js (100%) rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/mysql_schema_provider.js (100%) rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/mysql_utils.js (100%) rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/mysql_utils.spec.js (100%) rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/sql_exception_translator.js (100%) rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/sql_filter_transformer.js (100%) rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/sql_filter_transformer.spec.js (100%) rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/sql_schema_translator.js (100%) rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/sql_schema_translator.spec.js (100%) rename {packages/external-db-mysql/lib => libs/external-db-mysql/src}/supported_operations.js (100%) rename {packages => libs}/external-db-mysql/tests/drivers/db_operations_test_support.js (92%) rename {packages => libs}/external-db-mysql/tests/drivers/sql_filter_transformer_test_support.js (98%) rename {packages => libs}/external-db-mysql/tests/gen.js (100%) create mode 100644 libs/external-db-mysql/tsconfig.json create mode 100644 libs/external-db-mysql/tsconfig.lib.json create mode 100644 libs/external-db-mysql/tsconfig.spec.json create mode 100644 libs/external-db-postgres/.eslintrc.json rename {packages/external-db-spanner => libs/external-db-postgres}/.gitignore (100%) rename {packages/external-db-spanner => libs/external-db-postgres}/.nvmrc (100%) rename {packages => libs}/external-db-postgres/README.md (100%) create mode 100644 libs/external-db-postgres/jest.config.js create mode 100644 libs/external-db-postgres/package.json create mode 100644 libs/external-db-postgres/project.json rename {packages/external-db-postgres/lib => libs/external-db-postgres/src}/config_validator.spec.js (100%) rename {packages/external-db-postgres/lib => libs/external-db-postgres/src}/connection_provider.js (97%) rename {packages/external-db-postgres/lib => libs/external-db-postgres/src}/index.js (100%) rename {packages/external-db-postgres/lib => libs/external-db-postgres/src}/postgres_config_validator.js (100%) rename {packages/external-db-postgres/lib => libs/external-db-postgres/src}/postgres_data_provider.js (100%) rename {packages/external-db-postgres/lib => libs/external-db-postgres/src}/postgres_operations.js (100%) rename {packages/external-db-postgres/lib => libs/external-db-postgres/src}/postgres_schema_provider.js (100%) rename {packages/external-db-postgres/lib => libs/external-db-postgres/src}/postgres_utils.js (100%) rename {packages/external-db-postgres/lib => libs/external-db-postgres/src}/sql_exception_translator.js (100%) rename {packages/external-db-postgres/lib => libs/external-db-postgres/src}/sql_filter_transformer.js (100%) rename {packages/external-db-postgres/lib => libs/external-db-postgres/src}/sql_filter_transformer.spec.js (100%) rename {packages/external-db-postgres/lib => libs/external-db-postgres/src}/sql_schema_translator.js (100%) rename {packages/external-db-postgres/lib => libs/external-db-postgres/src}/sql_schema_translator.spec.js (100%) rename {packages/external-db-postgres/lib => libs/external-db-postgres/src}/supported_operations.js (100%) rename {packages => libs}/external-db-postgres/tests/drivers/db_operations_test_support.js (92%) rename {packages => libs}/external-db-postgres/tests/drivers/sql_filter_transformer_test_support.js (98%) rename {packages => libs}/external-db-postgres/tests/gen.js (100%) create mode 100644 libs/external-db-postgres/tsconfig.json create mode 100644 libs/external-db-postgres/tsconfig.lib.json create mode 100644 libs/external-db-postgres/tsconfig.spec.json create mode 100644 libs/external-db-security/.eslintrc.json rename {packages => libs}/external-db-security/.gitignore (100%) rename {packages => libs}/external-db-security/README.md (100%) create mode 100644 libs/external-db-security/jest.config.js create mode 100644 libs/external-db-security/package.json create mode 100644 libs/external-db-security/project.json rename {packages/external-db-security/lib => libs/external-db-security/src}/auth-providers/aws_auth_provider.js (100%) rename {packages/external-db-security/lib => libs/external-db-security/src}/auth-providers/azure_auth_provider.js (100%) rename {packages/external-db-security/lib => libs/external-db-security/src}/auth-providers/gcp_auth_provider.js (100%) rename {packages/external-db-security/lib => libs/external-db-security/src}/auth-providers/stub_auth_provider.js (100%) rename {packages/external-db-security/lib => libs/external-db-security/src}/factory.js (100%) rename {packages/external-db-security/lib => libs/external-db-security/src}/index.js (100%) rename {packages/external-db-security/lib => libs/external-db-security/src}/services/role_authorization.js (93%) rename {packages/external-db-security/lib => libs/external-db-security/src}/services/role_authorization.spec.js (97%) rename {packages/external-db-security/lib => libs/external-db-security/src}/test/gen.js (100%) create mode 100644 libs/external-db-security/tsconfig.json create mode 100644 libs/external-db-security/tsconfig.lib.json create mode 100644 libs/external-db-security/tsconfig.spec.json create mode 100644 libs/external-db-spanner/.eslintrc.json rename {packages/velo-external-db-core => libs/external-db-spanner}/.gitignore (100%) rename {packages/velo-external-db-core => libs/external-db-spanner}/.nvmrc (100%) rename {packages => libs}/external-db-spanner/README.md (100%) create mode 100644 libs/external-db-spanner/jest.config.js create mode 100644 libs/external-db-spanner/package.json create mode 100644 libs/external-db-spanner/project.json rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/connection_provider.js (100%) rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/escaping.spec.js (100%) rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/index.js (100%) rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/spanner_config_validator.js (100%) rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/spanner_data_provider.js (100%) rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/spanner_operations.js (100%) rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/spanner_schema_provider.js (100%) rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/spanner_utils.js (100%) rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/spanner_utils.spec.js (100%) rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/sql_exception_translator.js (100%) rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/sql_filter_transformer.js (100%) rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/sql_filter_transformer.spec.js (100%) rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/sql_schema_translator.js (100%) rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/sql_schema_translator.spec.js (100%) rename {packages/external-db-spanner/lib => libs/external-db-spanner/src}/supported_operations.js (100%) rename {packages => libs}/external-db-spanner/tests/drivers/db_operations_test_support.js (95%) rename {packages => libs}/external-db-spanner/tests/drivers/sql_filter_transformer_test_support.js (99%) create mode 100644 libs/external-db-spanner/tsconfig.json create mode 100644 libs/external-db-spanner/tsconfig.lib.json create mode 100644 libs/external-db-spanner/tsconfig.spec.json create mode 100644 libs/test-commons/.eslintrc.json rename {packages => libs}/test-commons/README.md (100%) create mode 100644 libs/test-commons/jest.config.js create mode 100644 libs/test-commons/package.json create mode 100644 libs/test-commons/project.json create mode 100644 libs/test-commons/src/index.js rename {packages/test-commons/lib => libs/test-commons/src/libs}/gen.js (100%) rename {packages/test-commons/lib => libs/test-commons/src/libs}/test-commons.js (100%) create mode 100644 libs/test-commons/tsconfig.json create mode 100644 libs/test-commons/tsconfig.lib.json create mode 100644 libs/test-commons/tsconfig.spec.json create mode 100644 libs/velo-external-db-commons/.eslintrc.json rename {packages => libs}/velo-external-db-commons/README.md (100%) create mode 100644 libs/velo-external-db-commons/jest.config.js create mode 100644 libs/velo-external-db-commons/package.json create mode 100644 libs/velo-external-db-commons/project.json create mode 100644 libs/velo-external-db-commons/src/index.js rename {packages/velo-external-db-commons/lib => libs/velo-external-db-commons/src/libs}/config_commons.js (100%) rename {packages/velo-external-db-commons/lib => libs/velo-external-db-commons/src/libs}/data_commons.js (100%) rename {packages/velo-external-db-commons/lib => libs/velo-external-db-commons/src/libs}/db_connector.js (100%) rename {packages/velo-external-db-commons/lib => libs/velo-external-db-commons/src/libs}/errors.js (100%) rename {packages/velo-external-db-commons/lib => libs/velo-external-db-commons/src/libs}/schema_commons.js (100%) create mode 100644 libs/velo-external-db-commons/tsconfig.json create mode 100644 libs/velo-external-db-commons/tsconfig.lib.json create mode 100644 libs/velo-external-db-commons/tsconfig.spec.json create mode 100644 libs/velo-external-db-core/.eslintrc.json rename {packages/velo-external-db => libs/velo-external-db-core}/.gitignore (100%) rename {packages/velo-external-db => libs/velo-external-db-core}/.nvmrc (100%) rename {packages => libs}/velo-external-db-core/README.md (100%) create mode 100644 libs/velo-external-db-core/jest.config.js create mode 100644 libs/velo-external-db-core/package.json create mode 100644 libs/velo-external-db-core/project.json rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/assets/cloud_bg.svg (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/assets/cloudy-bg.svg (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/assets/dark_bg.svg (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/assets/lightbulb_icon.svg (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/assets/sad-unicorn.svg (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/assets/sad-wix.svg (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/assets/stylesheets/style.css (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/assets/wix-logo.svg (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/converters/aggregation_transformer.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/converters/aggregation_transformer.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/converters/data_utils.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/converters/data_utils.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/converters/filter_transformer.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/converters/filter_transformer.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/converters/item_transformer.js (98%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/converters/item_transformer.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/converters/query_validator.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/converters/query_validator.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/converters/query_validator_utils.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/converters/query_validator_utils.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/converters/utils.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/data_hooks_utils.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/data_hooks_utils.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/health/app_info.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/health/app_info.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/index.js (100%) rename {packages/velo-external-db => libs/velo-external-db-core/src}/roles-config.json (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/router.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/schema_hooks_utils.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/schema_hooks_utils.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/service/data.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/service/data.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/service/operation.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/service/operation.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/service/schema.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/service/schema.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/service/schema_aware_data.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/service/schema_aware_data.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/service/schema_information.js (87%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/service/schema_information.spec.js (99%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/utils/data_utils.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/utils/date_time_provider.js (100%) create mode 100644 libs/velo-external-db-core/src/utils/router_utils.build.js rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/utils/router_utils.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/views/error.ejs (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/views/index.ejs (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/views/login.ejs (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/views/partials/details.ejs (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/web/auth-middleware.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/web/auth-middleware.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/web/auth-role-middleware.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/web/auth-role-middleware.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/web/error-middleware.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/web/error-middleware.spec.js (100%) rename {packages/velo-external-db-core/lib => libs/velo-external-db-core/src}/web/middleware-support.js (100%) rename {packages => libs}/velo-external-db-core/test/drivers/aggregation_transformer_test_support.js (100%) rename {packages => libs}/velo-external-db-core/test/drivers/app_info_test_support.js (100%) rename {packages => libs}/velo-external-db-core/test/drivers/auth_middleware_test_support.js (100%) rename {packages => libs}/velo-external-db-core/test/drivers/data_provider_test_support.js (100%) rename {packages => libs}/velo-external-db-core/test/drivers/data_service_test_support.js (100%) rename {packages => libs}/velo-external-db-core/test/drivers/date_time_provider_test_support.js (100%) rename {packages => libs}/velo-external-db-core/test/drivers/filter_transformer_test_support.js (94%) rename {packages/velo-external-db => libs/velo-external-db-core}/test/drivers/hooks_test_support.js (100%) rename {packages => libs}/velo-external-db-core/test/drivers/item_patcher_test_support.js (100%) rename {packages => libs}/velo-external-db-core/test/drivers/operation_provider_test_support.js (100%) rename {packages => libs}/velo-external-db-core/test/drivers/query_validator_test_support.js (100%) rename {packages => libs}/velo-external-db-core/test/drivers/schema_information_test_support.js (100%) rename {packages => libs}/velo-external-db-core/test/drivers/schema_matchers.js (100%) rename {packages => libs}/velo-external-db-core/test/drivers/schema_provider_test_support.js (100%) rename {packages/velo-external-db => libs/velo-external-db-core}/test/e2e/app_data_hooks.e2e.spec.js (100%) rename {packages/velo-external-db => libs/velo-external-db-core}/test/e2e/app_schema_hooks.e2e.spec.js (100%) rename {packages => libs}/velo-external-db-core/test/gen.js (100%) create mode 100644 libs/velo-external-db-core/tsconfig.json create mode 100644 libs/velo-external-db-core/tsconfig.lib.json create mode 100644 libs/velo-external-db-core/tsconfig.spec.json create mode 100644 nx.json delete mode 100644 packages/external-db-airtable/jest.config.js delete mode 100644 packages/external-db-airtable/package.json delete mode 100644 packages/external-db-bigquery/package.json delete mode 100644 packages/external-db-config/jest.config.js delete mode 100644 packages/external-db-config/package.json delete mode 100644 packages/external-db-dynamodb/jest.config.js delete mode 100644 packages/external-db-dynamodb/package.json delete mode 100644 packages/external-db-firestore/jest.config.js delete mode 100644 packages/external-db-firestore/package.json delete mode 100644 packages/external-db-google-sheets/jest.config.js delete mode 100644 packages/external-db-google-sheets/package.json delete mode 100644 packages/external-db-mongo/jest.config.js delete mode 100644 packages/external-db-mongo/package.json delete mode 100644 packages/external-db-mssql/jest.config.js delete mode 100644 packages/external-db-mssql/package.json delete mode 100644 packages/external-db-mysql/jest.config.js delete mode 100644 packages/external-db-mysql/package.json delete mode 100644 packages/external-db-postgres/jest.config.js delete mode 100644 packages/external-db-postgres/package.json delete mode 100644 packages/external-db-security/jest.config.js delete mode 100644 packages/external-db-security/package.json delete mode 100644 packages/external-db-spanner/jest.config.js delete mode 100644 packages/external-db-spanner/package.json delete mode 100644 packages/test-commons/lib/index.js delete mode 100644 packages/test-commons/package.json delete mode 100644 packages/velo-external-db-commons/lib/index.js delete mode 100644 packages/velo-external-db-commons/package.json delete mode 100644 packages/velo-external-db-core/jest.config.js delete mode 100644 packages/velo-external-db-core/package.json delete mode 100644 packages/velo-external-db/jest.config.js delete mode 100644 packages/velo-external-db/package.json create mode 100644 tools/scripts/publish.mjs create mode 100644 tsconfig.base.json create mode 100644 workspace.json diff --git a/.dockerignore b/.dockerignore index f39971f42..0261f080f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,25 @@ -packages/**/node_modules +# FOLDERS + +node_modules +.vscode +.github +.husky +scripts +tmp +dist +tools + + +# FILES + +npm-debug.log +Dockerfile* +docker-compose* +.dockerignore +.git +.gitignore +README.md +LICENSE +.eslintcache +.eslintrc.json +.nvmrc \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json index d56913b51..d9af06fcb 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,84 +5,63 @@ "es2021": true, "node": true }, - "settings": { - "jest": { - "version": "latest" - } - }, + "extends": ["eslint:recommended", "plugin:jest/recommended"], - "ignorePatterns": [""], "parserOptions": { "ecmaVersion": 12 }, - "plugins": ["jest"], + "plugins": ["jest", "@nrwl/nx"], "rules": { - "linebreak-style": [ - "error", - "unix" - ], - "quotes": [ - "error", - "single" - ], - "semi": [ - "error", - "never" - ], - "comma-spacing": [ - "error", - { - "before": false, - "after": true - } - ], - "space-before-function-paren": [ - "error", - "never" - ], - "space-before-blocks": [ - "error", - "always" - ], - "eqeqeq": [ - "error", - "always" - ], - "quote-props": [ - "error", - "as-needed" - ], - "no-case-declarations": [ - "off" - ], - "key-spacing": [ - "error", - { "afterColon": true } - ], - "object-curly-spacing": [ - "error", - "always" - ], - "arrow-spacing": [ - "error", - { "before": true, "after": true } - ], - "jest/no-standalone-expect": [ - "off", - { "additionalTestBlockFunctions": ["each.test"] } - ], - "jest/no-conditional-expect": [ - "off" - ], - "jest/no-identical-title": [ - "off" - ], - "no-unused-vars": [ - "error", - { - "ignoreRestSiblings": true, - "argsIgnorePattern": "^_" - } - ] + + }, + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": { + "@nrwl/nx/enforce-module-boundaries": [ + "error", + { + "enforceBuildableLibDependency": true, + "allow": [], + "depConstraints": [ + { + "sourceTag": "*", + "onlyDependOnLibsWithTags": ["*"] + } + ] + } + ] + } + }, + { + "files": ["*.ts", "*.tsx"], + "extends": ["plugin:@nrwl/nx/typescript"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "extends": ["plugin:@nrwl/nx/javascript"], + "rules": { + "@typescript-eslint/no-empty-function": ["off"], + "no-case-declarations": "off", + "linebreak-style": [ "error", "unix" ], + "quotes": [ "error", "single" ], + "semi": [ "error", "never" ], + "comma-spacing": [ "error", { "before": false, "after": true } ], + "space-before-function-paren": [ "error", "never" ], + "space-before-blocks": [ "error", "always" ], + "eqeqeq": [ "error", "always" ], + "quote-props": [ "error", "as-needed" ], + "no-case-declarations": [ "off" ], + "key-spacing": [ "error", { "afterColon": true } ], + "object-curly-spacing": [ "error", "always" ], + "arrow-spacing": [ "error", { "before": true, "after": true } ], + "jest/no-standalone-expect": [ "off", { "additionalTestBlockFunctions": ["each.test"] } ], + "jest/no-conditional-expect": [ "off" ], + "jest/no-identical-title": [ "off" ], + "no-unused-vars": [ "error", { "ignoreRestSiblings": true, "argsIgnorePattern": "^_" } ], + "@typescript-eslint/no-unused-vars": [ "error", { "ignoreRestSiblings": true, "argsIgnorePattern": "^_" } ] + } } + ] } \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e9b7b308e..7e7a28b7d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,8 +45,7 @@ jobs: "mongo", "mongo4", "firestore", "airtable", - "dynamodb", - "google-sheets" + "dynamodb" ] steps: @@ -68,13 +67,13 @@ jobs: - name: Downloading Image if: ${{ ( matrix.database != 'google-sheets') }} run: | - cd packages/velo-external-db/test/resources + cd apps/velo-external-db/test/resources docker compose pull --quiet ${{ matrix.database }} - name: Start Container if: ${{ ( matrix.database != 'google-sheets') }} run: | - cd packages/velo-external-db/test/resources + cd apps/velo-external-db/test/resources docker compose up --detach ${{ matrix.database }} - name: Installing Dependencies @@ -89,7 +88,7 @@ jobs: - name: Stop Container if: ${{ ( matrix.database != 'google-sheets') }} run: | - cd packages/velo-external-db/test/resources + cd apps/velo-external-db/test/resources docker compose down # test_bigquery: diff --git a/.gitignore b/.gitignore index b7a532ad0..31cb6cff4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ package-lock.json -node_modules + config.json schemas.json .gcloudignore @@ -8,4 +8,12 @@ schemas.json .vscode packages/.DS_Store .DS_Store -.eslintcache \ No newline at end of file +.eslintcache + +# dependencies +node_modules + +# compiled output +/dist +/tmp +/out-tsc diff --git a/Dockerfile b/Dockerfile index 70d5902f3..c9120d0da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,27 @@ -FROM node:lts-slim as full_version +# Compile stage +FROM node:lts-slim WORKDIR /usr/lib/app -COPY package.json . +# Copy the project dir +COPY . . -RUN npm install -g lerna +# Install NX and project dependencies +RUN npm install -g nx +RUN npm install -COPY packages ./packages/ -COPY lerna.json . +# Build the JS files +RUN nx run-many --target=build --all -RUN lerna bootstrap -- --production -CMD [ "npm", "--prefix", "packages/velo-external-db", "start" ] +FROM node:lts-alpine -FROM node:lts-slim -ARG TYPE WORKDIR /usr/lib/app -COPY --from=full_version /usr/lib/app/packages/external-db-config/ ./packages/external-db-config/ -COPY --from=full_version /usr/lib/app/packages/velo-external-db/ ./packages/velo-external-db/ -COPY --from=full_version /usr/lib/app/packages/velo-external-db-core/ ./packages/velo-external-db-core/ -COPY --from=full_version /usr/lib/app/packages/external-db-security/ ./packages/external-db-security/ -COPY --from=full_version /usr/lib/app/packages/velo-external-db-commons/ ./packages/velo-external-db-commons/ +# Copy the compiled JS files from the compile stage +COPY --from=0 /usr/lib/app/dist/apps/velo-external-db . -COPY --from=full_version /usr/lib/app/packages/external-db-${TYPE}/ ./packages/external-db-${TYPE}/ +# Install dependencies +RUN npm install --production -ENV TYPE=${TYPE} - -CMD [ "npm", "--prefix", "packages/velo-external-db", "start" ] +# Run the app +CMD node ./main.js diff --git a/apps/velo-external-db/.eslintrc.json b/apps/velo-external-db/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/apps/velo-external-db/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/external-db-airtable/.gitignore b/apps/velo-external-db/.gitignore similarity index 100% rename from packages/external-db-airtable/.gitignore rename to apps/velo-external-db/.gitignore diff --git a/packages/external-db-firestore/.nvmrc b/apps/velo-external-db/.nvmrc similarity index 100% rename from packages/external-db-firestore/.nvmrc rename to apps/velo-external-db/.nvmrc diff --git a/packages/velo-external-db/.travis.yml b/apps/velo-external-db/.travis.yml similarity index 100% rename from packages/velo-external-db/.travis.yml rename to apps/velo-external-db/.travis.yml diff --git a/apps/velo-external-db/Dockerfile b/apps/velo-external-db/Dockerfile new file mode 100644 index 000000000..7edee5ab6 --- /dev/null +++ b/apps/velo-external-db/Dockerfile @@ -0,0 +1,9 @@ +FROM node:lts-alpine +WORKDIR /app +COPY ./dist/apps/velo-external-db . +# ENV PORT=8080 +# EXPOSE ${PORT} +RUN npm install --production +# dependencies that nestjs needs +# RUN npm install reflect-metadata tslib rxjs @nestjs/platform-express +CMD node ./main.js \ No newline at end of file diff --git a/packages/velo-external-db/collection-level-roles-config.json b/apps/velo-external-db/collection-level-roles-config.json similarity index 100% rename from packages/velo-external-db/collection-level-roles-config.json rename to apps/velo-external-db/collection-level-roles-config.json diff --git a/apps/velo-external-db/jest.config.js b/apps/velo-external-db/jest.config.js new file mode 100644 index 000000000..df380c81b --- /dev/null +++ b/apps/velo-external-db/jest.config.js @@ -0,0 +1,24 @@ +module.exports = { + displayName: 'velo-external-db', + preset: '../../jest.preset.js', + clearMocks: true, + verbose: true, + roots: ['/src', '/test'], + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + // testRegex: '(.*\\.spec\\.)js$', + testEnvironment: 'node', + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + globalSetup: './test/env/env.db.setup.js', + globalTeardown: './test/env/env.db.teardown.js', + testTimeout: 20000, + moduleFileExtensions: ['ts', 'js', 'html'], + setupFilesAfterEnv: ['jest-extended/all'], + coverageDirectory: '../../coverage/apps/ex-db-template', + maxWorkers: 1, +} \ No newline at end of file diff --git a/apps/velo-external-db/project.json b/apps/velo-external-db/project.json new file mode 100644 index 000000000..e55fb53b9 --- /dev/null +++ b/apps/velo-external-db/project.json @@ -0,0 +1,73 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "apps/velo-external-db/src", + "projectType": "application", + "targets": { + "build": { + "executor": "@nrwl/node:webpack", + "outputs": [ "{options.outputPath}" ], + "options": { + "outputPath": "dist/apps/velo-external-db", + "main": "apps/velo-external-db/src/app.js", + "tsConfig": "apps/velo-external-db/tsconfig.app.json", + "generatePackageJson": true, + "progress": true, + "buildLibsFromSource": true, + "assets": [ + { "glob": "**/*", "input": "libs/velo-external-db-core/src/views", "output": "./views" }, + { "glob": "**/*", "input": "libs/velo-external-db-core/src/assets", "output": "./assets" } + ], + "fileReplacements": [ + { "replace": "apps/velo-external-db/src/environments/environment.js", "with": "apps/velo-external-db/src/environments/environment.prod.js" }, + { "replace": "libs/velo-external-db-core/src/utils/router_utils.js", "with": "libs/velo-external-db-core/src/utils/router_utils.build.js" } + ] + }, + "configurations": { + "production": { + "optimization": true, + "inspect": false + + } + } + }, + "serve": { + "executor": "@nrwl/node:node", + "options": { + "buildTarget": "velo-external-db:build" + } + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": [ + "{options.outputFile}" + ], + "options": { + "lintFilePatterns": [ + "apps/velo-external-db/**/*.js" + ] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": [ + "coverage/apps/velo-external-db" + ], + "options": { + "jestConfig": "apps/velo-external-db/jest.config.js", + "passWithNoTests": true + } + }, + + "build-image": { + "builder": "@nrwl/workspace:run-commands", + "options": { + "commands": [ + "nx run velo-external-db:build", + "docker build -f ./apps/velo-external-db/Dockerfile . -t velo-external-db" + ], + "parallel": false + } + } + }, + "tags": [] +} diff --git a/packages/velo-external-db-core/lib/roles-config.json b/apps/velo-external-db/roles-config.json similarity index 100% rename from packages/velo-external-db-core/lib/roles-config.json rename to apps/velo-external-db/roles-config.json diff --git a/packages/velo-external-db/lib/app.js b/apps/velo-external-db/src/app.js similarity index 99% rename from packages/velo-external-db/lib/app.js rename to apps/velo-external-db/src/app.js index e319f3cd1..9291753c1 100644 --- a/packages/velo-external-db/lib/app.js +++ b/apps/velo-external-db/src/app.js @@ -7,6 +7,9 @@ let started = false let server, _schemaProvider, _cleanup let externalDbRouter + + + const initConnector = async(hooks) => { const { vendor, type: adapterType } = readCommonConfig() const configReader = create() diff --git a/packages/velo-external-db/lib/auth/auth_request_handlers.js b/apps/velo-external-db/src/auth/auth_request_handlers.js similarity index 100% rename from packages/velo-external-db/lib/auth/auth_request_handlers.js rename to apps/velo-external-db/src/auth/auth_request_handlers.js diff --git a/packages/velo-external-db/lib/auth_router.js b/apps/velo-external-db/src/auth_router.js similarity index 100% rename from packages/velo-external-db/lib/auth_router.js rename to apps/velo-external-db/src/auth_router.js diff --git a/apps/velo-external-db/src/environments/environment.js b/apps/velo-external-db/src/environments/environment.js new file mode 100644 index 000000000..a868a1f90 --- /dev/null +++ b/apps/velo-external-db/src/environments/environment.js @@ -0,0 +1,3 @@ +export const environment = { + production: false, +} diff --git a/apps/velo-external-db/src/environments/environment.prod.js b/apps/velo-external-db/src/environments/environment.prod.js new file mode 100644 index 000000000..970e25bd7 --- /dev/null +++ b/apps/velo-external-db/src/environments/environment.prod.js @@ -0,0 +1,3 @@ +export const environment = { + production: true, +} diff --git a/packages/velo-external-db/lib/storage/factory.js b/apps/velo-external-db/src/storage/factory.js similarity index 100% rename from packages/velo-external-db/lib/storage/factory.js rename to apps/velo-external-db/src/storage/factory.js diff --git a/packages/velo-external-db/lib/storage/stub-db/init.js b/apps/velo-external-db/src/storage/stub-db/init.js similarity index 100% rename from packages/velo-external-db/lib/storage/stub-db/init.js rename to apps/velo-external-db/src/storage/stub-db/init.js diff --git a/packages/velo-external-db/lib/storage/stub-db/providers.js b/apps/velo-external-db/src/storage/stub-db/providers.js similarity index 100% rename from packages/velo-external-db/lib/storage/stub-db/providers.js rename to apps/velo-external-db/src/storage/stub-db/providers.js diff --git a/packages/velo-external-db/lib/storage/stub-db/stub-connector.js b/apps/velo-external-db/src/storage/stub-db/stub-connector.js similarity index 100% rename from packages/velo-external-db/lib/storage/stub-db/stub-connector.js rename to apps/velo-external-db/src/storage/stub-db/stub-connector.js diff --git a/packages/velo-external-db/test/drivers/auth_test_support.js b/apps/velo-external-db/test/drivers/auth_test_support.js similarity index 100% rename from packages/velo-external-db/test/drivers/auth_test_support.js rename to apps/velo-external-db/test/drivers/auth_test_support.js diff --git a/packages/velo-external-db/test/drivers/authorization_test_support.js b/apps/velo-external-db/test/drivers/authorization_test_support.js similarity index 100% rename from packages/velo-external-db/test/drivers/authorization_test_support.js rename to apps/velo-external-db/test/drivers/authorization_test_support.js diff --git a/packages/velo-external-db/test/drivers/data_api_rest_test_support.js b/apps/velo-external-db/test/drivers/data_api_rest_test_support.js similarity index 100% rename from packages/velo-external-db/test/drivers/data_api_rest_test_support.js rename to apps/velo-external-db/test/drivers/data_api_rest_test_support.js diff --git a/packages/velo-external-db/test/drivers/data_provider_matchers.js b/apps/velo-external-db/test/drivers/data_provider_matchers.js similarity index 100% rename from packages/velo-external-db/test/drivers/data_provider_matchers.js rename to apps/velo-external-db/test/drivers/data_provider_matchers.js diff --git a/packages/velo-external-db/test/drivers/schema_api_rest_matchers.js b/apps/velo-external-db/test/drivers/schema_api_rest_matchers.js similarity index 100% rename from packages/velo-external-db/test/drivers/schema_api_rest_matchers.js rename to apps/velo-external-db/test/drivers/schema_api_rest_matchers.js diff --git a/packages/velo-external-db/test/drivers/schema_api_rest_test_support.js b/apps/velo-external-db/test/drivers/schema_api_rest_test_support.js similarity index 100% rename from packages/velo-external-db/test/drivers/schema_api_rest_test_support.js rename to apps/velo-external-db/test/drivers/schema_api_rest_test_support.js diff --git a/packages/velo-external-db/test/drivers/schema_provider_matchers.js b/apps/velo-external-db/test/drivers/schema_provider_matchers.js similarity index 100% rename from packages/velo-external-db/test/drivers/schema_provider_matchers.js rename to apps/velo-external-db/test/drivers/schema_provider_matchers.js diff --git a/packages/velo-external-db/test/e2e/app.e2e.spec.js b/apps/velo-external-db/test/e2e/app.e2e.spec.js similarity index 100% rename from packages/velo-external-db/test/e2e/app.e2e.spec.js rename to apps/velo-external-db/test/e2e/app.e2e.spec.js diff --git a/packages/velo-external-db/test/e2e/app_auth.e2e.spec.js b/apps/velo-external-db/test/e2e/app_auth.e2e.spec.js similarity index 100% rename from packages/velo-external-db/test/e2e/app_auth.e2e.spec.js rename to apps/velo-external-db/test/e2e/app_auth.e2e.spec.js diff --git a/packages/velo-external-db/test/e2e/app_data.e2e.spec.js b/apps/velo-external-db/test/e2e/app_data.e2e.spec.js similarity index 100% rename from packages/velo-external-db/test/e2e/app_data.e2e.spec.js rename to apps/velo-external-db/test/e2e/app_data.e2e.spec.js diff --git a/packages/velo-external-db/test/e2e/app_schema.e2e.spec.js b/apps/velo-external-db/test/e2e/app_schema.e2e.spec.js similarity index 100% rename from packages/velo-external-db/test/e2e/app_schema.e2e.spec.js rename to apps/velo-external-db/test/e2e/app_schema.e2e.spec.js diff --git a/packages/velo-external-db/test/env/ci_utils.js b/apps/velo-external-db/test/env/ci_utils.js similarity index 100% rename from packages/velo-external-db/test/env/ci_utils.js rename to apps/velo-external-db/test/env/ci_utils.js diff --git a/packages/velo-external-db/test/env/env.db.setup.js b/apps/velo-external-db/test/env/env.db.setup.js similarity index 94% rename from packages/velo-external-db/test/env/env.db.setup.js rename to apps/velo-external-db/test/env/env.db.setup.js index 0bdd9132a..ebce6a000 100644 --- a/packages/velo-external-db/test/env/env.db.setup.js +++ b/apps/velo-external-db/test/env/env.db.setup.js @@ -1,3 +1,8 @@ +// path aliases within jest global setup/teardown +import { registerTsProject } from 'nx/src/utils/register' +registerTsProject('.', 'tsconfig.base.json') + + const postgres = require('../resources/engines/postgres_resources') const mysql = require('../resources/engines/mysql_resources') const spanner = require('../resources/engines/spanner_resources') diff --git a/packages/velo-external-db/test/env/env.db.teardown.js b/apps/velo-external-db/test/env/env.db.teardown.js similarity index 99% rename from packages/velo-external-db/test/env/env.db.teardown.js rename to apps/velo-external-db/test/env/env.db.teardown.js index d4cbc3589..6d97a0494 100644 --- a/packages/velo-external-db/test/env/env.db.teardown.js +++ b/apps/velo-external-db/test/env/env.db.teardown.js @@ -42,7 +42,7 @@ const shutdownEnv = async(testEngine) => { case 'dynamodb': await dynamo.shutdownEnv() break - + case 'mongo': await mongo.shutdownEnv() break diff --git a/packages/velo-external-db/test/gen.js b/apps/velo-external-db/test/gen.js similarity index 100% rename from packages/velo-external-db/test/gen.js rename to apps/velo-external-db/test/gen.js diff --git a/packages/velo-external-db/test/resources/docker-compose.yaml b/apps/velo-external-db/test/resources/docker-compose.yaml similarity index 100% rename from packages/velo-external-db/test/resources/docker-compose.yaml rename to apps/velo-external-db/test/resources/docker-compose.yaml diff --git a/packages/velo-external-db/test/resources/e2e_resources.js b/apps/velo-external-db/test/resources/e2e_resources.js similarity index 90% rename from packages/velo-external-db/test/resources/e2e_resources.js rename to apps/velo-external-db/test/resources/e2e_resources.js index 8b96a2f8a..fb8a3d9d7 100644 --- a/packages/velo-external-db/test/resources/e2e_resources.js +++ b/apps/velo-external-db/test/resources/e2e_resources.js @@ -9,7 +9,7 @@ const spanner = require('./engines/spanner_resources') const firestore = require('./engines/firestore_resources') const mssql = require('./engines/mssql_resources') const mongo = require('./engines/mongo_resources') -const googleSheet = require('./engines/google_sheets_resources') +// const googleSheet = require('./engines/google_sheets_resources') const airtable = require ('./engines/airtable_resources') const dynamo = require ('./engines/dynamodb_resources') const bigquery = require ('./engines/bigquery_resources') @@ -28,7 +28,7 @@ const initApp = async() => { await env.app.reload() } else { env.secretKey = authInit() - env.internals = require('../..').internals + env.internals = require('../../src/app').internals await waitUntil(() => env.internals().started) } @@ -56,7 +56,7 @@ const spannerTestEnvInit = async() => await dbInit(spanner) const firestoreTestEnvInit = async() => await dbInit(firestore) const mssqlTestEnvInit = async() => await dbInit(mssql) const mongoTestEnvInit = async() => await dbInit(mongo) -const googleSheetTestEnvInit = async() => await dbInit(googleSheet) +// const googleSheetTestEnvInit = async() => await dbInit(googleSheet) const airTableTestEnvInit = async() => await dbInit(airtable) const dynamoTestEnvInit = async() => await dbInit(dynamo) const bigqueryTestEnvInit = async() => await dbInit(bigquery) @@ -71,7 +71,7 @@ const testSuits = { airtable: suiteDef('Airtable', airTableTestEnvInit, airtable.supportedOperations), dynamodb: suiteDef('DynamoDb', dynamoTestEnvInit, dynamo.supportedOperations), bigquery: suiteDef('BigQuery', bigqueryTestEnvInit, bigquery.supportedOperations), - 'google-sheet': suiteDef('Google-sheet', googleSheetTestEnvInit, googleSheet.supportedOperations), + // 'google-sheet': suiteDef('Google-sheet', googleSheetTestEnvInit, googleSheet.supportedOperations), } const testedSuit = () => testSuits[process.env.TEST_ENGINE] diff --git a/packages/velo-external-db/test/resources/engines/airtable_resources.js b/apps/velo-external-db/test/resources/engines/airtable_resources.js similarity index 100% rename from packages/velo-external-db/test/resources/engines/airtable_resources.js rename to apps/velo-external-db/test/resources/engines/airtable_resources.js diff --git a/packages/velo-external-db/test/resources/engines/bigquery_resources.js b/apps/velo-external-db/test/resources/engines/bigquery_resources.js similarity index 85% rename from packages/velo-external-db/test/resources/engines/bigquery_resources.js rename to apps/velo-external-db/test/resources/engines/bigquery_resources.js index 32099d811..0358a08ec 100644 --- a/packages/velo-external-db/test/resources/engines/bigquery_resources.js +++ b/apps/velo-external-db/test/resources/engines/bigquery_resources.js @@ -14,8 +14,8 @@ const cleanup = async() => { await Promise.all(tables.map(t => t.id).map( t => schemaProvider.drop(t) )) } -const initEnv = async() => { -} +// eslint-disable-next-line @typescript-eslint/no-empty-function +const initEnv = async() => {} const setActive = () => { process.env.TYPE = 'bigquery' @@ -23,6 +23,7 @@ const setActive = () => { process.env.DATABASE_ID = databaseId } +// eslint-disable-next-line @typescript-eslint/no-empty-function const shutdownEnv = async() => { } diff --git a/packages/velo-external-db/test/resources/engines/docker_support.js b/apps/velo-external-db/test/resources/engines/docker_support.js similarity index 100% rename from packages/velo-external-db/test/resources/engines/docker_support.js rename to apps/velo-external-db/test/resources/engines/docker_support.js diff --git a/packages/velo-external-db/test/resources/engines/dynamodb_resources.js b/apps/velo-external-db/test/resources/engines/dynamodb_resources.js similarity index 100% rename from packages/velo-external-db/test/resources/engines/dynamodb_resources.js rename to apps/velo-external-db/test/resources/engines/dynamodb_resources.js diff --git a/packages/velo-external-db/test/resources/engines/firestore_resources.js b/apps/velo-external-db/test/resources/engines/firestore_resources.js similarity index 100% rename from packages/velo-external-db/test/resources/engines/firestore_resources.js rename to apps/velo-external-db/test/resources/engines/firestore_resources.js diff --git a/packages/velo-external-db/test/resources/engines/google_sheets_resources.js b/apps/velo-external-db/test/resources/engines/google_sheets_resources.js similarity index 100% rename from packages/velo-external-db/test/resources/engines/google_sheets_resources.js rename to apps/velo-external-db/test/resources/engines/google_sheets_resources.js diff --git a/packages/velo-external-db/test/resources/engines/init-mongo.js b/apps/velo-external-db/test/resources/engines/init-mongo.js similarity index 100% rename from packages/velo-external-db/test/resources/engines/init-mongo.js rename to apps/velo-external-db/test/resources/engines/init-mongo.js diff --git a/packages/velo-external-db/test/resources/engines/mongo_resources.js b/apps/velo-external-db/test/resources/engines/mongo_resources.js similarity index 100% rename from packages/velo-external-db/test/resources/engines/mongo_resources.js rename to apps/velo-external-db/test/resources/engines/mongo_resources.js diff --git a/packages/velo-external-db/test/resources/engines/mssql_resources.js b/apps/velo-external-db/test/resources/engines/mssql_resources.js similarity index 99% rename from packages/velo-external-db/test/resources/engines/mssql_resources.js rename to apps/velo-external-db/test/resources/engines/mssql_resources.js index 28c7e0b47..b1b379c57 100644 --- a/packages/velo-external-db/test/resources/engines/mssql_resources.js +++ b/apps/velo-external-db/test/resources/engines/mssql_resources.js @@ -33,7 +33,6 @@ const cleanup = async() => { } const initEnv = async() => { - await runImage('mssql') } diff --git a/packages/velo-external-db/test/resources/engines/mysql_resources.js b/apps/velo-external-db/test/resources/engines/mysql_resources.js similarity index 100% rename from packages/velo-external-db/test/resources/engines/mysql_resources.js rename to apps/velo-external-db/test/resources/engines/mysql_resources.js diff --git a/packages/velo-external-db/test/resources/engines/postgres_resources.js b/apps/velo-external-db/test/resources/engines/postgres_resources.js similarity index 100% rename from packages/velo-external-db/test/resources/engines/postgres_resources.js rename to apps/velo-external-db/test/resources/engines/postgres_resources.js diff --git a/packages/velo-external-db/test/resources/engines/spanner_resources.js b/apps/velo-external-db/test/resources/engines/spanner_resources.js similarity index 100% rename from packages/velo-external-db/test/resources/engines/spanner_resources.js rename to apps/velo-external-db/test/resources/engines/spanner_resources.js diff --git a/packages/velo-external-db/test/resources/operations_resources.js b/apps/velo-external-db/test/resources/operations_resources.js similarity index 97% rename from packages/velo-external-db/test/resources/operations_resources.js rename to apps/velo-external-db/test/resources/operations_resources.js index 422751866..4b2b324de 100644 --- a/packages/velo-external-db/test/resources/operations_resources.js +++ b/apps/velo-external-db/test/resources/operations_resources.js @@ -43,6 +43,7 @@ const testSuits = { airtable: suiteDef('Airtable', airTableTestEnvInit, misconfiguredDbOperation(airtable)), dynamodb: suiteDef('DynamoDb', dynamoTestEnvInit, misconfiguredDbOperation(dynamo)), bigquery: suiteDef('BigQuery', bigqueryTestEnvInit, misconfiguredDbOperation(bigquery)), + // 'google-sheet': suiteDef('Google-Sheet', googleSheetTestEnvInit), } const testedSuit = () => testSuits[process.env.TEST_ENGINE] diff --git a/packages/velo-external-db/test/resources/provider_resources.js b/apps/velo-external-db/test/resources/provider_resources.js similarity index 91% rename from packages/velo-external-db/test/resources/provider_resources.js rename to apps/velo-external-db/test/resources/provider_resources.js index eab2e87f6..48c06f977 100644 --- a/packages/velo-external-db/test/resources/provider_resources.js +++ b/apps/velo-external-db/test/resources/provider_resources.js @@ -28,8 +28,8 @@ const dynamoTestEnv = require ('./engines/dynamodb_resources.js') const bigquery = require('@wix-velo/external-db-bigquery') const bigqueryTestEnv = require('./engines/bigquery_resources') -const googleSheet = require('@wix-velo/external-db-google-sheets') -const googleSheetTestEnv = require('./engines/google_sheets_resources') +// const googleSheet = require('@wix-velo/external-db-google-sheets') +// const googleSheetTestEnv = require('./engines/google_sheets_resources') const env = { dataProvider: Uninitialized, @@ -68,7 +68,7 @@ const mongoTestEnvInit = async() => await dbInit(mongoTestEnv, mongo) const airTableTestEnvInit = async() => await dbInit(airtableEnv, airtable) const dynamoTestEnvInit = async() => await dbInit(dynamoTestEnv, dynamo) const bigqueryTestEnvInit = async() => await dbInit(bigqueryTestEnv, bigquery) -const googleSheetTestEnvInit = async() => await dbInit(googleSheetTestEnv, googleSheet) +// const googleSheetTestEnvInit = async() => await dbInit(googleSheetTestEnv, googleSheet) const testSuits = { mysql: suiteDef('MySql', mysqlTestEnvInit, mysql.supportedOperations), @@ -80,7 +80,7 @@ const testSuits = { airtable: suiteDef('Airtable', airTableTestEnvInit, airtable.supportedOperations), dynamodb: suiteDef('DynamoDb', dynamoTestEnvInit, dynamo.supportedOperations), bigquery: suiteDef('BigQuery', bigqueryTestEnvInit, bigquery.supportedOperations), - 'google-sheet': suiteDef('Google-Sheet', googleSheetTestEnvInit, googleSheet.supportedOperations), + // 'google-sheet': suiteDef('Google-Sheet', googleSheetTestEnvInit, googleSheet.supportedOperations), } const testedSuit = () => testSuits[process.env.TEST_ENGINE] diff --git a/packages/velo-external-db/test/resources/test_suite_definition.js b/apps/velo-external-db/test/resources/test_suite_definition.js similarity index 100% rename from packages/velo-external-db/test/resources/test_suite_definition.js rename to apps/velo-external-db/test/resources/test_suite_definition.js diff --git a/packages/velo-external-db/test/storage/data_provider.spec.js b/apps/velo-external-db/test/storage/data_provider.spec.js similarity index 99% rename from packages/velo-external-db/test/storage/data_provider.spec.js rename to apps/velo-external-db/test/storage/data_provider.spec.js index 20f7f90cd..71870a822 100644 --- a/packages/velo-external-db/test/storage/data_provider.spec.js +++ b/apps/velo-external-db/test/storage/data_provider.spec.js @@ -83,7 +83,7 @@ describe(`Data API: ${currentDbImplementationName()}`, () => { await expect( env.dataProvider.find(ctx.collectionName, ctx.filter, ctx.sort, 0, 50, projection) ).resolves.toEqual(entitiesWithOwnerFieldOnly(ctx.entities)) }) - if (shouldNotRunOn(['Airtable'], currentDbImplementationName())) { + if (shouldNotRunOn(['Airtable', 'Google-Sheet'], currentDbImplementationName())) { test('[gt] operator on string should return rows if bigger', async() => { await givenCollectionWith([ctx.entity], ctx.collectionName, ctx.entityFields) const smallerString = ctx.entity[ctx.column.name][0] !== 'a' ? String.fromCharCode(ctx.entity[ctx.column.name].charCodeAt(0) - 1) : 'a' diff --git a/packages/velo-external-db/test/storage/database_operation.spec.js b/apps/velo-external-db/test/storage/database_operation.spec.js similarity index 100% rename from packages/velo-external-db/test/storage/database_operation.spec.js rename to apps/velo-external-db/test/storage/database_operation.spec.js diff --git a/packages/velo-external-db/test/storage/schema_provider.spec.js b/apps/velo-external-db/test/storage/schema_provider.spec.js similarity index 100% rename from packages/velo-external-db/test/storage/schema_provider.spec.js rename to apps/velo-external-db/test/storage/schema_provider.spec.js diff --git a/apps/velo-external-db/tsconfig.app.json b/apps/velo-external-db/tsconfig.app.json new file mode 100644 index 000000000..35da387ae --- /dev/null +++ b/apps/velo-external-db/tsconfig.app.json @@ -0,0 +1,16 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["node", "express"] + }, + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.spec.js", + "**/*.test.js" + ], + "include": ["**/*.ts", "**/*.js"] +} diff --git a/apps/velo-external-db/tsconfig.json b/apps/velo-external-db/tsconfig.json new file mode 100644 index 000000000..cba0fd39d --- /dev/null +++ b/apps/velo-external-db/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.spec.json" + } + ], + "compilerOptions": { + "allowJs": true + } +} diff --git a/apps/velo-external-db/tsconfig.spec.json b/apps/velo-external-db/tsconfig.spec.json new file mode 100644 index 000000000..51977f12f --- /dev/null +++ b/apps/velo-external-db/tsconfig.spec.json @@ -0,0 +1,20 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "jest.config.ts", + "**/*.test.ts", + "**/*.spec.ts", + "**/*.test.tsx", + "**/*.spec.tsx", + "**/*.test.js", + "**/*.spec.js", + "**/*.test.jsx", + "**/*.spec.jsx", + "**/*.d.ts", + ] +} diff --git a/jest.preset.js b/jest.preset.js new file mode 100644 index 000000000..831de0a8d --- /dev/null +++ b/jest.preset.js @@ -0,0 +1,3 @@ +const nxPreset = require('@nrwl/jest/preset').default + +module.exports = { ...nxPreset } diff --git a/lerna.json b/lerna.json deleted file mode 100644 index 623d24ab7..000000000 --- a/lerna.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "packages": [ - "packages/*" - ], - "version": "1.0.2" -} diff --git a/libs/external-db-airtable/.eslintrc.json b/libs/external-db-airtable/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/external-db-airtable/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/external-db-dynamodb/.gitignore b/libs/external-db-airtable/.gitignore similarity index 100% rename from packages/external-db-dynamodb/.gitignore rename to libs/external-db-airtable/.gitignore diff --git a/packages/external-db-airtable/README.md b/libs/external-db-airtable/README.md similarity index 100% rename from packages/external-db-airtable/README.md rename to libs/external-db-airtable/README.md diff --git a/libs/external-db-airtable/jest.config.js b/libs/external-db-airtable/jest.config.js new file mode 100644 index 000000000..b02c3779a --- /dev/null +++ b/libs/external-db-airtable/jest.config.js @@ -0,0 +1,19 @@ +module.exports = { + displayName: 'external-db-airtable', + clearMocks: true, + verbose: true, + // roots: ['/src'], + // testRegex: '(.*\\.spec\\.)js$', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/external-db-airtable', + testEnvironment: 'node' +} \ No newline at end of file diff --git a/libs/external-db-airtable/package.json b/libs/external-db-airtable/package.json new file mode 100644 index 000000000..cb44f4560 --- /dev/null +++ b/libs/external-db-airtable/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/external-db-airtable", + "version": "1.0.3", + "type": "commonjs" +} \ No newline at end of file diff --git a/libs/external-db-airtable/project.json b/libs/external-db-airtable/project.json new file mode 100644 index 000000000..c9881d09a --- /dev/null +++ b/libs/external-db-airtable/project.json @@ -0,0 +1,46 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/external-db-airtable/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": [ "{options.outputPath}" ], + "options": { + "outputPath": "dist/libs/external-db-airtable", + "main": "libs/external-db-airtable/src/index.js", + "tsConfig": "libs/external-db-airtable/tsconfig.lib.json", + "assets": [ "libs/external-db-airtable/*.md" ], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/external-db-airtable {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": [ "{options.outputFile}" ], + "options": { + "lintFilePatterns": [ "libs/external-db-airtable/**/*.js" ] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": [ "coverage/libs/external-db-airtable" ], + "options": { + "jestConfig": "libs/external-db-airtable/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/packages/external-db-airtable/lib/airtable_config_validator.js b/libs/external-db-airtable/src/airtable_config_validator.js similarity index 100% rename from packages/external-db-airtable/lib/airtable_config_validator.js rename to libs/external-db-airtable/src/airtable_config_validator.js diff --git a/packages/external-db-airtable/lib/airtable_data_provider.js b/libs/external-db-airtable/src/airtable_data_provider.js similarity index 100% rename from packages/external-db-airtable/lib/airtable_data_provider.js rename to libs/external-db-airtable/src/airtable_data_provider.js diff --git a/packages/external-db-airtable/lib/airtable_operations.js b/libs/external-db-airtable/src/airtable_operations.js similarity index 100% rename from packages/external-db-airtable/lib/airtable_operations.js rename to libs/external-db-airtable/src/airtable_operations.js diff --git a/packages/external-db-airtable/lib/airtable_schema_provider.js b/libs/external-db-airtable/src/airtable_schema_provider.js similarity index 100% rename from packages/external-db-airtable/lib/airtable_schema_provider.js rename to libs/external-db-airtable/src/airtable_schema_provider.js diff --git a/packages/external-db-airtable/lib/airtable_utils.js b/libs/external-db-airtable/src/airtable_utils.js similarity index 100% rename from packages/external-db-airtable/lib/airtable_utils.js rename to libs/external-db-airtable/src/airtable_utils.js diff --git a/packages/external-db-airtable/lib/connection_provider.js b/libs/external-db-airtable/src/connection_provider.js similarity index 100% rename from packages/external-db-airtable/lib/connection_provider.js rename to libs/external-db-airtable/src/connection_provider.js diff --git a/packages/external-db-airtable/lib/index.js b/libs/external-db-airtable/src/index.js similarity index 100% rename from packages/external-db-airtable/lib/index.js rename to libs/external-db-airtable/src/index.js diff --git a/packages/external-db-airtable/lib/sql_exception_translator.js b/libs/external-db-airtable/src/sql_exception_translator.js similarity index 100% rename from packages/external-db-airtable/lib/sql_exception_translator.js rename to libs/external-db-airtable/src/sql_exception_translator.js diff --git a/packages/external-db-airtable/lib/sql_filter_transformer.js b/libs/external-db-airtable/src/sql_filter_transformer.js similarity index 100% rename from packages/external-db-airtable/lib/sql_filter_transformer.js rename to libs/external-db-airtable/src/sql_filter_transformer.js diff --git a/packages/external-db-airtable/lib/sql_filter_transformer.spec.js b/libs/external-db-airtable/src/sql_filter_transformer.spec.js similarity index 100% rename from packages/external-db-airtable/lib/sql_filter_transformer.spec.js rename to libs/external-db-airtable/src/sql_filter_transformer.spec.js diff --git a/packages/external-db-airtable/lib/sql_schema_translator.js b/libs/external-db-airtable/src/sql_schema_translator.js similarity index 100% rename from packages/external-db-airtable/lib/sql_schema_translator.js rename to libs/external-db-airtable/src/sql_schema_translator.js diff --git a/packages/external-db-airtable/lib/sql_schema_translator.spec.js b/libs/external-db-airtable/src/sql_schema_translator.spec.js similarity index 100% rename from packages/external-db-airtable/lib/sql_schema_translator.spec.js rename to libs/external-db-airtable/src/sql_schema_translator.spec.js diff --git a/packages/external-db-airtable/lib/supported_operations.js b/libs/external-db-airtable/src/supported_operations.js similarity index 100% rename from packages/external-db-airtable/lib/supported_operations.js rename to libs/external-db-airtable/src/supported_operations.js diff --git a/packages/external-db-airtable/tests/drivers/air_table_base.js b/libs/external-db-airtable/tests/drivers/air_table_base.js similarity index 100% rename from packages/external-db-airtable/tests/drivers/air_table_base.js rename to libs/external-db-airtable/tests/drivers/air_table_base.js diff --git a/packages/external-db-airtable/tests/drivers/air_table_mock_utils.js b/libs/external-db-airtable/tests/drivers/air_table_mock_utils.js similarity index 100% rename from packages/external-db-airtable/tests/drivers/air_table_mock_utils.js rename to libs/external-db-airtable/tests/drivers/air_table_mock_utils.js diff --git a/packages/external-db-airtable/tests/drivers/air_table_table.js b/libs/external-db-airtable/tests/drivers/air_table_table.js similarity index 100% rename from packages/external-db-airtable/tests/drivers/air_table_table.js rename to libs/external-db-airtable/tests/drivers/air_table_table.js diff --git a/packages/external-db-airtable/tests/drivers/db_operations_test_support.js b/libs/external-db-airtable/tests/drivers/db_operations_test_support.js similarity index 95% rename from packages/external-db-airtable/tests/drivers/db_operations_test_support.js rename to libs/external-db-airtable/tests/drivers/db_operations_test_support.js index 485e2b881..a06711847 100644 --- a/packages/external-db-airtable/tests/drivers/db_operations_test_support.js +++ b/libs/external-db-airtable/tests/drivers/db_operations_test_support.js @@ -1,4 +1,4 @@ -const DatabaseOperations = require('../../lib/airtable_operations') +const DatabaseOperations = require('../../src/airtable_operations') const Airtable = require('airtable') const createPool = modify => { diff --git a/packages/external-db-airtable/tests/drivers/mock_air_table.js b/libs/external-db-airtable/tests/drivers/mock_air_table.js similarity index 100% rename from packages/external-db-airtable/tests/drivers/mock_air_table.js rename to libs/external-db-airtable/tests/drivers/mock_air_table.js diff --git a/packages/external-db-airtable/tests/drivers/sql_filter_transformer_test_support.js b/libs/external-db-airtable/tests/drivers/sql_filter_transformer_test_support.js similarity index 97% rename from packages/external-db-airtable/tests/drivers/sql_filter_transformer_test_support.js rename to libs/external-db-airtable/tests/drivers/sql_filter_transformer_test_support.js index ac56faa06..a1c2a2473 100644 --- a/packages/external-db-airtable/tests/drivers/sql_filter_transformer_test_support.js +++ b/libs/external-db-airtable/tests/drivers/sql_filter_transformer_test_support.js @@ -1,6 +1,6 @@ const { EmptySort } = require('@wix-velo/velo-external-db-commons') const { when } = require('jest-when') -// const { escapeId } = require('../../lib/mysql_utils'); +// const { escapeId } = require('../../src/mysql_utils'); const filterParser = { transform: jest.fn(), diff --git a/libs/external-db-airtable/tsconfig.json b/libs/external-db-airtable/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/external-db-airtable/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/external-db-airtable/tsconfig.lib.json b/libs/external-db-airtable/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/external-db-airtable/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/external-db-airtable/tsconfig.spec.json b/libs/external-db-airtable/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/external-db-airtable/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/external-db-bigquery/.eslintrc.json b/libs/external-db-bigquery/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/external-db-bigquery/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/external-db-bigquery/README.md b/libs/external-db-bigquery/README.md similarity index 100% rename from packages/external-db-bigquery/README.md rename to libs/external-db-bigquery/README.md diff --git a/libs/external-db-bigquery/jest.config.js b/libs/external-db-bigquery/jest.config.js new file mode 100644 index 000000000..a95176986 --- /dev/null +++ b/libs/external-db-bigquery/jest.config.js @@ -0,0 +1,19 @@ +module.exports = { + displayName: 'external-db-bigquery', + clearMocks: true, + verbose: true, + // roots: ['/src'], + // testRegex: '(.*\\.spec\\.)js$', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/external-db-bigquery', + testEnvironment: 'node' +} \ No newline at end of file diff --git a/libs/external-db-bigquery/package.json b/libs/external-db-bigquery/package.json new file mode 100644 index 000000000..6159160c7 --- /dev/null +++ b/libs/external-db-bigquery/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/external-db-bigquery", + "version": "1.0.3", + "type": "commonjs" +} \ No newline at end of file diff --git a/libs/external-db-bigquery/project.json b/libs/external-db-bigquery/project.json new file mode 100644 index 000000000..995d60410 --- /dev/null +++ b/libs/external-db-bigquery/project.json @@ -0,0 +1,46 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/external-db-bigquery/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": [ "{options.outputPath}" ], + "options": { + "outputPath": "dist/libs/external-db-bigquery", + "main": "libs/external-db-bigquery/src/index.js", + "tsConfig": "libs/external-db-bigquery/tsconfig.lib.json", + "assets": [ "libs/external-db-bigquery/*.md" ], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/external-db-bigquery {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": [ "{options.outputFile}" ], + "options": { + "lintFilePatterns": [ "libs/external-db-bigquery/**/*.js" ] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": [ "coverage/libs/external-db-bigquery" ], + "options": { + "jestConfig": "libs/external-db-bigquery/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/packages/external-db-bigquery/lib/bigquery_config_validator.js b/libs/external-db-bigquery/src/bigquery_config_validator.js similarity index 100% rename from packages/external-db-bigquery/lib/bigquery_config_validator.js rename to libs/external-db-bigquery/src/bigquery_config_validator.js diff --git a/packages/external-db-bigquery/lib/bigquery_data_provider.js b/libs/external-db-bigquery/src/bigquery_data_provider.js similarity index 100% rename from packages/external-db-bigquery/lib/bigquery_data_provider.js rename to libs/external-db-bigquery/src/bigquery_data_provider.js diff --git a/packages/external-db-bigquery/lib/bigquery_operations.js b/libs/external-db-bigquery/src/bigquery_operations.js similarity index 100% rename from packages/external-db-bigquery/lib/bigquery_operations.js rename to libs/external-db-bigquery/src/bigquery_operations.js diff --git a/packages/external-db-bigquery/lib/bigquery_schema_provider.js b/libs/external-db-bigquery/src/bigquery_schema_provider.js similarity index 100% rename from packages/external-db-bigquery/lib/bigquery_schema_provider.js rename to libs/external-db-bigquery/src/bigquery_schema_provider.js diff --git a/packages/external-db-bigquery/lib/bigquery_utils.js b/libs/external-db-bigquery/src/bigquery_utils.js similarity index 100% rename from packages/external-db-bigquery/lib/bigquery_utils.js rename to libs/external-db-bigquery/src/bigquery_utils.js diff --git a/packages/external-db-bigquery/lib/bigquery_utils.spec.js b/libs/external-db-bigquery/src/bigquery_utils.spec.js similarity index 100% rename from packages/external-db-bigquery/lib/bigquery_utils.spec.js rename to libs/external-db-bigquery/src/bigquery_utils.spec.js diff --git a/packages/external-db-bigquery/lib/bigquery_utils_test_support.js b/libs/external-db-bigquery/src/bigquery_utils_test_support.js similarity index 100% rename from packages/external-db-bigquery/lib/bigquery_utils_test_support.js rename to libs/external-db-bigquery/src/bigquery_utils_test_support.js diff --git a/packages/external-db-bigquery/lib/connection_provider.js b/libs/external-db-bigquery/src/connection_provider.js similarity index 100% rename from packages/external-db-bigquery/lib/connection_provider.js rename to libs/external-db-bigquery/src/connection_provider.js diff --git a/packages/external-db-bigquery/lib/index.js b/libs/external-db-bigquery/src/index.js similarity index 100% rename from packages/external-db-bigquery/lib/index.js rename to libs/external-db-bigquery/src/index.js diff --git a/packages/external-db-bigquery/lib/sql_exception_translator.js b/libs/external-db-bigquery/src/sql_exception_translator.js similarity index 100% rename from packages/external-db-bigquery/lib/sql_exception_translator.js rename to libs/external-db-bigquery/src/sql_exception_translator.js diff --git a/packages/external-db-bigquery/lib/sql_filter_transformer.js b/libs/external-db-bigquery/src/sql_filter_transformer.js similarity index 100% rename from packages/external-db-bigquery/lib/sql_filter_transformer.js rename to libs/external-db-bigquery/src/sql_filter_transformer.js diff --git a/packages/external-db-bigquery/lib/sql_filter_transformer.spec.js b/libs/external-db-bigquery/src/sql_filter_transformer.spec.js similarity index 100% rename from packages/external-db-bigquery/lib/sql_filter_transformer.spec.js rename to libs/external-db-bigquery/src/sql_filter_transformer.spec.js diff --git a/packages/external-db-bigquery/lib/sql_schema_translator.js b/libs/external-db-bigquery/src/sql_schema_translator.js similarity index 100% rename from packages/external-db-bigquery/lib/sql_schema_translator.js rename to libs/external-db-bigquery/src/sql_schema_translator.js diff --git a/packages/external-db-bigquery/lib/supported_operations.js b/libs/external-db-bigquery/src/supported_operations.js similarity index 100% rename from packages/external-db-bigquery/lib/supported_operations.js rename to libs/external-db-bigquery/src/supported_operations.js diff --git a/packages/external-db-bigquery/tests/drivers/db_operations_test_support.js b/libs/external-db-bigquery/tests/drivers/db_operations_test_support.js similarity index 86% rename from packages/external-db-bigquery/tests/drivers/db_operations_test_support.js rename to libs/external-db-bigquery/tests/drivers/db_operations_test_support.js index a2e505e2b..cd1fa290a 100644 --- a/packages/external-db-bigquery/tests/drivers/db_operations_test_support.js +++ b/libs/external-db-bigquery/tests/drivers/db_operations_test_support.js @@ -1,5 +1,5 @@ -const DatabaseOperations = require('../../lib/bigquery_operations') -const init = require('../../lib/connection_provider') +const DatabaseOperations = require('../../src/bigquery_operations') +const init = require('../../src/connection_provider') const createPool = modify => { const config = {} diff --git a/packages/external-db-bigquery/tests/drivers/sql_filter_transformer_test_support.js b/libs/external-db-bigquery/tests/drivers/sql_filter_transformer_test_support.js similarity index 100% rename from packages/external-db-bigquery/tests/drivers/sql_filter_transformer_test_support.js rename to libs/external-db-bigquery/tests/drivers/sql_filter_transformer_test_support.js diff --git a/libs/external-db-bigquery/tsconfig.json b/libs/external-db-bigquery/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/external-db-bigquery/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/external-db-bigquery/tsconfig.lib.json b/libs/external-db-bigquery/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/external-db-bigquery/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/external-db-bigquery/tsconfig.spec.json b/libs/external-db-bigquery/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/external-db-bigquery/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/external-db-config/.eslintrc.json b/libs/external-db-config/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/external-db-config/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/external-db-config/.gitignore b/libs/external-db-config/.gitignore similarity index 100% rename from packages/external-db-config/.gitignore rename to libs/external-db-config/.gitignore diff --git a/packages/external-db-config/README.md b/libs/external-db-config/README.md similarity index 100% rename from packages/external-db-config/README.md rename to libs/external-db-config/README.md diff --git a/libs/external-db-config/jest.config.js b/libs/external-db-config/jest.config.js new file mode 100644 index 000000000..641e5a896 --- /dev/null +++ b/libs/external-db-config/jest.config.js @@ -0,0 +1,18 @@ +module.exports = { + displayName: 'external-db-config', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/velo-external-db-commons', + clearMocks: true, + verbose: true, + // testRegex: '(.*\\.spec\\.)js$', + }; + \ No newline at end of file diff --git a/libs/external-db-config/package.json b/libs/external-db-config/package.json new file mode 100644 index 000000000..7ecd3f286 --- /dev/null +++ b/libs/external-db-config/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/external-db-config", + "version": "1.0.3", + "type": "commonjs" +} diff --git a/libs/external-db-config/project.json b/libs/external-db-config/project.json new file mode 100644 index 000000000..01c3d2c28 --- /dev/null +++ b/libs/external-db-config/project.json @@ -0,0 +1,46 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/external-db-config/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/libs/external-db-config", + "main": "libs/external-db-config/src/index.js", + "tsConfig": "libs/external-db-config/tsconfig.lib.json", + "assets": ["libs/external-db-config/*.md"], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/external-db-config {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["libs/external-db-config/**/*.js"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/libs/external-db-config"], + "options": { + "jestConfig": "libs/external-db-config/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/packages/external-db-config/lib/factory.js b/libs/external-db-config/src/factory.js similarity index 100% rename from packages/external-db-config/lib/factory.js rename to libs/external-db-config/src/factory.js diff --git a/packages/external-db-config/lib/index.js b/libs/external-db-config/src/index.js similarity index 100% rename from packages/external-db-config/lib/index.js rename to libs/external-db-config/src/index.js diff --git a/packages/external-db-config/lib/readers/authorization_config_reader.js b/libs/external-db-config/src/readers/authorization_config_reader.js similarity index 100% rename from packages/external-db-config/lib/readers/authorization_config_reader.js rename to libs/external-db-config/src/readers/authorization_config_reader.js diff --git a/packages/external-db-config/lib/readers/aws_auth_config_reader.js b/libs/external-db-config/src/readers/aws_auth_config_reader.js similarity index 100% rename from packages/external-db-config/lib/readers/aws_auth_config_reader.js rename to libs/external-db-config/src/readers/aws_auth_config_reader.js diff --git a/packages/external-db-config/lib/readers/aws_authorization_config_reader.js b/libs/external-db-config/src/readers/aws_authorization_config_reader.js similarity index 100% rename from packages/external-db-config/lib/readers/aws_authorization_config_reader.js rename to libs/external-db-config/src/readers/aws_authorization_config_reader.js diff --git a/packages/external-db-config/lib/readers/aws_config_reader.js b/libs/external-db-config/src/readers/aws_config_reader.js similarity index 100% rename from packages/external-db-config/lib/readers/aws_config_reader.js rename to libs/external-db-config/src/readers/aws_config_reader.js diff --git a/packages/external-db-config/lib/readers/azure_auth_config_reader.js b/libs/external-db-config/src/readers/azure_auth_config_reader.js similarity index 100% rename from packages/external-db-config/lib/readers/azure_auth_config_reader.js rename to libs/external-db-config/src/readers/azure_auth_config_reader.js diff --git a/packages/external-db-config/lib/readers/azure_config_reader.js b/libs/external-db-config/src/readers/azure_config_reader.js similarity index 100% rename from packages/external-db-config/lib/readers/azure_config_reader.js rename to libs/external-db-config/src/readers/azure_config_reader.js diff --git a/packages/external-db-config/lib/readers/common_config_reader.js b/libs/external-db-config/src/readers/common_config_reader.js similarity index 100% rename from packages/external-db-config/lib/readers/common_config_reader.js rename to libs/external-db-config/src/readers/common_config_reader.js diff --git a/packages/external-db-config/lib/readers/gcp_auth_config_reader.js b/libs/external-db-config/src/readers/gcp_auth_config_reader.js similarity index 100% rename from packages/external-db-config/lib/readers/gcp_auth_config_reader.js rename to libs/external-db-config/src/readers/gcp_auth_config_reader.js diff --git a/packages/external-db-config/lib/readers/gcp_config_reader.js b/libs/external-db-config/src/readers/gcp_config_reader.js similarity index 100% rename from packages/external-db-config/lib/readers/gcp_config_reader.js rename to libs/external-db-config/src/readers/gcp_config_reader.js diff --git a/packages/external-db-config/lib/readers/stub_config_reader.js b/libs/external-db-config/src/readers/stub_config_reader.js similarity index 100% rename from packages/external-db-config/lib/readers/stub_config_reader.js rename to libs/external-db-config/src/readers/stub_config_reader.js diff --git a/packages/external-db-config/lib/service/config_reader.js b/libs/external-db-config/src/service/config_reader.js similarity index 100% rename from packages/external-db-config/lib/service/config_reader.js rename to libs/external-db-config/src/service/config_reader.js diff --git a/packages/external-db-config/lib/service/config_reader.spec.js b/libs/external-db-config/src/service/config_reader.spec.js similarity index 100% rename from packages/external-db-config/lib/service/config_reader.spec.js rename to libs/external-db-config/src/service/config_reader.spec.js diff --git a/packages/external-db-config/lib/service/config_reader_matchers.js b/libs/external-db-config/src/service/config_reader_matchers.js similarity index 100% rename from packages/external-db-config/lib/service/config_reader_matchers.js rename to libs/external-db-config/src/service/config_reader_matchers.js diff --git a/packages/external-db-config/lib/utils/config_utils.js b/libs/external-db-config/src/utils/config_utils.js similarity index 100% rename from packages/external-db-config/lib/utils/config_utils.js rename to libs/external-db-config/src/utils/config_utils.js diff --git a/packages/external-db-config/lib/utils/config_utils.spec.js b/libs/external-db-config/src/utils/config_utils.spec.js similarity index 100% rename from packages/external-db-config/lib/utils/config_utils.spec.js rename to libs/external-db-config/src/utils/config_utils.spec.js diff --git a/packages/external-db-config/lib/validators/authorization_config_validator.js b/libs/external-db-config/src/validators/authorization_config_validator.js similarity index 100% rename from packages/external-db-config/lib/validators/authorization_config_validator.js rename to libs/external-db-config/src/validators/authorization_config_validator.js diff --git a/packages/external-db-config/lib/validators/common_config_validator.js b/libs/external-db-config/src/validators/common_config_validator.js similarity index 100% rename from packages/external-db-config/lib/validators/common_config_validator.js rename to libs/external-db-config/src/validators/common_config_validator.js diff --git a/packages/external-db-config/lib/validators/config_validator.js b/libs/external-db-config/src/validators/config_validator.js similarity index 100% rename from packages/external-db-config/lib/validators/config_validator.js rename to libs/external-db-config/src/validators/config_validator.js diff --git a/packages/external-db-config/test/drivers/aws_mongo_config_test_support.js b/libs/external-db-config/test/drivers/aws_mongo_config_test_support.js similarity index 97% rename from packages/external-db-config/test/drivers/aws_mongo_config_test_support.js rename to libs/external-db-config/test/drivers/aws_mongo_config_test_support.js index 0c12ba2b8..e39de37fb 100644 --- a/packages/external-db-config/test/drivers/aws_mongo_config_test_support.js +++ b/libs/external-db-config/test/drivers/aws_mongo_config_test_support.js @@ -1,4 +1,4 @@ -const { AwsMongoConfigReader } = require('../../lib/readers/aws_config_reader') +const { AwsMongoConfigReader } = require('../../src/readers/aws_config_reader') const { SecretsManagerClient, GetSecretValueCommand } = require('@aws-sdk/client-secrets-manager') const mockClient = require('aws-sdk-client-mock') let mockedAwsSdk diff --git a/packages/external-db-config/test/drivers/aws_mysql_config_test_support.js b/libs/external-db-config/test/drivers/aws_mysql_config_test_support.js similarity index 97% rename from packages/external-db-config/test/drivers/aws_mysql_config_test_support.js rename to libs/external-db-config/test/drivers/aws_mysql_config_test_support.js index 8b8dbb893..00c916b3f 100644 --- a/packages/external-db-config/test/drivers/aws_mysql_config_test_support.js +++ b/libs/external-db-config/test/drivers/aws_mysql_config_test_support.js @@ -1,4 +1,4 @@ -const { AwsConfigReader } = require('../../lib/readers/aws_config_reader') +const { AwsConfigReader } = require('../../src/readers/aws_config_reader') const { SecretsManagerClient, GetSecretValueCommand } = require('@aws-sdk/client-secrets-manager') const mockClient = require('aws-sdk-client-mock') let mockedAwsSdk diff --git a/packages/external-db-config/test/drivers/azure_mysql_config_test_support.js b/libs/external-db-config/test/drivers/azure_mysql_config_test_support.js similarity index 96% rename from packages/external-db-config/test/drivers/azure_mysql_config_test_support.js rename to libs/external-db-config/test/drivers/azure_mysql_config_test_support.js index 72b924310..b25bb0eca 100644 --- a/packages/external-db-config/test/drivers/azure_mysql_config_test_support.js +++ b/libs/external-db-config/test/drivers/azure_mysql_config_test_support.js @@ -1,4 +1,4 @@ -const { AzureConfigReader } = require('../../lib/readers/azure_config_reader') +const { AzureConfigReader } = require('../../src/readers/azure_config_reader') const Chance = require('chance') const chance = new Chance() const { validAuthorizationConfig } = require ('../test_utils') diff --git a/packages/external-db-config/test/drivers/common_config_test_support.js b/libs/external-db-config/test/drivers/common_config_test_support.js similarity index 91% rename from packages/external-db-config/test/drivers/common_config_test_support.js rename to libs/external-db-config/test/drivers/common_config_test_support.js index 550df4d9f..fba2a045e 100644 --- a/packages/external-db-config/test/drivers/common_config_test_support.js +++ b/libs/external-db-config/test/drivers/common_config_test_support.js @@ -1,4 +1,4 @@ -const CommonConfigReader = require('../../lib/readers/common_config_reader') +const CommonConfigReader = require('../../src/readers/common_config_reader') const Chance = require('chance') const chance = new Chance() diff --git a/packages/external-db-config/test/drivers/external_config_reader_e2e_test_support.js b/libs/external-db-config/test/drivers/external_config_reader_e2e_test_support.js similarity index 96% rename from packages/external-db-config/test/drivers/external_config_reader_e2e_test_support.js rename to libs/external-db-config/test/drivers/external_config_reader_e2e_test_support.js index 96897989e..0c789cee4 100644 --- a/packages/external-db-config/test/drivers/external_config_reader_e2e_test_support.js +++ b/libs/external-db-config/test/drivers/external_config_reader_e2e_test_support.js @@ -1,5 +1,6 @@ + const { Uninitialized } = require('@wix-velo/test-commons') -const { create } = require('../../lib/factory') +const { create } = require('../../src/factory') const awsMySql = require('./aws_mysql_config_test_support') const awsMongo = require('./aws_mongo_config_test_support') const azureMySql = require('./azure_mysql_config_test_support') diff --git a/packages/external-db-config/test/drivers/external_db_config_test_support.js b/libs/external-db-config/test/drivers/external_db_config_test_support.js similarity index 100% rename from packages/external-db-config/test/drivers/external_db_config_test_support.js rename to libs/external-db-config/test/drivers/external_db_config_test_support.js diff --git a/packages/external-db-config/test/drivers/gcp_firestore_config_test_support.js b/libs/external-db-config/test/drivers/gcp_firestore_config_test_support.js similarity index 96% rename from packages/external-db-config/test/drivers/gcp_firestore_config_test_support.js rename to libs/external-db-config/test/drivers/gcp_firestore_config_test_support.js index 286deb8e3..ed831e076 100644 --- a/packages/external-db-config/test/drivers/gcp_firestore_config_test_support.js +++ b/libs/external-db-config/test/drivers/gcp_firestore_config_test_support.js @@ -1,4 +1,4 @@ -const { GcpFirestoreConfigReader } = require('../../lib/readers/gcp_config_reader') +const { GcpFirestoreConfigReader } = require('../../src/readers/gcp_config_reader') const Chance = require('chance') const chance = new Chance() const { validAuthorizationConfig } = require ('../test_utils') diff --git a/packages/external-db-config/test/drivers/gcp_mysql_config_test_support.js b/libs/external-db-config/test/drivers/gcp_mysql_config_test_support.js similarity index 97% rename from packages/external-db-config/test/drivers/gcp_mysql_config_test_support.js rename to libs/external-db-config/test/drivers/gcp_mysql_config_test_support.js index a5d010a4f..b381fd5f1 100644 --- a/packages/external-db-config/test/drivers/gcp_mysql_config_test_support.js +++ b/libs/external-db-config/test/drivers/gcp_mysql_config_test_support.js @@ -1,4 +1,4 @@ -const { GcpConfigReader } = require('../../lib/readers/gcp_config_reader') +const { GcpConfigReader } = require('../../src/readers/gcp_config_reader') const Chance = require('chance') const chance = new Chance() const { validAuthorizationConfig } = require ('../test_utils') diff --git a/packages/external-db-config/test/drivers/gcp_spanner_config_test_support.js b/libs/external-db-config/test/drivers/gcp_spanner_config_test_support.js similarity index 96% rename from packages/external-db-config/test/drivers/gcp_spanner_config_test_support.js rename to libs/external-db-config/test/drivers/gcp_spanner_config_test_support.js index 387cb2019..885a90d4d 100644 --- a/packages/external-db-config/test/drivers/gcp_spanner_config_test_support.js +++ b/libs/external-db-config/test/drivers/gcp_spanner_config_test_support.js @@ -1,4 +1,4 @@ -const { GcpSpannerConfigReader } = require('../../lib/readers/gcp_config_reader') +const { GcpSpannerConfigReader } = require('../../src/readers/gcp_config_reader') const Chance = require('chance') const chance = new Chance() const { validAuthorizationConfig } = require ('../test_utils') diff --git a/packages/external-db-config/test/e2e/external_db_config_client.e2e.spec.js b/libs/external-db-config/test/e2e/external_db_config_client.e2e.spec.js similarity index 100% rename from packages/external-db-config/test/e2e/external_db_config_client.e2e.spec.js rename to libs/external-db-config/test/e2e/external_db_config_client.e2e.spec.js diff --git a/packages/external-db-config/test/e2e/external_db_config_client_matcher.js b/libs/external-db-config/test/e2e/external_db_config_client_matcher.js similarity index 100% rename from packages/external-db-config/test/e2e/external_db_config_client_matcher.js rename to libs/external-db-config/test/e2e/external_db_config_client_matcher.js diff --git a/packages/external-db-config/test/gen.js b/libs/external-db-config/test/gen.js similarity index 100% rename from packages/external-db-config/test/gen.js rename to libs/external-db-config/test/gen.js diff --git a/packages/external-db-config/test/provider/config_reader_service.spec.js b/libs/external-db-config/test/provider/config_reader_service.spec.js similarity index 100% rename from packages/external-db-config/test/provider/config_reader_service.spec.js rename to libs/external-db-config/test/provider/config_reader_service.spec.js diff --git a/packages/external-db-config/test/test_utils.js b/libs/external-db-config/test/test_utils.js similarity index 100% rename from packages/external-db-config/test/test_utils.js rename to libs/external-db-config/test/test_utils.js diff --git a/libs/external-db-config/tsconfig.json b/libs/external-db-config/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/external-db-config/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/external-db-config/tsconfig.lib.json b/libs/external-db-config/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/external-db-config/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/external-db-config/tsconfig.spec.json b/libs/external-db-config/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/external-db-config/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/external-db-dynamodb/.eslintrc.json b/libs/external-db-dynamodb/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/external-db-dynamodb/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/external-db-firestore/.gitignore b/libs/external-db-dynamodb/.gitignore similarity index 100% rename from packages/external-db-firestore/.gitignore rename to libs/external-db-dynamodb/.gitignore diff --git a/packages/external-db-dynamodb/README.md b/libs/external-db-dynamodb/README.md similarity index 100% rename from packages/external-db-dynamodb/README.md rename to libs/external-db-dynamodb/README.md diff --git a/libs/external-db-dynamodb/jest.config.js b/libs/external-db-dynamodb/jest.config.js new file mode 100644 index 000000000..b47cc058f --- /dev/null +++ b/libs/external-db-dynamodb/jest.config.js @@ -0,0 +1,19 @@ +module.exports = { + displayName: 'external-db-dynamodb', + clearMocks: true, + verbose: true, + // roots: ['/src'], + // testRegex: '(.*\\.spec\\.)js$', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/external-db-dynamodb', + testEnvironment: 'node' +} \ No newline at end of file diff --git a/libs/external-db-dynamodb/package.json b/libs/external-db-dynamodb/package.json new file mode 100644 index 000000000..e2fe57be0 --- /dev/null +++ b/libs/external-db-dynamodb/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/external-db-dynamodb", + "version": "1.0.3", + "type": "commonjs" +} \ No newline at end of file diff --git a/libs/external-db-dynamodb/project.json b/libs/external-db-dynamodb/project.json new file mode 100644 index 000000000..88186d549 --- /dev/null +++ b/libs/external-db-dynamodb/project.json @@ -0,0 +1,46 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/external-db-dynamodb/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": [ "{options.outputPath}" ], + "options": { + "outputPath": "dist/libs/external-db-dynamodb", + "main": "libs/external-db-dynamodb/src/index.js", + "tsConfig": "libs/external-db-dynamodb/tsconfig.lib.json", + "assets": [ "libs/external-db-dynamodb/*.md" ], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/external-db-dynamodb {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": [ "{options.outputFile}" ], + "options": { + "lintFilePatterns": [ "libs/external-db-dynamodb/**/*.js" ] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": [ "coverage/libs/external-db-dynamodb" ], + "options": { + "jestConfig": "libs/external-db-dynamodb/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/packages/external-db-dynamodb/lib/connection_provider.js b/libs/external-db-dynamodb/src/connection_provider.js similarity index 100% rename from packages/external-db-dynamodb/lib/connection_provider.js rename to libs/external-db-dynamodb/src/connection_provider.js diff --git a/packages/external-db-dynamodb/lib/dynamo_config_validator.js b/libs/external-db-dynamodb/src/dynamo_config_validator.js similarity index 100% rename from packages/external-db-dynamodb/lib/dynamo_config_validator.js rename to libs/external-db-dynamodb/src/dynamo_config_validator.js diff --git a/packages/external-db-dynamodb/lib/dynamo_data_provider.js b/libs/external-db-dynamodb/src/dynamo_data_provider.js similarity index 100% rename from packages/external-db-dynamodb/lib/dynamo_data_provider.js rename to libs/external-db-dynamodb/src/dynamo_data_provider.js diff --git a/packages/external-db-dynamodb/lib/dynamo_data_requests_utils.js b/libs/external-db-dynamodb/src/dynamo_data_requests_utils.js similarity index 100% rename from packages/external-db-dynamodb/lib/dynamo_data_requests_utils.js rename to libs/external-db-dynamodb/src/dynamo_data_requests_utils.js diff --git a/packages/external-db-dynamodb/lib/dynamo_operations.js b/libs/external-db-dynamodb/src/dynamo_operations.js similarity index 100% rename from packages/external-db-dynamodb/lib/dynamo_operations.js rename to libs/external-db-dynamodb/src/dynamo_operations.js diff --git a/packages/external-db-dynamodb/lib/dynamo_schema_provider.js b/libs/external-db-dynamodb/src/dynamo_schema_provider.js similarity index 100% rename from packages/external-db-dynamodb/lib/dynamo_schema_provider.js rename to libs/external-db-dynamodb/src/dynamo_schema_provider.js diff --git a/packages/external-db-dynamodb/lib/dynamo_schema_requests_utils.js b/libs/external-db-dynamodb/src/dynamo_schema_requests_utils.js similarity index 100% rename from packages/external-db-dynamodb/lib/dynamo_schema_requests_utils.js rename to libs/external-db-dynamodb/src/dynamo_schema_requests_utils.js diff --git a/packages/external-db-dynamodb/lib/dynamo_utils.js b/libs/external-db-dynamodb/src/dynamo_utils.js similarity index 100% rename from packages/external-db-dynamodb/lib/dynamo_utils.js rename to libs/external-db-dynamodb/src/dynamo_utils.js diff --git a/packages/external-db-dynamodb/lib/dynamo_utils.spec.js b/libs/external-db-dynamodb/src/dynamo_utils.spec.js similarity index 100% rename from packages/external-db-dynamodb/lib/dynamo_utils.spec.js rename to libs/external-db-dynamodb/src/dynamo_utils.spec.js diff --git a/packages/external-db-dynamodb/lib/index.js b/libs/external-db-dynamodb/src/index.js similarity index 100% rename from packages/external-db-dynamodb/lib/index.js rename to libs/external-db-dynamodb/src/index.js diff --git a/packages/external-db-dynamodb/lib/sql_exception_translator.js b/libs/external-db-dynamodb/src/sql_exception_translator.js similarity index 100% rename from packages/external-db-dynamodb/lib/sql_exception_translator.js rename to libs/external-db-dynamodb/src/sql_exception_translator.js diff --git a/packages/external-db-dynamodb/lib/sql_filter_transformer.js b/libs/external-db-dynamodb/src/sql_filter_transformer.js similarity index 98% rename from packages/external-db-dynamodb/lib/sql_filter_transformer.js rename to libs/external-db-dynamodb/src/sql_filter_transformer.js index 1cdecf72f..e2c786943 100644 --- a/packages/external-db-dynamodb/lib/sql_filter_transformer.js +++ b/libs/external-db-dynamodb/src/sql_filter_transformer.js @@ -163,8 +163,7 @@ class FilterParser { return filter } - // eslint-disable-next-line no-unused-vars - canQuery(filterExpr, fields) { + canQuery(filterExpr, _fields) { // const collectionKeys = fields.filter(f=>f.isPrimary).map(f=>f.name) const collectionKeys = ['_id'] diff --git a/packages/external-db-dynamodb/lib/sql_filter_transformer.spec.js b/libs/external-db-dynamodb/src/sql_filter_transformer.spec.js similarity index 100% rename from packages/external-db-dynamodb/lib/sql_filter_transformer.spec.js rename to libs/external-db-dynamodb/src/sql_filter_transformer.spec.js diff --git a/packages/external-db-dynamodb/lib/supported_operations.js b/libs/external-db-dynamodb/src/supported_operations.js similarity index 100% rename from packages/external-db-dynamodb/lib/supported_operations.js rename to libs/external-db-dynamodb/src/supported_operations.js diff --git a/packages/external-db-dynamodb/tests/drivers/db_operations_test_support.js b/libs/external-db-dynamodb/tests/drivers/db_operations_test_support.js similarity index 93% rename from packages/external-db-dynamodb/tests/drivers/db_operations_test_support.js rename to libs/external-db-dynamodb/tests/drivers/db_operations_test_support.js index 2aa7c42b0..6db165e30 100644 --- a/packages/external-db-dynamodb/tests/drivers/db_operations_test_support.js +++ b/libs/external-db-dynamodb/tests/drivers/db_operations_test_support.js @@ -1,5 +1,5 @@ -const DatabaseOperations = require('../../lib/dynamo_operations') -const init = require('../../lib/connection_provider') +const DatabaseOperations = require('../../src/dynamo_operations') +const init = require('../../src/connection_provider') const config = () => ({ region: 'us-west-2', diff --git a/packages/external-db-dynamodb/tests/drivers/sql_filter_transformer_test_support.js b/libs/external-db-dynamodb/tests/drivers/sql_filter_transformer_test_support.js similarity index 97% rename from packages/external-db-dynamodb/tests/drivers/sql_filter_transformer_test_support.js rename to libs/external-db-dynamodb/tests/drivers/sql_filter_transformer_test_support.js index 4dd50152d..5f70f3b19 100644 --- a/packages/external-db-dynamodb/tests/drivers/sql_filter_transformer_test_support.js +++ b/libs/external-db-dynamodb/tests/drivers/sql_filter_transformer_test_support.js @@ -58,8 +58,7 @@ const givenProjectionExprFor = (projection) => } ) -// eslint-disable-next-line no-unused-vars -const givenAggregateQueryWith = (having, numericColumns, columnAliases, groupByColumns, filter) => {} +const givenAggregateQueryWith = (_having, _numericColumns, _columnAliases, _groupByColumns, _filter) => {} const givenStartsWithFilterFor = (filter, column, value) => when(filterParser.transform).calledWith(filter) diff --git a/packages/external-db-dynamodb/tests/gen.js b/libs/external-db-dynamodb/tests/gen.js similarity index 100% rename from packages/external-db-dynamodb/tests/gen.js rename to libs/external-db-dynamodb/tests/gen.js diff --git a/libs/external-db-dynamodb/tsconfig.json b/libs/external-db-dynamodb/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/external-db-dynamodb/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/external-db-dynamodb/tsconfig.lib.json b/libs/external-db-dynamodb/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/external-db-dynamodb/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/external-db-dynamodb/tsconfig.spec.json b/libs/external-db-dynamodb/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/external-db-dynamodb/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/external-db-firestore/.eslintrc.json b/libs/external-db-firestore/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/external-db-firestore/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/external-db-mongo/.gitignore b/libs/external-db-firestore/.gitignore similarity index 100% rename from packages/external-db-mongo/.gitignore rename to libs/external-db-firestore/.gitignore diff --git a/packages/external-db-mongo/.nvmrc b/libs/external-db-firestore/.nvmrc similarity index 100% rename from packages/external-db-mongo/.nvmrc rename to libs/external-db-firestore/.nvmrc diff --git a/packages/external-db-firestore/README.md b/libs/external-db-firestore/README.md similarity index 100% rename from packages/external-db-firestore/README.md rename to libs/external-db-firestore/README.md diff --git a/libs/external-db-firestore/jest.config.js b/libs/external-db-firestore/jest.config.js new file mode 100644 index 000000000..9a0e6f853 --- /dev/null +++ b/libs/external-db-firestore/jest.config.js @@ -0,0 +1,19 @@ +module.exports = { + displayName: 'external-db-firestore', + clearMocks: true, + verbose: true, + // roots: ['/src'], + // testRegex: '(.*\\.spec\\.)js$', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/external-db-firestore', + testEnvironment: 'node' +} \ No newline at end of file diff --git a/libs/external-db-firestore/package.json b/libs/external-db-firestore/package.json new file mode 100644 index 000000000..226cc33b9 --- /dev/null +++ b/libs/external-db-firestore/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/external-db-firestore", + "version": "1.0.3", + "type": "commonjs" +} \ No newline at end of file diff --git a/libs/external-db-firestore/project.json b/libs/external-db-firestore/project.json new file mode 100644 index 000000000..02a69521c --- /dev/null +++ b/libs/external-db-firestore/project.json @@ -0,0 +1,48 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/external-db-firestore/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": [ "{options.outputPath}" ], + "options": { + "outputPath": "dist/libs/external-db-firestore", + "main": "libs/external-db-firestore/src/index.js", + "tsConfig": "libs/external-db-firestore/tsconfig.lib.json", + "assets": [ "libs/external-db-firestore/*.md" ], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/external-db-firestore {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": [ + "{options.outputFile}" + ], + "options": { + "lintFilePatterns": [ "libs/external-db-firestore/**/*.js" ] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": [ "coverage/libs/external-db-firestore" ], + "options": { + "jestConfig": "libs/external-db-firestore/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/packages/external-db-firestore/lib/connection_provider.js b/libs/external-db-firestore/src/connection_provider.js similarity index 100% rename from packages/external-db-firestore/lib/connection_provider.js rename to libs/external-db-firestore/src/connection_provider.js diff --git a/packages/external-db-firestore/lib/firestore_config_validator.js b/libs/external-db-firestore/src/firestore_config_validator.js similarity index 100% rename from packages/external-db-firestore/lib/firestore_config_validator.js rename to libs/external-db-firestore/src/firestore_config_validator.js diff --git a/packages/external-db-firestore/lib/firestore_data_provider.js b/libs/external-db-firestore/src/firestore_data_provider.js similarity index 100% rename from packages/external-db-firestore/lib/firestore_data_provider.js rename to libs/external-db-firestore/src/firestore_data_provider.js diff --git a/packages/external-db-firestore/lib/firestore_operations.js b/libs/external-db-firestore/src/firestore_operations.js similarity index 100% rename from packages/external-db-firestore/lib/firestore_operations.js rename to libs/external-db-firestore/src/firestore_operations.js diff --git a/packages/external-db-firestore/lib/firestore_schema_provider.js b/libs/external-db-firestore/src/firestore_schema_provider.js similarity index 100% rename from packages/external-db-firestore/lib/firestore_schema_provider.js rename to libs/external-db-firestore/src/firestore_schema_provider.js diff --git a/packages/external-db-firestore/lib/firestore_utils.js b/libs/external-db-firestore/src/firestore_utils.js similarity index 100% rename from packages/external-db-firestore/lib/firestore_utils.js rename to libs/external-db-firestore/src/firestore_utils.js diff --git a/packages/external-db-firestore/lib/index.js b/libs/external-db-firestore/src/index.js similarity index 100% rename from packages/external-db-firestore/lib/index.js rename to libs/external-db-firestore/src/index.js diff --git a/packages/external-db-firestore/lib/sql_exception_translator.js b/libs/external-db-firestore/src/sql_exception_translator.js similarity index 100% rename from packages/external-db-firestore/lib/sql_exception_translator.js rename to libs/external-db-firestore/src/sql_exception_translator.js diff --git a/packages/external-db-firestore/lib/sql_filter_transformer.js b/libs/external-db-firestore/src/sql_filter_transformer.js similarity index 100% rename from packages/external-db-firestore/lib/sql_filter_transformer.js rename to libs/external-db-firestore/src/sql_filter_transformer.js diff --git a/packages/external-db-firestore/lib/sql_filter_transformer.spec.js b/libs/external-db-firestore/src/sql_filter_transformer.spec.js similarity index 100% rename from packages/external-db-firestore/lib/sql_filter_transformer.spec.js rename to libs/external-db-firestore/src/sql_filter_transformer.spec.js diff --git a/packages/external-db-firestore/lib/supported_operations.js b/libs/external-db-firestore/src/supported_operations.js similarity index 100% rename from packages/external-db-firestore/lib/supported_operations.js rename to libs/external-db-firestore/src/supported_operations.js diff --git a/packages/external-db-firestore/tests/drivers/broken_creds.json b/libs/external-db-firestore/tests/drivers/broken_creds.json similarity index 100% rename from packages/external-db-firestore/tests/drivers/broken_creds.json rename to libs/external-db-firestore/tests/drivers/broken_creds.json diff --git a/packages/external-db-firestore/tests/drivers/db_operations_test_support.js b/libs/external-db-firestore/tests/drivers/db_operations_test_support.js similarity index 87% rename from packages/external-db-firestore/tests/drivers/db_operations_test_support.js rename to libs/external-db-firestore/tests/drivers/db_operations_test_support.js index 2abf3cd35..cf50f1bc3 100644 --- a/packages/external-db-firestore/tests/drivers/db_operations_test_support.js +++ b/libs/external-db-firestore/tests/drivers/db_operations_test_support.js @@ -1,4 +1,4 @@ -const init = require('../../lib/connection_provider') +const init = require('../../src/connection_provider') const createPool = modify => { const config = { @@ -10,7 +10,7 @@ const createPool = modify => { const unplugEmulator = () => delete process.env.FIRESTORE_EMULATOR_HOST -const setWrongCredentials = () => process.env.GOOGLE_APPLICATION_CREDENTIALS='../../packages/external-db-firestore/tests/drivers/broken_creds.json' +const setWrongCredentials = () => process.env.GOOGLE_APPLICATION_CREDENTIALS='./libs/external-db-firestore/tests/drivers/broken_creds.json' const dbOperationWithMisconfiguredProjectId = () => { unplugEmulator() diff --git a/packages/external-db-firestore/tests/drivers/sql_filter_transformer_test_support.js b/libs/external-db-firestore/tests/drivers/sql_filter_transformer_test_support.js similarity index 98% rename from packages/external-db-firestore/tests/drivers/sql_filter_transformer_test_support.js rename to libs/external-db-firestore/tests/drivers/sql_filter_transformer_test_support.js index a950edc1a..fc861943a 100644 --- a/packages/external-db-firestore/tests/drivers/sql_filter_transformer_test_support.js +++ b/libs/external-db-firestore/tests/drivers/sql_filter_transformer_test_support.js @@ -1,5 +1,5 @@ const { when } = require('jest-when') -const { LastLetterCoder } = require('../../lib/firestore_utils') +const { LastLetterCoder } = require('../../src/firestore_utils') const escapeId = x => x const EmptySort = [] diff --git a/packages/external-db-firestore/tests/gen.js b/libs/external-db-firestore/tests/gen.js similarity index 100% rename from packages/external-db-firestore/tests/gen.js rename to libs/external-db-firestore/tests/gen.js diff --git a/libs/external-db-firestore/tsconfig.json b/libs/external-db-firestore/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/external-db-firestore/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/external-db-firestore/tsconfig.lib.json b/libs/external-db-firestore/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/external-db-firestore/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/external-db-firestore/tsconfig.spec.json b/libs/external-db-firestore/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/external-db-firestore/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/external-db-google-sheets/.eslintrc.json b/libs/external-db-google-sheets/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/external-db-google-sheets/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/external-db-google-sheets/.gitignore b/libs/external-db-google-sheets/.gitignore similarity index 100% rename from packages/external-db-google-sheets/.gitignore rename to libs/external-db-google-sheets/.gitignore diff --git a/packages/external-db-google-sheets/README.md b/libs/external-db-google-sheets/README.md similarity index 100% rename from packages/external-db-google-sheets/README.md rename to libs/external-db-google-sheets/README.md diff --git a/libs/external-db-google-sheets/jest.config.js b/libs/external-db-google-sheets/jest.config.js new file mode 100644 index 000000000..276e3c0c9 --- /dev/null +++ b/libs/external-db-google-sheets/jest.config.js @@ -0,0 +1,19 @@ +module.exports = { + displayName: 'external-db-google-sheets', + clearMocks: true, + verbose: true, + // roots: ['/src'], + // testRegex: '(.*\\.spec\\.)js$', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/external-db-google-sheets', + testEnvironment: 'node' +} \ No newline at end of file diff --git a/libs/external-db-google-sheets/package.json b/libs/external-db-google-sheets/package.json new file mode 100644 index 000000000..753a7d87b --- /dev/null +++ b/libs/external-db-google-sheets/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/external-db-google-sheets", + "version": "1.0.3", + "type": "commonjs" +} \ No newline at end of file diff --git a/libs/external-db-google-sheets/project.json b/libs/external-db-google-sheets/project.json new file mode 100644 index 000000000..a001590bc --- /dev/null +++ b/libs/external-db-google-sheets/project.json @@ -0,0 +1,46 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/external-db-google-sheets/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": [ "{options.outputPath}" ], + "options": { + "outputPath": "dist/libs/external-db-google-sheets", + "main": "libs/external-db-google-sheets/src/index.js", + "tsConfig": "libs/external-db-google-sheets/tsconfig.lib.json", + "assets": [ "libs/external-db-google-sheets/*.md" ], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/external-db-google-sheets {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": [ "{options.outputFile}" ], + "options": { + "lintFilePatterns": [ "libs/external-db-google-sheets/**/*.js" ] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": [ "coverage/libs/external-db-google-sheets" ], + "options": { + "jestConfig": "libs/external-db-google-sheets/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/packages/external-db-google-sheets/lib/connection_provider.js b/libs/external-db-google-sheets/src/connection_provider.js similarity index 100% rename from packages/external-db-google-sheets/lib/connection_provider.js rename to libs/external-db-google-sheets/src/connection_provider.js diff --git a/packages/external-db-google-sheets/lib/google_sheet_config_validator.js b/libs/external-db-google-sheets/src/google_sheet_config_validator.js similarity index 100% rename from packages/external-db-google-sheets/lib/google_sheet_config_validator.js rename to libs/external-db-google-sheets/src/google_sheet_config_validator.js diff --git a/packages/external-db-google-sheets/lib/google_sheet_data_provider.js b/libs/external-db-google-sheets/src/google_sheet_data_provider.js similarity index 100% rename from packages/external-db-google-sheets/lib/google_sheet_data_provider.js rename to libs/external-db-google-sheets/src/google_sheet_data_provider.js diff --git a/packages/external-db-google-sheets/lib/google_sheet_exception_translator.js b/libs/external-db-google-sheets/src/google_sheet_exception_translator.js similarity index 100% rename from packages/external-db-google-sheets/lib/google_sheet_exception_translator.js rename to libs/external-db-google-sheets/src/google_sheet_exception_translator.js diff --git a/packages/external-db-google-sheets/lib/google_sheet_operations.js b/libs/external-db-google-sheets/src/google_sheet_operations.js similarity index 100% rename from packages/external-db-google-sheets/lib/google_sheet_operations.js rename to libs/external-db-google-sheets/src/google_sheet_operations.js diff --git a/packages/external-db-google-sheets/lib/google_sheet_schema_provider.js b/libs/external-db-google-sheets/src/google_sheet_schema_provider.js similarity index 100% rename from packages/external-db-google-sheets/lib/google_sheet_schema_provider.js rename to libs/external-db-google-sheets/src/google_sheet_schema_provider.js diff --git a/packages/external-db-google-sheets/lib/google_sheet_utils.js b/libs/external-db-google-sheets/src/google_sheet_utils.js similarity index 100% rename from packages/external-db-google-sheets/lib/google_sheet_utils.js rename to libs/external-db-google-sheets/src/google_sheet_utils.js diff --git a/packages/external-db-google-sheets/lib/index.js b/libs/external-db-google-sheets/src/index.js similarity index 100% rename from packages/external-db-google-sheets/lib/index.js rename to libs/external-db-google-sheets/src/index.js diff --git a/packages/external-db-google-sheets/lib/sql_filter_transformer.js b/libs/external-db-google-sheets/src/sql_filter_transformer.js similarity index 100% rename from packages/external-db-google-sheets/lib/sql_filter_transformer.js rename to libs/external-db-google-sheets/src/sql_filter_transformer.js diff --git a/packages/external-db-google-sheets/lib/supported_operations.js b/libs/external-db-google-sheets/src/supported_operations.js similarity index 100% rename from packages/external-db-google-sheets/lib/supported_operations.js rename to libs/external-db-google-sheets/src/supported_operations.js diff --git a/packages/external-db-google-sheets/tests/google_sheet_doc_class.js b/libs/external-db-google-sheets/tests/google_sheet_doc_class.js similarity index 100% rename from packages/external-db-google-sheets/tests/google_sheet_doc_class.js rename to libs/external-db-google-sheets/tests/google_sheet_doc_class.js diff --git a/packages/external-db-google-sheets/tests/google_sheet_sheet_class.js b/libs/external-db-google-sheets/tests/google_sheet_sheet_class.js similarity index 100% rename from packages/external-db-google-sheets/tests/google_sheet_sheet_class.js rename to libs/external-db-google-sheets/tests/google_sheet_sheet_class.js diff --git a/packages/external-db-google-sheets/tests/google_sheets_test_utils.js b/libs/external-db-google-sheets/tests/google_sheets_test_utils.js similarity index 100% rename from packages/external-db-google-sheets/tests/google_sheets_test_utils.js rename to libs/external-db-google-sheets/tests/google_sheets_test_utils.js diff --git a/packages/external-db-google-sheets/tests/mock-server.js b/libs/external-db-google-sheets/tests/mock-server.js similarity index 100% rename from packages/external-db-google-sheets/tests/mock-server.js rename to libs/external-db-google-sheets/tests/mock-server.js diff --git a/packages/external-db-google-sheets/tests/mock_google_sheets_api.js b/libs/external-db-google-sheets/tests/mock_google_sheets_api.js similarity index 100% rename from packages/external-db-google-sheets/tests/mock_google_sheets_api.js rename to libs/external-db-google-sheets/tests/mock_google_sheets_api.js diff --git a/packages/external-db-google-sheets/tests/sql_filter_transformer_test_support.js b/libs/external-db-google-sheets/tests/sql_filter_transformer_test_support.js similarity index 96% rename from packages/external-db-google-sheets/tests/sql_filter_transformer_test_support.js rename to libs/external-db-google-sheets/tests/sql_filter_transformer_test_support.js index aff4ac467..b1ab7c77e 100644 --- a/packages/external-db-google-sheets/tests/sql_filter_transformer_test_support.js +++ b/libs/external-db-google-sheets/tests/sql_filter_transformer_test_support.js @@ -1,6 +1,6 @@ const { EmptySort } = require('@wix-velo/velo-external-db-commons') const { when } = require('jest-when') -// const { escapeId } = require('../../lib/mysql_utils'); +// const { escapeId } = require('../../src/mysql_utils'); const filterParser = { transform: jest.fn(), diff --git a/packages/external-db-google-sheets/tests/templates.js b/libs/external-db-google-sheets/tests/templates.js similarity index 100% rename from packages/external-db-google-sheets/tests/templates.js rename to libs/external-db-google-sheets/tests/templates.js diff --git a/libs/external-db-google-sheets/tsconfig.json b/libs/external-db-google-sheets/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/external-db-google-sheets/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/external-db-google-sheets/tsconfig.lib.json b/libs/external-db-google-sheets/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/external-db-google-sheets/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/external-db-google-sheets/tsconfig.spec.json b/libs/external-db-google-sheets/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/external-db-google-sheets/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/external-db-mongo/.eslintrc.json b/libs/external-db-mongo/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/external-db-mongo/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/external-db-mssql/.gitignore b/libs/external-db-mongo/.gitignore similarity index 100% rename from packages/external-db-mssql/.gitignore rename to libs/external-db-mongo/.gitignore diff --git a/packages/external-db-mssql/.nvmrc b/libs/external-db-mongo/.nvmrc similarity index 100% rename from packages/external-db-mssql/.nvmrc rename to libs/external-db-mongo/.nvmrc diff --git a/packages/external-db-mongo/README.md b/libs/external-db-mongo/README.md similarity index 100% rename from packages/external-db-mongo/README.md rename to libs/external-db-mongo/README.md diff --git a/libs/external-db-mongo/jest.config.js b/libs/external-db-mongo/jest.config.js new file mode 100644 index 000000000..eff635333 --- /dev/null +++ b/libs/external-db-mongo/jest.config.js @@ -0,0 +1,19 @@ +module.exports = { + displayName: 'external-db-spanner', + clearMocks: true, + verbose: true, + // roots: ['/src'], + // testRegex: '(.*\\.spec\\.)js$', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/external-db-mssql', + testEnvironment: 'node' +} \ No newline at end of file diff --git a/libs/external-db-mongo/package.json b/libs/external-db-mongo/package.json new file mode 100644 index 000000000..a06d934d4 --- /dev/null +++ b/libs/external-db-mongo/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/external-db-mongo", + "version": "1.0.3", + "type": "commonjs" +} \ No newline at end of file diff --git a/libs/external-db-mongo/project.json b/libs/external-db-mongo/project.json new file mode 100644 index 000000000..96036ec1e --- /dev/null +++ b/libs/external-db-mongo/project.json @@ -0,0 +1,48 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/external-db-mongo/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": [ "{options.outputPath}" ], + "options": { + "outputPath": "dist/libs/external-db-mongo", + "main": "libs/external-db-mongo/src/index.js", + "tsConfig": "libs/external-db-mongo/tsconfig.lib.json", + "assets": [ "libs/external-db-mongo/*.md" ], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/external-db-mongo {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": [ + "{options.outputFile}" + ], + "options": { + "lintFilePatterns": [ "libs/external-db-mongo/**/*.js" ] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": [ "coverage/libs/external-db-mongo" ], + "options": { + "jestConfig": "libs/external-db-mongo/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/packages/external-db-mongo/lib/connection_provider.js b/libs/external-db-mongo/src/connection_provider.js similarity index 100% rename from packages/external-db-mongo/lib/connection_provider.js rename to libs/external-db-mongo/src/connection_provider.js diff --git a/packages/external-db-mongo/lib/exception_translator.js b/libs/external-db-mongo/src/exception_translator.js similarity index 79% rename from packages/external-db-mongo/lib/exception_translator.js rename to libs/external-db-mongo/src/exception_translator.js index bcd1985e8..9dcc8f509 100644 --- a/packages/external-db-mongo/lib/exception_translator.js +++ b/libs/external-db-mongo/src/exception_translator.js @@ -1,4 +1,5 @@ -const { ItemAlreadyExists } = require('@wix-velo/velo-external-db-commons/lib/errors') +const { errors } = require('@wix-velo/velo-external-db-commons') +const { ItemAlreadyExists } = errors const notThrowingTranslateErrorCodes = err => { switch (err.code) { diff --git a/packages/external-db-mongo/lib/index.js b/libs/external-db-mongo/src/index.js similarity index 100% rename from packages/external-db-mongo/lib/index.js rename to libs/external-db-mongo/src/index.js diff --git a/packages/external-db-mongo/lib/mongo_config_validator.js b/libs/external-db-mongo/src/mongo_config_validator.js similarity index 100% rename from packages/external-db-mongo/lib/mongo_config_validator.js rename to libs/external-db-mongo/src/mongo_config_validator.js diff --git a/packages/external-db-mongo/lib/mongo_data_provider.js b/libs/external-db-mongo/src/mongo_data_provider.js similarity index 100% rename from packages/external-db-mongo/lib/mongo_data_provider.js rename to libs/external-db-mongo/src/mongo_data_provider.js diff --git a/packages/external-db-mongo/lib/mongo_operations.js b/libs/external-db-mongo/src/mongo_operations.js similarity index 100% rename from packages/external-db-mongo/lib/mongo_operations.js rename to libs/external-db-mongo/src/mongo_operations.js diff --git a/packages/external-db-mongo/lib/mongo_schema_provider.js b/libs/external-db-mongo/src/mongo_schema_provider.js similarity index 100% rename from packages/external-db-mongo/lib/mongo_schema_provider.js rename to libs/external-db-mongo/src/mongo_schema_provider.js diff --git a/packages/external-db-mongo/lib/mongo_utils.js b/libs/external-db-mongo/src/mongo_utils.js similarity index 100% rename from packages/external-db-mongo/lib/mongo_utils.js rename to libs/external-db-mongo/src/mongo_utils.js diff --git a/packages/external-db-mongo/lib/mongo_utils.spec.js b/libs/external-db-mongo/src/mongo_utils.spec.js similarity index 100% rename from packages/external-db-mongo/lib/mongo_utils.spec.js rename to libs/external-db-mongo/src/mongo_utils.spec.js diff --git a/packages/external-db-mongo/lib/sql_filter_transformer.js b/libs/external-db-mongo/src/sql_filter_transformer.js similarity index 100% rename from packages/external-db-mongo/lib/sql_filter_transformer.js rename to libs/external-db-mongo/src/sql_filter_transformer.js diff --git a/packages/external-db-mongo/lib/sql_filter_transformer.spec.js b/libs/external-db-mongo/src/sql_filter_transformer.spec.js similarity index 100% rename from packages/external-db-mongo/lib/sql_filter_transformer.spec.js rename to libs/external-db-mongo/src/sql_filter_transformer.spec.js diff --git a/packages/external-db-mongo/lib/supported_operations.js b/libs/external-db-mongo/src/supported_operations.js similarity index 100% rename from packages/external-db-mongo/lib/supported_operations.js rename to libs/external-db-mongo/src/supported_operations.js diff --git a/packages/external-db-mongo/tests/drivers/db_operations_test_support.js b/libs/external-db-mongo/tests/drivers/db_operations_test_support.js similarity index 96% rename from packages/external-db-mongo/tests/drivers/db_operations_test_support.js rename to libs/external-db-mongo/tests/drivers/db_operations_test_support.js index 0cf11c47a..5c188b83a 100644 --- a/packages/external-db-mongo/tests/drivers/db_operations_test_support.js +++ b/libs/external-db-mongo/tests/drivers/db_operations_test_support.js @@ -1,5 +1,5 @@ // const { ConnectionPool } = require('mongodb') -const DatabaseOperations = require('../../lib/mongo_operations') +const DatabaseOperations = require('../../src/mongo_operations') const { MongoClient } = require('mongodb') diff --git a/packages/external-db-mongo/tests/drivers/sql_filter_transformer_test_support.js b/libs/external-db-mongo/tests/drivers/sql_filter_transformer_test_support.js similarity index 100% rename from packages/external-db-mongo/tests/drivers/sql_filter_transformer_test_support.js rename to libs/external-db-mongo/tests/drivers/sql_filter_transformer_test_support.js diff --git a/libs/external-db-mongo/tsconfig.json b/libs/external-db-mongo/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/external-db-mongo/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/external-db-mongo/tsconfig.lib.json b/libs/external-db-mongo/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/external-db-mongo/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/external-db-mongo/tsconfig.spec.json b/libs/external-db-mongo/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/external-db-mongo/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/external-db-mssql/.eslintrc.json b/libs/external-db-mssql/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/external-db-mssql/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/external-db-mysql/.gitignore b/libs/external-db-mssql/.gitignore similarity index 100% rename from packages/external-db-mysql/.gitignore rename to libs/external-db-mssql/.gitignore diff --git a/packages/external-db-mysql/.nvmrc b/libs/external-db-mssql/.nvmrc similarity index 100% rename from packages/external-db-mysql/.nvmrc rename to libs/external-db-mssql/.nvmrc diff --git a/packages/external-db-mssql/README.md b/libs/external-db-mssql/README.md similarity index 100% rename from packages/external-db-mssql/README.md rename to libs/external-db-mssql/README.md diff --git a/libs/external-db-mssql/jest.config.js b/libs/external-db-mssql/jest.config.js new file mode 100644 index 000000000..bc9cbb2d6 --- /dev/null +++ b/libs/external-db-mssql/jest.config.js @@ -0,0 +1,19 @@ +module.exports = { + displayName: 'external-db-mssql', + clearMocks: true, + verbose: true, + // roots: ['/src'], + // testRegex: '(.*\\.spec\\.)js$', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/external-db-mssql', + testEnvironment: 'node' +} \ No newline at end of file diff --git a/libs/external-db-mssql/package.json b/libs/external-db-mssql/package.json new file mode 100644 index 000000000..b0e81ea92 --- /dev/null +++ b/libs/external-db-mssql/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/external-db-mssql", + "version": "1.0.3", + "type": "commonjs" +} \ No newline at end of file diff --git a/libs/external-db-mssql/project.json b/libs/external-db-mssql/project.json new file mode 100644 index 000000000..0adc6323f --- /dev/null +++ b/libs/external-db-mssql/project.json @@ -0,0 +1,48 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/external-db-mssql/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": [ "{options.outputPath}" ], + "options": { + "outputPath": "dist/libs/external-db-mssql", + "main": "libs/external-db-mssql/src/index.js", + "tsConfig": "libs/external-db-mssql/tsconfig.lib.json", + "assets": [ "libs/external-db-mssql/*.md" ], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/external-db-mssql {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": [ + "{options.outputFile}" + ], + "options": { + "lintFilePatterns": [ "libs/external-db-mssql/**/*.js" ] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": [ "coverage/libs/external-db-mssql" ], + "options": { + "jestConfig": "libs/external-db-mssql/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/packages/external-db-mssql/lib/connection_provider.js b/libs/external-db-mssql/src/connection_provider.js similarity index 100% rename from packages/external-db-mssql/lib/connection_provider.js rename to libs/external-db-mssql/src/connection_provider.js diff --git a/packages/external-db-mssql/lib/index.js b/libs/external-db-mssql/src/index.js similarity index 100% rename from packages/external-db-mssql/lib/index.js rename to libs/external-db-mssql/src/index.js diff --git a/packages/external-db-mssql/lib/mssql_config_validator.js b/libs/external-db-mssql/src/mssql_config_validator.js similarity index 100% rename from packages/external-db-mssql/lib/mssql_config_validator.js rename to libs/external-db-mssql/src/mssql_config_validator.js diff --git a/packages/external-db-mssql/lib/mssql_data_provider.js b/libs/external-db-mssql/src/mssql_data_provider.js similarity index 100% rename from packages/external-db-mssql/lib/mssql_data_provider.js rename to libs/external-db-mssql/src/mssql_data_provider.js diff --git a/packages/external-db-mssql/lib/mssql_operations.js b/libs/external-db-mssql/src/mssql_operations.js similarity index 100% rename from packages/external-db-mssql/lib/mssql_operations.js rename to libs/external-db-mssql/src/mssql_operations.js diff --git a/packages/external-db-mssql/lib/mssql_schema_provider.js b/libs/external-db-mssql/src/mssql_schema_provider.js similarity index 100% rename from packages/external-db-mssql/lib/mssql_schema_provider.js rename to libs/external-db-mssql/src/mssql_schema_provider.js diff --git a/packages/external-db-mssql/lib/mssql_utils.js b/libs/external-db-mssql/src/mssql_utils.js similarity index 100% rename from packages/external-db-mssql/lib/mssql_utils.js rename to libs/external-db-mssql/src/mssql_utils.js diff --git a/packages/external-db-mssql/lib/mysql_utils.spec.js b/libs/external-db-mssql/src/mysql_utils.spec.js similarity index 100% rename from packages/external-db-mssql/lib/mysql_utils.spec.js rename to libs/external-db-mssql/src/mysql_utils.spec.js diff --git a/packages/external-db-mssql/lib/sql_exception_translator.js b/libs/external-db-mssql/src/sql_exception_translator.js similarity index 100% rename from packages/external-db-mssql/lib/sql_exception_translator.js rename to libs/external-db-mssql/src/sql_exception_translator.js diff --git a/packages/external-db-mssql/lib/sql_filter_transformer.js b/libs/external-db-mssql/src/sql_filter_transformer.js similarity index 100% rename from packages/external-db-mssql/lib/sql_filter_transformer.js rename to libs/external-db-mssql/src/sql_filter_transformer.js diff --git a/packages/external-db-mssql/lib/sql_filter_transformer.spec.js b/libs/external-db-mssql/src/sql_filter_transformer.spec.js similarity index 100% rename from packages/external-db-mssql/lib/sql_filter_transformer.spec.js rename to libs/external-db-mssql/src/sql_filter_transformer.spec.js diff --git a/packages/external-db-mssql/lib/sql_schema_translator.js b/libs/external-db-mssql/src/sql_schema_translator.js similarity index 100% rename from packages/external-db-mssql/lib/sql_schema_translator.js rename to libs/external-db-mssql/src/sql_schema_translator.js diff --git a/packages/external-db-mssql/lib/sql_schema_translator.spec.js b/libs/external-db-mssql/src/sql_schema_translator.spec.js similarity index 100% rename from packages/external-db-mssql/lib/sql_schema_translator.spec.js rename to libs/external-db-mssql/src/sql_schema_translator.spec.js diff --git a/packages/external-db-mssql/lib/supported_operations.js b/libs/external-db-mssql/src/supported_operations.js similarity index 100% rename from packages/external-db-mssql/lib/supported_operations.js rename to libs/external-db-mssql/src/supported_operations.js diff --git a/packages/external-db-mssql/tests/drivers/db_operations_test_support.js b/libs/external-db-mssql/tests/drivers/db_operations_test_support.js similarity index 96% rename from packages/external-db-mssql/tests/drivers/db_operations_test_support.js rename to libs/external-db-mssql/tests/drivers/db_operations_test_support.js index 774b41322..0ef8361a1 100644 --- a/packages/external-db-mssql/tests/drivers/db_operations_test_support.js +++ b/libs/external-db-mssql/tests/drivers/db_operations_test_support.js @@ -1,5 +1,5 @@ const { ConnectionPool } = require('mssql') -const DatabaseOperations = require('../../lib/mssql_operations') +const DatabaseOperations = require('../../src/mssql_operations') const createPool = async modify => { const config = { diff --git a/packages/external-db-mssql/tests/drivers/sql_filter_transformer_test_support.js b/libs/external-db-mssql/tests/drivers/sql_filter_transformer_test_support.js similarity index 99% rename from packages/external-db-mssql/tests/drivers/sql_filter_transformer_test_support.js rename to libs/external-db-mssql/tests/drivers/sql_filter_transformer_test_support.js index 72e133b7c..9761ebe63 100644 --- a/packages/external-db-mssql/tests/drivers/sql_filter_transformer_test_support.js +++ b/libs/external-db-mssql/tests/drivers/sql_filter_transformer_test_support.js @@ -1,6 +1,6 @@ const { EmptySort } = require('@wix-velo/velo-external-db-commons') const { when } = require('jest-when') -const { escapeId, validateLiteral, patchFieldName } = require('../../lib/mssql_utils') +const { escapeId, validateLiteral, patchFieldName } = require('../../src/mssql_utils') const filterParser = { transform: jest.fn(), diff --git a/libs/external-db-mssql/tsconfig.json b/libs/external-db-mssql/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/external-db-mssql/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/external-db-mssql/tsconfig.lib.json b/libs/external-db-mssql/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/external-db-mssql/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/external-db-mssql/tsconfig.spec.json b/libs/external-db-mssql/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/external-db-mssql/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/external-db-mysql/.eslintrc.json b/libs/external-db-mysql/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/external-db-mysql/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/external-db-postgres/.gitignore b/libs/external-db-mysql/.gitignore similarity index 100% rename from packages/external-db-postgres/.gitignore rename to libs/external-db-mysql/.gitignore diff --git a/packages/external-db-postgres/.nvmrc b/libs/external-db-mysql/.nvmrc similarity index 100% rename from packages/external-db-postgres/.nvmrc rename to libs/external-db-mysql/.nvmrc diff --git a/packages/external-db-mysql/README.md b/libs/external-db-mysql/README.md similarity index 100% rename from packages/external-db-mysql/README.md rename to libs/external-db-mysql/README.md diff --git a/libs/external-db-mysql/jest.config.js b/libs/external-db-mysql/jest.config.js new file mode 100644 index 000000000..2bed46886 --- /dev/null +++ b/libs/external-db-mysql/jest.config.js @@ -0,0 +1,18 @@ +module.exports = { + displayName: 'external-db-mysql', + clearMocks: true, + verbose: true, + // roots: ['/src'], + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/external-db-mysql', + testEnvironment: 'node' +} \ No newline at end of file diff --git a/libs/external-db-mysql/package.json b/libs/external-db-mysql/package.json new file mode 100644 index 000000000..b93ec6be4 --- /dev/null +++ b/libs/external-db-mysql/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/external-db-mysql", + "version": "1.0.3", + "type": "commonjs" +} \ No newline at end of file diff --git a/libs/external-db-mysql/project.json b/libs/external-db-mysql/project.json new file mode 100644 index 000000000..0d65634f8 --- /dev/null +++ b/libs/external-db-mysql/project.json @@ -0,0 +1,48 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/external-db-mysql/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": [ "{options.outputPath}" ], + "options": { + "outputPath": "dist/libs/external-db-mysql", + "main": "libs/external-db-mysql/src/index.js", + "tsConfig": "libs/external-db-mysql/tsconfig.lib.json", + "assets": [ "libs/external-db-mysql/*.md" ], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/external-db-mysql {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": [ + "{options.outputFile}" + ], + "options": { + "lintFilePatterns": [ "libs/external-db-mysql/**/*.js" ] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": [ "coverage/libs/external-db-mysql" ], + "options": { + "jestConfig": "libs/external-db-mysql/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/packages/external-db-mysql/lib/config_validator.spec.js b/libs/external-db-mysql/src/config_validator.spec.js similarity index 100% rename from packages/external-db-mysql/lib/config_validator.spec.js rename to libs/external-db-mysql/src/config_validator.spec.js diff --git a/packages/external-db-mysql/lib/connection_provider.js b/libs/external-db-mysql/src/connection_provider.js similarity index 100% rename from packages/external-db-mysql/lib/connection_provider.js rename to libs/external-db-mysql/src/connection_provider.js diff --git a/packages/external-db-mysql/lib/index.js b/libs/external-db-mysql/src/index.js similarity index 100% rename from packages/external-db-mysql/lib/index.js rename to libs/external-db-mysql/src/index.js diff --git a/packages/external-db-mysql/lib/mysql_config_validator.js b/libs/external-db-mysql/src/mysql_config_validator.js similarity index 100% rename from packages/external-db-mysql/lib/mysql_config_validator.js rename to libs/external-db-mysql/src/mysql_config_validator.js diff --git a/packages/external-db-mysql/lib/mysql_data_provider.js b/libs/external-db-mysql/src/mysql_data_provider.js similarity index 100% rename from packages/external-db-mysql/lib/mysql_data_provider.js rename to libs/external-db-mysql/src/mysql_data_provider.js diff --git a/packages/external-db-mysql/lib/mysql_operations.js b/libs/external-db-mysql/src/mysql_operations.js similarity index 100% rename from packages/external-db-mysql/lib/mysql_operations.js rename to libs/external-db-mysql/src/mysql_operations.js diff --git a/packages/external-db-mysql/lib/mysql_schema_provider.js b/libs/external-db-mysql/src/mysql_schema_provider.js similarity index 100% rename from packages/external-db-mysql/lib/mysql_schema_provider.js rename to libs/external-db-mysql/src/mysql_schema_provider.js diff --git a/packages/external-db-mysql/lib/mysql_utils.js b/libs/external-db-mysql/src/mysql_utils.js similarity index 100% rename from packages/external-db-mysql/lib/mysql_utils.js rename to libs/external-db-mysql/src/mysql_utils.js diff --git a/packages/external-db-mysql/lib/mysql_utils.spec.js b/libs/external-db-mysql/src/mysql_utils.spec.js similarity index 100% rename from packages/external-db-mysql/lib/mysql_utils.spec.js rename to libs/external-db-mysql/src/mysql_utils.spec.js diff --git a/packages/external-db-mysql/lib/sql_exception_translator.js b/libs/external-db-mysql/src/sql_exception_translator.js similarity index 100% rename from packages/external-db-mysql/lib/sql_exception_translator.js rename to libs/external-db-mysql/src/sql_exception_translator.js diff --git a/packages/external-db-mysql/lib/sql_filter_transformer.js b/libs/external-db-mysql/src/sql_filter_transformer.js similarity index 100% rename from packages/external-db-mysql/lib/sql_filter_transformer.js rename to libs/external-db-mysql/src/sql_filter_transformer.js diff --git a/packages/external-db-mysql/lib/sql_filter_transformer.spec.js b/libs/external-db-mysql/src/sql_filter_transformer.spec.js similarity index 100% rename from packages/external-db-mysql/lib/sql_filter_transformer.spec.js rename to libs/external-db-mysql/src/sql_filter_transformer.spec.js diff --git a/packages/external-db-mysql/lib/sql_schema_translator.js b/libs/external-db-mysql/src/sql_schema_translator.js similarity index 100% rename from packages/external-db-mysql/lib/sql_schema_translator.js rename to libs/external-db-mysql/src/sql_schema_translator.js diff --git a/packages/external-db-mysql/lib/sql_schema_translator.spec.js b/libs/external-db-mysql/src/sql_schema_translator.spec.js similarity index 100% rename from packages/external-db-mysql/lib/sql_schema_translator.spec.js rename to libs/external-db-mysql/src/sql_schema_translator.spec.js diff --git a/packages/external-db-mysql/lib/supported_operations.js b/libs/external-db-mysql/src/supported_operations.js similarity index 100% rename from packages/external-db-mysql/lib/supported_operations.js rename to libs/external-db-mysql/src/supported_operations.js diff --git a/packages/external-db-mysql/tests/drivers/db_operations_test_support.js b/libs/external-db-mysql/tests/drivers/db_operations_test_support.js similarity index 92% rename from packages/external-db-mysql/tests/drivers/db_operations_test_support.js rename to libs/external-db-mysql/tests/drivers/db_operations_test_support.js index cb689037c..7daca4928 100644 --- a/packages/external-db-mysql/tests/drivers/db_operations_test_support.js +++ b/libs/external-db-mysql/tests/drivers/db_operations_test_support.js @@ -1,5 +1,5 @@ -const DatabaseOperations = require('../../lib/mysql_operations') -const init = require('../../lib/connection_provider') +const DatabaseOperations = require('../../src/mysql_operations') +const init = require('../../src/connection_provider') const createPool = modify => { const config = { diff --git a/packages/external-db-mysql/tests/drivers/sql_filter_transformer_test_support.js b/libs/external-db-mysql/tests/drivers/sql_filter_transformer_test_support.js similarity index 98% rename from packages/external-db-mysql/tests/drivers/sql_filter_transformer_test_support.js rename to libs/external-db-mysql/tests/drivers/sql_filter_transformer_test_support.js index 023a09f4f..6e65b3fe9 100644 --- a/packages/external-db-mysql/tests/drivers/sql_filter_transformer_test_support.js +++ b/libs/external-db-mysql/tests/drivers/sql_filter_transformer_test_support.js @@ -1,6 +1,6 @@ const { EmptySort } = require('@wix-velo/velo-external-db-commons') const { when } = require('jest-when') -const { escapeId } = require('../../lib/mysql_utils') +const { escapeId } = require('../../src/mysql_utils') const filterParser = { transform: jest.fn(), diff --git a/packages/external-db-mysql/tests/gen.js b/libs/external-db-mysql/tests/gen.js similarity index 100% rename from packages/external-db-mysql/tests/gen.js rename to libs/external-db-mysql/tests/gen.js diff --git a/libs/external-db-mysql/tsconfig.json b/libs/external-db-mysql/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/external-db-mysql/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/external-db-mysql/tsconfig.lib.json b/libs/external-db-mysql/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/external-db-mysql/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/external-db-mysql/tsconfig.spec.json b/libs/external-db-mysql/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/external-db-mysql/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/external-db-postgres/.eslintrc.json b/libs/external-db-postgres/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/external-db-postgres/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/external-db-spanner/.gitignore b/libs/external-db-postgres/.gitignore similarity index 100% rename from packages/external-db-spanner/.gitignore rename to libs/external-db-postgres/.gitignore diff --git a/packages/external-db-spanner/.nvmrc b/libs/external-db-postgres/.nvmrc similarity index 100% rename from packages/external-db-spanner/.nvmrc rename to libs/external-db-postgres/.nvmrc diff --git a/packages/external-db-postgres/README.md b/libs/external-db-postgres/README.md similarity index 100% rename from packages/external-db-postgres/README.md rename to libs/external-db-postgres/README.md diff --git a/libs/external-db-postgres/jest.config.js b/libs/external-db-postgres/jest.config.js new file mode 100644 index 000000000..b73e121a1 --- /dev/null +++ b/libs/external-db-postgres/jest.config.js @@ -0,0 +1,19 @@ +module.exports = { + displayName: 'external-db-postgres', + clearMocks: true, + verbose: true, + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/external-db-postgres', + testEnvironment: 'node' + // roots: ['/src'], + // testRegex: '(.*\\.spec\\.)js$', +} \ No newline at end of file diff --git a/libs/external-db-postgres/package.json b/libs/external-db-postgres/package.json new file mode 100644 index 000000000..dd0d51c16 --- /dev/null +++ b/libs/external-db-postgres/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/external-db-postgres", + "version": "1.0.3", + "type": "commonjs" +} \ No newline at end of file diff --git a/libs/external-db-postgres/project.json b/libs/external-db-postgres/project.json new file mode 100644 index 000000000..967803bbd --- /dev/null +++ b/libs/external-db-postgres/project.json @@ -0,0 +1,48 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/external-db-postgres/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": [ "{options.outputPath}" ], + "options": { + "outputPath": "dist/libs/external-db-postgres", + "main": "libs/external-db-postgres/src/index.js", + "tsConfig": "libs/external-db-postgres/tsconfig.lib.json", + "assets": [ "libs/external-db-postgres/*.md" ], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/external-db-postgres {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": [ + "{options.outputFile}" + ], + "options": { + "lintFilePatterns": [ "libs/external-db-postgres/**/*.js" ] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": [ "coverage/libs/external-db-postgres" ], + "options": { + "jestConfig": "libs/external-db-postgres/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/packages/external-db-postgres/lib/config_validator.spec.js b/libs/external-db-postgres/src/config_validator.spec.js similarity index 100% rename from packages/external-db-postgres/lib/config_validator.spec.js rename to libs/external-db-postgres/src/config_validator.spec.js diff --git a/packages/external-db-postgres/lib/connection_provider.js b/libs/external-db-postgres/src/connection_provider.js similarity index 97% rename from packages/external-db-postgres/lib/connection_provider.js rename to libs/external-db-postgres/src/connection_provider.js index cb9382c22..6bc224e32 100644 --- a/packages/external-db-postgres/lib/connection_provider.js +++ b/libs/external-db-postgres/src/connection_provider.js @@ -1,4 +1,4 @@ -const { Pool, types } = require('pg') +import { Pool, types } from 'pg' const { builtins } = require('pg-types') const SchemaProvider = require('./postgres_schema_provider') const DataProvider = require('./postgres_data_provider') diff --git a/packages/external-db-postgres/lib/index.js b/libs/external-db-postgres/src/index.js similarity index 100% rename from packages/external-db-postgres/lib/index.js rename to libs/external-db-postgres/src/index.js diff --git a/packages/external-db-postgres/lib/postgres_config_validator.js b/libs/external-db-postgres/src/postgres_config_validator.js similarity index 100% rename from packages/external-db-postgres/lib/postgres_config_validator.js rename to libs/external-db-postgres/src/postgres_config_validator.js diff --git a/packages/external-db-postgres/lib/postgres_data_provider.js b/libs/external-db-postgres/src/postgres_data_provider.js similarity index 100% rename from packages/external-db-postgres/lib/postgres_data_provider.js rename to libs/external-db-postgres/src/postgres_data_provider.js diff --git a/packages/external-db-postgres/lib/postgres_operations.js b/libs/external-db-postgres/src/postgres_operations.js similarity index 100% rename from packages/external-db-postgres/lib/postgres_operations.js rename to libs/external-db-postgres/src/postgres_operations.js diff --git a/packages/external-db-postgres/lib/postgres_schema_provider.js b/libs/external-db-postgres/src/postgres_schema_provider.js similarity index 100% rename from packages/external-db-postgres/lib/postgres_schema_provider.js rename to libs/external-db-postgres/src/postgres_schema_provider.js diff --git a/packages/external-db-postgres/lib/postgres_utils.js b/libs/external-db-postgres/src/postgres_utils.js similarity index 100% rename from packages/external-db-postgres/lib/postgres_utils.js rename to libs/external-db-postgres/src/postgres_utils.js diff --git a/packages/external-db-postgres/lib/sql_exception_translator.js b/libs/external-db-postgres/src/sql_exception_translator.js similarity index 100% rename from packages/external-db-postgres/lib/sql_exception_translator.js rename to libs/external-db-postgres/src/sql_exception_translator.js diff --git a/packages/external-db-postgres/lib/sql_filter_transformer.js b/libs/external-db-postgres/src/sql_filter_transformer.js similarity index 100% rename from packages/external-db-postgres/lib/sql_filter_transformer.js rename to libs/external-db-postgres/src/sql_filter_transformer.js diff --git a/packages/external-db-postgres/lib/sql_filter_transformer.spec.js b/libs/external-db-postgres/src/sql_filter_transformer.spec.js similarity index 100% rename from packages/external-db-postgres/lib/sql_filter_transformer.spec.js rename to libs/external-db-postgres/src/sql_filter_transformer.spec.js diff --git a/packages/external-db-postgres/lib/sql_schema_translator.js b/libs/external-db-postgres/src/sql_schema_translator.js similarity index 100% rename from packages/external-db-postgres/lib/sql_schema_translator.js rename to libs/external-db-postgres/src/sql_schema_translator.js diff --git a/packages/external-db-postgres/lib/sql_schema_translator.spec.js b/libs/external-db-postgres/src/sql_schema_translator.spec.js similarity index 100% rename from packages/external-db-postgres/lib/sql_schema_translator.spec.js rename to libs/external-db-postgres/src/sql_schema_translator.spec.js diff --git a/packages/external-db-postgres/lib/supported_operations.js b/libs/external-db-postgres/src/supported_operations.js similarity index 100% rename from packages/external-db-postgres/lib/supported_operations.js rename to libs/external-db-postgres/src/supported_operations.js diff --git a/packages/external-db-postgres/tests/drivers/db_operations_test_support.js b/libs/external-db-postgres/tests/drivers/db_operations_test_support.js similarity index 92% rename from packages/external-db-postgres/tests/drivers/db_operations_test_support.js rename to libs/external-db-postgres/tests/drivers/db_operations_test_support.js index a306d519e..a082eb8f4 100644 --- a/packages/external-db-postgres/tests/drivers/db_operations_test_support.js +++ b/libs/external-db-postgres/tests/drivers/db_operations_test_support.js @@ -1,5 +1,5 @@ -const DatabaseOperations = require('../../lib/postgres_operations') -const init = require('../../lib/connection_provider') +const DatabaseOperations = require('../../src/postgres_operations') +const init = require('../../src/connection_provider') const createPool = modify => { const config = { diff --git a/packages/external-db-postgres/tests/drivers/sql_filter_transformer_test_support.js b/libs/external-db-postgres/tests/drivers/sql_filter_transformer_test_support.js similarity index 98% rename from packages/external-db-postgres/tests/drivers/sql_filter_transformer_test_support.js rename to libs/external-db-postgres/tests/drivers/sql_filter_transformer_test_support.js index 68ab050c5..5e93a3fe4 100644 --- a/packages/external-db-postgres/tests/drivers/sql_filter_transformer_test_support.js +++ b/libs/external-db-postgres/tests/drivers/sql_filter_transformer_test_support.js @@ -1,6 +1,6 @@ const { EmptySort } = require('@wix-velo/velo-external-db-commons') const { when } = require('jest-when') -const { escapeIdentifier } = require('../../lib/postgres_utils') +const { escapeIdentifier } = require('../../src/postgres_utils') const filterParser = { transform: jest.fn(), diff --git a/packages/external-db-postgres/tests/gen.js b/libs/external-db-postgres/tests/gen.js similarity index 100% rename from packages/external-db-postgres/tests/gen.js rename to libs/external-db-postgres/tests/gen.js diff --git a/libs/external-db-postgres/tsconfig.json b/libs/external-db-postgres/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/external-db-postgres/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/external-db-postgres/tsconfig.lib.json b/libs/external-db-postgres/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/external-db-postgres/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/external-db-postgres/tsconfig.spec.json b/libs/external-db-postgres/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/external-db-postgres/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/external-db-security/.eslintrc.json b/libs/external-db-security/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/external-db-security/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/external-db-security/.gitignore b/libs/external-db-security/.gitignore similarity index 100% rename from packages/external-db-security/.gitignore rename to libs/external-db-security/.gitignore diff --git a/packages/external-db-security/README.md b/libs/external-db-security/README.md similarity index 100% rename from packages/external-db-security/README.md rename to libs/external-db-security/README.md diff --git a/libs/external-db-security/jest.config.js b/libs/external-db-security/jest.config.js new file mode 100644 index 000000000..d86cf7972 --- /dev/null +++ b/libs/external-db-security/jest.config.js @@ -0,0 +1,21 @@ +module.exports = { + displayName: 'external-db-security', + clearMocks: true, + verbose: true, + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/external-db-security', + // testRegex: '(.*\\.spec\\.)js$', + // roots: ['/src'], + // testRegex: '(.*\\.spec\\.)js$', + // testEnvironment: 'node', +} + \ No newline at end of file diff --git a/libs/external-db-security/package.json b/libs/external-db-security/package.json new file mode 100644 index 000000000..8008bb9ae --- /dev/null +++ b/libs/external-db-security/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/external-db-security", + "version": "1.0.3", + "type": "commonjs" +} diff --git a/libs/external-db-security/project.json b/libs/external-db-security/project.json new file mode 100644 index 000000000..19b948803 --- /dev/null +++ b/libs/external-db-security/project.json @@ -0,0 +1,46 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/external-db-security/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/libs/external-db-security", + "main": "libs/external-db-security/src/index.js", + "tsConfig": "libs/external-db-security/tsconfig.lib.json", + "assets": ["libs/external-db-security/*.md"], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/external-db-security {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["libs/external-db-security/**/*.js"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/libs/external-db-security"], + "options": { + "jestConfig": "libs/external-db-security/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/packages/external-db-security/lib/auth-providers/aws_auth_provider.js b/libs/external-db-security/src/auth-providers/aws_auth_provider.js similarity index 100% rename from packages/external-db-security/lib/auth-providers/aws_auth_provider.js rename to libs/external-db-security/src/auth-providers/aws_auth_provider.js diff --git a/packages/external-db-security/lib/auth-providers/azure_auth_provider.js b/libs/external-db-security/src/auth-providers/azure_auth_provider.js similarity index 100% rename from packages/external-db-security/lib/auth-providers/azure_auth_provider.js rename to libs/external-db-security/src/auth-providers/azure_auth_provider.js diff --git a/packages/external-db-security/lib/auth-providers/gcp_auth_provider.js b/libs/external-db-security/src/auth-providers/gcp_auth_provider.js similarity index 100% rename from packages/external-db-security/lib/auth-providers/gcp_auth_provider.js rename to libs/external-db-security/src/auth-providers/gcp_auth_provider.js diff --git a/packages/external-db-security/lib/auth-providers/stub_auth_provider.js b/libs/external-db-security/src/auth-providers/stub_auth_provider.js similarity index 100% rename from packages/external-db-security/lib/auth-providers/stub_auth_provider.js rename to libs/external-db-security/src/auth-providers/stub_auth_provider.js diff --git a/packages/external-db-security/lib/factory.js b/libs/external-db-security/src/factory.js similarity index 100% rename from packages/external-db-security/lib/factory.js rename to libs/external-db-security/src/factory.js diff --git a/packages/external-db-security/lib/index.js b/libs/external-db-security/src/index.js similarity index 100% rename from packages/external-db-security/lib/index.js rename to libs/external-db-security/src/index.js diff --git a/packages/external-db-security/lib/services/role_authorization.js b/libs/external-db-security/src/services/role_authorization.js similarity index 93% rename from packages/external-db-security/lib/services/role_authorization.js rename to libs/external-db-security/src/services/role_authorization.js index 132c2c0eb..e98bf4e99 100644 --- a/packages/external-db-security/lib/services/role_authorization.js +++ b/libs/external-db-security/src/services/role_authorization.js @@ -1,4 +1,5 @@ -const { UnauthorizedError } = require('@wix-velo/velo-external-db-commons/lib/errors') +const { errors } = require('@wix-velo/velo-external-db-commons') +const { UnauthorizedError } = errors const DefaultPolicies = ['Admin'] class RoleAuthorizationService { diff --git a/packages/external-db-security/lib/services/role_authorization.spec.js b/libs/external-db-security/src/services/role_authorization.spec.js similarity index 97% rename from packages/external-db-security/lib/services/role_authorization.spec.js rename to libs/external-db-security/src/services/role_authorization.spec.js index 31e3cd2d9..d4c2bb44a 100644 --- a/packages/external-db-security/lib/services/role_authorization.spec.js +++ b/libs/external-db-security/src/services/role_authorization.spec.js @@ -1,8 +1,9 @@ -const RoleAuthorizationService = require('./role_authorization') +const each = require('jest-each').default const { Uninitialized } = require('@wix-velo/test-commons') +const { errors } = require('@wix-velo/velo-external-db-commons') +const RoleAuthorizationService = require('./role_authorization') const gen = require ('../test/gen') -const { UnauthorizedError } = require('@wix-velo/velo-external-db-commons/lib/errors') -const each = require('jest-each').default +const { UnauthorizedError } = errors describe('Authorization Service', () => { describe('Authorize read', () => { diff --git a/packages/external-db-security/lib/test/gen.js b/libs/external-db-security/src/test/gen.js similarity index 100% rename from packages/external-db-security/lib/test/gen.js rename to libs/external-db-security/src/test/gen.js diff --git a/libs/external-db-security/tsconfig.json b/libs/external-db-security/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/external-db-security/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/external-db-security/tsconfig.lib.json b/libs/external-db-security/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/external-db-security/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/external-db-security/tsconfig.spec.json b/libs/external-db-security/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/external-db-security/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/external-db-spanner/.eslintrc.json b/libs/external-db-spanner/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/external-db-spanner/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/velo-external-db-core/.gitignore b/libs/external-db-spanner/.gitignore similarity index 100% rename from packages/velo-external-db-core/.gitignore rename to libs/external-db-spanner/.gitignore diff --git a/packages/velo-external-db-core/.nvmrc b/libs/external-db-spanner/.nvmrc similarity index 100% rename from packages/velo-external-db-core/.nvmrc rename to libs/external-db-spanner/.nvmrc diff --git a/packages/external-db-spanner/README.md b/libs/external-db-spanner/README.md similarity index 100% rename from packages/external-db-spanner/README.md rename to libs/external-db-spanner/README.md diff --git a/libs/external-db-spanner/jest.config.js b/libs/external-db-spanner/jest.config.js new file mode 100644 index 000000000..eff635333 --- /dev/null +++ b/libs/external-db-spanner/jest.config.js @@ -0,0 +1,19 @@ +module.exports = { + displayName: 'external-db-spanner', + clearMocks: true, + verbose: true, + // roots: ['/src'], + // testRegex: '(.*\\.spec\\.)js$', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/external-db-mssql', + testEnvironment: 'node' +} \ No newline at end of file diff --git a/libs/external-db-spanner/package.json b/libs/external-db-spanner/package.json new file mode 100644 index 000000000..84a0fbc82 --- /dev/null +++ b/libs/external-db-spanner/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/external-db-sapnner", + "version": "1.0.3", + "type": "commonjs" +} \ No newline at end of file diff --git a/libs/external-db-spanner/project.json b/libs/external-db-spanner/project.json new file mode 100644 index 000000000..aae431564 --- /dev/null +++ b/libs/external-db-spanner/project.json @@ -0,0 +1,48 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/external-db-spanner/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": [ "{options.outputPath}" ], + "options": { + "outputPath": "dist/libs/external-db-spanner", + "main": "libs/external-db-spanner/src/index.js", + "tsConfig": "libs/external-db-spanner/tsconfig.lib.json", + "assets": [ "libs/external-db-spanner/*.md" ], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/external-db-spanner {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": [ + "{options.outputFile}" + ], + "options": { + "lintFilePatterns": [ "libs/external-db-spanner/**/*.js" ] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": [ "coverage/libs/external-db-spanner" ], + "options": { + "jestConfig": "libs/external-db-spanner/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/packages/external-db-spanner/lib/connection_provider.js b/libs/external-db-spanner/src/connection_provider.js similarity index 100% rename from packages/external-db-spanner/lib/connection_provider.js rename to libs/external-db-spanner/src/connection_provider.js diff --git a/packages/external-db-spanner/lib/escaping.spec.js b/libs/external-db-spanner/src/escaping.spec.js similarity index 100% rename from packages/external-db-spanner/lib/escaping.spec.js rename to libs/external-db-spanner/src/escaping.spec.js diff --git a/packages/external-db-spanner/lib/index.js b/libs/external-db-spanner/src/index.js similarity index 100% rename from packages/external-db-spanner/lib/index.js rename to libs/external-db-spanner/src/index.js diff --git a/packages/external-db-spanner/lib/spanner_config_validator.js b/libs/external-db-spanner/src/spanner_config_validator.js similarity index 100% rename from packages/external-db-spanner/lib/spanner_config_validator.js rename to libs/external-db-spanner/src/spanner_config_validator.js diff --git a/packages/external-db-spanner/lib/spanner_data_provider.js b/libs/external-db-spanner/src/spanner_data_provider.js similarity index 100% rename from packages/external-db-spanner/lib/spanner_data_provider.js rename to libs/external-db-spanner/src/spanner_data_provider.js diff --git a/packages/external-db-spanner/lib/spanner_operations.js b/libs/external-db-spanner/src/spanner_operations.js similarity index 100% rename from packages/external-db-spanner/lib/spanner_operations.js rename to libs/external-db-spanner/src/spanner_operations.js diff --git a/packages/external-db-spanner/lib/spanner_schema_provider.js b/libs/external-db-spanner/src/spanner_schema_provider.js similarity index 100% rename from packages/external-db-spanner/lib/spanner_schema_provider.js rename to libs/external-db-spanner/src/spanner_schema_provider.js diff --git a/packages/external-db-spanner/lib/spanner_utils.js b/libs/external-db-spanner/src/spanner_utils.js similarity index 100% rename from packages/external-db-spanner/lib/spanner_utils.js rename to libs/external-db-spanner/src/spanner_utils.js diff --git a/packages/external-db-spanner/lib/spanner_utils.spec.js b/libs/external-db-spanner/src/spanner_utils.spec.js similarity index 100% rename from packages/external-db-spanner/lib/spanner_utils.spec.js rename to libs/external-db-spanner/src/spanner_utils.spec.js diff --git a/packages/external-db-spanner/lib/sql_exception_translator.js b/libs/external-db-spanner/src/sql_exception_translator.js similarity index 100% rename from packages/external-db-spanner/lib/sql_exception_translator.js rename to libs/external-db-spanner/src/sql_exception_translator.js diff --git a/packages/external-db-spanner/lib/sql_filter_transformer.js b/libs/external-db-spanner/src/sql_filter_transformer.js similarity index 100% rename from packages/external-db-spanner/lib/sql_filter_transformer.js rename to libs/external-db-spanner/src/sql_filter_transformer.js diff --git a/packages/external-db-spanner/lib/sql_filter_transformer.spec.js b/libs/external-db-spanner/src/sql_filter_transformer.spec.js similarity index 100% rename from packages/external-db-spanner/lib/sql_filter_transformer.spec.js rename to libs/external-db-spanner/src/sql_filter_transformer.spec.js diff --git a/packages/external-db-spanner/lib/sql_schema_translator.js b/libs/external-db-spanner/src/sql_schema_translator.js similarity index 100% rename from packages/external-db-spanner/lib/sql_schema_translator.js rename to libs/external-db-spanner/src/sql_schema_translator.js diff --git a/packages/external-db-spanner/lib/sql_schema_translator.spec.js b/libs/external-db-spanner/src/sql_schema_translator.spec.js similarity index 100% rename from packages/external-db-spanner/lib/sql_schema_translator.spec.js rename to libs/external-db-spanner/src/sql_schema_translator.spec.js diff --git a/packages/external-db-spanner/lib/supported_operations.js b/libs/external-db-spanner/src/supported_operations.js similarity index 100% rename from packages/external-db-spanner/lib/supported_operations.js rename to libs/external-db-spanner/src/supported_operations.js diff --git a/packages/external-db-spanner/tests/drivers/db_operations_test_support.js b/libs/external-db-spanner/tests/drivers/db_operations_test_support.js similarity index 95% rename from packages/external-db-spanner/tests/drivers/db_operations_test_support.js rename to libs/external-db-spanner/tests/drivers/db_operations_test_support.js index 70f9e254d..3d39c50dd 100644 --- a/packages/external-db-spanner/tests/drivers/db_operations_test_support.js +++ b/libs/external-db-spanner/tests/drivers/db_operations_test_support.js @@ -1,4 +1,4 @@ -const init = require('../../lib/connection_provider') +const init = require('../../src/connection_provider') const createPool = modify => { const config = { diff --git a/packages/external-db-spanner/tests/drivers/sql_filter_transformer_test_support.js b/libs/external-db-spanner/tests/drivers/sql_filter_transformer_test_support.js similarity index 99% rename from packages/external-db-spanner/tests/drivers/sql_filter_transformer_test_support.js rename to libs/external-db-spanner/tests/drivers/sql_filter_transformer_test_support.js index 5e77a2679..492343d27 100644 --- a/packages/external-db-spanner/tests/drivers/sql_filter_transformer_test_support.js +++ b/libs/external-db-spanner/tests/drivers/sql_filter_transformer_test_support.js @@ -1,6 +1,6 @@ const { EmptySort } = require('@wix-velo/velo-external-db-commons') const { when } = require('jest-when') -const { escapeId, escapeFieldId, validateLiteral } = require('../../lib/spanner_utils') +const { escapeId, escapeFieldId, validateLiteral } = require('../../src/spanner_utils') const filterParser = { transform: jest.fn(), diff --git a/libs/external-db-spanner/tsconfig.json b/libs/external-db-spanner/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/external-db-spanner/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/external-db-spanner/tsconfig.lib.json b/libs/external-db-spanner/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/external-db-spanner/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/external-db-spanner/tsconfig.spec.json b/libs/external-db-spanner/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/external-db-spanner/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/test-commons/.eslintrc.json b/libs/test-commons/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/test-commons/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/test-commons/README.md b/libs/test-commons/README.md similarity index 100% rename from packages/test-commons/README.md rename to libs/test-commons/README.md diff --git a/libs/test-commons/jest.config.js b/libs/test-commons/jest.config.js new file mode 100644 index 000000000..8efc41bbd --- /dev/null +++ b/libs/test-commons/jest.config.js @@ -0,0 +1,15 @@ +/* eslint-disable */ +module.exports = { + displayName: 'test-commons', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/test-commons', +}; diff --git a/libs/test-commons/package.json b/libs/test-commons/package.json new file mode 100644 index 000000000..2a0006268 --- /dev/null +++ b/libs/test-commons/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/test-commons", + "version": "1.0.3", + "type": "commonjs" +} diff --git a/libs/test-commons/project.json b/libs/test-commons/project.json new file mode 100644 index 000000000..c95e14460 --- /dev/null +++ b/libs/test-commons/project.json @@ -0,0 +1,46 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/test-commons/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/libs/test-commons", + "main": "libs/test-commons/src/index.js", + "tsConfig": "libs/test-commons/tsconfig.lib.json", + "assets": ["libs/test-commons/*.md"], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/test-commons {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["libs/test-commons/**/*.js"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/libs/test-commons"], + "options": { + "jestConfig": "libs/test-commons/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/libs/test-commons/src/index.js b/libs/test-commons/src/index.js new file mode 100644 index 000000000..269ff2f60 --- /dev/null +++ b/libs/test-commons/src/index.js @@ -0,0 +1,4 @@ +const testCommons = require('./libs/test-commons') +const gen = require('./libs/gen') + +module.exports = { ...testCommons, gen } \ No newline at end of file diff --git a/packages/test-commons/lib/gen.js b/libs/test-commons/src/libs/gen.js similarity index 100% rename from packages/test-commons/lib/gen.js rename to libs/test-commons/src/libs/gen.js diff --git a/packages/test-commons/lib/test-commons.js b/libs/test-commons/src/libs/test-commons.js similarity index 100% rename from packages/test-commons/lib/test-commons.js rename to libs/test-commons/src/libs/test-commons.js diff --git a/libs/test-commons/tsconfig.json b/libs/test-commons/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/test-commons/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/test-commons/tsconfig.lib.json b/libs/test-commons/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/test-commons/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/test-commons/tsconfig.spec.json b/libs/test-commons/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/test-commons/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/velo-external-db-commons/.eslintrc.json b/libs/velo-external-db-commons/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/velo-external-db-commons/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/velo-external-db-commons/README.md b/libs/velo-external-db-commons/README.md similarity index 100% rename from packages/velo-external-db-commons/README.md rename to libs/velo-external-db-commons/README.md diff --git a/libs/velo-external-db-commons/jest.config.js b/libs/velo-external-db-commons/jest.config.js new file mode 100644 index 000000000..d11e4a34b --- /dev/null +++ b/libs/velo-external-db-commons/jest.config.js @@ -0,0 +1,15 @@ +/* eslint-disable */ +module.exports = { + displayName: 'velo-external-db-commons', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/velo-external-db-commons', +}; diff --git a/libs/velo-external-db-commons/package.json b/libs/velo-external-db-commons/package.json new file mode 100644 index 000000000..0b7c6b65a --- /dev/null +++ b/libs/velo-external-db-commons/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/velo-external-db-commons", + "version": "1.0.3", + "type": "commonjs" +} diff --git a/libs/velo-external-db-commons/project.json b/libs/velo-external-db-commons/project.json new file mode 100644 index 000000000..9dc812859 --- /dev/null +++ b/libs/velo-external-db-commons/project.json @@ -0,0 +1,46 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/velo-external-db-commons/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/libs/velo-external-db-commons", + "main": "libs/velo-external-db-commons/src/index.js", + "tsConfig": "libs/velo-external-db-commons/tsconfig.lib.json", + "assets": ["libs/velo-external-db-commons/*.md"], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/velo-external-db-commons {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["libs/velo-external-db-commons/**/*.js"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/libs/velo-external-db-commons"], + "options": { + "jestConfig": "libs/velo-external-db-commons/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/libs/velo-external-db-commons/src/index.js b/libs/velo-external-db-commons/src/index.js new file mode 100644 index 000000000..f9b158db7 --- /dev/null +++ b/libs/velo-external-db-commons/src/index.js @@ -0,0 +1,13 @@ +const errors = require('./libs/errors') +const schemaCommons = require('./libs/schema_commons') +const dataCommons = require('./libs/data_commons') +const configCommons = require ('./libs/config_commons') +const DbConnector = require ('./libs/db_connector') + +module.exports = { + errors, + ...schemaCommons, + ...dataCommons, + ...configCommons, + DbConnector +} \ No newline at end of file diff --git a/packages/velo-external-db-commons/lib/config_commons.js b/libs/velo-external-db-commons/src/libs/config_commons.js similarity index 100% rename from packages/velo-external-db-commons/lib/config_commons.js rename to libs/velo-external-db-commons/src/libs/config_commons.js diff --git a/packages/velo-external-db-commons/lib/data_commons.js b/libs/velo-external-db-commons/src/libs/data_commons.js similarity index 100% rename from packages/velo-external-db-commons/lib/data_commons.js rename to libs/velo-external-db-commons/src/libs/data_commons.js diff --git a/packages/velo-external-db-commons/lib/db_connector.js b/libs/velo-external-db-commons/src/libs/db_connector.js similarity index 100% rename from packages/velo-external-db-commons/lib/db_connector.js rename to libs/velo-external-db-commons/src/libs/db_connector.js diff --git a/packages/velo-external-db-commons/lib/errors.js b/libs/velo-external-db-commons/src/libs/errors.js similarity index 100% rename from packages/velo-external-db-commons/lib/errors.js rename to libs/velo-external-db-commons/src/libs/errors.js diff --git a/packages/velo-external-db-commons/lib/schema_commons.js b/libs/velo-external-db-commons/src/libs/schema_commons.js similarity index 100% rename from packages/velo-external-db-commons/lib/schema_commons.js rename to libs/velo-external-db-commons/src/libs/schema_commons.js diff --git a/libs/velo-external-db-commons/tsconfig.json b/libs/velo-external-db-commons/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/velo-external-db-commons/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/velo-external-db-commons/tsconfig.lib.json b/libs/velo-external-db-commons/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/velo-external-db-commons/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/velo-external-db-commons/tsconfig.spec.json b/libs/velo-external-db-commons/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/velo-external-db-commons/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/velo-external-db-core/.eslintrc.json b/libs/velo-external-db-core/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/libs/velo-external-db-core/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/velo-external-db/.gitignore b/libs/velo-external-db-core/.gitignore similarity index 100% rename from packages/velo-external-db/.gitignore rename to libs/velo-external-db-core/.gitignore diff --git a/packages/velo-external-db/.nvmrc b/libs/velo-external-db-core/.nvmrc similarity index 100% rename from packages/velo-external-db/.nvmrc rename to libs/velo-external-db-core/.nvmrc diff --git a/packages/velo-external-db-core/README.md b/libs/velo-external-db-core/README.md similarity index 100% rename from packages/velo-external-db-core/README.md rename to libs/velo-external-db-core/README.md diff --git a/libs/velo-external-db-core/jest.config.js b/libs/velo-external-db-core/jest.config.js new file mode 100644 index 000000000..2235a737f --- /dev/null +++ b/libs/velo-external-db-core/jest.config.js @@ -0,0 +1,19 @@ +module.exports = { + displayName: 'velo-external-db-core', + clearMocks: true, + verbose: true, + roots: ['/src'], + testEnvironment: 'node', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]s$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/velo-external-db-core', + setupFilesAfterEnv: ['jest-extended/all'], +} \ No newline at end of file diff --git a/libs/velo-external-db-core/package.json b/libs/velo-external-db-core/package.json new file mode 100644 index 000000000..2d89f8db9 --- /dev/null +++ b/libs/velo-external-db-core/package.json @@ -0,0 +1,5 @@ +{ + "name": "@wix-velo/velo-external-db-core", + "version": "1.0.3", + "type": "commonjs" +} diff --git a/libs/velo-external-db-core/project.json b/libs/velo-external-db-core/project.json new file mode 100644 index 000000000..1f4a25e52 --- /dev/null +++ b/libs/velo-external-db-core/project.json @@ -0,0 +1,46 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/velo-external-db-core/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/libs/velo-external-db-core", + "main": "libs/velo-external-db-core/src/index.js", + "tsConfig": "libs/velo-external-db-core/tsconfig.lib.json", + "assets": ["libs/velo-external-db-core/*.md", "libs/velo-external-db-core/src/assets/**/*", "libs/velo-external-db-core/src/views/**/*", "libs/velo-external-db-core/src/*.json"], + "buildableProjectDepsInPackageJsonType": "dependencies" + } + }, + "publish": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs @wix-velo/velo-external-db-core {args.ver} {args.tag}" + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["libs/velo-external-db-core/**/*.js"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/libs/velo-external-db-core"], + "options": { + "jestConfig": "libs/velo-external-db-core/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/packages/velo-external-db-core/lib/assets/cloud_bg.svg b/libs/velo-external-db-core/src/assets/cloud_bg.svg similarity index 100% rename from packages/velo-external-db-core/lib/assets/cloud_bg.svg rename to libs/velo-external-db-core/src/assets/cloud_bg.svg diff --git a/packages/velo-external-db-core/lib/assets/cloudy-bg.svg b/libs/velo-external-db-core/src/assets/cloudy-bg.svg similarity index 100% rename from packages/velo-external-db-core/lib/assets/cloudy-bg.svg rename to libs/velo-external-db-core/src/assets/cloudy-bg.svg diff --git a/packages/velo-external-db-core/lib/assets/dark_bg.svg b/libs/velo-external-db-core/src/assets/dark_bg.svg similarity index 100% rename from packages/velo-external-db-core/lib/assets/dark_bg.svg rename to libs/velo-external-db-core/src/assets/dark_bg.svg diff --git a/packages/velo-external-db-core/lib/assets/lightbulb_icon.svg b/libs/velo-external-db-core/src/assets/lightbulb_icon.svg similarity index 100% rename from packages/velo-external-db-core/lib/assets/lightbulb_icon.svg rename to libs/velo-external-db-core/src/assets/lightbulb_icon.svg diff --git a/packages/velo-external-db-core/lib/assets/sad-unicorn.svg b/libs/velo-external-db-core/src/assets/sad-unicorn.svg similarity index 100% rename from packages/velo-external-db-core/lib/assets/sad-unicorn.svg rename to libs/velo-external-db-core/src/assets/sad-unicorn.svg diff --git a/packages/velo-external-db-core/lib/assets/sad-wix.svg b/libs/velo-external-db-core/src/assets/sad-wix.svg similarity index 100% rename from packages/velo-external-db-core/lib/assets/sad-wix.svg rename to libs/velo-external-db-core/src/assets/sad-wix.svg diff --git a/packages/velo-external-db-core/lib/assets/stylesheets/style.css b/libs/velo-external-db-core/src/assets/stylesheets/style.css similarity index 100% rename from packages/velo-external-db-core/lib/assets/stylesheets/style.css rename to libs/velo-external-db-core/src/assets/stylesheets/style.css diff --git a/packages/velo-external-db-core/lib/assets/wix-logo.svg b/libs/velo-external-db-core/src/assets/wix-logo.svg similarity index 100% rename from packages/velo-external-db-core/lib/assets/wix-logo.svg rename to libs/velo-external-db-core/src/assets/wix-logo.svg diff --git a/packages/velo-external-db-core/lib/converters/aggregation_transformer.js b/libs/velo-external-db-core/src/converters/aggregation_transformer.js similarity index 100% rename from packages/velo-external-db-core/lib/converters/aggregation_transformer.js rename to libs/velo-external-db-core/src/converters/aggregation_transformer.js diff --git a/packages/velo-external-db-core/lib/converters/aggregation_transformer.spec.js b/libs/velo-external-db-core/src/converters/aggregation_transformer.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/converters/aggregation_transformer.spec.js rename to libs/velo-external-db-core/src/converters/aggregation_transformer.spec.js diff --git a/packages/velo-external-db-core/lib/converters/data_utils.js b/libs/velo-external-db-core/src/converters/data_utils.js similarity index 100% rename from packages/velo-external-db-core/lib/converters/data_utils.js rename to libs/velo-external-db-core/src/converters/data_utils.js diff --git a/packages/velo-external-db-core/lib/converters/data_utils.spec.js b/libs/velo-external-db-core/src/converters/data_utils.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/converters/data_utils.spec.js rename to libs/velo-external-db-core/src/converters/data_utils.spec.js diff --git a/packages/velo-external-db-core/lib/converters/filter_transformer.js b/libs/velo-external-db-core/src/converters/filter_transformer.js similarity index 100% rename from packages/velo-external-db-core/lib/converters/filter_transformer.js rename to libs/velo-external-db-core/src/converters/filter_transformer.js diff --git a/packages/velo-external-db-core/lib/converters/filter_transformer.spec.js b/libs/velo-external-db-core/src/converters/filter_transformer.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/converters/filter_transformer.spec.js rename to libs/velo-external-db-core/src/converters/filter_transformer.spec.js diff --git a/packages/velo-external-db-core/lib/converters/item_transformer.js b/libs/velo-external-db-core/src/converters/item_transformer.js similarity index 98% rename from packages/velo-external-db-core/lib/converters/item_transformer.js rename to libs/velo-external-db-core/src/converters/item_transformer.js index 146a1c484..e0ccb7e2d 100644 --- a/packages/velo-external-db-core/lib/converters/item_transformer.js +++ b/libs/velo-external-db-core/src/converters/item_transformer.js @@ -1,8 +1,8 @@ - const { v4: uuidv4 } = require('uuid') -const { isObject } = require('@wix-velo/velo-external-db-commons') let dateTimeProvider = require('../utils/date_time_provider') +const isObject = (o) => typeof o === 'object' && o !== null + class ItemTransformer { constructor() { } diff --git a/packages/velo-external-db-core/lib/converters/item_transformer.spec.js b/libs/velo-external-db-core/src/converters/item_transformer.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/converters/item_transformer.spec.js rename to libs/velo-external-db-core/src/converters/item_transformer.spec.js diff --git a/packages/velo-external-db-core/lib/converters/query_validator.js b/libs/velo-external-db-core/src/converters/query_validator.js similarity index 100% rename from packages/velo-external-db-core/lib/converters/query_validator.js rename to libs/velo-external-db-core/src/converters/query_validator.js diff --git a/packages/velo-external-db-core/lib/converters/query_validator.spec.js b/libs/velo-external-db-core/src/converters/query_validator.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/converters/query_validator.spec.js rename to libs/velo-external-db-core/src/converters/query_validator.spec.js diff --git a/packages/velo-external-db-core/lib/converters/query_validator_utils.js b/libs/velo-external-db-core/src/converters/query_validator_utils.js similarity index 100% rename from packages/velo-external-db-core/lib/converters/query_validator_utils.js rename to libs/velo-external-db-core/src/converters/query_validator_utils.js diff --git a/packages/velo-external-db-core/lib/converters/query_validator_utils.spec.js b/libs/velo-external-db-core/src/converters/query_validator_utils.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/converters/query_validator_utils.spec.js rename to libs/velo-external-db-core/src/converters/query_validator_utils.spec.js diff --git a/packages/velo-external-db-core/lib/converters/utils.js b/libs/velo-external-db-core/src/converters/utils.js similarity index 100% rename from packages/velo-external-db-core/lib/converters/utils.js rename to libs/velo-external-db-core/src/converters/utils.js diff --git a/packages/velo-external-db-core/lib/data_hooks_utils.js b/libs/velo-external-db-core/src/data_hooks_utils.js similarity index 100% rename from packages/velo-external-db-core/lib/data_hooks_utils.js rename to libs/velo-external-db-core/src/data_hooks_utils.js diff --git a/packages/velo-external-db-core/lib/data_hooks_utils.spec.js b/libs/velo-external-db-core/src/data_hooks_utils.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/data_hooks_utils.spec.js rename to libs/velo-external-db-core/src/data_hooks_utils.spec.js diff --git a/packages/velo-external-db-core/lib/health/app_info.js b/libs/velo-external-db-core/src/health/app_info.js similarity index 100% rename from packages/velo-external-db-core/lib/health/app_info.js rename to libs/velo-external-db-core/src/health/app_info.js diff --git a/packages/velo-external-db-core/lib/health/app_info.spec.js b/libs/velo-external-db-core/src/health/app_info.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/health/app_info.spec.js rename to libs/velo-external-db-core/src/health/app_info.spec.js diff --git a/packages/velo-external-db-core/lib/index.js b/libs/velo-external-db-core/src/index.js similarity index 100% rename from packages/velo-external-db-core/lib/index.js rename to libs/velo-external-db-core/src/index.js diff --git a/packages/velo-external-db/roles-config.json b/libs/velo-external-db-core/src/roles-config.json similarity index 100% rename from packages/velo-external-db/roles-config.json rename to libs/velo-external-db-core/src/roles-config.json diff --git a/packages/velo-external-db-core/lib/router.js b/libs/velo-external-db-core/src/router.js similarity index 100% rename from packages/velo-external-db-core/lib/router.js rename to libs/velo-external-db-core/src/router.js diff --git a/packages/velo-external-db-core/lib/schema_hooks_utils.js b/libs/velo-external-db-core/src/schema_hooks_utils.js similarity index 100% rename from packages/velo-external-db-core/lib/schema_hooks_utils.js rename to libs/velo-external-db-core/src/schema_hooks_utils.js diff --git a/packages/velo-external-db-core/lib/schema_hooks_utils.spec.js b/libs/velo-external-db-core/src/schema_hooks_utils.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/schema_hooks_utils.spec.js rename to libs/velo-external-db-core/src/schema_hooks_utils.spec.js diff --git a/packages/velo-external-db-core/lib/service/data.js b/libs/velo-external-db-core/src/service/data.js similarity index 100% rename from packages/velo-external-db-core/lib/service/data.js rename to libs/velo-external-db-core/src/service/data.js diff --git a/packages/velo-external-db-core/lib/service/data.spec.js b/libs/velo-external-db-core/src/service/data.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/service/data.spec.js rename to libs/velo-external-db-core/src/service/data.spec.js diff --git a/packages/velo-external-db-core/lib/service/operation.js b/libs/velo-external-db-core/src/service/operation.js similarity index 100% rename from packages/velo-external-db-core/lib/service/operation.js rename to libs/velo-external-db-core/src/service/operation.js diff --git a/packages/velo-external-db-core/lib/service/operation.spec.js b/libs/velo-external-db-core/src/service/operation.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/service/operation.spec.js rename to libs/velo-external-db-core/src/service/operation.spec.js diff --git a/packages/velo-external-db-core/lib/service/schema.js b/libs/velo-external-db-core/src/service/schema.js similarity index 100% rename from packages/velo-external-db-core/lib/service/schema.js rename to libs/velo-external-db-core/src/service/schema.js diff --git a/packages/velo-external-db-core/lib/service/schema.spec.js b/libs/velo-external-db-core/src/service/schema.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/service/schema.spec.js rename to libs/velo-external-db-core/src/service/schema.spec.js diff --git a/packages/velo-external-db-core/lib/service/schema_aware_data.js b/libs/velo-external-db-core/src/service/schema_aware_data.js similarity index 100% rename from packages/velo-external-db-core/lib/service/schema_aware_data.js rename to libs/velo-external-db-core/src/service/schema_aware_data.js diff --git a/packages/velo-external-db-core/lib/service/schema_aware_data.spec.js b/libs/velo-external-db-core/src/service/schema_aware_data.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/service/schema_aware_data.spec.js rename to libs/velo-external-db-core/src/service/schema_aware_data.spec.js diff --git a/packages/velo-external-db-core/lib/service/schema_information.js b/libs/velo-external-db-core/src/service/schema_information.js similarity index 87% rename from packages/velo-external-db-core/lib/service/schema_information.js rename to libs/velo-external-db-core/src/service/schema_information.js index dc495f4b8..1dd7a8106 100644 --- a/packages/velo-external-db-core/lib/service/schema_information.js +++ b/libs/velo-external-db-core/src/service/schema_information.js @@ -8,11 +8,11 @@ class CacheableSchemaInformation { this.schemaProvider = schemaProvider this.cache = new NodeCache( { checkperiod: FiveMinutes + 10 } ) - const refreshFunc = async() => { - await this.refresh() - .catch( console.log ) - } - setImmediate(refreshFunc) + // const refreshFunc = async() => { + // await this.refresh() + // .catch( console.log ) + // } + // setImmediate(refreshFunc) } async schemaFieldsFor(collectionName) { diff --git a/packages/velo-external-db-core/lib/service/schema_information.spec.js b/libs/velo-external-db-core/src/service/schema_information.spec.js similarity index 99% rename from packages/velo-external-db-core/lib/service/schema_information.spec.js rename to libs/velo-external-db-core/src/service/schema_information.spec.js index cc60d6534..f38c9a201 100644 --- a/packages/velo-external-db-core/lib/service/schema_information.spec.js +++ b/libs/velo-external-db-core/src/service/schema_information.spec.js @@ -5,7 +5,6 @@ const gen = require('../../test/gen') const { CollectionDoesNotExists } = require('@wix-velo/velo-external-db-commons').errors describe('Schema Information Service', () => { - test('will automatically refresh and return schema for collection when queried', async() => { driver.givenFindResults(ctx.dbs) diff --git a/packages/velo-external-db-core/lib/utils/data_utils.js b/libs/velo-external-db-core/src/utils/data_utils.js similarity index 100% rename from packages/velo-external-db-core/lib/utils/data_utils.js rename to libs/velo-external-db-core/src/utils/data_utils.js diff --git a/packages/velo-external-db-core/lib/utils/date_time_provider.js b/libs/velo-external-db-core/src/utils/date_time_provider.js similarity index 100% rename from packages/velo-external-db-core/lib/utils/date_time_provider.js rename to libs/velo-external-db-core/src/utils/date_time_provider.js diff --git a/libs/velo-external-db-core/src/utils/router_utils.build.js b/libs/velo-external-db-core/src/utils/router_utils.build.js new file mode 100644 index 000000000..2896a3abc --- /dev/null +++ b/libs/velo-external-db-core/src/utils/router_utils.build.js @@ -0,0 +1,18 @@ +const path = require('path') +const ejs = require('ejs') +const fs = require('fs').promises + +const getAppInfoTemplate = async() => { + return await fs.readFile(path.join( __dirname, 'views', 'index.ejs'), 'utf8') +} + +const getAppInfoPage = async(appInfo) => { + const appInfoTemplate = await getAppInfoTemplate() + const appInfoPage = ejs.render(appInfoTemplate, appInfo) + return appInfoPage +} + +module.exports = { getAppInfoPage } + + + diff --git a/packages/velo-external-db-core/lib/utils/router_utils.js b/libs/velo-external-db-core/src/utils/router_utils.js similarity index 100% rename from packages/velo-external-db-core/lib/utils/router_utils.js rename to libs/velo-external-db-core/src/utils/router_utils.js diff --git a/packages/velo-external-db-core/lib/views/error.ejs b/libs/velo-external-db-core/src/views/error.ejs similarity index 100% rename from packages/velo-external-db-core/lib/views/error.ejs rename to libs/velo-external-db-core/src/views/error.ejs diff --git a/packages/velo-external-db-core/lib/views/index.ejs b/libs/velo-external-db-core/src/views/index.ejs similarity index 100% rename from packages/velo-external-db-core/lib/views/index.ejs rename to libs/velo-external-db-core/src/views/index.ejs diff --git a/packages/velo-external-db-core/lib/views/login.ejs b/libs/velo-external-db-core/src/views/login.ejs similarity index 100% rename from packages/velo-external-db-core/lib/views/login.ejs rename to libs/velo-external-db-core/src/views/login.ejs diff --git a/packages/velo-external-db-core/lib/views/partials/details.ejs b/libs/velo-external-db-core/src/views/partials/details.ejs similarity index 100% rename from packages/velo-external-db-core/lib/views/partials/details.ejs rename to libs/velo-external-db-core/src/views/partials/details.ejs diff --git a/packages/velo-external-db-core/lib/web/auth-middleware.js b/libs/velo-external-db-core/src/web/auth-middleware.js similarity index 100% rename from packages/velo-external-db-core/lib/web/auth-middleware.js rename to libs/velo-external-db-core/src/web/auth-middleware.js diff --git a/packages/velo-external-db-core/lib/web/auth-middleware.spec.js b/libs/velo-external-db-core/src/web/auth-middleware.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/web/auth-middleware.spec.js rename to libs/velo-external-db-core/src/web/auth-middleware.spec.js diff --git a/packages/velo-external-db-core/lib/web/auth-role-middleware.js b/libs/velo-external-db-core/src/web/auth-role-middleware.js similarity index 100% rename from packages/velo-external-db-core/lib/web/auth-role-middleware.js rename to libs/velo-external-db-core/src/web/auth-role-middleware.js diff --git a/packages/velo-external-db-core/lib/web/auth-role-middleware.spec.js b/libs/velo-external-db-core/src/web/auth-role-middleware.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/web/auth-role-middleware.spec.js rename to libs/velo-external-db-core/src/web/auth-role-middleware.spec.js diff --git a/packages/velo-external-db-core/lib/web/error-middleware.js b/libs/velo-external-db-core/src/web/error-middleware.js similarity index 100% rename from packages/velo-external-db-core/lib/web/error-middleware.js rename to libs/velo-external-db-core/src/web/error-middleware.js diff --git a/packages/velo-external-db-core/lib/web/error-middleware.spec.js b/libs/velo-external-db-core/src/web/error-middleware.spec.js similarity index 100% rename from packages/velo-external-db-core/lib/web/error-middleware.spec.js rename to libs/velo-external-db-core/src/web/error-middleware.spec.js diff --git a/packages/velo-external-db-core/lib/web/middleware-support.js b/libs/velo-external-db-core/src/web/middleware-support.js similarity index 100% rename from packages/velo-external-db-core/lib/web/middleware-support.js rename to libs/velo-external-db-core/src/web/middleware-support.js diff --git a/packages/velo-external-db-core/test/drivers/aggregation_transformer_test_support.js b/libs/velo-external-db-core/test/drivers/aggregation_transformer_test_support.js similarity index 100% rename from packages/velo-external-db-core/test/drivers/aggregation_transformer_test_support.js rename to libs/velo-external-db-core/test/drivers/aggregation_transformer_test_support.js diff --git a/packages/velo-external-db-core/test/drivers/app_info_test_support.js b/libs/velo-external-db-core/test/drivers/app_info_test_support.js similarity index 100% rename from packages/velo-external-db-core/test/drivers/app_info_test_support.js rename to libs/velo-external-db-core/test/drivers/app_info_test_support.js diff --git a/packages/velo-external-db-core/test/drivers/auth_middleware_test_support.js b/libs/velo-external-db-core/test/drivers/auth_middleware_test_support.js similarity index 100% rename from packages/velo-external-db-core/test/drivers/auth_middleware_test_support.js rename to libs/velo-external-db-core/test/drivers/auth_middleware_test_support.js diff --git a/packages/velo-external-db-core/test/drivers/data_provider_test_support.js b/libs/velo-external-db-core/test/drivers/data_provider_test_support.js similarity index 100% rename from packages/velo-external-db-core/test/drivers/data_provider_test_support.js rename to libs/velo-external-db-core/test/drivers/data_provider_test_support.js diff --git a/packages/velo-external-db-core/test/drivers/data_service_test_support.js b/libs/velo-external-db-core/test/drivers/data_service_test_support.js similarity index 100% rename from packages/velo-external-db-core/test/drivers/data_service_test_support.js rename to libs/velo-external-db-core/test/drivers/data_service_test_support.js diff --git a/packages/velo-external-db-core/test/drivers/date_time_provider_test_support.js b/libs/velo-external-db-core/test/drivers/date_time_provider_test_support.js similarity index 100% rename from packages/velo-external-db-core/test/drivers/date_time_provider_test_support.js rename to libs/velo-external-db-core/test/drivers/date_time_provider_test_support.js diff --git a/packages/velo-external-db-core/test/drivers/filter_transformer_test_support.js b/libs/velo-external-db-core/test/drivers/filter_transformer_test_support.js similarity index 94% rename from packages/velo-external-db-core/test/drivers/filter_transformer_test_support.js rename to libs/velo-external-db-core/test/drivers/filter_transformer_test_support.js index f9600e03a..5d8bcd7df 100644 --- a/packages/velo-external-db-core/test/drivers/filter_transformer_test_support.js +++ b/libs/velo-external-db-core/test/drivers/filter_transformer_test_support.js @@ -1,4 +1,4 @@ -const { EmptyFilter } = require('../../lib/converters/utils') +const { EmptyFilter } = require('../../src/converters/utils') const { when } = require('jest-when') const { AdapterFunctions } = require('@wix-velo/velo-external-db-commons') diff --git a/packages/velo-external-db/test/drivers/hooks_test_support.js b/libs/velo-external-db-core/test/drivers/hooks_test_support.js similarity index 100% rename from packages/velo-external-db/test/drivers/hooks_test_support.js rename to libs/velo-external-db-core/test/drivers/hooks_test_support.js diff --git a/packages/velo-external-db-core/test/drivers/item_patcher_test_support.js b/libs/velo-external-db-core/test/drivers/item_patcher_test_support.js similarity index 100% rename from packages/velo-external-db-core/test/drivers/item_patcher_test_support.js rename to libs/velo-external-db-core/test/drivers/item_patcher_test_support.js diff --git a/packages/velo-external-db-core/test/drivers/operation_provider_test_support.js b/libs/velo-external-db-core/test/drivers/operation_provider_test_support.js similarity index 100% rename from packages/velo-external-db-core/test/drivers/operation_provider_test_support.js rename to libs/velo-external-db-core/test/drivers/operation_provider_test_support.js diff --git a/packages/velo-external-db-core/test/drivers/query_validator_test_support.js b/libs/velo-external-db-core/test/drivers/query_validator_test_support.js similarity index 100% rename from packages/velo-external-db-core/test/drivers/query_validator_test_support.js rename to libs/velo-external-db-core/test/drivers/query_validator_test_support.js diff --git a/packages/velo-external-db-core/test/drivers/schema_information_test_support.js b/libs/velo-external-db-core/test/drivers/schema_information_test_support.js similarity index 100% rename from packages/velo-external-db-core/test/drivers/schema_information_test_support.js rename to libs/velo-external-db-core/test/drivers/schema_information_test_support.js diff --git a/packages/velo-external-db-core/test/drivers/schema_matchers.js b/libs/velo-external-db-core/test/drivers/schema_matchers.js similarity index 100% rename from packages/velo-external-db-core/test/drivers/schema_matchers.js rename to libs/velo-external-db-core/test/drivers/schema_matchers.js diff --git a/packages/velo-external-db-core/test/drivers/schema_provider_test_support.js b/libs/velo-external-db-core/test/drivers/schema_provider_test_support.js similarity index 100% rename from packages/velo-external-db-core/test/drivers/schema_provider_test_support.js rename to libs/velo-external-db-core/test/drivers/schema_provider_test_support.js diff --git a/packages/velo-external-db/test/e2e/app_data_hooks.e2e.spec.js b/libs/velo-external-db-core/test/e2e/app_data_hooks.e2e.spec.js similarity index 100% rename from packages/velo-external-db/test/e2e/app_data_hooks.e2e.spec.js rename to libs/velo-external-db-core/test/e2e/app_data_hooks.e2e.spec.js diff --git a/packages/velo-external-db/test/e2e/app_schema_hooks.e2e.spec.js b/libs/velo-external-db-core/test/e2e/app_schema_hooks.e2e.spec.js similarity index 100% rename from packages/velo-external-db/test/e2e/app_schema_hooks.e2e.spec.js rename to libs/velo-external-db-core/test/e2e/app_schema_hooks.e2e.spec.js diff --git a/packages/velo-external-db-core/test/gen.js b/libs/velo-external-db-core/test/gen.js similarity index 100% rename from packages/velo-external-db-core/test/gen.js rename to libs/velo-external-db-core/test/gen.js diff --git a/libs/velo-external-db-core/tsconfig.json b/libs/velo-external-db-core/tsconfig.json new file mode 100644 index 000000000..9d7f15bc8 --- /dev/null +++ b/libs/velo-external-db-core/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/velo-external-db-core/tsconfig.lib.json b/libs/velo-external-db-core/tsconfig.lib.json new file mode 100644 index 000000000..80e0aebae --- /dev/null +++ b/libs/velo-external-db-core/tsconfig.lib.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": [ + "jest.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.test.js" + ] +} diff --git a/libs/velo-external-db-core/tsconfig.spec.json b/libs/velo-external-db-core/tsconfig.spec.json new file mode 100644 index 000000000..546f12877 --- /dev/null +++ b/libs/velo-external-db-core/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/nx.json b/nx.json new file mode 100644 index 000000000..94a716414 --- /dev/null +++ b/nx.json @@ -0,0 +1,35 @@ +{ + "$schema": "./node_modules/nx/schemas/nx-schema.json", + "tasksRunnerOptions": { + "default": { + "runner": "nx/tasks-runners/default", + "options": { + "cacheableOperations": [ "build", "test", "lint", "package", "prepare" ] + } + } + }, + "targetDependencies": { + "build": [ + { + "target": "build", + "projects": "dependencies" + } + ], + "prepare": [ + { + "target": "prepare", + "projects": "dependencies" + } + ], + "package": [ + { + "target": "package", + "projects": "dependencies" + } + ] + }, + "affected": { + "defaultBase": "master" + }, + "defaultProject": "velo-external-db" +} diff --git a/package.json b/package.json index af16fbc84..05e975c36 100644 --- a/package.json +++ b/package.json @@ -1,62 +1,102 @@ { "name": "velo-external-database-adapter", "scripts": { - "start": "lerna exec --scope @wix-velo/velo-external-db \"npm run start\"", - "build:dev": "lerna bootstrap --hoist", - "build:full-image": "docker build --target full_version -t velo-external-db .", + "start": "nx serve", + "start:dev": "nx run velo-external-db:serve", + "build:dev": "nx run-many --target=build --all", + "build:full-image": "nx run velo-external-db:build-image ", "lint": "eslint --cache ./", "lint:fix": "eslint --cache --fix ./", "test": "npm run test:core; npm run test:postgres; npm run test:spanner; npm run test:mysql; npm run test:mssql; npm run test:firestore; npm run test:mongo; npm run test:airtable; npm run test:dynamodb; npm run test:bigquery", - "test:core": "lerna exec --scope '{@wix-velo/external-db-config,@wix-velo/velo-external-db-core,@wix-velo/external-db-security}' \"npm test\"", - "test:postgres": "lerna exec --scope @wix-velo/external-db-postgres \"npm test\" && lerna exec --scope @wix-velo/velo-external-db \"npm run test:postgres\"", + "test:core": "nx run-many --skip-nx-cache --target=test --projects=@wix-velo/external-db-config,@wix-velo/velo-external-db-core,@wix-velo/external-db-security", + "test:postgres": "TEST_ENGINE=postgres nx run-many --skip-nx-cache --target=test --projects=@wix-velo/external-db-postgres,velo-external-db", "test:postgres13": "npm run test:postgres", "test:postgres12": "npm run test:postgres", "test:postgres11": "npm run test:postgres", "test:postgres10": "npm run test:postgres", "test:postgres9": "npm run test:postgres", - "test:spanner": "lerna exec --scope @wix-velo/external-db-spanner \"npm test\" && lerna exec --scope @wix-velo/velo-external-db \"npm run test:spanner\"", - "test:mysql": "lerna exec --scope @wix-velo/external-db-mysql \"npm test\" && lerna exec --scope @wix-velo/velo-external-db \"npm run test:mysql\"", + "test:spanner": "TEST_ENGINE=spanner nx run-many --skip-nx-cache --target=test --projects=@wix-velo/external-db-spanner,velo-external-db", + "test:mysql": "TEST_ENGINE=mysql nx run-many --skip-nx-cache --target=test --projects=@wix-velo/external-db-mysql,velo-external-db", "test:mysql5": "npm run test:mysql", - "test:mssql": "lerna exec --scope @wix-velo/external-db-mssql \"npm test\" && lerna exec --scope @wix-velo/velo-external-db \"npm run test:mssql\"", + "test:mssql": "TEST_ENGINE=mssql nx run-many --skip-nx-cache --target=test --projects=@wix-velo/external-db-mssql,velo-external-db", "test:mssql17": "npm run test:mssql", - "test:firestore": "lerna exec --scope @wix-velo/external-db-firestore \"npm test\" && lerna exec --scope @wix-velo/velo-external-db \"npm run test:firestore\"", - "test:mongo": "lerna exec --scope @wix-velo/external-db-mongo \"npm test\" && lerna exec --scope @wix-velo/velo-external-db \"npm run test:mongo\"", + "test:firestore": "TEST_ENGINE=firestore nx run-many --skip-nx-cache --target=test --projects=@wix-velo/external-db-firestore,velo-external-db", + "test:mongo": "TEST_ENGINE=mongo nx run-many --skip-nx-cache --target=test --projects=@wix-velo/external-db-mongo,velo-external-db", "test:mongo4": "npm run test:mongo", - "test:google-sheets": "lerna exec --scope @wix-velo/external-db-google-sheets \"npm test\" && lerna exec --scope @wix-velo/velo-external-db \"npm run test:google-sheets\"", - "test:airtable": "lerna exec --scope @wix-velo/external-db-airtable \"npm test\" && lerna exec --scope @wix-velo/velo-external-db \"npm run test:airtable\"", - "test:dynamodb": "lerna exec --scope @wix-velo/external-db-dynamodb \"npm test\" && lerna exec --scope @wix-velo/velo-external-db \"npm run test:dynamodb\"", - "test:bigquery": "lerna exec --scope @wix-velo/external-db-bigquery \"npm test\" && lerna exec --scope @wix-velo/velo-external-db \"npm run test:bigquery\"", - "release": "lerna version --no-push", - "outdated:all": "lerna exec --scope '{@wix-velo/external-db-config,@wix-velo/external-db-firestore,@wix-velo/external-db-mongo,@wix-velo/external-db-mssql,@wix-velo/external-db-mysql,@wix-velo/external-db-postgres,@wix-velo/external-db-spanner,@wix-velo/external-db-google-sheets,@wix-velo/external-db-airtable,@wix-velo/external-db-dynamodb,velo-external-db,@wix-velo/velo-external-db-core,@wix-velo/external-db-security }' \"npm outdated\"", - "ci:publish": "lerna publish -y from-git", + "test:google-sheets": "TEST_ENGINE=google-sheet nx run-many --skip-nx-cache --target=test --projects=@wix-velo/external-db-google-sheets,velo-external-db", + "test:airtable": "TEST_ENGINE=airtable nx run-many --skip-nx-cache --target=test --projects=@wix-velo/external-db-airtable,velo-external-db", + "test:dynamodb": "TEST_ENGINE=dynamodb nx run-many --skip-nx-cache --target=test --projects=@wix-velo/external-db-dynamodb,velo-external-db", + "test:bigquery": "TEST_ENGINE=bigquery nx run-many --skip-nx-cache --target=test --projects=@wix-velo/external-db-bigquery,velo-external-db", + "outdated:all": "npm outdated", + "ci:publish": "nx run-many --target=publish --all", "prepare": "husky install" }, + "dependencies": { + "@aws-sdk/client-cognito-identity-provider": "^3.87.0", + "@aws-sdk/client-dynamodb": "^3.92.0", + "@aws-sdk/client-secrets-manager": "^3.89.0", + "@aws-sdk/lib-dynamodb": "^3.92.0", + "@google-cloud/bigquery": "^5.12.0", + "@google-cloud/firestore": "^5.0.2", + "@google-cloud/spanner": "^5.18.0", + "airtable": "^0.11.4", + "ajv": "^6.12.6", + "async-wait-until": "^2.0.12", + "axios": "^0.27.2", + "bluebird": "^3.7.2", + "compression": "^1.7.4", + "docker-compose": "^0.23.17", + "ejs": "^3.1.8", + "express": "^4.17.2", + "google-spreadsheet": "^3.3.0", + "moment": "^2.29.3", + "mongodb": "^4.6.0", + "mssql": "^8.1.0", + "mysql": "^2.18.1", + "nested-property": "^4.0.0", + "node-cache": "^5.1.2", + "passport-azure-ad-oauth2": "^0.0.4", + "passport-google-oauth20": "^2.0.0", + "passport-local": "^1.0.0", + "passport-oauth2": "^1.6.1", + "pg": "^8.7.3", + "pg-escape": "^0.2.0", + "sqlstring": "^2.3.3", + "tslib": "^2.3.0", + "tsqlstring": "^1.0.1", + "uuid": "^8.3.2" + }, "devDependencies": { - "eslint": "^7.32.0", + "@nrwl/cli": "14.1.5", + "@nrwl/eslint-plugin-nx": "14.1.5", + "@nrwl/express": "14.1.5", + "@nrwl/jest": "14.1.5", + "@nrwl/linter": "14.1.5", + "@nrwl/node": "14.1.5", + "@nrwl/workspace": "14.1.5", + "@types/express": "4.17.13", + "@types/jest": "27.4.1", + "@types/node": "16.11.7", + "@typescript-eslint/eslint-plugin": "~5.18.0", + "@typescript-eslint/parser": "~5.18.0", + "aws-sdk-client-mock": "^0.6.2", + "chance": "^1.1.8", + "eslint": "~8.12.0", + "eslint-config-prettier": "8.1.0", "eslint-plugin-jest": "^25.3.0", "husky": "^7.0.4", - "lerna": "^4.0.0", - "lint-staged": "^12.1.2" - }, - "workspaces": { - "packages": [ - "external-db-config", - "external-db-firestore", - "external-db-mongo", - "external-db-mssql", - "external-db-mysql", - "external-db-postgres", - "external-db-spanner", - "external-db-google-sheets", - "external-db-airtable", - "external-db-dynamodb", - "external-db-bigquery", - "velo-external-db", - "velo-external-db-core", - "external-db-security", - "test-commons", - "velo-external-db-commons" - ] + "jest": "27.5.1", + "jest-each": "^28.1.0", + "jest-extended": "^2.0.0", + "jest-when": "^3.5.1", + "lint-staged": "^12.1.2", + "nx": "14.1.5", + "prettier": "^2.5.1", + "rewire": "^6.0.0", + "ts-jest": "27.1.4", + "ts-node": "9.1.1", + "typescript": "~4.6.2", + "uuid-validate": "^0.0.3" }, "lint-staged": { "*.js": "eslint --cache --fix" diff --git a/packages/external-db-airtable/jest.config.js b/packages/external-db-airtable/jest.config.js deleted file mode 100644 index bbf8a7a61..000000000 --- a/packages/external-db-airtable/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - clearMocks: true, - verbose: true, - roots: ['/lib'], - testRegex: '(.*\\.spec\\.)js$', - testEnvironment: 'node' -} \ No newline at end of file diff --git a/packages/external-db-airtable/package.json b/packages/external-db-airtable/package.json deleted file mode 100644 index e6da15060..000000000 --- a/packages/external-db-airtable/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@wix-velo/external-db-airtable", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/external-db-airtable" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "jest" - }, - "dependencies": { - "@wix-velo/velo-external-db-commons": "^1.0.2", - "airtable": "^0.11.2", - "axios": "^0.26.0", - "express": "^4.17.3" - }, - "devDependencies": { - "@wix-velo/test-commons": "^1.0.2", - "chance": "^1.1.8", - "jest": "^27.5.1", - "jest-when": "^3.5.1" - } -} diff --git a/packages/external-db-bigquery/package.json b/packages/external-db-bigquery/package.json deleted file mode 100644 index 86767963b..000000000 --- a/packages/external-db-bigquery/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "@wix-velo/external-db-bigquery", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/external-db-bigquery" - }, - "scripts": { - "test": "jest" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@google-cloud/bigquery": "^5.9.1", - "@wix-velo/velo-external-db-commons": "^1.0.2" - }, - "devDependencies": { - "@wix-velo/test-commons": "^1.0.2", - "chance": "^1.1.8", - "jest-each": "^27.4.6", - "jest-when": "^3.5.1" - } -} diff --git a/packages/external-db-config/jest.config.js b/packages/external-db-config/jest.config.js deleted file mode 100644 index 5a24c1b22..000000000 --- a/packages/external-db-config/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - clearMocks: true, - verbose: true, - roots: ['/lib', '/test'], - testRegex: '(.*\\.spec\\.)js$', - testEnvironment: 'node' -} \ No newline at end of file diff --git a/packages/external-db-config/package.json b/packages/external-db-config/package.json deleted file mode 100644 index ed994dc41..000000000 --- a/packages/external-db-config/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "@wix-velo/external-db-config", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/external-db-config" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "scripts": { - "test": "jest" - }, - "dependencies": { - "@aws-sdk/client-secrets-manager": "^3.53.0", - "ajv": "^8.10.0" - }, - "devDependencies": { - "@wix-velo/test-commons": "^1.0.2", - "aws-sdk-client-mock": "^0.6.0", - "chance": "^1.1.8", - "jest": "^27.5.1", - "jest-each": "^27.4.6", - "jest-when": "^3.5.1" - } -} diff --git a/packages/external-db-dynamodb/jest.config.js b/packages/external-db-dynamodb/jest.config.js deleted file mode 100644 index bbf8a7a61..000000000 --- a/packages/external-db-dynamodb/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - clearMocks: true, - verbose: true, - roots: ['/lib'], - testRegex: '(.*\\.spec\\.)js$', - testEnvironment: 'node' -} \ No newline at end of file diff --git a/packages/external-db-dynamodb/package.json b/packages/external-db-dynamodb/package.json deleted file mode 100644 index fecf4bdf2..000000000 --- a/packages/external-db-dynamodb/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@wix-velo/external-db-dynamodb", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/external-db-dynamodb" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "jest" - }, - "dependencies": { - "@aws-sdk/client-dynamodb": "^3.52.0", - "@aws-sdk/lib-dynamodb": "^3.52.0", - "@wix-velo/velo-external-db-commons": "^1.0.2", - "mysql": "^2.18.1" - }, - "devDependencies": { - "@wix-velo/test-commons": "^1.0.2", - "chance": "^1.1.8", - "jest": "^27.5.1", - "jest-when": "^3.5.1" - } -} diff --git a/packages/external-db-firestore/jest.config.js b/packages/external-db-firestore/jest.config.js deleted file mode 100644 index c5b7d42cd..000000000 --- a/packages/external-db-firestore/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ - -module.exports = { - clearMocks: true, - verbose: true, - roots: ['/lib'], - testRegex: '(.*\\.spec\\.)js$', - testEnvironment: 'node' -} \ No newline at end of file diff --git a/packages/external-db-firestore/package.json b/packages/external-db-firestore/package.json deleted file mode 100644 index fc728f37d..000000000 --- a/packages/external-db-firestore/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "@wix-velo/external-db-firestore", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/external-db-firestore" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "jest" - }, - "dependencies": { - "@google-cloud/firestore": "^5.0.2", - "@wix-velo/velo-external-db-commons": "^1.0.2" - }, - "devDependencies": { - "@wix-velo/test-commons": "^1.0.2", - "chance": "^1.1.8", - "jest": "^27.5.1", - "jest-when": "^3.5.1" - } -} diff --git a/packages/external-db-google-sheets/jest.config.js b/packages/external-db-google-sheets/jest.config.js deleted file mode 100644 index bbf8a7a61..000000000 --- a/packages/external-db-google-sheets/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - clearMocks: true, - verbose: true, - roots: ['/lib'], - testRegex: '(.*\\.spec\\.)js$', - testEnvironment: 'node' -} \ No newline at end of file diff --git a/packages/external-db-google-sheets/package.json b/packages/external-db-google-sheets/package.json deleted file mode 100644 index 2a108f37b..000000000 --- a/packages/external-db-google-sheets/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "@wix-velo/external-db-google-sheets", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/external-db-google-sheets" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "" - }, - "dependencies": { - "@wix-velo/velo-external-db-commons": "^1.0.2", - "express": "^4.17.3", - "google-spreadsheet": "^3.2.0", - "googleapis": "^95.0.0" - }, - "devDependencies": { - "@wix-velo/test-commons": "^1.0.2", - "jest": "^27.5.1", - "jest-when": "^3.5.1" - } -} diff --git a/packages/external-db-mongo/jest.config.js b/packages/external-db-mongo/jest.config.js deleted file mode 100644 index bbf8a7a61..000000000 --- a/packages/external-db-mongo/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - clearMocks: true, - verbose: true, - roots: ['/lib'], - testRegex: '(.*\\.spec\\.)js$', - testEnvironment: 'node' -} \ No newline at end of file diff --git a/packages/external-db-mongo/package.json b/packages/external-db-mongo/package.json deleted file mode 100644 index ba457d4de..000000000 --- a/packages/external-db-mongo/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "@wix-velo/external-db-mongo", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/external-db-mongo" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "jest" - }, - "dependencies": { - "@wix-velo/velo-external-db-commons": "^1.0.2", - "mongodb": "^4.4.0" - }, - "devDependencies": { - "@wix-velo/test-commons": "^1.0.2", - "chance": "^1.1.8", - "jest": "^27.5.1", - "jest-when": "^3.5.1" - } -} diff --git a/packages/external-db-mssql/jest.config.js b/packages/external-db-mssql/jest.config.js deleted file mode 100644 index bbf8a7a61..000000000 --- a/packages/external-db-mssql/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - clearMocks: true, - verbose: true, - roots: ['/lib'], - testRegex: '(.*\\.spec\\.)js$', - testEnvironment: 'node' -} \ No newline at end of file diff --git a/packages/external-db-mssql/package.json b/packages/external-db-mssql/package.json deleted file mode 100644 index 9fba9d965..000000000 --- a/packages/external-db-mssql/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "@wix-velo/external-db-mssql", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/external-db-mssql" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "jest" - }, - "dependencies": { - "@wix-velo/velo-external-db-commons": "^1.0.2", - "mssql": "^8.0.2", - "tsqlstring": "^1.0.1" - }, - "devDependencies": { - "@wix-velo/test-commons": "^1.0.2", - "chance": "^1.1.8", - "jest": "^27.5.1", - "jest-when": "^3.5.1" - } -} diff --git a/packages/external-db-mysql/jest.config.js b/packages/external-db-mysql/jest.config.js deleted file mode 100644 index bbf8a7a61..000000000 --- a/packages/external-db-mysql/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - clearMocks: true, - verbose: true, - roots: ['/lib'], - testRegex: '(.*\\.spec\\.)js$', - testEnvironment: 'node' -} \ No newline at end of file diff --git a/packages/external-db-mysql/package.json b/packages/external-db-mysql/package.json deleted file mode 100644 index 4b083d9d8..000000000 --- a/packages/external-db-mysql/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "@wix-velo/external-db-mysql", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/external-db-mysql" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "jest" - }, - "dependencies": { - "@wix-velo/velo-external-db-commons": "^1.0.2", - "mysql": "^2.18.1" - }, - "devDependencies": { - "@wix-velo/test-commons": "^1.0.2", - "chance": "^1.1.8", - "jest": "^27.5.1", - "jest-when": "^3.5.1" - } -} diff --git a/packages/external-db-postgres/jest.config.js b/packages/external-db-postgres/jest.config.js deleted file mode 100644 index bbf8a7a61..000000000 --- a/packages/external-db-postgres/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - clearMocks: true, - verbose: true, - roots: ['/lib'], - testRegex: '(.*\\.spec\\.)js$', - testEnvironment: 'node' -} \ No newline at end of file diff --git a/packages/external-db-postgres/package.json b/packages/external-db-postgres/package.json deleted file mode 100644 index 985995ef1..000000000 --- a/packages/external-db-postgres/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "@wix-velo/external-db-postgres", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/external-db-postgres" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "jest" - }, - "dependencies": { - "@wix-velo/velo-external-db-commons": "^1.0.2", - "pg": "^8.7.3", - "pg-escape": "^0.2.0" - }, - "devDependencies": { - "@wix-velo/test-commons": "^1.0.2", - "chance": "^1.1.8", - "jest": "^27.5.1", - "jest-when": "^3.5.1" - } -} diff --git a/packages/external-db-security/jest.config.js b/packages/external-db-security/jest.config.js deleted file mode 100644 index 8930c4891..000000000 --- a/packages/external-db-security/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - clearMocks: true, - verbose: true, - roots: ['/lib'], - testRegex: '(.*\\.spec\\.)js$', - testEnvironment: 'node', -} \ No newline at end of file diff --git a/packages/external-db-security/package.json b/packages/external-db-security/package.json deleted file mode 100644 index c3f81a6cc..000000000 --- a/packages/external-db-security/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@wix-velo/external-db-security", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/external-db-security" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "jest" - }, - "dependencies": { - "@aws-sdk/client-cognito-identity-provider": "^3.47.0", - "@wix-velo/velo-external-db-commons": "^1.0.2", - "passport-azure-ad-oauth2": "^0.0.4", - "passport-google-oauth20": "^2.0.0", - "passport-local": "^1.0.0", - "passport-oauth2": "^1.6.1" - }, - "devDependencies": { - "@wix-velo/test-commons": "^1.0.2", - "chance": "^1.1.8", - "jest": "^27.5.1", - "jest-each": "^27.4.6", - "jest-when": "^3.5.1" - } -} diff --git a/packages/external-db-spanner/jest.config.js b/packages/external-db-spanner/jest.config.js deleted file mode 100644 index bbf8a7a61..000000000 --- a/packages/external-db-spanner/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - clearMocks: true, - verbose: true, - roots: ['/lib'], - testRegex: '(.*\\.spec\\.)js$', - testEnvironment: 'node' -} \ No newline at end of file diff --git a/packages/external-db-spanner/package.json b/packages/external-db-spanner/package.json deleted file mode 100644 index 497eba60c..000000000 --- a/packages/external-db-spanner/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "@wix-velo/external-db-spanner", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/external-db-spanner" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "jest" - }, - "dependencies": { - "@google-cloud/spanner": "^5.16.3", - "@wix-velo/test-commons": "^1.0.2", - "@wix-velo/velo-external-db-commons": "^1.0.2", - "sqlstring": "^2.3.2" - }, - "devDependencies": { - "@wix-velo/test-commons": "^1.0.0", - "chance": "^1.1.8", - "jest": "^27.5.1", - "jest-each": "^27.4.6", - "jest-when": "^3.5.1" - } -} diff --git a/packages/test-commons/lib/index.js b/packages/test-commons/lib/index.js deleted file mode 100644 index 1e048477d..000000000 --- a/packages/test-commons/lib/index.js +++ /dev/null @@ -1,4 +0,0 @@ -const testCommons = require('./test-commons') -const gen = require('./gen') - -module.exports = { ...testCommons, gen } \ No newline at end of file diff --git a/packages/test-commons/package.json b/packages/test-commons/package.json deleted file mode 100644 index dc2fef25e..000000000 --- a/packages/test-commons/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@wix-velo/test-commons", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/test-commons" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "" - }, - "dependencies": { - "@wix-velo/velo-external-db-commons": "^1.0.2", - "chance": "^1.1.8" - } -} diff --git a/packages/velo-external-db-commons/lib/index.js b/packages/velo-external-db-commons/lib/index.js deleted file mode 100644 index 0ccdbaf07..000000000 --- a/packages/velo-external-db-commons/lib/index.js +++ /dev/null @@ -1,13 +0,0 @@ -const errors = require('./errors') -const schemaCommons = require('./schema_commons') -const dataCommons = require('./data_commons') -const configCommons = require ('./config_commons') -const DbConnector = require ('./db_connector') - -module.exports = { - errors, - ...schemaCommons, - ...dataCommons, - ...configCommons, - DbConnector -} \ No newline at end of file diff --git a/packages/velo-external-db-commons/package.json b/packages/velo-external-db-commons/package.json deleted file mode 100644 index bf278469e..000000000 --- a/packages/velo-external-db-commons/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@wix-velo/velo-external-db-commons", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/velo-external-db-commons" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "" - }, - "dependencies": { - "moment": "^2.29.1" - } -} diff --git a/packages/velo-external-db-core/jest.config.js b/packages/velo-external-db-core/jest.config.js deleted file mode 100644 index 15e3e11e0..000000000 --- a/packages/velo-external-db-core/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - clearMocks: true, - verbose: true, - roots: ['/lib'], - testRegex: '(.*\\.spec\\.)js$', - testEnvironment: 'node', - setupFilesAfterEnv: ['jest-extended/all'], -} \ No newline at end of file diff --git a/packages/velo-external-db-core/package.json b/packages/velo-external-db-core/package.json deleted file mode 100644 index 8d904123d..000000000 --- a/packages/velo-external-db-core/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "@wix-velo/velo-external-db-core", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/velo-external-db-core" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "jest" - }, - "dependencies": { - "@wix-velo/external-db-config": "^1.0.2", - "@wix-velo/external-db-security": "^1.0.2", - "@wix-velo/velo-external-db-commons": "^1.0.2", - "ajv": "^8.11.0", - "bluebird": "^3.7.2", - "compression": "^1.7.4", - "ejs": "^3.1.8", - "express": "^4.17.3", - "nested-property": "^4.0.0", - "node-cache": "^5.1.2", - "uuid": "^8.3.2" - }, - "devDependencies": { - "@wix-velo/test-commons": "^1.0.2", - "chance": "^1.1.8", - "jest": "^27.5.1", - "jest-each": "^27.4.6", - "jest-extended": "^2.0.0", - "jest-when": "^3.5.1", - "rewire": "^6.0.0", - "uuid-validate": "^0.0.3" - } -} diff --git a/packages/velo-external-db/jest.config.js b/packages/velo-external-db/jest.config.js deleted file mode 100644 index 17de41a2a..000000000 --- a/packages/velo-external-db/jest.config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - clearMocks: true, - verbose: true, - roots: ['/lib', '/test'], - testRegex: '(.*\\.spec\\.)js$', - testEnvironment: 'node', - globalSetup: './test/env/env.db.setup.js', - globalTeardown: './test/env/env.db.teardown.js', - testTimeout: 20000, - setupFilesAfterEnv: ['jest-extended/all'] -} \ No newline at end of file diff --git a/packages/velo-external-db/package.json b/packages/velo-external-db/package.json deleted file mode 100644 index 3dc3ddee6..000000000 --- a/packages/velo-external-db/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "@wix-velo/velo-external-db", - "version": "1.0.2", - "description": "", - "homepage": "https://github.com/wix/velo-external-db#readme", - "license": "MIT", - "main": "lib/app.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/wix/velo-external-db.git", - "directory": "packages/velo-external-db" - }, - "bugs": { - "url": "https://github.com/wix/velo-external-db/issues" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "jest lib", - "test:mysql": "TEST_ENGINE=mysql jest --runInBand ./test", - "test:spanner": "TEST_ENGINE=spanner jest --runInBand ./test", - "test:postgres": "TEST_ENGINE=postgres jest --runInBand ./test", - "test:firestore": "TEST_ENGINE=firestore jest --runInBand ./test", - "test:mssql": "TEST_ENGINE=mssql jest --runInBand ./test", - "test:mongo": "TEST_ENGINE=mongo jest --runInBand ./test", - "test:google-sheets": "TEST_ENGINE=google-sheet jest --runInBand schema_provider.spec.js app_data.e2e.spec.js app_schema.e2e.spec.js ", - "test:airtable": "TEST_ENGINE=airtable jest --runInBand ./test ", - "test:dynamodb": "TEST_ENGINE=dynamodb jest --runInBand ./test ", - "test:bigquery": "TEST_ENGINE=bigquery jest --runInBand ./test", - "test:watch": "jest --detectOpenHandles --watch", - "start": "node lib/app.js", - "deploy": "gcloud app deploy ./app.yaml" - }, - "dependencies": { - "@wix-velo/external-db-airtable": "^1.0.2", - "@wix-velo/external-db-bigquery": "^1.0.2", - "@wix-velo/external-db-config": "^1.0.2", - "@wix-velo/external-db-dynamodb": "^1.0.2", - "@wix-velo/external-db-firestore": "^1.0.2", - "@wix-velo/external-db-google-sheets": "^1.0.2", - "@wix-velo/external-db-mongo": "^1.0.2", - "@wix-velo/external-db-mssql": "^1.0.2", - "@wix-velo/external-db-mysql": "^1.0.2", - "@wix-velo/external-db-postgres": "^1.0.2", - "@wix-velo/external-db-security": "^1.0.2", - "@wix-velo/external-db-spanner": "^1.0.2", - "@wix-velo/velo-external-db-commons": "^1.0.2", - "@wix-velo/velo-external-db-core": "^1.0.2", - "compression": "^1.7.4", - "ejs": "^3.1.7", - "express": "^4.17.3", - "nested-property": "^4.0.0" - }, - "devDependencies": { - "@wix-velo/test-commons": "^1.0.2", - "async-wait-until": "^2.0.9", - "axios": "^0.26.0", - "chance": "^1.1.8", - "docker-compose": "^0.23.17", - "jest": "^27.5.1", - "jest-each": "^27.4.6", - "jest-extended": "^2.0.0", - "jest-when": "^3.5.1" - } -} diff --git a/tools/scripts/publish.mjs b/tools/scripts/publish.mjs new file mode 100644 index 000000000..f7c96e2b2 --- /dev/null +++ b/tools/scripts/publish.mjs @@ -0,0 +1,63 @@ + +/** + * This is a minimal script to publish your package to "npm". + * This is meant to be used as-is or customize as you see fit. + * + * This script is executed on "dist/path/to/library" as "cwd" by default. + * + * You might need to authenticate with NPM before running this script. + */ + +import { readCachedProjectGraph } from '@nrwl/devkit'; +import { execSync } from 'child_process'; +import { readFileSync, writeFileSync } from 'fs'; +import chalk from 'chalk'; + +function invariant(condition, message) { + if (!condition) { + console.error(chalk.bold.red(message)); + process.exit(1); + } +} + +// Executing publish script: node path/to/publish.mjs {name} --version {version} --tag {tag} +// Default "tag" to "next" so we won't publish the "latest" tag by accident. +const [, , name, version, tag = 'next'] = process.argv; + +// A simple SemVer validation to validate the version +const validVersion = /^\d+\.\d+\.\d(-\w+\.\d+)?/; +invariant( + version && validVersion.test(version), + `No version provided or version did not match Semantic Versioning, expected: #.#.#-tag.# or #.#.#, got ${version}.` +); + + +const graph = readCachedProjectGraph(); +const project = graph.nodes[name]; + +invariant( + project, + `Could not find project "${name}" in the workspace. Is the project.json configured correctly?` +); + +const outputPath = project.data?.targets?.build?.options?.outputPath; +invariant( + outputPath, + `Could not find "build.options.outputPath" of project "${name}". Is project.json configured correctly?` +); + +process.chdir(outputPath); + +// Updating the version in "package.json" before publishing +try { + const json = JSON.parse(readFileSync(`package.json`).toString()); + json.version = version; + writeFileSync(`package.json`, JSON.stringify(json, null, 2)); +} catch (e) { + console.error( + chalk.bold.red(`Error reading package.json file from library build output.`) + ); +} + +// Execute "npm publish" to publish +execSync(`npm publish --access public --tag ${tag}`); diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 000000000..2ec5e29cd --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,37 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "rootDir": ".", + "sourceMap": true, + "declaration": false, + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "importHelpers": true, + "target": "es2015", + "module": "esnext", + "lib": [ "es2017", "dom" ], + "skipLibCheck": true, + "skipDefaultLibCheck": true, + "baseUrl": ".", + "paths": { + "@wix-velo/external-db-config": [ "libs/external-db-config/src/index.js" ], + "@wix-velo/external-db-postgres": [ "libs/external-db-postgres/src/index.js" ], + "@wix-velo/external-db-mysql": [ "libs/external-db-mysql/src/index.js" ], + "@wix-velo/external-db-mssql": [ "libs/external-db-mssql/src/index.js" ], + "@wix-velo/external-db-spanner": [ "libs/external-db-spanner/src/index.js" ], + "@wix-velo/external-db-mongo": [ "libs/external-db-mongo/src/index.js" ], + "@wix-velo/external-db-firestore": [ "libs/external-db-firestore/src/index.js" ], + "@wix-velo/external-db-dynamodb": [ "libs/external-db-dynamodb/src/index.js" ], + "@wix-velo/external-db-google-sheets": [ "libs/external-db-google-sheets/src/index.js" ], + "@wix-velo/external-db-airtable": [ "libs/external-db-airtable/src/index.js" ], + "@wix-velo/external-db-bigquery": [ "libs/external-db-bigquery/src/index.js" ], + "@wix-velo/external-db-security": [ "libs/external-db-security/src/index.js" ], + "@wix-velo/test-commons": [ "libs/test-commons/src/index.js" ], + "@wix-velo/velo-external-db-commons": [ "libs/velo-external-db-commons/src/index.js" ], + "@wix-velo/velo-external-db-core": [ "libs/velo-external-db-core/src/index.js" ], + "velo-external-db": [ "apps/velo-external-db/src/app.js" ] + } + }, + "exclude": [ "node_modules", "tmp" ] +} diff --git a/workspace.json b/workspace.json new file mode 100644 index 000000000..c1194647c --- /dev/null +++ b/workspace.json @@ -0,0 +1,21 @@ +{ + "version": 2, + "projects": { + "@wix-velo/external-db-config": "libs/external-db-config", + "@wix-velo/external-db-postgres": "libs/external-db-postgres", + "@wix-velo/external-db-mysql": "libs/external-db-mysql", + "@wix-velo/external-db-mssql": "libs/external-db-mssql", + "@wix-velo/external-db-spanner": "libs/external-db-spanner", + "@wix-velo/external-db-mongo": "libs/external-db-mongo", + "@wix-velo/external-db-firestore": "libs/external-db-firestore", + "@wix-velo/external-db-airtable": "libs/external-db-airtable", + "@wix-velo/external-db-bigquery": "libs/external-db-bigquery", + "@wix-velo/external-db-dynamodb": "libs/external-db-dynamodb", + "@wix-velo/external-db-google-sheets": "libs/external-db-google-sheets", + "@wix-velo/external-db-security": "libs/external-db-security", + "@wix-velo/test-commons": "libs/test-commons", + "@wix-velo/velo-external-db-commons": "libs/velo-external-db-commons", + "@wix-velo/velo-external-db-core": "libs/velo-external-db-core", + "velo-external-db": "apps/velo-external-db" + } +}