Skip to content

Commit c6799fe

Browse files
authored
Merge pull request #105 from graphile/fixes-from-organizations-branch
Fixes from organizations branch
2 parents d5bf7bc + 421f684 commit c6799fe

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ dist
99
/@app/graphql/index.*
1010
.agignore
1111
*.tsbuildinfo
12+
.ethereal

@app/client/src/next.config.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,27 @@ if (!ROOT_URL) {
4141
webpack(config, { webpack, dev, isServer }) {
4242
if (dev) config.devtool = "cheap-module-source-map";
4343

44+
const makeSafe = externals => {
45+
if (Array.isArray(externals)) {
46+
return externals.map(ext => {
47+
if (typeof ext === "function") {
48+
return (context, request, callback) => {
49+
if (/^@app\//.test(request)) {
50+
callback();
51+
} else {
52+
return ext(context, request, callback);
53+
}
54+
};
55+
} else {
56+
return ext;
57+
}
58+
});
59+
}
60+
};
61+
62+
const externals =
63+
isServer && dev ? makeSafe(config.externals) : config.externals;
64+
4465
return {
4566
...config,
4667
plugins: [
@@ -51,7 +72,7 @@ if (!ROOT_URL) {
5172
}),
5273
],
5374
externals: [
54-
...(config.externals || []),
75+
...(externals || []),
5576
isServer ? { "pg-native": "pg/lib/client" } : null,
5677
].filter(_ => _),
5778
};

@app/db/__tests__/helpers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export const becomeUser = async (
8585
client: PoolClient,
8686
userOrUserId: User | number | null
8787
) => {
88+
await becomeRoot(client);
8889
const session = userOrUserId
8990
? await createSession(
9091
client,

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@
393393
"@babel/traverse" "^7.7.4"
394394
"@babel/types" "^7.7.4"
395395

396-
"@babel/highlight@^7.0.0", "@babel/highlight@^7.8.3":
396+
"@babel/highlight@^7.8.3":
397397
version "7.8.3"
398398
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.8.3.tgz#28f173d04223eaaa59bc1d439a3836e6d1265797"
399399
integrity sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==
@@ -407,7 +407,7 @@
407407
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.3.tgz#790874091d2001c9be6ec426c2eed47bc7679081"
408408
integrity sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==
409409

410-
"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.6.4", "@babel/parser@^7.7.2", "@babel/parser@^7.7.4", "@babel/parser@^7.7.5", "@babel/parser@^7.8.3":
410+
"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.6.4", "@babel/parser@^7.7.2", "@babel/parser@^7.7.5", "@babel/parser@^7.8.3":
411411
version "7.8.4"
412412
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.4.tgz#d1dbe64691d60358a974295fa53da074dd2ce8e8"
413413
integrity sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==

0 commit comments

Comments
 (0)