diff --git a/__tests__/integration/one-app.spec.js b/__tests__/integration/one-app.spec.js index edb2d176..7e6170c6 100644 --- a/__tests__/integration/one-app.spec.js +++ b/__tests__/integration/one-app.spec.js @@ -108,7 +108,7 @@ describe('Tests that require Docker setup', () => { expect(rawHeaders).not.toHaveProperty('access-control-allow-credentials'); }); - describe('tenant without corsOrigins set', () => { + describe('root module without corsOrigins set', () => { beforeAll(async () => { await addModuleToModuleMap({ moduleName: 'frank-lloyd-root', @@ -277,7 +277,7 @@ describe('Tests that require Docker setup', () => { }); }); - describe('tenant module config', () => { + describe('root module module config', () => { test('provideStateConfig sets config', async () => { await browser.url(`${appAtTestUrls.browserUrl}/success`); const configPreTag = await browser.$('.value-provided-from-config'); @@ -318,14 +318,14 @@ describe('Tests that require Docker setup', () => { }); describe('child module config', () => { - test('validateStateConfig validates an acceptable tenant module config', async () => { + test('validateStateConfig validates an acceptable module config', async () => { await browser.url(`${appAtTestUrls.browserUrl}/demo/picky-frank`); const versionSelector = await browser.$('.version'); const version = await versionSelector.getText(); expect(version).toEqual('v0.0.0'); }); - describe('child module fails to validate tenant module config', () => { + describe('child module fails to validate the module config', () => { let failedChildModuleSearch; const failedChildModuleValidation = /Error: Failed to pass correct url on client/; @@ -518,7 +518,7 @@ describe('Tests that require Docker setup', () => { expect(JSON.parse(needyFrankModuleState)).toMatchSnapshot(); }); - describe('uses tenant provided fetch', () => { + describe('uses root module provided fetch', () => { test('should timeout on server if request exceeds one second', async () => { await browser.url(`${appAtTestUrls.browserUrl}/demo/needy-frank?api=https://slow.api.frank/posts`); const needyFrankModuleStateTag = await browser.$('.needy-frank-loaded-data'); @@ -735,8 +735,8 @@ describe('Tests that require Docker setup', () => { }); }); - describe('module requires SafeRequest Restricted Attributes not provided by tenant module', () => { - const requestRestrictedAttributesRegex = /Error: Tenant root must extendSafeRequestRestrictedAttributes with cookies: \[macadamia,homebaked\]/; + describe('module requires SafeRequest Restricted Attributes not provided by the root module', () => { + const requestRestrictedAttributesRegex = /Error: Root module must extendSafeRequestRestrictedAttributes with cookies: \[macadamia,homebaked\]/; let requestRestrictedAttributesLogSearch; beforeAll(async () => { @@ -770,7 +770,7 @@ describe('Tests that require Docker setup', () => { }); }); - test('app calls loadModuleData to run async requests using Tenant provided fetchClient', async () => { + test('app calls loadModuleData to run async requests using root module provided fetchClient', async () => { const response = await fetch(`${appAtTestUrls.fetchUrl}/demo/ssr-frank`, { ...defaultFetchOptions, }); @@ -803,7 +803,7 @@ describe('Tests that require Docker setup', () => { await expect(searchForRequerstLog).resolves.toMatch(requestLogRegex); }); - it('log gets updated when Tenancy Root module gets updated', async () => { + it('log gets updated when Root module gets updated', async () => { await addModuleToModuleMap({ moduleName: 'frank-lloyd-root', version: '0.0.2', diff --git a/__tests__/server/utils/__snapshots__/onModuleLoad.spec.jsx.snap b/__tests__/server/utils/__snapshots__/onModuleLoad.spec.jsx.snap index a6c8da4d..4de504f2 100644 --- a/__tests__/server/utils/__snapshots__/onModuleLoad.spec.jsx.snap +++ b/__tests__/server/utils/__snapshots__/onModuleLoad.spec.jsx.snap @@ -1,15 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`onModuleLoad includes messages about all missing or incompatible externals 1`] = ` -"dep-a@^2.0.0 is required by my-awesome-module, but tenant root module provides 3.2.0 -dep-b@~5.8.0 is required by my-awesome-module, but tenant root module provides 5.9.6 -External 'dep-d' is required by my-awesome-module, but is not provided by tenant root module" +"dep-a@^2.0.0 is required by my-awesome-module, but the root module provides 3.2.0 +dep-b@~5.8.0 is required by my-awesome-module, but the root module provides 5.9.6 +External 'dep-d' is required by my-awesome-module, but is not provided by the root module" `; -exports[`onModuleLoad throws if the tenant root module does not provide the expected external 1`] = `"External 'dep-b' is required by my-awesome-module, but is not provided by tenant root module"`; +exports[`onModuleLoad throws if the root module does not provide the expected external 1`] = `"External 'dep-b' is required by my-awesome-module, but is not provided by the root module"`; -exports[`onModuleLoad throws if the tenant root module provides an incompatible version of a required external 1`] = `"dep-a@^2.1.1 is required by my-awesome-module, but tenant root module provides 2.1.0"`; +exports[`onModuleLoad throws if the root module provides an incompatible version of a required external 1`] = `"dep-a@^2.1.1 is required by my-awesome-module, but the root module provides 2.1.0"`; exports[`onModuleLoad throws when the one app version is incompatible 1`] = `"some-module@1.0.2 is not compatible with this version of one-app (4.43.0-0), it requires ~4.41.0."`; -exports[`onModuleLoad validates csp added to tenant module 1`] = `"Root module must provide a valid content security policy"`; +exports[`onModuleLoad validates csp added to the root module 1`] = `"Root module must provide a valid content security policy"`; diff --git a/__tests__/server/utils/__snapshots__/safeRequest.spec.js.snap b/__tests__/server/utils/__snapshots__/safeRequest.spec.js.snap index c81aca20..0ba0f436 100644 --- a/__tests__/server/utils/__snapshots__/safeRequest.spec.js.snap +++ b/__tests__/server/utils/__snapshots__/safeRequest.spec.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`safeRequest validateSafeRequestRestrictedAttributes throws error when missing in safeRequest 1`] = ` -"Tenant root must extendSafeRequestRestrictedAttributes with cookies: [jaffa-cake] -Tenant root must extendSafeRequestRestrictedAttributes with headers: [secret-id]" +"Root module must extendSafeRequestRestrictedAttributes with cookies: [jaffa-cake] +Root module must extendSafeRequestRestrictedAttributes with headers: [secret-id]" `; diff --git a/__tests__/server/utils/__snapshots__/stateConfig.spec.js.snap b/__tests__/server/utils/__snapshots__/stateConfig.spec.js.snap index 7f20749d..3ae8deb9 100644 --- a/__tests__/server/utils/__snapshots__/stateConfig.spec.js.snap +++ b/__tests__/server/utils/__snapshots__/stateConfig.spec.js.snap @@ -138,9 +138,9 @@ Object { } `; -exports[`stateConfig methods stateConfig with module config should throw if ONE_CONFIG_ENV is not set on parsing client 1`] = `"Failed to parse an object in the tenant root configuration due to missing ONE_CONFIG_ENV."`; +exports[`stateConfig methods stateConfig with module config should throw if ONE_CONFIG_ENV is not set on parsing client 1`] = `"Failed to parse an object in the root module configuration due to missing ONE_CONFIG_ENV."`; -exports[`stateConfig methods stateConfig with module config should throw if ONE_CONFIG_ENV is not set on parsing server 1`] = `"Failed to parse an object in the tenant root configuration due to missing ONE_CONFIG_ENV."`; +exports[`stateConfig methods stateConfig with module config should throw if ONE_CONFIG_ENV is not set on parsing server 1`] = `"Failed to parse an object in the root module configuration due to missing ONE_CONFIG_ENV."`; exports[`stateConfig methods stateConfig with module config should throw if client variables are supplied without server variables 1`] = ` "Root module attempted to set the following non-overrideable options for the client but not the server: diff --git a/__tests__/server/utils/batchModulesToUpdate.spec.js b/__tests__/server/utils/batchModulesToUpdate.spec.js index a57d9c52..172f115e 100644 --- a/__tests__/server/utils/batchModulesToUpdate.spec.js +++ b/__tests__/server/utils/batchModulesToUpdate.spec.js @@ -27,7 +27,7 @@ describe('batchModulesToUpdate', () => { const modulesWithoutRoot = [...modules]; modules.splice(20, 0, 'my-root'); - it('should put the tenant root module first', () => { + it('should put the root module first', () => { const result = batchModulesToUpdate(modules); expect(result[0]).toEqual(['my-root']); }); diff --git a/__tests__/server/utils/onModuleLoad.spec.jsx b/__tests__/server/utils/onModuleLoad.spec.jsx index 92a24ebb..c918ae5a 100644 --- a/__tests__/server/utils/onModuleLoad.spec.jsx +++ b/__tests__/server/utils/onModuleLoad.spec.jsx @@ -167,7 +167,7 @@ describe('onModuleLoad', () => { expect(setStateConfig).toHaveBeenCalledWith(provideStateConfig); }); - it('does not throw if the tenant root module provides the expected versions of required externals', () => { + it('does not throw if the root module provides the expected versions of required externals', () => { RootModule[CONFIGURATION_KEY] = { providedExternals: { 'dep-a': { version: '2.1.0', module: () => 0 }, @@ -185,7 +185,7 @@ describe('onModuleLoad', () => { expect(() => onModuleLoad({ module: { [CONFIGURATION_KEY]: configuration, [META_DATA_KEY]: { version: '1.0.7' } }, moduleName: 'my-awesome-module' })).not.toThrow(); }); - it('warns if a module that isn\'t the tenant root module attempts to provide externals', () => { + it('warns if a module that isn\'t the root module attempts to provide externals', () => { const configuration = { providedExternals: { 'dep-b': { @@ -199,7 +199,7 @@ describe('onModuleLoad', () => { expect(consoleWarnSpy).toHaveBeenCalledTimes(1); }); - it('throws if the tenant root module does not provide the expected external', () => { + it('throws if the root module does not provide the expected external', () => { RootModule[CONFIGURATION_KEY] = { providedExternals: { 'dep-a': { version: '2.1.0', module: () => 0 }, @@ -213,7 +213,7 @@ describe('onModuleLoad', () => { expect(() => onModuleLoad({ module: { [CONFIGURATION_KEY]: configuration, [META_DATA_KEY]: { version: '1.0.9' } }, moduleName: 'my-awesome-module' })).toThrowErrorMatchingSnapshot(); }); - it('throws if the tenant root module provides an incompatible version of a required external', () => { + it('throws if the root module provides an incompatible version of a required external', () => { RootModule[CONFIGURATION_KEY].providedExternals = { 'dep-a': { version: '2.1.0', module: () => 0 }, }; @@ -271,7 +271,7 @@ describe('onModuleLoad', () => { expect(getModulesUsingExternals()).toEqual([]); }); - it('validates csp added to tenant module', () => { + it('validates csp added to the root module', () => { const callOnModuleLoad = () => (onModuleLoad({ module: {}, moduleName: 'some-root', @@ -280,7 +280,7 @@ describe('onModuleLoad', () => { expect(callOnModuleLoad).toThrowErrorMatchingSnapshot(); }); - it('updates createSsrFetch when added on tenant module', () => { + it('updates createSsrFetch when added on the root module', () => { const fakeCreateSsrFetch = jest.fn(); onModuleLoad({ module: { @@ -296,7 +296,7 @@ describe('onModuleLoad', () => { expect(setCreateSsrFetch).toHaveBeenCalledWith(fakeCreateSsrFetch); }); - it('sets CORS origins from tenant module', () => { + it('sets CORS origins from the root module', () => { const corsOrigins = ['example.com']; onModuleLoad({ module: { @@ -329,7 +329,7 @@ describe('onModuleLoad', () => { expect(consoleInfoSpy).toHaveBeenCalledWith('Loaded module not-the-root-module@1.0.16'); }); - it('updates allowed safeRequest values from tenant root', () => { + it('updates allowed safeRequest values from the root module', () => { onModuleLoad({ module: { [CONFIGURATION_KEY]: { @@ -361,7 +361,7 @@ describe('onModuleLoad', () => { }); }); - it('sets configureRequestLog when given on tenant root', () => { + it('sets configureRequestLog when given on the root module', () => { const configureRequestLog = jest.fn(); onModuleLoad({ module: { diff --git a/__tests__/universal/routes.spec.jsx b/__tests__/universal/routes.spec.jsx index a83d916c..9bed012f 100644 --- a/__tests__/universal/routes.spec.jsx +++ b/__tests__/universal/routes.spec.jsx @@ -44,7 +44,7 @@ describe('routes', () => { beforeEach(() => jest.clearAllMocks()); - it('should set up the tenancy root route first', () => { + it('should set up the root module route first', () => { const RootRoute = createRoutes(store)[0]; expect(ReactTestUtils.isElement(RootRoute)).toBe(true); expect(RootRoute.props).toEqual({ moduleName: 'fakeRootModule', store }); diff --git a/prod-sample/sample-modules/frank-lloyd-root/0.0.0/README.md b/prod-sample/sample-modules/frank-lloyd-root/0.0.0/README.md index 4d791cd5..364b09c7 100644 --- a/prod-sample/sample-modules/frank-lloyd-root/0.0.0/README.md +++ b/prod-sample/sample-modules/frank-lloyd-root/0.0.0/README.md @@ -1,3 +1,3 @@ # frank-lloyd-root -Tenancy root module for integration tests. This specific version has a valid configuration. \ No newline at end of file +Root module for integration tests. This specific version has a valid configuration. diff --git a/prod-sample/sample-modules/frank-lloyd-root/0.0.0/package.json b/prod-sample/sample-modules/frank-lloyd-root/0.0.0/package.json index 29e40626..7a356b3d 100644 --- a/prod-sample/sample-modules/frank-lloyd-root/0.0.0/package.json +++ b/prod-sample/sample-modules/frank-lloyd-root/0.0.0/package.json @@ -1,7 +1,7 @@ { "name": "frank-lloyd-root", "version": "0.0.0", - "description": "Tenancy root module for integration tests", + "description": "Root module for integration tests", "scripts": { "prebuild": "npm run clean", "build": "bundle-module", diff --git a/prod-sample/sample-modules/frank-lloyd-root/0.0.0/src/components/FrankLloydRoot.jsx b/prod-sample/sample-modules/frank-lloyd-root/0.0.0/src/components/FrankLloydRoot.jsx index d0feab54..b68d4059 100644 --- a/prod-sample/sample-modules/frank-lloyd-root/0.0.0/src/components/FrankLloydRoot.jsx +++ b/prod-sample/sample-modules/frank-lloyd-root/0.0.0/src/components/FrankLloydRoot.jsx @@ -31,7 +31,7 @@ export function FrankLloydRoot({ children, config }) { return ( diff --git a/src/server/utils/onModuleLoad.js b/src/server/utils/onModuleLoad.js index 484a229d..49bc3145 100644 --- a/src/server/utils/onModuleLoad.js +++ b/src/server/utils/onModuleLoad.js @@ -66,7 +66,7 @@ export default function onModuleLoad({ }) { const { [CONFIGURATION_KEY]: { - // Tenant Root Specific + // Root Module Specific providedExternals, provideStateConfig, csp, @@ -130,9 +130,9 @@ export default function onModuleLoad({ const providedExternal = RootModule[CONFIGURATION_KEY].providedExternals[externalName]; if (!providedExternal) { - messages.push(`External '${externalName}' is required by ${moduleName}, but is not provided by tenant root module`); + messages.push(`External '${externalName}' is required by ${moduleName}, but is not provided by the root module`); } else if (!semver.satisfies(providedExternal.version, requestedExternalVersion)) { - messages.push(`${externalName}@${requestedExternalVersion} is required by ${moduleName}, but tenant root module provides ${providedExternal.version}`); + messages.push(`${externalName}@${requestedExternalVersion} is required by ${moduleName}, but the root module provides ${providedExternal.version}`); } }); diff --git a/src/server/utils/safeRequest.js b/src/server/utils/safeRequest.js index e865af51..c0370810 100644 --- a/src/server/utils/safeRequest.js +++ b/src/server/utils/safeRequest.js @@ -114,7 +114,7 @@ export const validateSafeRequestRestrictedAttributes = (requiredAttributes, modu if (!requestItemsIncluded) { missingRequestItemsMessages.push( - `Tenant root must extendSafeRequestRestrictedAttributes with ${key}: [${requiredItems}]` + `Root module must extendSafeRequestRestrictedAttributes with ${key}: [${requiredItems}]` ); } }); diff --git a/src/server/utils/stateConfig.js b/src/server/utils/stateConfig.js index 23192ef4..3f5d4b86 100644 --- a/src/server/utils/stateConfig.js +++ b/src/server/utils/stateConfig.js @@ -87,7 +87,7 @@ if (process.env.NODE_ENV === 'development' && fs.existsSync(pathToDevEndpoints)) let stateConfigFromModule = { server: {}, client: {} }; const configEnv = process.env.ONE_CONFIG_ENV; -const makeConfigEnvError = () => new Error('Failed to parse an object in the tenant root configuration due to missing ONE_CONFIG_ENV.'); +const makeConfigEnvError = () => new Error('Failed to parse an object in the root module configuration due to missing ONE_CONFIG_ENV.'); // Set initial config state let clientStateConfig = {