gdu 4.0.12 → 4.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,8 @@
1
1
  export declare const withTM: (nextConfig?: {}) => {};
2
+ export declare const defaultSecurityHeaders: {
3
+ key: string;
4
+ value: string;
5
+ }[];
2
6
  export declare const createNextJSConfig: (buildEnv: any) => {
3
7
  distDir: string;
4
8
  reactStrictMode: boolean;
@@ -14,9 +18,10 @@ export declare const createNextJSConfig: (buildEnv: any) => {
14
18
  ignoreBuildErrors: boolean;
15
19
  };
16
20
  images: {
17
- domains: string[];
18
21
  formats: string[];
22
+ deviceSizes: number[];
19
23
  imageSizes: number[];
24
+ domains: string[];
20
25
  };
21
26
  webpack: (defaultConfig: any) => any;
22
27
  };
@@ -22,16 +22,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.createNextJSTranspiledConfig = exports.createNextJSConfig = exports.withTM = void 0;
25
+ exports.createNextJSTranspiledConfig = exports.createNextJSConfig = exports.defaultSecurityHeaders = exports.withTM = void 0;
26
26
  const path_1 = __importStar(require("path"));
27
27
  const next_plugin_1 = require("@vanilla-extract/next-plugin");
28
28
  const dotenv_webpack_1 = __importDefault(require("dotenv-webpack"));
29
29
  const next_transpile_modules_1 = __importDefault(require("next-transpile-modules"));
30
30
  const webpack_1 = require("webpack");
31
+ const config_1 = require("../lib/config");
31
32
  const misc_1 = require("../lib/misc");
32
33
  const roots_1 = require("../lib/roots");
33
34
  const configs_1 = require("../utils/configs");
34
- const config_1 = require("../lib/config");
35
35
  const withVanillaExtract = next_plugin_1.createVanillaExtractPlugin();
36
36
  exports.withTM = next_transpile_modules_1.default([
37
37
  '@autoguru/themes',
@@ -45,6 +45,62 @@ exports.withTM = next_transpile_modules_1.default([
45
45
  '@autoguru/layout',
46
46
  '@popperjs/core',
47
47
  ]);
48
+ const allowedScriptSources = [
49
+ "'self'",
50
+ "'unsafe-inline'",
51
+ '*.autoguru.com.au',
52
+ '*.googletagmanager.com',
53
+ '*.google-analytics.com',
54
+ '*.google.com',
55
+ '*.google.com.au',
56
+ '*.gstatic.com',
57
+ '*.googleadservices.com',
58
+ '*.heapanalytics.com',
59
+ '*.doubleclick.net',
60
+ '*.mapbox.com',
61
+ '*.quantserve.com',
62
+ '*.wisepops.com',
63
+ '*.tvsquared.com',
64
+ '*.quantcount.com',
65
+ ].join(' ');
66
+ const allowedStyleSources = [
67
+ "'self'",
68
+ "'unsafe-inline'",
69
+ 'https://*.autoguru.com.au',
70
+ 'https://*.googleapis.com',
71
+ ].join(' ');
72
+ const allowedIFrameSources = [
73
+ "'self'",
74
+ 'https://www.youtube.com',
75
+ 'https://www.google.com',
76
+ ].join(' ');
77
+ const allowedImageSources = ["'self'"].join(' ');
78
+ const allowedDataDomains = ['https://*'].join(' ');
79
+ const allowedFontSources = [
80
+ 'https://*.autoguru.com.au',
81
+ 'https://*.googleapis.com',
82
+ 'https://*.gstatic.com',
83
+ ].join(' ');
84
+ const allowedDataSources = ["'self'", 'blob:'].join(' ');
85
+ const allowedObjectSources = ["'none'"].join(' ');
86
+ exports.defaultSecurityHeaders = [
87
+ {
88
+ key: 'X-DNS-Prefetch-Control',
89
+ value: 'on',
90
+ },
91
+ {
92
+ key: 'X-XSS-Protection',
93
+ value: '1; mode=block',
94
+ },
95
+ {
96
+ key: 'X-Frame-Options',
97
+ value: 'SAMEORIGIN https://*.autoguru.com.au',
98
+ },
99
+ {
100
+ key: 'Content-Security-Policy',
101
+ value: `frame-ancestors https://*.autoguru.com.au; frame-src ${allowedIFrameSources}; style-src ${allowedStyleSources}; img-src ${allowedImageSources} data: ${allowedDataDomains}; font-src ${allowedFontSources}; worker-src ${allowedDataSources}; child-src ${allowedDataSources}; object-src ${allowedObjectSources}';connect-src ${allowedScriptSources}; script-src-elem ${allowedScriptSources}; script-src ${allowedScriptSources};`,
102
+ },
103
+ ];
48
104
  const createNextJSConfig = (buildEnv) => {
49
105
  var _a, _b;
50
106
  const isDev = !misc_1.isEnvProduction();
@@ -65,15 +121,21 @@ const createNextJSConfig = (buildEnv) => {
65
121
  ignoreBuildErrors: true,
66
122
  },
67
123
  images: {
124
+ formats: ['image/avif', 'image/webp'],
125
+ deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
126
+ imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
68
127
  domains: [
128
+ 'www.autoguru.com.au',
129
+ 'dev.autoguru.com.au',
130
+ 'test.autoguru.com.au',
131
+ 'uat.autoguru.com.au',
132
+ 'preprod.autoguru.com.au',
69
133
  'cdn.autoguru.com.au',
70
134
  'cdn-dev.autoguru.com.au',
71
135
  'cdn-test.autoguru.com.au',
72
136
  'cdn-uat.autoguru.com.au',
73
137
  'cdn-preprod.autoguru.com.au',
74
138
  ],
75
- formats: ['image/avif', 'image/webp'],
76
- imageSizes: [16, 32, 48, 64, 96, 128, 256, 384, 512],
77
139
  },
78
140
  webpack: (defaultConfig) => {
79
141
  defaultConfig.plugins.push(new webpack_1.DefinePlugin({
@@ -281,11 +281,9 @@ const baseOptions = (buildEnv, isMultiEnv) => ({
281
281
  }),
282
282
  ...configs_1.getConfigsDirs().flatMap((configsDir) => [
283
283
  new dotenv_webpack_1.default({
284
- defaults: true,
285
284
  path: path_1.default.resolve(configsDir, '.env.defaults'),
286
285
  }),
287
286
  new dotenv_webpack_1.default({
288
- defaults: true,
289
287
  path: path_1.default.resolve(configsDir, `.env.${process.env.APP_ENV || (isDev ? 'dev' : buildEnv)}`),
290
288
  }),
291
289
  ]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdu",
3
- "version": "4.0.12",
3
+ "version": "4.1.3",
4
4
  "private": false,
5
5
  "description": "AutoGuru's development toolkit",
6
6
  "homepage": "https://github.com/autoguru-au/octane/tree/master/packages/gdu#readme",
@@ -40,7 +40,7 @@
40
40
  "babel-loader": "^8.2.2",
41
41
  "babel-plugin-relay": "^11.0.2",
42
42
  "babel-plugin-treat": "^1.6.2",
43
- "browserslist-config-autoguru": "^2.0.1",
43
+ "browserslist-config-autoguru": "^2.1.2",
44
44
  "clean-webpack-plugin": "^4.0.0-alpha.0",
45
45
  "core-js": "^3.9.1",
46
46
  "css-loader": "^6.4.0",
package/CHANGELOG.md DELETED
@@ -1,408 +0,0 @@
1
- # gdu
2
-
3
- ## 4.0.12
4
-
5
- ### Patch Changes
6
-
7
- - GDU adds default support for dot env configs
8
-
9
- ## 4.0.11
10
-
11
- ### Patch Changes
12
-
13
- - GDU: Updates public paths
14
-
15
- ## 4.0.10
16
-
17
- ### Patch Changes
18
-
19
- - GDU: Fixes prod env public path
20
-
21
- ## 4.0.9
22
-
23
- ### Patch Changes
24
-
25
- - GDU: Fixes spa public path for prod env
26
-
27
- ## 4.0.8
28
-
29
- ### Patch Changes
30
-
31
- - GDU: Fixes public path for prod builds
32
-
33
- ## 4.0.7
34
-
35
- ### Patch Changes
36
-
37
- - GDU: sets unique ourput dirs
38
-
39
- ## 4.0.6
40
-
41
- ### Patch Changes
42
-
43
- - GDU: sets octopus var for prod public path
44
-
45
- ## 4.0.5
46
-
47
- ### Patch Changes
48
-
49
- - GDU: Sets public asset paths
50
-
51
- ## 4.0.4
52
-
53
- ### Patch Changes
54
-
55
- - GDU: Passes on app and node envs to build command
56
-
57
- ## 4.0.3
58
-
59
- ### Patch Changes
60
-
61
- - SSR apps: Get changes to their nextjs config defaults
62
-
63
- ## 4.0.2
64
-
65
- ### Patch Changes
66
-
67
- - GDU: Fixes spa relay artifact resoluton
68
-
69
- ## 4.0.1
70
-
71
- ### Patch Changes
72
-
73
- - GDU: Supports artifact directory for relay generated files
74
-
75
- ## 4.0.0
76
-
77
- ### Major Changes
78
-
79
- - Upgrades browserlist
80
- - a08a3f9: GDU: Upgrades babel
81
- - 2486c59: GDU: Applies caching to babel
82
- - 2486c59: GDU fixed build commads
83
-
84
- ### Patch Changes
85
-
86
- - cdd95c9: Fixes ssr builds
87
- - 7c65b2c: GDU: Uses dotenv for env variables
88
- - 7b7fecc: Upgrades webpack dependencies
89
- - c0130be: GDU: Puts prod artifacts in folder when building for multiple envs
90
- - 2adfc80: Adds AG cdn to next image domains
91
- - 0185749: GDU: Improves build maniset plugin
92
- - 7f3b1ac: Add multi env build support for nextJS apps
93
- - 3acac86: GDU: Fixes build manifest plugin
94
- - f7d42ea: Adds fleet
95
- - 4288672: GDU: Exposes naked nextjs configs
96
- - 3acac86: GDU Assumed prod env fro build commands
97
- - 1f93d6c: GDU: Support vanilla extract
98
- - 33c60da: GDU: Moves build cache to project root level
99
- - 2750501: GDU: Allows app level configs
100
- - 33c60da: GDU uses APP_ENV instead of NODE_ENV for environment configs
101
- - 94bb85b: Fixes for ssr apps
102
- - 6c1f212: GDU: Fixed config file paths
103
- - 9a144dc: GDU: Uses next cli dev command to start dev server
104
- - 2486c59: GDU Updated GuruBuildManifest plugin
105
- - 7c65b2c: Dev server: Removed invalid options
106
- - 61f1da4: GDU upgrades webpack dependency to v5
107
- - Updated dependencies [undefined]
108
- - browserslist-config-autoguru@2.0.1
109
-
110
- ## 4.0.0-next.20
111
-
112
- ### Patch Changes
113
-
114
- - Add multi env build support for nextJS apps
115
-
116
- ## 4.0.0-next.19
117
-
118
- ### Patch Changes
119
-
120
- - Fixes ssr builds
121
-
122
- ## 4.0.0-next.18
123
-
124
- ### Patch Changes
125
-
126
- - GDU: Puts prod artifacts in folder when building for multiple envs
127
-
128
- ## 4.0.0-next.17
129
-
130
- ### Patch Changes
131
-
132
- - GDU: Improves build maniset plugin
133
-
134
- ## 4.0.0-next.16
135
-
136
- ### Patch Changes
137
-
138
- - GDU: Fixes build manifest plugin
139
-
140
- ## 4.0.0-next.15
141
-
142
- ### Patch Changes
143
-
144
- - GDU Assumed prod env fro build commands
145
-
146
- ## 4.0.0-next.14
147
-
148
- ### Patch Changes
149
-
150
- - GDU: Exposes naked nextjs configs
151
-
152
- ## 4.0.0-next.13
153
-
154
- ### Patch Changes
155
-
156
- - Adds fleet
157
-
158
- ## 4.0.0-next.12
159
-
160
- ### Patch Changes
161
-
162
- - 2adfc80: Adds AG cdn to next image domains
163
-
164
- ## 4.0.0-next.11
165
-
166
- ### Patch Changes
167
-
168
- - Fixes for ssr apps
169
-
170
- ## 4.0.0-next.10
171
-
172
- ### Patch Changes
173
-
174
- - GDU: Uses next cli dev command to start dev server
175
-
176
- ## 4.0.0-next.9
177
-
178
- ### Patch Changes
179
-
180
- - GDU: Support vanilla extract
181
-
182
- ## 4.0.0-next.8
183
-
184
- ### Major Changes
185
-
186
- - GDU: Applies caching to babel
187
- - GDU fixed build commads
188
-
189
- ## 4.0.0-next.7
190
-
191
- ### Patch Changes
192
-
193
- - GDU Updated GuruBuildManifest plugin
194
-
195
- ## 4.0.0-next.6
196
-
197
- ### Patch Changes
198
-
199
- - GDU: Moves build cache to project root level
200
- - GDU uses APP_ENV instead of NODE_ENV for environment configs
201
-
202
- ## 4.0.0-next.5
203
-
204
- ### Patch Changes
205
-
206
- - GDU: Allows app level configs
207
-
208
- ## 4.0.0-next.4
209
-
210
- ### Patch Changes
211
-
212
- - GDU: Fixed config file paths
213
-
214
- ## 4.0.0-next.3
215
-
216
- ### Patch Changes
217
-
218
- - GDU: Uses dotenv for env variables
219
- - Dev server: Removed invalid options
220
-
221
- ## 4.0.0-next.2
222
-
223
- ### Patch Changes
224
-
225
- - GDU upgrades webpack dependency to v5
226
-
227
- ## 4.0.0-next.1
228
-
229
- ### Patch Changes
230
-
231
- - Upgrades webpack dependencies
232
-
233
- ## 4.0.0-next.0
234
-
235
- ### Major Changes
236
-
237
- - GDU: Upgrades babel
238
-
239
- ## 3.3.0
240
-
241
- ### Minor Changes
242
-
243
- - 55153b1: GDU: Upgrades treat to latest version
244
-
245
- ### Patch Changes
246
-
247
- - Updated dependencies [14e78dc]
248
- - browserslist-config-autoguru@2.0.0
249
-
250
- ## 3.2.1
251
-
252
- ### Patch Changes
253
-
254
- - e625578: GDU: No longer follows "unicorn/prefer-node-protocol" rule
255
-
256
- ## 3.2.0
257
-
258
- ### Minor Changes
259
-
260
- - d80a10b: Unicorn eslint rules: Upgraded to v33
261
-
262
- Prettier: Upgrades to v2.3
263
-
264
- ### Patch Changes
265
-
266
- - Updated dependencies [d80a10b]
267
- - @autoguru/babel-preset@1.2.0
268
- - browserslist-config-autoguru@1.1.0
269
- - @autoguru/utilities@1.1.0
270
-
271
- ## 3.1.0
272
-
273
- ### Minor Changes
274
-
275
- - 7917b5d: graphql config endpoint gets support for optional schema
276
- normalisers patterns
277
- - 4f954f8: graphql config endpoint normaliser pattern gets optional flag
278
-
279
- ## 3.0.1
280
-
281
- ### Patch Changes
282
-
283
- - cdace6e: graphql-schema command expects endpointConfig url to be the
284
- complete url to the schema
285
- - cdace6e: graphql-schema command respects endpointConfig's http method
286
-
287
- ## 3.0.0
288
-
289
- ### Major Changes
290
-
291
- - 41b6042: Uses named webpack chunks
292
-
293
- ## 2.2.2
294
-
295
- ### Patch Changes
296
-
297
- - 3078dbf: Correctly split the chunks such that gdu is included with main
298
-
299
- ## 2.2.1
300
-
301
- ### Patch Changes
302
-
303
- - 5990714: Process all node_modules through babel as well
304
- - ea885c9: Upgrades treat to latest
305
-
306
- ## 2.2.0
307
-
308
- ### Minor Changes
309
-
310
- - 941261e: Supports latest nextjs as well new babel integration
311
- - 68ae99c: Adds support for React Native to use our config strategy.
312
-
313
- Usage:
314
-
315
- ```js
316
- // index.js (the entrypoint)
317
- import 'gdu/react-native/config';
318
- ```
319
-
320
- ```js
321
- // consumer
322
- import * as config from 'gdu/config';
323
- import { api } from 'gdu/config';
324
- import { auth, url as url2 } from 'gdu/config';
325
- ```
326
-
327
- ```js
328
- // babel.config.js
329
-
330
- module.exports = {
331
- plugins: [
332
- require.resolve('babel-plugin-macros'),
333
- require.resolve('gdu/babel/config-plugin'),
334
- ],
335
- };
336
- ```
337
-
338
- > Make sure you have `babel-plugin-macros` added to your project.
339
-
340
- > _**Note**_ Please only use this for react-native projects, config is
341
- > managed via webpack for our browser apps.
342
-
343
- - 00da6cc: Removes sass support, we are now treat through-and-through.
344
-
345
- ### Patch Changes
346
-
347
- - 919e4a0: Upgraded all dev and prod deps
348
- - Updated dependencies [941261e]
349
- - Updated dependencies [919e4a0]
350
- - @autoguru/babel-preset@1.1.0
351
- - browserslist-config-autoguru@1.0.89
352
- - @autoguru/tsconfig@1.0.79
353
- - @autoguru/utilities@1.0.98
354
-
355
- ## 2.1.3
356
-
357
- ### Patch Changes
358
-
359
- - d016ff6: Adds in an intersection observer polyfill
360
-
361
- ## 2.1.2
362
-
363
- ### Patch Changes
364
-
365
- - 4260eb3: Bumps deps and publishes new peerDeeps ranges
366
- - Updated dependencies [4260eb3]
367
- - @autoguru/babel-preset@1.0.98
368
-
369
- ## 2.1.1
370
-
371
- ### Patch Changes
372
-
373
- - 6886f49: GDU will now render a stack trace for errors
374
- - 3deb6b9: Fix issue where the next-babel-loader is at index 0, not 1
375
-
376
- ## 2.1.0
377
-
378
- ### Minor Changes
379
-
380
- - b5c0b8f: Performs schema fetching using HC's `/schema` endpoint
381
- - 69a313d: gdu.d.ts file is now removed in favour of npm maintained file,
382
- allowing for more defined properties and can be _more_ global.
383
-
384
- ### Patch Changes
385
-
386
- - dc79f71: Drops custom sass from NextJs apps
387
-
388
- ## 2.0.46
389
-
390
- ### Patch Changes
391
-
392
- - b0d77f1: Performance metrics added and better global app debug info
393
- - Updated dependencies [b0d77f1]
394
- - @autoguru/babel-preset@1.0.97
395
- - browserslist-config-autoguru@1.0.88
396
- - @autoguru/tsconfig@1.0.78
397
- - @autoguru/utilities@1.0.97
398
-
399
- ## 2.0.39
400
-
401
- ### Patch Changes
402
-
403
- - 724083c: GDU html-webpack-plugin requires template to be a string, and never
404
- undefined.
405
-
406
- **BUG FIXES**
407
-
408
- When no consumer template.html the property should be set to `auto`