From b3de60e8c71497eda3eb3f280a4dca87935c753e Mon Sep 17 00:00:00 2001 From: Will Schurman Date: Tue, 11 Jun 2024 21:39:54 -0700 Subject: [PATCH 1/3] chore: upgrade barrelsby --- .barrelsby.json | 8 +++++++ package.json | 2 +- .../package.json | 2 +- .../entity-cache-adapter-redis/package.json | 2 +- .../entity-database-adapter-knex/package.json | 2 +- packages/entity-example/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../entity-secondary-cache-redis/package.json | 2 +- packages/entity/package.json | 2 +- yarn.lock | 22 +++++++++---------- 11 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 .barrelsby.json diff --git a/.barrelsby.json b/.barrelsby.json new file mode 100644 index 00000000..b6fc0f09 --- /dev/null +++ b/.barrelsby.json @@ -0,0 +1,8 @@ +{ + "directory": "./src", + "location": "top", + "exclude": ["tests__", "testfixtures"], + "singleQuotes": true, + "exportDefault": true, + "delete": true +} \ No newline at end of file diff --git a/package.json b/package.json index 66f5800c..faf65141 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@types/lru-cache": "^5.1.1", "@types/node": "^20.14.1", "@types/uuid": "^8.3.0", - "barrelsby": "^2.2.0", + "barrelsby": "^2.8.1", "eslint": "^8.56.0", "eslint-config-universe": "^13.0.0", "eslint-plugin-tsdoc": "^0.3.0", diff --git a/packages/entity-cache-adapter-local-memory/package.json b/packages/entity-cache-adapter-local-memory/package.json index 3f132b21..cac611fc 100644 --- a/packages/entity-cache-adapter-local-memory/package.json +++ b/packages/entity-cache-adapter-local-memory/package.json @@ -16,7 +16,7 @@ "test": "jest --rootDir . --config ../../resources/jest.config.js", "integration": "../../resources/run-with-docker yarn integration-no-setup", "integration-no-setup": "jest --config ../../resources/jest-integration.config.js --rootDir . --runInBand --passWithNoTests", - "barrelsby": "barrelsby --directory src --location top --exclude tests__ --singleQuotes --exportDefault --delete" + "barrelsby": "barrelsby --config ../../.barrelsby.json" }, "engines": { "node": ">=16" diff --git a/packages/entity-cache-adapter-redis/package.json b/packages/entity-cache-adapter-redis/package.json index dcf9bd5c..9f799dc1 100644 --- a/packages/entity-cache-adapter-redis/package.json +++ b/packages/entity-cache-adapter-redis/package.json @@ -16,7 +16,7 @@ "test": "jest --rootDir . --config ../../resources/jest.config.js", "integration": "../../resources/run-with-docker yarn integration-no-setup", "integration-no-setup": "jest --config ../../resources/jest-integration.config.js --rootDir . --runInBand --passWithNoTests", - "barrelsby": "barrelsby --directory src --location top --exclude tests__ --singleQuotes --exportDefault --delete" + "barrelsby": "barrelsby --config ../../.barrelsby.json" }, "engines": { "node": ">=16" diff --git a/packages/entity-database-adapter-knex/package.json b/packages/entity-database-adapter-knex/package.json index b9a7a624..eafaf688 100644 --- a/packages/entity-database-adapter-knex/package.json +++ b/packages/entity-database-adapter-knex/package.json @@ -16,7 +16,7 @@ "test": "jest --rootDir . --config ../../resources/jest.config.js --passWithNoTests", "integration": "../../resources/run-with-docker yarn integration-no-setup", "integration-no-setup": "jest --config ../../resources/jest-integration.config.js --rootDir . --runInBand --passWithNoTests", - "barrelsby": "barrelsby --directory src --location top --exclude tests__ --singleQuotes --exportDefault --delete" + "barrelsby": "barrelsby --config ../../.barrelsby.json" }, "engines": { "node": ">=16" diff --git a/packages/entity-example/package.json b/packages/entity-example/package.json index 7941e074..350acd4a 100644 --- a/packages/entity-example/package.json +++ b/packages/entity-example/package.json @@ -11,7 +11,7 @@ "test": "jest --rootDir . --config ../../resources/jest.config.js", "integration": "../../resources/run-with-docker yarn integration-no-setup", "integration-no-setup": "jest --config ../../resources/jest-integration.config.js --rootDir . --runInBand --passWithNoTests", - "barrelsby": "barrelsby --directory src --location top --exclude tests__ --singleQuotes --exportDefault --delete", + "barrelsby": "barrelsby --config ../../.barrelsby.json", "start": "tsnd --transpile-only --inspect --respawn --no-notify --async-stack-traces --throw-deprecation -- src/index.ts" }, "engines": { diff --git a/packages/entity-full-integration-tests/package.json b/packages/entity-full-integration-tests/package.json index 8bf46c88..013da502 100644 --- a/packages/entity-full-integration-tests/package.json +++ b/packages/entity-full-integration-tests/package.json @@ -11,7 +11,7 @@ "test": "jest --rootDir . --config ../../resources/jest.config.js --passWithNoTests", "integration": "../../resources/run-with-docker yarn integration-no-setup", "integration-no-setup": "jest --config ../../resources/jest-integration.config.js --rootDir . --runInBand --passWithNoTests", - "barrelsby": "barrelsby --directory src --location top --exclude tests__ --singleQuotes --exportDefault --delete" + "barrelsby": "barrelsby --config ../../.barrelsby.json" }, "engines": { "node": ">=16" diff --git a/packages/entity-secondary-cache-local-memory/package.json b/packages/entity-secondary-cache-local-memory/package.json index 4ce56e43..5cce4392 100644 --- a/packages/entity-secondary-cache-local-memory/package.json +++ b/packages/entity-secondary-cache-local-memory/package.json @@ -16,7 +16,7 @@ "test": "jest --rootDir . --config ../../resources/jest.config.js --passWithNoTests", "integration": "../../resources/run-with-docker yarn integration-no-setup", "integration-no-setup": "jest --config ../../resources/jest-integration.config.js --rootDir . --runInBand --passWithNoTests", - "barrelsby": "barrelsby --directory src --location top --exclude tests__ --singleQuotes --exportDefault --delete" + "barrelsby": "barrelsby --config ../../.barrelsby.json" }, "engines": { "node": ">=16" diff --git a/packages/entity-secondary-cache-redis/package.json b/packages/entity-secondary-cache-redis/package.json index dcbb59c8..b53fc1b1 100644 --- a/packages/entity-secondary-cache-redis/package.json +++ b/packages/entity-secondary-cache-redis/package.json @@ -16,7 +16,7 @@ "test": "jest --rootDir . --config ../../resources/jest.config.js --passWithNoTests", "integration": "../../resources/run-with-docker yarn integration-no-setup", "integration-no-setup": "jest --config ../../resources/jest-integration.config.js --rootDir . --runInBand --passWithNoTests", - "barrelsby": "barrelsby --directory src --location top --exclude tests__ --singleQuotes --exportDefault --delete" + "barrelsby": "barrelsby --config ../../.barrelsby.json" }, "engines": { "node": ">=16" diff --git a/packages/entity/package.json b/packages/entity/package.json index b9de56b7..88809d78 100644 --- a/packages/entity/package.json +++ b/packages/entity/package.json @@ -16,7 +16,7 @@ "test": "jest --rootDir . --config ../../resources/jest.config.js", "integration": "../../resources/run-with-docker yarn integration-no-setup", "integration-no-setup": "jest --config ../../resources/jest-integration.config.js --rootDir . --runInBand --passWithNoTests", - "barrelsby": "barrelsby --directory src --location top --exclude tests__ --singleQuotes --exportDefault --delete" + "barrelsby": "barrelsby --config ../../.barrelsby.json" }, "engines": { "node": ">=16" diff --git a/yarn.lock b/yarn.lock index 07f35c7a..d1bdd799 100644 --- a/yarn.lock +++ b/yarn.lock @@ -854,31 +854,31 @@ integrity sha512-reebgVwjf8VfZxSXU7e+UjpXGwcUTIMpWR9FY54Oh70ulhXrQiZei62B4D9bH3SVYMwnDGzifHJ8INRrJ+0L1g== "@expo/entity-cache-adapter-local-memory@file:packages/entity-cache-adapter-local-memory": - version "0.35.0" + version "0.36.0" dependencies: lru-cache "^6.0.0" "@expo/entity-cache-adapter-redis@file:packages/entity-cache-adapter-redis": - version "0.35.0" + version "0.36.0" "@expo/entity-database-adapter-knex@file:packages/entity-database-adapter-knex": - version "0.35.0" + version "0.36.0" dependencies: knex "^3.1.0" "@expo/entity-ip-address-field@file:packages/entity-ip-address-field": - version "0.35.0" + version "0.36.0" dependencies: ip-address "^8.1.0" "@expo/entity-secondary-cache-local-memory@file:packages/entity-secondary-cache-local-memory": - version "0.35.0" + version "0.36.0" "@expo/entity-secondary-cache-redis@file:packages/entity-secondary-cache-redis": - version "0.35.0" + version "0.36.0" "@expo/entity@file:packages/entity": - version "0.35.0" + version "0.36.0" dependencies: "@expo/results" "^1.0.0" dataloader "^2.0.0" @@ -3222,10 +3222,10 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -barrelsby@^2.2.0: - version "2.3.4" - resolved "https://registry.yarnpkg.com/barrelsby/-/barrelsby-2.3.4.tgz#bd31e06b62ddc510fa0b6e202c1ff0cd9f096867" - integrity sha512-p2dFA7nkgjvUkVKf3cvTt4nBWxg5E9gpxUUX857F+0+Mx/P1Iw+WO5/yJSLE2eibIVbj1D+29sE4JczLLoQfKA== +barrelsby@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/barrelsby/-/barrelsby-2.8.1.tgz#ea25bd7c4e61a7dcec1a2117f01811196ce86586" + integrity sha512-barN2MVKqUVwmjRy3JLSMYufrBDcdWUc2pjlR0V9P8S3aMvvJ4StFz1GJMzEi5GBoQlnBIWOcCxBDzI2xfaaGw== dependencies: "@types/yargs" "^17.0.10" signale "^1.4.0" From 7d42f863109b6fc769b63a50f484f0b80151734a Mon Sep 17 00:00:00 2001 From: Will Schurman Date: Wed, 12 Jun 2024 09:40:00 -0700 Subject: [PATCH 2/3] Update barrels --- .../entity-cache-adapter-redis/src/index.ts | 5 +- .../entity-database-adapter-knex/src/index.ts | 3 +- packages/entity-example/package.json | 2 +- packages/entity/src/index.ts | 46 ++++++++++--------- 4 files changed, 31 insertions(+), 25 deletions(-) diff --git a/packages/entity-cache-adapter-redis/src/index.ts b/packages/entity-cache-adapter-redis/src/index.ts index bf46d00d..df710207 100644 --- a/packages/entity-cache-adapter-redis/src/index.ts +++ b/packages/entity-cache-adapter-redis/src/index.ts @@ -4,7 +4,8 @@ * @module @expo/entity-cache-adapter-redis */ -export { default as RedisCacheAdapterProvider } from './RedisCacheAdapterProvider'; -export * from './RedisCommon'; export { default as GenericRedisCacher } from './GenericRedisCacher'; export * from './GenericRedisCacher'; +export { default as RedisCacheAdapterProvider } from './RedisCacheAdapterProvider'; +export * from './RedisCommon'; +export { default as wrapNativeRedisCallAsync } from './errors/wrapNativeRedisCallAsync'; diff --git a/packages/entity-database-adapter-knex/src/index.ts b/packages/entity-database-adapter-knex/src/index.ts index 1e728f8f..d5ba5520 100644 --- a/packages/entity-database-adapter-knex/src/index.ts +++ b/packages/entity-database-adapter-knex/src/index.ts @@ -4,7 +4,8 @@ * @module @expo/entity-database-adapter-knex */ +export * from './EntityFields'; export { default as PostgresEntityDatabaseAdapter } from './PostgresEntityDatabaseAdapter'; export { default as PostgresEntityDatabaseAdapterProvider } from './PostgresEntityDatabaseAdapterProvider'; export { default as PostgresEntityQueryContextProvider } from './PostgresEntityQueryContextProvider'; -export * from './EntityFields'; +export { default as wrapNativePostgresCallAsync } from './errors/wrapNativePostgresCallAsync'; diff --git a/packages/entity-example/package.json b/packages/entity-example/package.json index 350acd4a..d143d2ab 100644 --- a/packages/entity-example/package.json +++ b/packages/entity-example/package.json @@ -11,7 +11,7 @@ "test": "jest --rootDir . --config ../../resources/jest.config.js", "integration": "../../resources/run-with-docker yarn integration-no-setup", "integration-no-setup": "jest --config ../../resources/jest-integration.config.js --rootDir . --runInBand --passWithNoTests", - "barrelsby": "barrelsby --config ../../.barrelsby.json", + "barrelsby": "", "start": "tsnd --transpile-only --inspect --respawn --no-notify --async-stack-traces --throw-deprecation -- src/index.ts" }, "engines": { diff --git a/packages/entity/src/index.ts b/packages/entity/src/index.ts index b75eb8f9..54a4a904 100644 --- a/packages/entity/src/index.ts +++ b/packages/entity/src/index.ts @@ -4,16 +4,14 @@ * @module @expo/entity */ +export { default as AuthorizationResultBasedEntityLoader } from './AuthorizationResultBasedEntityLoader'; export { default as ComposedEntityCacheAdapter } from './ComposedEntityCacheAdapter'; export { default as ComposedSecondaryEntityCache } from './ComposedSecondaryEntityCache'; -export { default as GenericSecondaryEntityCache } from './GenericSecondaryEntityCache'; export { default as EnforcingEntityLoader } from './EnforcingEntityLoader'; export { default as Entity } from './Entity'; export * from './Entity'; export { default as EntityAssociationLoader } from './EntityAssociationLoader'; export * from './EntityAssociationLoader'; -export { default as IEntityCacheAdapter } from './IEntityCacheAdapter'; -export { default as GenericEntityCacheAdapter } from './GenericEntityCacheAdapter'; export { default as EntityCompanion } from './EntityCompanion'; export * from './EntityCompanion'; export { default as EntityCompanionProvider } from './EntityCompanionProvider'; @@ -21,32 +19,27 @@ export * from './EntityCompanionProvider'; export { default as EntityConfiguration } from './EntityConfiguration'; export { default as EntityDatabaseAdapter } from './EntityDatabaseAdapter'; export * from './EntityDatabaseAdapter'; -export { default as EntityDatabaseAdapterError } from './errors/EntityDatabaseAdapterError'; -export * from './errors/EntityDatabaseAdapterError'; -export { default as EntityCacheAdapterError } from './errors/EntityCacheAdapterError'; -export * from './errors/EntityCacheAdapterError'; -export * from './errors/EntityError'; -export { default as EntityError } from './errors/EntityError'; -export { default as EntityNotAuthorizedError } from './errors/EntityNotAuthorizedError'; -export { default as EntityNotFoundError } from './errors/EntityNotFoundError'; -export * from './EntityFields'; export * from './EntityFieldDefinition'; +export * from './EntityFields'; export { default as EntityLoader } from './EntityLoader'; export { default as EntityLoaderFactory } from './EntityLoaderFactory'; -export { default as EntitySecondaryCacheLoader } from './EntitySecondaryCacheLoader'; -export * from './EntitySecondaryCacheLoader'; -export * from './EntityMutator'; -export { default as EntityMutationValidator } from './EntityMutationValidator'; +export { default as EntityLoaderUtils } from './EntityLoaderUtils'; export * from './EntityMutationInfo'; -export * from './EntityMutationTriggerConfiguration'; export { default as EntityMutationTriggerConfiguration } from './EntityMutationTriggerConfiguration'; +export * from './EntityMutationTriggerConfiguration'; +export { default as EntityMutationValidator } from './EntityMutationValidator'; +export * from './EntityMutator'; export { default as EntityMutatorFactory } from './EntityMutatorFactory'; export { default as EntityPrivacyPolicy } from './EntityPrivacyPolicy'; export * from './EntityPrivacyPolicy'; export * from './EntityQueryContext'; +export { default as EntityQueryContextProvider } from './EntityQueryContextProvider'; +export { default as EntitySecondaryCacheLoader } from './EntitySecondaryCacheLoader'; +export { default as GenericEntityCacheAdapter } from './GenericEntityCacheAdapter'; +export { default as GenericSecondaryEntityCache } from './GenericSecondaryEntityCache'; +export { default as IEntityCacheAdapter } from './IEntityCacheAdapter'; export { default as IEntityCacheAdapterProvider } from './IEntityCacheAdapterProvider'; export { default as IEntityDatabaseAdapterProvider } from './IEntityDatabaseAdapterProvider'; -export { default as EntityQueryContextProvider } from './EntityQueryContextProvider'; export { default as IEntityGenericCacher } from './IEntityGenericCacher'; export { default as ReadonlyEntity } from './ReadonlyEntity'; export { default as ViewerContext } from './ViewerContext'; @@ -55,8 +48,18 @@ export { default as ViewerScopedEntityCompanionProvider } from './ViewerScopedEn export { default as ViewerScopedEntityLoaderFactory } from './ViewerScopedEntityLoaderFactory'; export { default as ViewerScopedEntityMutatorFactory } from './ViewerScopedEntityMutatorFactory'; export * from './entityUtils'; +export { default as EntityCacheAdapterError } from './errors/EntityCacheAdapterError'; +export * from './errors/EntityCacheAdapterError'; +export { default as EntityDatabaseAdapterError } from './errors/EntityDatabaseAdapterError'; +export * from './errors/EntityDatabaseAdapterError'; +export { default as EntityError } from './errors/EntityError'; +export * from './errors/EntityError'; +export { default as EntityInvalidFieldValueError } from './errors/EntityInvalidFieldValueError'; +export { default as EntityNotAuthorizedError } from './errors/EntityNotAuthorizedError'; +export { default as EntityNotFoundError } from './errors/EntityNotFoundError'; export { default as EntityDataManager } from './internal/EntityDataManager'; export * from './internal/EntityFieldTransformationUtils'; +export { default as EntityTableDataCoordinator } from './internal/EntityTableDataCoordinator'; export { default as ReadThroughEntityCache } from './internal/ReadThroughEntityCache'; export * from './internal/ReadThroughEntityCache'; export * from './metrics/EntityMetricsUtils'; @@ -68,12 +71,13 @@ export { default as AlwaysDenyPrivacyPolicyRule } from './rules/AlwaysDenyPrivac export { default as AlwaysSkipPrivacyPolicyRule } from './rules/AlwaysSkipPrivacyPolicyRule'; export { default as PrivacyPolicyRule } from './rules/PrivacyPolicyRule'; export * from './rules/PrivacyPolicyRule'; +export * from './utils/EntityPrivacyUtils'; +export * from './utils/mergeEntityMutationTriggerConfigurations'; +export * from './utils/collections/maps'; export * from './utils/testing/PrivacyPolicyRuleTestUtils'; export * from './utils/testing/StubCacheAdapter'; -export { default as describeFieldTestCase } from './utils/testing/describeFieldTestCase'; export { default as StubDatabaseAdapter } from './utils/testing/StubDatabaseAdapter'; export { default as StubDatabaseAdapterProvider } from './utils/testing/StubDatabaseAdapterProvider'; export { default as StubQueryContextProvider } from './utils/testing/StubQueryContextProvider'; export * from './utils/testing/createUnitTestEntityCompanionProvider'; -export * from './utils/collections/maps'; -export * from './utils/EntityPrivacyUtils'; +export { default as describeFieldTestCase } from './utils/testing/describeFieldTestCase'; From 5badaabc834c4f5310825749621b0ae03726bc6c Mon Sep 17 00:00:00 2001 From: Will Schurman Date: Wed, 12 Jun 2024 09:49:50 -0700 Subject: [PATCH 3/3] Fix erroneous removal --- packages/entity/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/entity/src/index.ts b/packages/entity/src/index.ts index 54a4a904..f8ad5d7e 100644 --- a/packages/entity/src/index.ts +++ b/packages/entity/src/index.ts @@ -35,6 +35,7 @@ export * from './EntityPrivacyPolicy'; export * from './EntityQueryContext'; export { default as EntityQueryContextProvider } from './EntityQueryContextProvider'; export { default as EntitySecondaryCacheLoader } from './EntitySecondaryCacheLoader'; +export * from './EntitySecondaryCacheLoader'; export { default as GenericEntityCacheAdapter } from './GenericEntityCacheAdapter'; export { default as GenericSecondaryEntityCache } from './GenericSecondaryEntityCache'; export { default as IEntityCacheAdapter } from './IEntityCacheAdapter';